|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectMapMouseAdapter
CursorTool
AbstractZoomTool
ZoomInTool
public class ZoomInTool
A zoom-in tool for JMapPane.
For mouse clicks, the display will be zoomed-in such that the map centre is the position of the mouse click and the map width and height are calculated as:
len = len.old / z
where z
is the linear zoom increment (>= 1.0)
The tool also responds to the user drawing a box on the map mapPane with mouse click-and-drag to define the zoomed-in area.
Field Summary | |
---|---|
static String |
TOOL_NAME
Tool name |
static String |
TOOL_TIP
Tool tip text |
Fields inherited from class AbstractZoomTool |
---|
DEFAULT_ZOOM_FACTOR, zoom |
Fields inherited from class CursorTool |
---|
ANY_BUTTON |
Constructor Summary | |
---|---|
ZoomInTool()
Constructs a new zoom in tool which is triggered by any mouse button. |
|
ZoomInTool(int triggerButtonMask)
Constructs a new zoom in tool. |
Method Summary | |
---|---|
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 |
boolean |
isDrawing()
Returns true for any tool which is drawing
while dragging. |
void |
onMouseClicked(MapMouseEvent e)
Zoom in by the currently set increment, with the map centred at the location (in world coords) of the mouse click |
void |
onMouseDragged(MapMouseEvent ev)
Records that the mouse is being dragged |
void |
onMousePressed(MapMouseEvent ev)
Records the map position of the mouse event in case this button press is the beginning of a mouse drag |
void |
onMouseReleased(MapMouseEvent ev)
If the mouse was dragged, determines the bounds of the box that the user defined and passes this to the mapPane's AbstractMapPane.setDisplayArea(org.opengis.geometry.Envelope)
method |
static double |
pythagoras(double d1,
double d2)
|
Methods inherited from class AbstractZoomTool |
---|
getZoom, setZoom |
Methods inherited from class CursorTool |
---|
getMapPane, isTriggerMouseButton, setMapPane |
Methods inherited from class MapMouseAdapter |
---|
onMouseEntered, onMouseExited, onMouseMoved, onMouseWheelMoved |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TOOL_NAME
public static final String TOOL_TIP
Constructor Detail |
---|
public ZoomInTool(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 ZoomInTool()
Method Detail |
---|
public void onMouseClicked(MapMouseEvent e)
onMouseClicked
in interface MapMouseListener
onMouseClicked
in class MapMouseAdapter
e
- map mapPane mouse eventpublic void onMousePressed(MapMouseEvent ev)
onMousePressed
in interface MapMouseListener
onMousePressed
in class MapMouseAdapter
ev
- the mouse eventpublic void onMouseDragged(MapMouseEvent ev)
onMouseDragged
in interface MapMouseListener
onMouseDragged
in class MapMouseAdapter
ev
- the mouse eventpublic void onMouseReleased(MapMouseEvent ev)
AbstractMapPane.setDisplayArea(org.opengis.geometry.Envelope)
method
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.public boolean isDrawing()
CursorTool
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 CursorTool.canDraw()
is
true
while they are actually not active.
isDrawing
in class CursorTool
true
if the tool is drawing while draggingpublic static double pythagoras(double d1, double d2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |