public class GraphUndoManager
extends com.mxgraph.util.mxUndoManager
implements com.mxgraph.util.mxEventSource.mxIEventListener, java.beans.PropertyChangeListener
mxUndoManager
with the ability to
track undo operations on a certain graph and to adjust to changes of the
model and view properties of that graph. In addition this implementation
can be paused to allow for changes on the graph that are not reflected in
the undo history.
Note:
While pausing the undo manager and therefore excluding edits from being
stored is useful when moving cells in the context of some "graphical cleanup",
it can be particularly dangerous when the correct result of a chain of
edits depends on all of them being executed!
Modifier and Type | Field and Description |
---|---|
protected boolean |
paused |
Constructor and Description |
---|
GraphUndoManager() |
GraphUndoManager(int size) |
Modifier and Type | Method and Description |
---|---|
void |
install(com.mxgraph.view.mxGraph graph) |
void |
invoke(java.lang.Object sender,
com.mxgraph.util.mxEventObject evt) |
boolean |
isPaused() |
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
setPaused(boolean paused) |
void |
undoableEditHappened(com.mxgraph.util.mxUndoableEdit undoableEdit) |
void |
uninstall(com.mxgraph.view.mxGraph graph) |
canRedo, canUndo, clear, isEmpty, redo, trim, undo
public GraphUndoManager()
public GraphUndoManager(int size)
public void setPaused(boolean paused)
public boolean isPaused()
public void undoableEditHappened(com.mxgraph.util.mxUndoableEdit undoableEdit)
undoableEditHappened
in class com.mxgraph.util.mxUndoManager
public void install(com.mxgraph.view.mxGraph graph)
public void uninstall(com.mxgraph.view.mxGraph graph)
public void invoke(java.lang.Object sender, com.mxgraph.util.mxEventObject evt)
invoke
in interface com.mxgraph.util.mxEventSource.mxIEventListener
mxEventSource.mxIEventListener.invoke(java.lang.Object, com.mxgraph.util.mxEventObject)
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)