Package org.geotools.swing
Interface MapPane
- 
- All Known Implementing Classes:
- AbstractMapPane,- JLayeredMapPane,- JMapPane
 
 public interface MapPaneDefines the core map pane methods.- Since:
- 8.0
- Author:
- Michael Bedward
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMapPaneListener(MapPaneListener listener)Adds a listener to receiveMapPaneEvents.voidaddMouseListener(MapMouseListener listener)Registers an object that wishes to receiveMapMouseEvents such as a JMapStatusBar.CursorToolgetCursorTool()Gets the current cursor tool.ReferencedEnvelopegetDisplayArea()Gets the current display area in world coordinates.MapContentgetMapContent()Gets theMapConentinstance containing the layers being displayed by this map pane.MapMouseEventDispatchergetMouseEventDispatcher()Gets the current mouse event dispatcher which is responsible for converting each input Java AWT mouse event into a MapMouseEvent and forwarding it to each MapMouseListener.AffineTransformgetScreenToWorldTransform()Gets the screen to world coordinate transform.AffineTransformgetWorldToScreenTransform()Gets the world to screen coordinate transform.voidmoveImage(int dx, int dy)Moves the image(s) displayed by the map pane from the current origin (x,y) (device pixels) to (x+dx, y+dy).voidremoveMapPaneListener(MapPaneListener listener)Removes the specified listener.voidremoveMouseListener(MapMouseListener listener)Removes the specified listener.voidreset()Reset the map area to include the full extent of all layers and redraw the displayvoidsetCursorTool(CursorTool tool)Sets the current cursor tool.voidsetDisplayArea(Bounds envelope)Sets the area to display in world units.voidsetMapContent(MapContent content)Sets theMapContentinstance containing the layers to display.voidsetMouseEventDispatcher(MapMouseEventDispatcher dispatcher)Replaces the current mouse event dispatcher.
 
- 
- 
- 
Method Detail- 
getMapContentMapContent getMapContent() Gets theMapConentinstance containing the layers being displayed by this map pane.- Returns:
- the map content
 
 - 
setMapContentvoid setMapContent(MapContent content) Sets theMapContentinstance containing the layers to display.- Parameters:
- content- the map content
 
 - 
getMouseEventDispatcherMapMouseEventDispatcher getMouseEventDispatcher() Gets the current mouse event dispatcher which is responsible for converting each input Java AWT mouse event into a MapMouseEvent and forwarding it to each MapMouseListener.- Returns:
- the current mouse event dispatcher (may be null)
 
 - 
setMouseEventDispatchervoid setMouseEventDispatcher(MapMouseEventDispatcher dispatcher) Replaces the current mouse event dispatcher. All current listeners will be removed. It is the responsibility of the client to add them to the new dispatcher if this is desired.- Parameters:
- dispatcher- the new dispatcher (may be- null)
 
 - 
getDisplayAreaReferencedEnvelope getDisplayArea() Gets the current display area in world coordinates. This is a short-cut formapPane.getMapContent().getViewport().getBounds(). If a MapContent object has not yet been associated with the map pane, an emptyReferencedEnvelopeis returned.- Returns:
- the display area in world coordinates
 
 - 
setDisplayAreavoid setDisplayArea(Bounds envelope) Sets the area to display in world units.- Parameters:
- envelope- the new display area
- Throws:
- IllegalArgumentException- if- envelopeis- null
 
 - 
resetvoid reset() Reset the map area to include the full extent of all layers and redraw the display
 - 
getScreenToWorldTransformAffineTransform getScreenToWorldTransform() Gets the screen to world coordinate transform. This is a short-cut formapPane.getMapContent().getViewport().getScreenToWorld().- Returns:
- the screen to world coordinate transform
 
 - 
getWorldToScreenTransformAffineTransform getWorldToScreenTransform() Gets the world to screen coordinate transform. This is a short-cut formapPane.getMapContent().getViewport().getWorldToScreen().The returned AffineTransformcan be used to determine the current drawing scale...double scale = mapPane.getWorldToScreenTransform().getScaleX();- Returns:
- the world to screen coordinate transform
 
 - 
addMapPaneListenervoid addMapPaneListener(MapPaneListener listener) Adds a listener to receiveMapPaneEvents.- Parameters:
- listener- the listener to add
- Throws:
- IllegalArgumentException- if- listeneris- null
 
 - 
removeMapPaneListenervoid removeMapPaneListener(MapPaneListener listener) Removes the specified listener.- Parameters:
- listener- the listener to remove
 
 - 
addMouseListenervoid addMouseListener(MapMouseListener listener) Registers an object that wishes to receiveMapMouseEvents such as a JMapStatusBar.- Parameters:
- listener- the listener to add
- Throws:
- IllegalArgumentException- if listener is null
- See Also:
- MapMouseListener
 
 - 
removeMouseListenervoid removeMouseListener(MapMouseListener listener) Removes the specified listener.- Parameters:
- listener- the listener to remove
 
 - 
getCursorToolCursorTool getCursorTool() Gets the current cursor tool.- Returns:
- the current cursor tool (may be null)
 
 - 
setCursorToolvoid setCursorTool(CursorTool tool) Sets the current cursor tool.- Parameters:
- tool- the tool; or- nullfor no cursor tool
 
 - 
moveImagevoid moveImage(int dx, int dy)Moves the image(s) displayed by the map pane from the current origin (x,y) (device pixels) to (x+dx, y+dy). If this method is called when the map pane is not visible, or when the pane's visible rectangle is empty, it is ignored.- Parameters:
- dx- the x offset in pixels
- dy- the y offset in pixels.
 
 
- 
 
-