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
,PreferenceChangedListener
,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.- Since:
- 1
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
Fields Modifier and Type Field Description 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, meta, platformMenuShortcutKeyMask, shift
-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description ZoomAction(MapFrame mapFrame)
Construct a ZoomAction without a label.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enterMode()
Makes this map mode active.void
exitMode()
Makes this map mode inactive.java.lang.String
getModeHelpText()
Returns a short translated help message describing how this map mode can be used, to be displayed in status line.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, isEditableDataLayer, layerIsSupported, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, preferenceChanged, readPreferences, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiers, updateKeyModifiersEx, updateStatusLine
-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
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
-
-
-
-
Field Detail
-
selectionManager
private final transient 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 interfaceSelectionManager.SelectionEnded
- Parameters:
r
- The rectangle that encloses the current selection.e
- The mouse event.- See Also:
InputEvent.getModifiersEx()
,SelectionManager.getSelectedObjects(boolean)
-
enterMode
public void enterMode()
Description copied from class:MapMode
Makes this map mode active.
-
exitMode
public void exitMode()
Description copied from class:MapMode
Makes this map mode inactive.
-
getModeHelpText
public java.lang.String getModeHelpText()
Description copied from class:MapMode
Returns a short translated help message describing how this map mode can be used, to be displayed in status line.- Overrides:
getModeHelpText
in classMapMode
- Returns:
- a short translated help message describing how this map mode can be used
-
-