artisynth.core.gui.editorManager
Class UndoManager

java.lang.Object
  extended by artisynth.core.gui.editorManager.UndoManager

public class UndoManager
extends java.lang.Object


Constructor Summary
UndoManager()
           
 
Method Summary
 void addCommand(java.util.ArrayList<Command> newCommands)
          Add a set of commands that have been executed and should be undone together.
 void addCommand(Command newCommand)
          Add a single command that has been executed and should be undone on it's own.
 void addCommand(Command newCommand, CompositeState state)
          Add a single command that has been executed and should be undone on it's own.
 void clearCommands()
           
 void execute(Command cmd)
           
 int getDepth()
           
 Command getLastCommand()
           
 CompositeState getModelState()
           
 boolean hasCommandToUndo()
           
 void saveStateAndExecute(Command cmd)
           
 void setDepth(int depth)
           
 void undoLastCommand()
          Undo the most recently executed set of commands.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoManager

public UndoManager()
Method Detail

setDepth

public void setDepth(int depth)

getDepth

public int getDepth()

addCommand

public void addCommand(java.util.ArrayList<Command> newCommands)
Add a set of commands that have been executed and should be undone together.

Parameters:
newCommands - The commands that have been executed.

addCommand

public void addCommand(Command newCommand)
Add a single command that has been executed and should be undone on it's own.

Parameters:
newCommand - The command that has been executed.

addCommand

public void addCommand(Command newCommand,
                       CompositeState state)
Add a single command that has been executed and should be undone on it's own.

Parameters:
newCommand - The command that has been executed.

undoLastCommand

public void undoLastCommand()
Undo the most recently executed set of commands.


getLastCommand

public Command getLastCommand()

clearCommands

public void clearCommands()

hasCommandToUndo

public boolean hasCommandToUndo()

execute

public void execute(Command cmd)

getModelState

public CompositeState getModelState()

saveStateAndExecute

public void saveStateAndExecute(Command cmd)