skrueger.geotools
Class MapView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by skrueger.geotools.MapView
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MapView
extends JPanel

Achtung! Dieser code ist verwuestet TODO DOKU und initialize schöner machen. SK

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  GeoMapPane geoMapPane
          Komponente, in der die Karten, der Massstab und das Koordinaten-Raster dargestellt werden.
protected  MapPaneStatusBar statusBar
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MapView(Component parentGui)
          Creates a new MapView.
MapView(Component parentGui, MapPaneToolBar toolBar)
          Creates a new MapView.
 
Method Summary
 void dispose()
          Help the garbage collection
 GeoMapPane getGeoMapPane()
           
 SelectableXMapPane getMapPane()
          Liefert den Karten-Bereich der Komponente.
 int getSelectedTool()
           
 JComponent getSidePane()
          called by initialize() to fill the left of the XULUMapView Supposed to be overwritten by AtlasMapView or DesignMapView
 JSplitPane getSplitPane()
          Returns the split pane which divides the layer list from the map panel.
 MapPaneStatusBar getStatusBar()
          Liefert die Status-Zeile, in der die Koordinaten und Raster-Werte angezeigt werden.
 MapPaneToolBar getToolBar()
          Returns the tool bar which controls the active mouse actions on the map.
 void initialize()
          This routine creates the main components of the GUI: The left Side and the map on the right side.
 boolean isToolEnabled(Integer tool)
          Checks whether a tool is activated.
 void setAllToolsEnabled(boolean enabled, boolean hideOnDisable)
          Sets the activation for all tools.
 void setSelectedTool(Integer tool)
          Sets the active tool.
 void setToolEnabled(Integer tool, boolean enabled, boolean hideOnDisable)
          Sets whether a tool is activated or not.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statusBar

protected MapPaneStatusBar statusBar

geoMapPane

protected final GeoMapPane geoMapPane
Komponente, in der die Karten, der Massstab und das Koordinaten-Raster dargestellt werden.

Constructor Detail

MapView

public MapView(Component parentGui,
               MapPaneToolBar toolBar)
Creates a new MapView. A MapView is a combination of a GeoMapPane, a MapContextManagerInterface on the left, and some buttons floating over the SelectableXMapPane


MapView

public MapView(Component parentGui)
Creates a new MapView. A MapView is a combination of a GeoMapPane, a MapContextManagerInterface on the left, and some buttons floating over the SelectableXMapPane

Method Detail

initialize

public void initialize()
This routine creates the main components of the GUI: The left Side and the map on the right side.
Calls #getSidePanel() which can be overwritten (call super!).
This method initialized the variables statusBar and splitPane

See Also:
#adjustSizeOfGeoMapPane()

getToolBar

public MapPaneToolBar getToolBar()
Returns the tool bar which controls the active mouse actions on the map.

Returns:
never null, will rather create a default

getSplitPane

public JSplitPane getSplitPane()
Returns the split pane which divides the layer list from the map panel.


setSelectedTool

public void setSelectedTool(Integer tool)
Sets the active tool. Simply calls MapPaneToolBar.setSelectedTool(Integer).

Parameters:
tool - One of #TOOL_INFO, #TOOL_PAN .. constants

setToolEnabled

public void setToolEnabled(Integer tool,
                           boolean enabled,
                           boolean hideOnDisable)
Sets whether a tool is activated or not. Simply calls MapPaneToolBar.setButtonEnabled(int, boolean, boolean).

Parameters:
tool - tool ID
enabled - if true the tool becomes available
hideOnDisable - if true the button is also hidden if enabled is false

setAllToolsEnabled

public void setAllToolsEnabled(boolean enabled,
                               boolean hideOnDisable)
Sets the activation for all tools. Simply calls MapPaneToolBar.setAllToolsEnabled(boolean, boolean).

Parameters:
enabled - if true all tool becomes available
hideOnDisable - if true the buttons are also hidden if enabled is false

isToolEnabled

public boolean isToolEnabled(Integer tool)
Checks whether a tool is activated. Simply calls MapPaneToolBar#isButtonEnabled(Integer).

Parameters:
tool - tool ID
Returns:
false if an unknown ID is specified

getSidePane

public JComponent getSidePane()
called by initialize() to fill the left of the XULUMapView Supposed to be overwritten by AtlasMapView or DesignMapView


getStatusBar

public MapPaneStatusBar getStatusBar()
Liefert die Status-Zeile, in der die Koordinaten und Raster-Werte angezeigt werden.


getMapPane

public final SelectableXMapPane getMapPane()
Liefert den Karten-Bereich der Komponente.


getGeoMapPane

public GeoMapPane getGeoMapPane()

getSelectedTool

public int getSelectedTool()

dispose

public void dispose()
Help the garbage collection