org.geotools.swt.tool
Class AbstractZoomTool

Object
  extended by MapMouseAdapter
      extended by CursorTool
          extended by AbstractZoomTool
All Implemented Interfaces:
MapMouseListener
Direct Known Subclasses:
ZoomInTool, ZoomOutTool

public abstract class AbstractZoomTool
extends CursorTool

Abstract base class for the zoom-in and zoom-out tools. Provides getter / setter methods for the zoom increment.

Since:
2.6
Author:
Michael Bedward

Field Summary
static double DEFAULT_ZOOM_FACTOR
          The default zoom increment
protected  double zoom
          The working zoom increment
 
Fields inherited from class CursorTool
ANY_BUTTON
 
Constructor Summary
AbstractZoomTool()
          Constructs a new abstract zoom tool which is triggered by any mouse button.
AbstractZoomTool(int triggerButtonMask)
          Constructs a new abstract zoom tool.
 
Method Summary
 double getZoom()
          Get the current areal zoom increment.
 double setZoom(double newZoom)
          Set the zoom increment
 
Methods inherited from class CursorTool
canDraw, canMove, getCursor, getMapPane, isDrawing, isTriggerMouseButton, setMapPane
 
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

DEFAULT_ZOOM_FACTOR

public static final double DEFAULT_ZOOM_FACTOR
The default zoom increment

See Also:
Constant Field Values

zoom

protected double zoom
The working zoom increment

Constructor Detail

AbstractZoomTool

public AbstractZoomTool(int triggerButtonMask)
Constructs a new abstract zoom tool. To activate the tool only on certain mouse events provide a single mask, e.g. SWT.BUTTON1, or a combination of multiple SWT-masks.

Parameters:
triggerButtonMask - Mouse button which triggers the tool's activation or if the tool is to be triggered by any button

AbstractZoomTool

public AbstractZoomTool()
Constructs a new abstract zoom tool which is triggered by any mouse button.

Method Detail

getZoom

public double getZoom()
Get the current areal zoom increment.

Returns:
the current zoom increment as a double

setZoom

public double setZoom(double newZoom)
Set the zoom increment

Parameters:
newZoom - the new zoom increment; values <= 1.0 will be ignored
Returns:
the previous zoom increment


Copyright © 1996-2014 Geotools. All Rights Reserved.