org.jhotdraw.util
Class UndoCommand
java.lang.Object
org.jhotdraw.standard.AbstractCommand
org.jhotdraw.util.UndoCommand
- All Implemented Interfaces:
- FigureSelectionListener, Command
public class UndoCommand
- extends AbstractCommand
Command to undo the latest change in the drawing.
Undo activities can be undone only once, therefore they
are not added to the undo stack again (redo activities
can be added to the redo stack again, because they can
be redone several times, every time pushing a corresponding
undo activity as well).
- Version:
- <$CURRENT_VERSION$>
- Author:
- Wolfram Kaiser
Methods inherited from class org.jhotdraw.standard.AbstractCommand |
addCommandListener, dispose, figureSelectionChanged, getDrawingEditor, getUndoActivity, isExecutable, name, removeCommandListener, setName, setUndoActivity, view |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UndoCommand
public UndoCommand(java.lang.String name,
DrawingEditor newDrawingEditor)
- Constructs a properties command.
- Parameters:
name
- the command namenewDrawingEditor
- the DrawingEditor which manages the views
execute
public void execute()
- Description copied from class:
AbstractCommand
- Executes the command.
- Specified by:
execute
in interface Command
- Overrides:
execute
in class AbstractCommand
isExecutableWithView
public boolean isExecutableWithView()
- Used in enabling the undo menu item.
Undo menu item will be enabled only when there is atleast one undoable
activity registered with UndoManager.