public class PanTool extends CursorTool
SwtMapPane
.
Allows the user to drag the map with the mouse.
Modifier and Type | Field and Description |
---|---|
static String |
TOOL_NAME
Tool name
|
static String |
TOOL_TIP
Tool tip text
|
ANY_BUTTON
Constructor and Description |
---|
PanTool()
Constructs a new pan tool which is triggered by any mouse button.
|
PanTool(int triggerButtonMask)
Constructs a new pan tool.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDraw()
Checks if the tool can draw when dragging.
|
boolean |
canMove()
Checks if the tool can move the map when dragging.
|
Cursor |
getCursor()
Get the mouse cursor for this tool
|
void |
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
|
getMapPane, isDrawing, isTriggerMouseButton, setMapPane
onMouseClicked, onMouseEntered, onMouseExited, onMouseMoved, onMouseWheelMoved
public static final String TOOL_NAME
public static final String TOOL_TIP
public PanTool(int triggerButtonMask)
SWT.BUTTON1
, or
a combination of multiple SWT-masks.triggerButtonMask
- Mouse button which triggers the tool's activation
or if the tool is to be triggered by any buttonpublic PanTool()
public void onMousePressed(MapMouseEvent ev)
onMousePressed
in interface MapMouseListener
onMousePressed
in class MapMouseAdapter
ev
- the mouse eventpublic void onMouseDragged(MapMouseEvent ev)
org.geotools.swing.JMapPane#moveImage()
onMouseDragged
in interface MapMouseListener
onMouseDragged
in class MapMouseAdapter
ev
- the mouse eventpublic void onMouseReleased(MapMouseEvent ev)
onMouseReleased
in interface MapMouseListener
onMouseReleased
in class MapMouseAdapter
ev
- the mouse eventpublic Cursor getCursor()
getCursor
in class CursorTool
public boolean canDraw()
CursorTool
canDraw
in class CursorTool
true
if the tool can draw.public boolean canMove()
CursorTool
canMove
in class CursorTool
true
if the tool can move the map while dragging.Copyright © 1996–2018 Geotools. All rights reserved.