org.jgraph.graph

Class GraphUndoManager

public class GraphUndoManager extends UndoManager

An UndoManager that may be shared among multiple GraphLayoutCache's.
Method Summary
booleancanRedo(Object source)
Overridden to preserve usual semantics: returns true if a redo operation would be successful now for the given view, false otherwise
booleancanUndo(Object source)
Overridden to preserve usual semantics: returns true if an undo operation would be successful now for the given view, false otherwise
protected UndoableEditeditToBeRedone(Object source)
protected UndoableEditeditToBeUndone(Object source)
protected UndoableEditnextEditToBeRedone(UndoableEdit current)
Returns the the next significant edit wrt to current to be redone if redo is called.
protected UndoableEditnextEditToBeUndone(UndoableEdit current)
Returns the the next significant edit wrt to current to be undone if undo is called.
voidredo(Object source)
If this UndoManager is inProgress, redoes the last significant UndoableEdit with respect to source or after, and all insignificant edits up to it.
voidundo(Object source)
If this UndoManager is inProgress, undo the last significant UndoableEdit wrt to source, and all insignificant edits back to it.

Method Detail

canRedo

public boolean canRedo(Object source)
Overridden to preserve usual semantics: returns true if a redo operation would be successful now for the given view, false otherwise

canUndo

public boolean canUndo(Object source)
Overridden to preserve usual semantics: returns true if an undo operation would be successful now for the given view, false otherwise

editToBeRedone

protected UndoableEdit editToBeRedone(Object source)

editToBeUndone

protected UndoableEdit editToBeUndone(Object source)

nextEditToBeRedone

protected UndoableEdit nextEditToBeRedone(UndoableEdit current)
Returns the the next significant edit wrt to current to be redone if redo is called. May return null.

nextEditToBeUndone

protected UndoableEdit nextEditToBeUndone(UndoableEdit current)
Returns the the next significant edit wrt to current to be undone if undo is called. May return null.

redo

public void redo(Object source)
If this UndoManager is inProgress, redoes the last significant UndoableEdit with respect to source or after, and all insignificant edits up to it. Updates indexOfNextAdd accordingly.

If not inProgress, indexOfNextAdd is ignored and super's routine is called.

undo

public void undo(Object source)
If this UndoManager is inProgress, undo the last significant UndoableEdit wrt to source, and all insignificant edits back to it. Updates indexOfNextAdd accordingly.

If not inProgress, indexOfNextAdd is ignored and super's routine is called.

See Also: UndoManager#undo

Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.