org.openstreetmap.josm.actions.mapmode
Class ZoomAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.JosmAction
org.openstreetmap.josm.actions.mapmode.MapMode
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
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 |
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 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 |
selectionManager
private final SelectionManager selectionManager
- Manager that manages the selection rectangle with the aspect ratio of the
MapView.
ZoomAction
public ZoomAction(MapFrame mapFrame)
- Construct a ZoomAction without a label.
- Parameters:
mapFrame
- The MapFrame, whose zoom mode should be enabled.
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