|
|||||
| SUMMARY: FIELD | CONSTR | METHOD| EVENT | DETAIL: FIELD | CONSTR | METHOD| EVENT | ||||
This class adds support for undo/redo to a graph.
| Constructor Summary | |
|---|---|
UndoManager(/*Graph*/ graph)
This class adds support for undo/redo to a graph. |
|
| Method Summary | |
|---|---|
|
canUndoRedo(/*Object*/ caller, /*Function*/ success, /*Function*/ failure, /*anything*/ customData)
queries the server whether an undo or a redo is currently possible. |
Graph |
getGraph()
Returns the graph of this undo manager. |
|
redo(/*anything*/ customData)
performs a change again which was undone before if possible. |
|
setGraph(/*Graph*/ graph, /*Object*/ caller, /*Function*/ callback, /*anything*/ customData)
Changes the graph of this undo manager. |
|
undo(/*anything*/ customData)
undoes the last update if possible. |
| Event Summary | |
|---|---|
|
onRedo(/*Object*/ info, /*String*/ name, /*anything*/ customData)
is called if redoing succeeded. |
|
onRedoFailed(/*String*/ name, /*anything*/ customData)
is called if redoing failed. |
|
onUndo(/*Object*/ info, /*String*/ name, /*anything*/ customData)
is called if undoing the last change succeeded. |
|
onUndoFailed(/*String*/ name, /*anything*/ customData)
is called if undoing the last change failed. |
| Constructor Detail |
|---|
UndoManager(/*Graph*/ graph)
graph - the graph for which undo/redo should be performed
| Method Detail |
|---|
canUndoRedo(/*Object*/ caller, /*Function*/ success, /*Function*/ failure, /*anything*/ customData)
caller - the object for the callback
success - the callback in the success case, which is called with the undo state (Boolean),
the name of the graph and the custom data
failure - the callback in the failure case, which is called with the name of the graph and the
custom data
customData - is passed to the callback (also in the failure case)
Graph getGraph()
redo(/*anything*/ customData)
customData - is passed to the callback (also in the failure case)
setGraph(/*Graph*/ graph, /*Object*/ caller, /*Function*/ callback, /*anything*/ customData)
graph - the graph for which undo/redo should be performed
caller - the object for the callback
callback - the callback, which is called with boolean flag indicating whether the
request succeeded, the name of the graph and the custom data
customData - is passed to the callback (also in the failure case)
undo(/*anything*/ customData)
customData - is passed to the callback (also in the failure case)
| Event Detail |
|---|
onRedo(/*Object*/ info, /*String*/ name, /*anything*/ customData)
info - an object with "canUndo" and "canRedo" fields with boolean values
name - symbolic name of the graph
customData - custom data from the request
onRedoFailed(/*String*/ name, /*anything*/ customData)
name - symbolic name of the graph
customData - custom data from the request
onUndo(/*Object*/ info, /*String*/ name, /*anything*/ customData)
info - an object with "canUndo" and "canRedo" fields with boolean values
name - symbolic name of the graph
customData - custom data from the request
onUndoFailed(/*String*/ name, /*anything*/ customData)
name - symbolic name of the graph
customData - custom data from the request