Class UndoRedoManager

java.lang.Object
gov.nasa.jpl.command.UndoRedoManager

public class UndoRedoManager extends Object
  • Constructor Details

    • UndoRedoManager

      public UndoRedoManager()
  • Method Details

    • undo

      public static void undo() throws CommandException
      Executes the most recent command stored in the undo stack. Adds the command to the redo stack.
      Throws:
      CommandException
    • redo

      public static void redo() throws CommandException
      Executes the most recent command stored in the redo stack. Adds the command to the undo stack.
      Throws:
      CommandException
    • addToUndoStack

      public static void addToUndoStack(Command command)
      Add a command to the undo stack.
      Parameters:
      command -
    • addToRedoStack

      public static void addToRedoStack(Command command)
      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.