org.geotools.swing.tool
Class ZoomOutTool

Object
  extended by MapMouseAdapter
      extended by CursorTool
          extended by AbstractZoomTool
              extended by ZoomOutTool
All Implemented Interfaces:
MapMouseListener

public class ZoomOutTool
extends AbstractZoomTool

A zoom-out tool for JMapPane.

For mouse clicks, the display will be zoomed-out 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)

Since:
2.6
Author:
Michael Bedward
Module:
modules/unsupported/swing (gt-swing.jar)

Field Summary
static Point CURSOR_HOTSPOT
          Cursor hotspot coordinates
static String CURSOR_IMAGE
          Cursor
static String ICON_IMAGE
          Icon for the control
static String TOOL_NAME
          Tool name
static String TOOL_TIP
          Tool tip text
 
Fields inherited from class AbstractZoomTool
DEFAULT_ZOOM_FACTOR, zoom
 
Constructor Summary
ZoomOutTool()
          Constructor
 
Method Summary
 boolean drawDragBox()
          Returns false to indicate that this tool does not draw a box on the map display when the mouse is being dragged
 Cursor getCursor()
          Get the mouse cursor for this tool
 void onMouseClicked(MapMouseEvent ev)
          Zoom out by the currently set increment, with the map centred at the location (in world coords) of the mouse click
 
Methods inherited from class AbstractZoomTool
getZoom, setZoom
 
Methods inherited from class CursorTool
getMapPane, setMapPane
 
Methods inherited from class MapMouseAdapter
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

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
Constructor Detail

ZoomOutTool

public ZoomOutTool()
Constructor

Method Detail

onMouseClicked

public void onMouseClicked(MapMouseEvent ev)
Zoom out by the currently set increment, with the map centred at the location (in world coords) of the mouse click

Specified by:
onMouseClicked in interface MapMouseListener
Overrides:
onMouseClicked in class MapMouseAdapter
Parameters:
ev - the mouse event

getCursor

public Cursor getCursor()
Get the mouse cursor for this tool

Overrides:
getCursor in class CursorTool
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 class CursorTool
Returns:
true if this tool supports drawing a drag-box on the map; false otherwise


Copyright © 1996-2009 Geotools. All Rights Reserved.