Package org.openstreetmap.josm.actions
Class ZoomToAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.ZoomToAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,ListSelectionListener,LayerManager.LayerChangeListener,MainLayerManager.ActiveLayerChangeListener
public class ZoomToAction
extends AbstractAction
implements LayerManager.LayerChangeListener, MainLayerManager.ActiveLayerChangeListener, ListSelectionListener
An action that zooms to the selected OSM primitive in a table of primitives.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Stringprivate final Stringprivate final OsmPrimitivesTableFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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
ConstructorsConstructorDescriptionZoomToAction(NodeListTable table) Creates a new zoom to action for aNodeListTableusing the matching description stringsZoomToAction(RelationMemberTable table) Creates a new zoom to action for aRelationMemberTableusing the matching description stringsZoomToAction(MemberTable table) Creates a new zoom to action for aMemberTableusing the matching description stringsZoomToAction(OsmPrimitivesTable table, String descriptionNominal, String descriptionInactiveLayer, String descriptionNoSelection) Creates a new, generic zoom to action -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidCalled whenever the active or edit layer changed.voidNotifies this listener that a layer has been added.voidNotifies this listener that the order of layers was changed.voidNotifies this listener that a layer was just removed.protected final voidvoidMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
table
-
descriptionNominal
-
descriptionInactiveLayer
-
descriptionNoSelection
-
-
Constructor Details
-
ZoomToAction
public ZoomToAction(OsmPrimitivesTable table, String descriptionNominal, String descriptionInactiveLayer, String descriptionNoSelection) Creates a new, generic zoom to action- Parameters:
table- The table to get the selected element fromdescriptionNominal- The description to display if zooming is possibledescriptionInactiveLayer- The description to display if zooming is impossible because the layer is not activedescriptionNoSelection- The description to display if zooming is impossible because the table selection is empty
-
ZoomToAction
Creates a new zoom to action for aMemberTableusing the matching description strings- Parameters:
table- The table to get the selected element from
-
ZoomToAction
Creates a new zoom to action for aRelationMemberTableusing the matching description strings- Parameters:
table- The table to get the selected element from
-
ZoomToAction
Creates a new zoom to action for aNodeListTableusing the matching description strings- Parameters:
table- The table to get the selected element from
-
-
Method Details
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
updateEnabledState
-
valueChanged
- Specified by:
valueChangedin interfaceListSelectionListener
-
activeOrEditLayerChanged
Description copied from interface:MainLayerManager.ActiveLayerChangeListenerCalled whenever the active or edit layer changed.You can be sure that this layer is still contained in this set.
Listeners are called in the EDT thread and you can manipulate the layer manager in the current thread.
- Specified by:
activeOrEditLayerChangedin interfaceMainLayerManager.ActiveLayerChangeListener- Parameters:
e- The change event.
-
layerAdded
Description copied from interface:LayerManager.LayerChangeListenerNotifies this listener that a layer has been added.Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
- Specified by:
layerAddedin interfaceLayerManager.LayerChangeListener- Parameters:
e- The new added layer event
-
layerRemoving
Description copied from interface:LayerManager.LayerChangeListenerNotifies this listener that a layer was just removed.Listeners are called in the EDT thread after the layer was removed. Use
LayerManager.LayerRemoveEvent.scheduleRemoval(Collection)to remove more layers. You should not do blocking or long-running tasks in this method.- Specified by:
layerRemovingin interfaceLayerManager.LayerChangeListener- Parameters:
e- The layer to be removed (as event)
-
layerOrderChanged
Description copied from interface:LayerManager.LayerChangeListenerNotifies this listener that the order of layers was changed.Listeners are called in the EDT thread. You should not do blocking or long-running tasks in this method.
- Specified by:
layerOrderChangedin interfaceLayerManager.LayerChangeListener- Parameters:
e- The order change event.
-