|
|||||||||||
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 org.geotools.gui.swing.ZoomPane org.geotools.gui.swing.MapPane
A Swing component for displaying geographic features.
Since this class extends ZoomPane
, the user can use mouse and keyboard
to zoom, translate and rotate around the map (Remind: MapPanel
has
no scrollbar. To display scrollbars, use ZoomPane.createScrollPane()
).
Nested Class Summary |
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 |
Fields inherited from class org.geotools.gui.swing.ZoomPane |
DEFAULT_ZOOM, RESET, ROTATE, SCALE_X, SCALE_Y, TRANSLATE_X, TRANSLATE_Y, UNIFORM_SCALE, zoom |
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 | |
MapPane()
Construct a default map panel. |
|
MapPane(CoordinateSystem cs)
Construct a map panel using the specified coordinate system. |
Method Summary | |
java.awt.geom.Rectangle2D |
getArea()
Returns a bounding box representative of the geographic area to drawn. |
CoordinateSystem |
getCoordinateSystem()
Returns the view coordinate system. |
protected javax.swing.JPopupMenu |
getDefaultPopupMenu(GeoMouseEvent event)
Returns a default popup menu for the given mouse event. |
protected java.awt.Dimension |
getDefaultSize()
Returns the default size for this component. |
protected javax.swing.JPopupMenu |
getPopupMenu(java.awt.event.MouseEvent event)
Returns the popup menu to appears for a given mouse event. |
protected java.awt.geom.Dimension2D |
getPreferredPixelSize()
Returns the preferred pixel size in "real world" coordinates. |
Renderer |
getRenderer()
Returns the renderer for this map pane. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
Returns the string to be used as the tooltip for a given mouse event. |
protected void |
paintComponent(java.awt.Graphics2D graphics)
Paint this MapPane and all visible layers. |
protected void |
printComponent(java.awt.Graphics2D graphics)
Print this MapPane and all visible layers. |
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 |
setCoordinateSystem(CoordinateSystem cs)
Set the view coordinate system. |
void |
setToolTipText(java.lang.String tooltip)
Registers the default text to display in a tool tip. |
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, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, processComponentKeyEvent, processKeyBinding, processKeyEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, 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, 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 |
Constructor Detail |
public MapPane()
public MapPane(CoordinateSystem cs)
cs
- The rendering coordinate system.Method Detail |
public CoordinateSystem getCoordinateSystem()
public void setCoordinateSystem(CoordinateSystem cs) throws org.opengis.referencing.operation.TransformException
cs
- The view coordinate system. If this coordinate system has
more than 2 dimensions, then only the 2 first will be retained.
org.opengis.referencing.operation.TransformException
- If cs
can't be reduced to a two-dimensional
coordinate system., or if data can't be transformed for some other reason.public java.awt.geom.Rectangle2D getArea()
getArea
in class ZoomPane
null
if this area can't be computed.ZoomPane.setPreferredArea(java.awt.geom.Rectangle2D)
,
Renderer.getPreferredArea()
protected java.awt.geom.Dimension2D getPreferredPixelSize()
ZoomPane
will adjusts the map scale in such a way that
structures of preferredPixelSize
will appears as one pixel on the
screen device.
getPreferredPixelSize
in class ZoomPane
Renderer.getPreferredPixelSize()
protected java.awt.Dimension getDefaultSize()
JComponent.getPreferredSize()
if no preferred size has
been explicitly set.
getDefaultSize
in class ZoomPane
public Renderer getRenderer()
Renderer.addLayer(org.geotools.renderer.j2d.RenderedLayer)
,
Renderer.removeLayer(org.geotools.renderer.j2d.RenderedLayer)
,
Renderer.removeAllLayers()
,
Renderer.getLayers()
,
Renderer.getLayerCount()
protected void paintComponent(java.awt.Graphics2D graphics)
MapPane
and all visible layers.
paintComponent
in class ZoomPane
graphics
- The graphics context.protected void printComponent(java.awt.Graphics2D graphics)
MapPane
and all visible layers.
printComponent
in class ZoomPane
graphics
- The graphics context.public void setToolTipText(java.lang.String tooltip)
Renderer.getToolTipText(org.geotools.renderer.j2d.GeoMouseEvent)
returned null
for all registered layers).
tooltip
- The default tooltip, or null
if none.public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Renderer.getToolTipText(org.geotools.renderer.j2d.GeoMouseEvent)
.
event
- The mouse event.
null
if there is no tool tip for this location.setToolTipText(java.lang.String)
,
Renderer.getToolTipText(org.geotools.renderer.j2d.GeoMouseEvent)
protected javax.swing.JPopupMenu getPopupMenu(java.awt.event.MouseEvent event)
ContextualMenuTool#getPopupMenu
in decreasing
z-order until one is found to
returns a non-null menu. If no layer has a popup menu for this event,
then this method returns getDefaultPopupMenu(org.geotools.renderer.j2d.GeoMouseEvent)
.
getPopupMenu
in class ZoomPane
event
- The mouse event.
null
if there is none.getDefaultPopupMenu(org.geotools.renderer.j2d.GeoMouseEvent)
protected javax.swing.JPopupMenu getDefaultPopupMenu(GeoMouseEvent event)
getPopupMenu(java.awt.event.MouseEvent)
,
ZoomPane.getPopupMenu(java.awt.event.MouseEvent)
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.
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.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |