IBM ILOG Dojo Diagrammer 1.1 API Documentation
Legend: Array Boolean Constructor Date DomNode Error Function Namespace Number Object RegExp Singleton String

ibm_ilog.diagram.editor.undo.UndoManager (version 1.1-SNAPSHOT)

Object » ibm_ilog.diagram.editor.undo.UndoManager
dojo.require("ibm_ilog.diagram.editor.undo.UndoManager");

this class is the central component of the Undo Management system. The undo management provides the user the ability to undo applied changes to the diagram, and after an undo operation, the redo of the undone action. This feature is available out of the box in the DiagramEditor, and support not only all standard changes that can be applied through the DiagramEditor, but also any simple property change that the user could apply programmatically, with the corresponding undo object registration. More complex operation can also be supported by the Undo Management system, but the user would be responsible for the implementation of the custom undo action

Method Summary

  • addAction(action) adds an action to the undo action stack (clearing the redo stack)
  • constructor(diagram) creates a new instance of UndoManager
  • getDiagram() gets the used Diagram
  • getMaximumStackSize() gets the maximum stack size
  • getParentId(parent) get the Parent id. If the given parent is a graph from a subgraph, return the subgraph id. If the parent is the top level graph, the graph id is returned
  • getRedoStack() returns a copy of the redo stack
  • getRedoStackCount() returns the size of the redo stack
  • getRegisteredGraphElement(id) gets the registered graph element corresponding to the given id, looking for the replacement if necessary
  • getRegisteredGraphElementReplacement(id) gets the registered replacement for the given ge id. Look for it recursively so as to find the last replacement. if not replacement is registered the given ge id is returned.
  • getRegisteredParent(id) return the graph parent for the given id. If the id correspond to a subgraph, the inner graph is returned.
  • getUndoStack() returns a copy of the undo stack
  • getUndoStackCount() returns the size of the undo stack
  • redoAction() unstack an action from the redo stack, apply the redo operation and stack it on the undo stack
  • registerGraphElementReplacement(oldId, newId) register when a graph element id is replaced by another (when a ge is removed and by a undo/redo operation a replacement is created again, with a new Id)
  • reset()
  • setMaximumStackSize(stackSize) sets the maximum stack size
  • undoAction() unstacks an action from the undo stack, apply the undo operation and stack it on the redo stack

Event Summary

  • onChange(action) this method is called when and undo or redo action is applied

Methods

addAction
adds an action to the undo action stack (clearing the redo stack)
ParameterTypeDescription
action
constructor
creates a new instance of UndoManager
ParameterTypeDescription
diagram
getDiagram
gets the used Diagram
getMaximumStackSize
gets the maximum stack size
getParentId
get the Parent id. If the given parent is a graph from a subgraph, return the subgraph id. If the parent is the top level graph, the graph id is returned
ParameterTypeDescription
parent
getRedoStack
returns a copy of the redo stack
getRedoStackCount
returns the size of the redo stack
getRegisteredGraphElement
gets the registered graph element corresponding to the given id, looking for the replacement if necessary
ParameterTypeDescription
id
getRegisteredGraphElementReplacement
gets the registered replacement for the given ge id. Look for it recursively so as to find the last replacement. if not replacement is registered the given ge id is returned.
ParameterTypeDescription
id
getRegisteredParent
return the graph parent for the given id. If the id correspond to a subgraph, the inner graph is returned.
ParameterTypeDescription
id
getUndoStack
returns a copy of the undo stack
getUndoStackCount
returns the size of the undo stack
redoAction
unstack an action from the redo stack, apply the redo operation and stack it on the undo stack
registerGraphElementReplacement
register when a graph element id is replaced by another (when a ge is removed and by a undo/redo operation a replacement is created again, with a new Id)
ParameterTypeDescription
oldId
newId
reset
setMaximumStackSize
sets the maximum stack size
ParameterTypeDescription
stackSize
undoAction
unstacks an action from the undo stack, apply the undo operation and stack it on the redo stack

Events

onChange
this method is called when and undo or redo action is applied
ParameterTypeDescription
action