|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.geotools.gui.swing.MapPaneImpl
This widget is responsible for marshalling the rendering of a map. It processes Listener events and calls the Renderer as required. It maintains the correct aspect ratio by resizing the Context's BoundingBox when this component changes size.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected java.awt.geom.AffineTransform |
dotToCoordinateTransform
A transform from screen coordinates to real world coordinates. |
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 | |
MapPaneImpl(MapContext context)
Create a MapPane. |
|
MapPaneImpl(MapContext context,
ToolList toolList)
Create a MapPane. |
|
MapPaneImpl(MapContext context,
ToolList toolList,
boolean concatTransform)
|
Method Summary | |
void |
componentHidden(java.awt.event.ComponentEvent e)
Invoked when the component has been made invisible. |
void |
componentMoved(java.awt.event.ComponentEvent e)
Invoked when the component's position changes. |
void |
componentResized(java.awt.event.ComponentEvent e)
Invoked when the component's size changes, change the AreaOfInterest so that the aspect ratio remains the same. |
void |
componentShown(java.awt.event.ComponentEvent e)
Invoked when the component has been made visible. |
ToolList |
getToolList()
Get the ToolList for this class. |
void |
layerAdded(MapLayerListEvent event)
Triggered when a new layer is added to the MapContext |
void |
layerChanged(MapLayerListEvent event)
Triggered when something in a layer changed (data, style, title) |
void |
layerMoved(MapLayerListEvent event)
Triggered when a group of layers chenges position in the layer list |
void |
layerRemoved(MapLayerListEvent event)
Triggered when a layer is removed from the MapContext |
void |
mapBoundsChanged(MapBoundsEvent event)
Invoked when the area of interest or the coordinate system changes |
void |
paintComponent(java.awt.Graphics graphics)
Loop through all the layers in this mapPane's layerList and render each Layer which is set to Visable. |
protected void |
processMouseEvent(java.awt.event.MouseEvent event)
Processes mouse events occurring on this component. |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent event)
Processes mouse motion events occurring on this component. |
void |
selectedToolChanged(java.util.EventObject event)
Called when the selectedTool on a MapPane changes. |
void |
setToolList(ToolList toolList)
Set the ToolList for this class. |
java.awt.geom.Point2D |
toScreenPoint(java.awt.geom.Point2D worldPoint)
Added by Jamison Conley Aug 12, 2004 Takes a point in real world coordinates and returns the same point in screen coordinates. |
java.awt.Shape |
toScreenShape(java.awt.Shape worldShape)
Added by Jamison Conley Aug 13, 2004 Takes a point in real world coordinates and returns the same point in screen coordinates. |
java.awt.geom.Point2D |
toWorldPoint(java.awt.geom.Point2D screenPoint)
Added by Jamison Conley Aug 12, 2004 Takes a point in screen coordinates and returns the same point in real world coordinates. |
java.awt.Shape |
toWorldShape(java.awt.Shape screenShape)
Added by Jamison Conley Aug 13, 2004 Takes a shape in screen coordinates and returns the smape in real world coordinates |
void |
updateAspectRatio()
|
void |
updateTransform()
Re-evaluate the screen to CoordinateSystem transform, this method should be called whenever the MapPane resizes, boundingBox resizes, or coordinateSystem changes. |
void |
useMemoryCache(boolean flag)
|
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, 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 |
protected java.awt.geom.AffineTransform dotToCoordinateTransform
Constructor Detail |
public MapPaneImpl(MapContext context, ToolList toolList) throws java.lang.IllegalArgumentException, java.io.IOException
context
- The context where layerList and boundingBox are kept. If
context is null, an IllegalArguementException is thrown.toolList
- The list of tools which can be used by this class.
java.lang.IllegalArgumentException
- when parameters are null.
java.io.IOException
public MapPaneImpl(MapContext context, ToolList toolList, boolean concatTransform) throws java.lang.IllegalArgumentException, java.io.IOException
public MapPaneImpl(MapContext context) throws java.lang.IllegalArgumentException, java.io.IOException
context
- The context where layerList and boundingBox are kept. If
context is null, an IllegalArguementException is thrown.
java.lang.IllegalArgumentException
- when parameters are null.
java.io.IOException
Method Detail |
public void paintComponent(java.awt.Graphics graphics)
graphics
- The graphics object to paint to.protected void processMouseEvent(java.awt.event.MouseEvent event)
MouseEvent
into a GeoMouseEvent
. Then, the default
AWT's implementation is invoked in order to pass this event to any
registered MouseListener
objects.
event
- The click point.protected void processMouseMotionEvent(java.awt.event.MouseEvent event)
MouseEvent
into a GeoMouseEvent
. Then, the default
AWT's implementation is invoked in order to pass this event to any
registered MouseMotionListener
objects.
event
- The mouse point.public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
e
- ComponentEvent.public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
e
- ComponentEvent.public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
e
- ComponentEvent.
java.lang.reflect.UndeclaredThrowableException
- DOCUMENT ME!public void updateAspectRatio()
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
e
- ComponentEvent.public void selectedToolChanged(java.util.EventObject event)
selectedToolChanged
in interface SelectedToolListener
event
- ComponenetEvent.public void updateTransform()
public java.awt.geom.Point2D toWorldPoint(java.awt.geom.Point2D screenPoint)
screenPoint
- the point in screen coordinates
public java.awt.geom.Point2D toScreenPoint(java.awt.geom.Point2D worldPoint)
worldPoint
- the point in real world coordinates
public java.awt.Shape toWorldShape(java.awt.Shape screenShape)
screenShape
- the shape in screen coordinates
public java.awt.Shape toScreenShape(java.awt.Shape worldShape)
public void setToolList(ToolList toolList)
toolList
- The list of tools than can be used by this class.public ToolList getToolList()
public void mapBoundsChanged(MapBoundsEvent event)
MapBoundsListener
mapBoundsChanged
in interface MapBoundsListener
event
- The change event.public void layerAdded(MapLayerListEvent event)
MapLayerListListener
layerAdded
in interface MapLayerListListener
event
- encapsulating the event informationpublic void layerRemoved(MapLayerListEvent event)
MapLayerListListener
layerRemoved
in interface MapLayerListListener
event
- encapsulating the event informationpublic void layerChanged(MapLayerListEvent event)
MapLayerListListener
layerChanged
in interface MapLayerListListener
event
- encapsulating the event informationpublic void layerMoved(MapLayerListEvent event)
MapLayerListListener
layerMoved
in interface MapLayerListListener
event
- encapsulating the event informationpublic void useMemoryCache(boolean flag)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |