Package org.openstreetmap.josm.actions
Class UndoAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.UndoAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,UndoRedoHandler.CommandQueueListener,Destroyable
public class UndoAction extends JosmAction implements UndoRedoHandler.CommandQueueListener
Undoes the last command.- 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 inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description UndoAction()Construct the action with "Undo" as label.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)voidcommandChanged(int queueSize, int redoSize)Notifies the listener about the new queue sizeprotected voidupdateEnabledState()Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
UndoAction
public UndoAction()
Construct the action with "Undo" as label.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:JosmActionOverride in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e. when a layer is removed or added. SeeJosmAction.updateEnabledState(Collection)to respond to changes in the collection of selected primitives. Default behavior is empty.- Overrides:
updateEnabledStatein classJosmAction- See Also:
JosmAction.updateEnabledState(Collection),JosmAction.initEnabledState(),JosmAction.listenToLayerChange()
-
commandChanged
public void commandChanged(int queueSize, int redoSize)
Description copied from interface:UndoRedoHandler.CommandQueueListenerNotifies the listener about the new queue size- Specified by:
commandChangedin interfaceUndoRedoHandler.CommandQueueListener- Parameters:
queueSize- Undo stack sizeredoSize- Redo stack size
-
-