Package org.geotools.swing.tool
Class ZoomInTool
Object
MapMouseAdapter
CursorTool
AbstractZoomTool
ZoomInTool
- All Implemented Interfaces:
- MapMouseListener
A cursor tool to zoom in the map pane display.
 
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.
- Since:
- 2.6
- Author:
- Michael Bedward
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final PointCursor hotspot coordinatesstatic final StringCursorstatic final StringIcon for the controlstatic final StringTool namestatic final StringTool tip textFields inherited from class AbstractZoomToolDEFAULT_ZOOM_FACTOR, zoom
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true to indicate that this tool draws a box on the map display when the mouse is being dragged to show the zoom-in areaGet the mouse cursor for this toolvoidZoom in by the currently set increment, with the map centred at the location (in world coords) of the mouse clickvoidRecords that the mouse is being draggedvoidRecords the map position of the mouse event in case this button press is the beginning of a mouse dragvoidIf the mouse was dragged, determines the bounds of the box that the user defined and passes this to the mapPane'ssetDisplayAreamethod.Methods inherited from class AbstractZoomToolgetZoom, setZoomMethods inherited from class CursorToolgetMapPane, setMapPaneMethods inherited from class MapMouseAdapteronMouseEntered, onMouseExited, onMouseMoved, onMouseWheelMoved
- 
Field Details- 
TOOL_NAMETool name
- 
TOOL_TIPTool tip text
- 
CURSOR_IMAGECursor- See Also:
 
- 
CURSOR_HOTSPOTCursor hotspot coordinates
- 
ICON_IMAGEIcon for the control- See Also:
 
 
- 
- 
Constructor Details- 
ZoomInToolpublic ZoomInTool()Constructor
 
- 
- 
Method Details- 
onMouseClickedZoom in by the currently set increment, with the map centred at the location (in world coords) of the mouse click- Specified by:
- onMouseClickedin interface- MapMouseListener
- Overrides:
- onMouseClickedin class- MapMouseAdapter
- Parameters:
- e- map mapPane mouse event
 
- 
onMousePressedRecords the map position of the mouse event in case this button press is the beginning of a mouse drag- Specified by:
- onMousePressedin interface- MapMouseListener
- Overrides:
- onMousePressedin class- MapMouseAdapter
- Parameters:
- ev- the mouse event
 
- 
onMouseDraggedRecords that the mouse is being dragged- Specified by:
- onMouseDraggedin interface- MapMouseListener
- Overrides:
- onMouseDraggedin class- MapMouseAdapter
- Parameters:
- ev- the mouse event
 
- 
onMouseReleasedIf the mouse was dragged, determines the bounds of the box that the user defined and passes this to the mapPane'ssetDisplayAreamethod.- Specified by:
- onMouseReleasedin interface- MapMouseListener
- Overrides:
- onMouseReleasedin class- MapMouseAdapter
- Parameters:
- ev- the mouse event
 
- 
getCursorGet the mouse cursor for this tool- Overrides:
- getCursorin class- CursorTool
- Returns:
- the default cursor
 
- 
drawDragBoxpublic boolean drawDragBox()Returns true to indicate that this tool draws a box on the map display when the mouse is being dragged to show the zoom-in area- Overrides:
- drawDragBoxin class- CursorTool
- Returns:
- true if this tool supports drawing a drag-box on the map; false otherwise
 
 
-