jfig.commands
Class UndoStack

java.lang.Object
  extended byjfig.commands.UndoStack

public class UndoStack
extends java.lang.Object

keep track of jfig editing commands for undo and redo.


Constructor Summary
UndoStack()
           
 
Method Summary
 boolean hasChanges()
           
 void push(Command cmd)
           
 void redo()
          redo an operation: pop off the top-level Command from the redoStack and call it's execute() method.
 void setMenuItems(java.lang.Object undoMI, java.lang.Object redoMI)
          set the MenuItem corresponding to the 'Undo' and 'Redo' Commands.
 java.lang.String toString()
           
 void undo()
          undo an operation: pop off the top-level Command from the undoStack, put it to the top of the redoStack, then call it's undo() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndoStack

public UndoStack()
Method Detail

hasChanges

public boolean hasChanges()

push

public void push(Command cmd)

undo

public void undo()
undo an operation: pop off the top-level Command from the undoStack, put it to the top of the redoStack, then call it's undo() method.


redo

public void redo()
redo an operation: pop off the top-level Command from the redoStack and call it's execute() method. Ok, we also have to push the operation onto the undoStack again...


setMenuItems

public void setMenuItems(java.lang.Object undoMI,
                         java.lang.Object redoMI)
set the MenuItem corresponding to the 'Undo' and 'Redo' Commands. This allows the UndoStack to modify the MenuItem Strings, in order to give the user a hint about what Commands are on top of the undo/redo-stacks.


toString

public java.lang.String toString()