Package org.jgraph.graph
Class GraphUndoManager
- java.lang.Object
-
- javax.swing.undo.AbstractUndoableEdit
-
- javax.swing.undo.CompoundEdit
-
- javax.swing.undo.UndoManager
-
- org.jgraph.graph.GraphUndoManager
-
- All Implemented Interfaces:
java.io.Serializable,java.util.EventListener,javax.swing.event.UndoableEditListener,javax.swing.undo.UndoableEdit
public class GraphUndoManager extends javax.swing.undo.UndoManagerAn UndoManager that may be shared among multiple GraphLayoutCache's.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GraphUndoManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRedo(java.lang.Object source)Overridden to preserve usual semantics: returns true if a redo operation would be successful now for the given view, false otherwisebooleancanUndo(java.lang.Object source)Overridden to preserve usual semantics: returns true if an undo operation would be successful now for the given view, false otherwiseprotected javax.swing.undo.UndoableEditeditToBeRedone(java.lang.Object source)protected javax.swing.undo.UndoableEditeditToBeUndone(java.lang.Object source)protected javax.swing.undo.UndoableEditnextEditToBeRedone(javax.swing.undo.UndoableEdit current)Returns the the next significant edit wrt to current to be redone if redo is called.protected javax.swing.undo.UndoableEditnextEditToBeUndone(javax.swing.undo.UndoableEdit current)Returns the the next significant edit wrt to current to be undone if undo is called.voidredo(java.lang.Object source)If thisUndoManagerisinProgress, redoes the last significantUndoableEditwith respect to source or after, and all insignificant edits up to it.voidundo(java.lang.Object source)If this UndoManager is inProgress, undo the last significant UndoableEdit wrt to source, and all insignificant edits back to it.-
Methods inherited from class javax.swing.undo.UndoManager
addEdit, canRedo, canUndo, canUndoOrRedo, discardAllEdits, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redo, redoTo, setLimit, toString, trimEdits, trimForLimit, undo, undoableEditHappened, undoOrRedo, undoTo
-
-
-
-
Method Detail
-
canUndo
public boolean canUndo(java.lang.Object source)
Overridden to preserve usual semantics: returns true if an undo operation would be successful now for the given view, false otherwise
-
canRedo
public boolean canRedo(java.lang.Object source)
Overridden to preserve usual semantics: returns true if a redo operation would be successful now for the given view, false otherwise
-
undo
public void undo(java.lang.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()
-
editToBeUndone
protected javax.swing.undo.UndoableEdit editToBeUndone(java.lang.Object source)
-
nextEditToBeUndone
protected javax.swing.undo.UndoableEdit nextEditToBeUndone(javax.swing.undo.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(java.lang.Object source)
If thisUndoManagerisinProgress, redoes the last significantUndoableEditwith respect to source or after, and all insignificant edits up to it. UpdatesindexOfNextAddaccordingly.If not
inProgress,indexOfNextAddis ignored and super's routine is called.
-
editToBeRedone
protected javax.swing.undo.UndoableEdit editToBeRedone(java.lang.Object source)
-
nextEditToBeRedone
protected javax.swing.undo.UndoableEdit nextEditToBeRedone(javax.swing.undo.UndoableEdit current)
Returns the the next significant edit wrt to current to be redone if redo is called. May return null.
-
-