Package org.geotools.swing.tool
Class PanTool
- Object
-
- MapMouseAdapter
-
- CursorTool
-
- PanTool
-
- All Implemented Interfaces:
MapMouseListener
public class PanTool extends CursorTool
A cursor tool to pan the map pane display.- Since:
- 2.6
- Author:
- Michael Bedward
-
-
Field Summary
Fields Modifier and Type Field Description static Point
CURSOR_HOTSPOT
Cursor hotspot coordinatesstatic String
CURSOR_IMAGE
Cursorstatic String
ICON_IMAGE
Icon for the controlstatic String
TOOL_NAME
Tool namestatic String
TOOL_TIP
Tool tip text
-
Constructor Summary
Constructors Constructor Description PanTool()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
drawDragBox()
Returns false to indicate that this tool does not draw a box on the map display when the mouse is being draggedCursor
getCursor()
Get the mouse cursor for this toolvoid
onMouseDragged(MapMouseEvent ev)
Respond to a mouse dragged event.void
onMousePressed(MapMouseEvent ev)
Respond to a mouse button press event from the map mapPane.void
onMouseReleased(MapMouseEvent ev)
If this button release is the end of a mouse dragged event, requests the map mapPane to repaint the display-
Methods inherited from class CursorTool
getMapPane, setMapPane
-
Methods inherited from class MapMouseAdapter
onMouseClicked, onMouseEntered, onMouseExited, onMouseMoved, onMouseWheelMoved
-
-
-
-
Field Detail
-
TOOL_NAME
public static final String TOOL_NAME
Tool name
-
TOOL_TIP
public static final String TOOL_TIP
Tool tip text
-
CURSOR_IMAGE
public static final String CURSOR_IMAGE
Cursor- See Also:
- Constant Field Values
-
CURSOR_HOTSPOT
public static final Point CURSOR_HOTSPOT
Cursor hotspot coordinates
-
ICON_IMAGE
public static final String ICON_IMAGE
Icon for the control- See Also:
- Constant Field Values
-
-
Method Detail
-
onMousePressed
public void onMousePressed(MapMouseEvent ev)
Respond to a mouse button press event from the map mapPane. This may signal the start of a mouse drag. Records the event's window position.- Specified by:
onMousePressed
in interfaceMapMouseListener
- Overrides:
onMousePressed
in classMapMouseAdapter
- Parameters:
ev
- the mouse event
-
onMouseDragged
public void onMouseDragged(MapMouseEvent ev)
Respond to a mouse dragged event. CallsMapPane.moveImage(int, int)
- Specified by:
onMouseDragged
in interfaceMapMouseListener
- Overrides:
onMouseDragged
in classMapMouseAdapter
- Parameters:
ev
- the mouse event
-
onMouseReleased
public void onMouseReleased(MapMouseEvent ev)
If this button release is the end of a mouse dragged event, requests the map mapPane to repaint the display- Specified by:
onMouseReleased
in interfaceMapMouseListener
- Overrides:
onMouseReleased
in classMapMouseAdapter
- Parameters:
ev
- the mouse event
-
getCursor
public Cursor getCursor()
Get the mouse cursor for this tool- Overrides:
getCursor
in classCursorTool
- Returns:
- the default cursor
-
drawDragBox
public boolean drawDragBox()
Returns false to indicate that this tool does not draw a box on the map display when the mouse is being dragged- Overrides:
drawDragBox
in classCursorTool
- Returns:
- true if this tool supports drawing a drag-box on the map; false otherwise
-
-