org.openstreetmap.josm.actions.mapmode
Class ZoomAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.openstreetmap.josm.actions.JosmAction
          extended by org.openstreetmap.josm.actions.mapmode.MapMode
              extended by org.openstreetmap.josm.actions.mapmode.ZoomAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, SelectionManager.SelectionEnded, Destroyable

public class ZoomAction
extends MapMode
implements SelectionManager.SelectionEnded

Enable the zoom mode within the MapFrame. Holding down the left mouse button select a rectangle with the same aspect ratio than the current map view. Holding down left and right let the user move the former selected rectangle. Releasing the left button zoom to the selection. Rectangle selections with either height or width smaller than 3 pixels are ignored.

See Also:
Serialized Form

Field Summary
private  SelectionManager selectionManager
          Manager that manages the selection rectangle with the aspect ratio of the MapView.
 
Fields inherited from class org.openstreetmap.josm.actions.mapmode.MapMode
alt, ctrl, cursor, shift
 
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ZoomAction(MapFrame mapFrame)
          Construct a ZoomAction without a label.
 
Method Summary
 void enterMode()
           
 void exitMode()
           
 java.lang.String getModeHelpText()
           
 void selectionEnded(java.awt.Rectangle r, java.awt.event.MouseEvent e)
          Zoom to the rectangle on the map.
 
Methods inherited from class org.openstreetmap.josm.actions.mapmode.MapMode
actionPerformed, layerIsSupported, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, updateKeyModifiers, updateKeyModifiers, updateKeyModifiers, updateStatusLine
 
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState, updateEnabledState
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.josm.gui.SelectionManager.SelectionEnded
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

selectionManager

private final SelectionManager selectionManager
Manager that manages the selection rectangle with the aspect ratio of the MapView.

Constructor Detail

ZoomAction

public ZoomAction(MapFrame mapFrame)
Construct a ZoomAction without a label.

Parameters:
mapFrame - The MapFrame, whose zoom mode should be enabled.
Method Detail

selectionEnded

public void selectionEnded(java.awt.Rectangle r,
                           java.awt.event.MouseEvent e)
Zoom to the rectangle on the map.

Specified by:
selectionEnded in interface SelectionManager.SelectionEnded
Parameters:
r - The rectangle that is currently the selection.
See Also:
InputEvent.getModifiersEx()

enterMode

public void enterMode()
Overrides:
enterMode in class MapMode

exitMode

public void exitMode()
Overrides:
exitMode in class MapMode

getModeHelpText

public java.lang.String getModeHelpText()
Overrides:
getModeHelpText in class MapMode


JOSM