Package gov.nasa.jpl.command
Class UndoRedoManager
java.lang.Object
gov.nasa.jpl.command.UndoRedoManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToRedoStack(Command command) Add a command to the redo stack.static voidaddToUndoStack(Command command) Add a command to the undo stack.static voidClears the redo stack.static voidredo()Executes the most recent command stored in the redo stack.static voidundo()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.
-