Class AbstractUndoRedoAction
java.lang.Object
javax.swing.AbstractAction
jmt.framework.gui.listeners.AbstractJMTAction
jsimgraph.controller.actions.AbstractJmodelAction
jsimgraph.controller.actions.AbstractUndoRedoAction
- All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
- Direct Known Subclasses:
ActionRedo, ActionUndo
An abstract class grouping functionalities common to Undo and Redo action.
These kind of action are a bit tricky because we want their displayed name to contain a
description of the edit that will be redone. A way to do this is maintaining a list
of all created instances and scanning through it at every update.
That said, the main function of this class is to provide a means to update the state of all Undo/redo actions through its static method
That said, the main function of this class is to provide a means to update the state of all Undo/redo actions through its static method
updateAll()- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static intprotected static Vector<AbstractUndoRedoAction> Fields inherited from class AbstractJmodelAction
mediatorFields inherited from class AbstractJMTAction
GROUP, IMAGE_NAME, MENUACTIONS, PROPERTY_SELECTED, SELECTABLEFields inherited from class AbstractAction
changeSupport, enabledFields inherited from interface 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
Constructors -
Method Summary
Methods inherited from class AbstractJMTAction
getMenuActions, isSelected, setAcceleratorKey, setGroup, setHelpText, setIcon, setMenuActions, setMenuActions, setMnemonicKey, setName, setSelectable, setSelected, setTooltipTextMethods inherited from class AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ActionListener
actionPerformed
-
Field Details
-
instances
-
instanceCount
protected static int instanceCount
-
-
Constructor Details
-
AbstractUndoRedoAction
-
-
Method Details
-
update
public abstract void update()Update the state (name & enabled) of this instance. To be overridden in subclasses -
updateAll
public static void updateAll()Update the state (name & enabled) of all instances -
dispose
public void dispose()Removes this action from the update list. Should be called before deleting all references to anActionRedo
-