JHotDraw 6.0b1

org.jhotdraw.util
Class UndoManager

java.lang.Object
  extended by org.jhotdraw.util.UndoManager

public class UndoManager
extends java.lang.Object

This class manages all the undoable commands. It keeps track of all the modifications done through user interactions.


Field Summary
static int DEFAULT_BUFFER_SIZE
          Maximum default buffer size for undo and redo stack
 
Constructor Summary
UndoManager()
           
UndoManager(int newUndoStackSize)
           
 
Method Summary
 void clearRedos()
           
 void clearRedos(DrawingView checkDV)
          Removes all redo activities that operate on the given DrawingView.
protected  void clearStack(java.util.List clearStack)
           
 void clearUndos()
           
 void clearUndos(DrawingView checkDV)
          Removes all undo activities that operate on the given DrawingView.
 int getRedoSize()
          Returns the current size of redo buffer.
 int getUndoSize()
          Returns the current size of undo buffer.
 boolean isRedoable()
           
 boolean isUndoable()
           
protected  Undoable peekRedo()
           
protected  Undoable peekUndo()
           
 Undoable popRedo()
          Throw NoSuchElementException if there is none
 Undoable popUndo()
          Throw NoSuchElementException if there is none
 void pushRedo(Undoable redoActivity)
           
 void pushUndo(Undoable undoActivity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
Maximum default buffer size for undo and redo stack

See Also:
Constant Field Values
Constructor Detail

UndoManager

public UndoManager()

UndoManager

public UndoManager(int newUndoStackSize)
Method Detail

pushUndo

public void pushUndo(Undoable undoActivity)

pushRedo

public void pushRedo(Undoable redoActivity)

isUndoable

public boolean isUndoable()

isRedoable

public boolean isRedoable()

peekUndo

protected Undoable peekUndo()

peekRedo

protected Undoable peekRedo()

getUndoSize

public int getUndoSize()
Returns the current size of undo buffer.


getRedoSize

public int getRedoSize()
Returns the current size of redo buffer.


popUndo

public Undoable popUndo()
Throw NoSuchElementException if there is none


popRedo

public Undoable popRedo()
Throw NoSuchElementException if there is none


clearUndos

public void clearUndos()

clearRedos

public void clearRedos()

clearStack

protected void clearStack(java.util.List clearStack)

clearUndos

public void clearUndos(DrawingView checkDV)
Removes all undo activities that operate on the given DrawingView.

Parameters:
checkDV - DrawingView which is compared undo's DrawingView

clearRedos

public void clearRedos(DrawingView checkDV)
Removes all redo activities that operate on the given DrawingView.

Parameters:
checkDV - DrawingView which is compared redo's DrawingView

JHotDraw 6.0b1