|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectMapMouseAdapter
CursorTool
public abstract class CursorTool
The base class for map pane cursor tools. Simply adds a getCursor method to the MapToolAdapter
Field Summary | |
---|---|
static int |
ANY_BUTTON
Flag indicating that the tool should be triggered whenever any mouse button is used. |
Constructor Summary | |
---|---|
CursorTool()
Constructs a new cursor tool which is triggered by any mouse button. |
|
CursorTool(int triggerButtonMask)
Constructs a new cursor tool. |
Method Summary | |
---|---|
abstract boolean |
canDraw()
Checks if the tool can draw when dragging. |
abstract boolean |
canMove()
Checks if the tool can move the map when dragging. |
Cursor |
getCursor()
Get the cursor for this tool. |
SwtMapPane |
getMapPane()
Get the map pane that this tool is servicing |
boolean |
isDrawing()
Returns true for any tool which is drawing
while dragging. |
protected boolean |
isTriggerMouseButton(MapMouseEvent event)
Checks if the tool should be triggered by the event. |
void |
setMapPane(SwtMapPane pane)
Set the map pane that this cursor tool is associated with |
Methods inherited from class MapMouseAdapter |
---|
onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheelMoved |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ANY_BUTTON
Constructor Detail |
---|
public CursorTool(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 CursorTool()
Method Detail |
---|
public void setMapPane(SwtMapPane pane)
pane
- the map pane
IllegalArgumentException
- if mapPane is nullpublic SwtMapPane getMapPane()
public Cursor getCursor()
public abstract boolean canDraw()
true
if the tool can draw.public abstract boolean canMove()
true
if the tool can move the map while dragging.public boolean isDrawing()
true
for any tool which is drawing
while dragging. For tools which are triggered only by a certain
mouse event it might be the case that canDraw()
is
true
while they are actually not active.
true
if the tool is drawing while draggingprotected boolean isTriggerMouseButton(MapMouseEvent event)
event
- event to be checked
true
if the tool is triggered by the event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |