Package gov.nasa.jpl.command
Class UndoRedoManager
java.lang.Object
gov.nasa.jpl.command.UndoRedoManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addToRedoStack
(Command command) Add a command to the redo stack.static void
addToUndoStack
(Command command) Add a command to the undo stack.static void
Clears the redo stack.static void
redo()
Executes the most recent command stored in the redo stack.static void
undo()
Executes the most recent command stored in the undo stack.
-
Constructor Details
-
UndoRedoManager
public UndoRedoManager()
-
-
Method Details
-
undo
Executes the most recent command stored in the undo stack. Adds the command to the redo stack.- Throws:
CommandException
-
redo
Executes the most recent command stored in the redo stack. Adds the command to the undo stack.- Throws:
CommandException
-
addToUndoStack
Add a command to the undo stack.- Parameters:
command
-
-
addToRedoStack
Add a command to the redo stack.- Parameters:
command
-
-
clearRedoStack
public static void clearRedoStack()Clears the redo stack. Should be done whenever a command is executed that is not undo/redo.
-