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.EditingUtils (version 1.1-SNAPSHOT)

Object » ibm_ilog.diagram.editor.EditingUtils

Method Summary

  • addItermediatePoint(D, link, point, index) adds a intermediate point to the given link, in the specified index. diagram: ibm_ilog.diagram.widget.Diagram the diagram where the elements are deleted.
  • alignBottom(diagram, elements, pivotElement) Align the elements based on the pivotElement bottom side.
  • alignHCenter(diagram, elements, pivotElement) Align the elements based on the pivotElement horizontal center.
  • alignLeft(diagram, elements, pivotElement) Align the elements based on the pivotElement left side.
  • alignRight(diagram, elements, pivotElement) Align the elements based on the pivotElement right side.
  • alignTop(diagram, elements, pivotElement) Align the elements based on the pivotElement top side.
  • alignVCenter(diagram, elements, pivotElement) Align the elements based on the pivotElement vertical center.
  • alignWithPivot(diagram, elements, pivotElement, getBBPivot) Align the elements based on the pivotElement and the getBBPivot function.
  • bringForward(selectedElements) Send the selected elements one position front.
  • bringToFront(selectedElements) Send the selected elements to the front.
  • classifyList(childList, in_b, scope) evaluates each element in the with the in_b function, and add it to the a list if true, and to the b one if false.
  • createAddItermediatePointUndoAction(diagram, link, point, index) creates the undo action
  • createDeleteUndoAction(diagram, targetSet) creates the move undo action, based on the target.
  • createGroupUndoAction(subgraph, elements) creates the group undo action.
  • createInvertLinkUndoAction(link)
  • createMoveUndoAction(target, oldTransformation, newTransformation) ibm_ilog.diagram.editor.undo.UngroupAction creates the move undo action, based on the target.
  • createOnDropAction(D, droppedItem, p, elements) ibm_ilog.diagram.editor.undo.DropAction creates the drop undo action.
  • createUngroupUndoAction(diagram, subgraphId, elements, deleteAction, sgTransform) ibm_ilog.diagram.editor.undo.UngroupAction creates the ungroup undo action.
  • deleteGraphElements(diagram, elements, doDeleteFunction) returns ibm_ilog.diagram.editor.undo.Action deletes the elements from the diagram
  • doDeleteAction(diagram, shapes) returns ibm_ilog.diagram.editor.undo.DeleteAction Deletes the specified shapes from the given diagram and returns a corresponding undo Action.
  • findElementsToDelete(diagram, elements, result) iterate over the elements and add to the result all the children and the connected links.
  • groupElements(diagram, elements, subgraphName) Creates a new subgraph, and moves all the elements inside it. This method return a JSObject with the created subgraph and the Undo Action: { subgraph:sg , action:action }
  • groupReparent(diagram, elements, newParent, oldParent) Change the parent of all the elements given by parameter.
  • invertLink(link)
  • prepareDeletedSet(diagram, elements) returns ibm_ilog.diagram.GraphElement[] Computes the set of GraphElement to delete based on the specified elements list.
  • reorderSelection(selectedElements, childrenReorderer) get the selection, and iterates over the selection parents, calling the childrenReorderer function passed as parameter, with each parent element and the list of selected elements ids.
  • reorderedParents(graphElements) given a list of GraphElements, return and array list with the parents of the elements, and a dictionary of the elements, with the Id as keys.
  • reparentTransform(diagram, element, newParent, oldParent) Apply the transformation to reparent an element without noticeable transformation change.
  • sendBackward(selectedElements) Send the selected elements one position back.
  • sendToBack(selectedElements) Send the selected elements to back .
  • setChildrenOrder(order) order the elements in the order parameter, as they are passed. This cause a reverse z-order (the last element is the Front one, and the other way about).
  • startDropAction(droppedItem, p, D, elements, dropAction) starts a drop action. This method cam be called externally, from the DropInteractor or from an DropAction (redo).
  • ungroupElements(diagram, subgraph) Deletes the subgraph and moves all its children to its parent.

Methods

addItermediatePoint
adds a intermediate point to the given link, in the specified index. diagram: ibm_ilog.diagram.widget.Diagram the diagram where the elements are deleted.
ParameterTypeDescription
D
linkibm_ilog.diagram.Linkthe link to be modified
pointpointthe point to be added
indexintegerthe position where to be added (between the intermediate points).
alignBottom
Align the elements based on the pivotElement bottom side.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are aligned.
elementsarrayof ibm_ilog.diagram.Node the target set to be aligned.
pivotElementibm_ilog.diagram.Nodethe element taken as pivot for alignment.
alignHCenter
Align the elements based on the pivotElement horizontal center.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are aligned.
elementsarrayof ibm_ilog.diagram.Node the target set to be aligned.
pivotElementibm_ilog.diagram.Nodethe element taken as pivot for alignment.
alignLeft
Align the elements based on the pivotElement left side.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are aligned.
elementsarrayof ibm_ilog.diagram.Node the target set to be aligned.
pivotElementibm_ilog.diagram.Nodethe element taken as pivot for alignment.
alignRight
Align the elements based on the pivotElement right side.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are aligned.
elementsarrayof ibm_ilog.diagram.Node the target set to be aligned.
pivotElementibm_ilog.diagram.Nodethe element taken as pivot for alignment.
alignTop
Align the elements based on the pivotElement top side.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are aligned.
elementsarrayof ibm_ilog.diagram.Node the target set to be aligned.
pivotElementibm_ilog.diagram.Nodethe element taken as pivot for alignment.
alignVCenter
Align the elements based on the pivotElement vertical center.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are aligned.
elementsarrayof ibm_ilog.diagram.Node the target set to be aligned.
pivotElementibm_ilog.diagram.Nodethe element taken as pivot for alignment.
alignWithPivot
Align the elements based on the pivotElement and the getBBPivot function.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are aligned.
elementsarrayof ibm_ilog.diagram.Node the target set to be aligned.
pivotElementibm_ilog.diagram.Nodethe element taken as pivot for alignment.
getBBPivotFunctionthis function determines the alignment position.
bringForward
Send the selected elements one position front.
ParameterTypeDescription
selectedElementsarrayof ibm_ilog.diagram.GraphElement the elements to be arranged.
bringToFront
Send the selected elements to the front.
ParameterTypeDescription
selectedElementsarrayof ibm_ilog.diagram.GraphElement the elements to be arranged
classifyList
evaluates each element in the with the in_b function, and add it to the a list if true, and to the b one if false.
ParameterTypeDescription
childListarrayof ibm_ilog.diagram.GraphElement the elements to be order
in_bFunctionthe function to evaluate.
scopeScopethe scope where to evaluate the in_b function.
createAddItermediatePointUndoAction
creates the undo action
ParameterTypeDescription
diagram
link
point
index
createDeleteUndoAction
creates the move undo action, based on the target.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are deleted.
targetSetarrayof ibm_ilog.diagram.GraphElement the target set to be deleted
createGroupUndoAction
creates the group undo action.
ParameterTypeDescription
subgraphibm_ilog.diagram.Subgraphthe created subgraph, that groups the elements.
elementsarrayof ibm_ilog.diagram.GraphElement the elements that have been group.
createInvertLinkUndoAction
ParameterTypeDescription
link
createMoveUndoAction
ibm_ilog.diagram.editor.undo.UngroupAction creates the move undo action, based on the target.
ParameterTypeDescription
targetibm_ilog.diagram.GraphElementthe element that has been moved.
oldTransformationdojox.gfx.matrixthe old transformation matrix.
newTransformationdojox.gfx.matrixthe new transformation matrix.
createOnDropAction
ibm_ilog.diagram.editor.undo.DropAction creates the drop undo action.
ParameterTypeDescription
D
droppedItemibm_ilog.diagram.GraphElementthe item that has been dropped.
pPointthe dropping point.
elementsarrayof ibm_ilog.diagram.GraphElement the elements that have been detected behind the point
createUngroupUndoAction
ibm_ilog.diagram.editor.undo.UngroupAction creates the ungroup undo action.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram where the elements are ungroup. subgraph: String the deleted subgraph Id.
subgraphId
elementsarrayof ibm_ilog.diagram.GraphElement the elements that have been ungroup.
deleteActionibm_ilog.diagram.editor.undo.DeleteActionthe created deleteAction, obtained when deleting the subgraph.
sgTransform
deleteGraphElements
Returns ibm_ilog.diagram.editor.undo.Action: The Action corresponding to the delete operation.
deletes the elements from the diagram
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram from where to delete
elementsibm_ilog.diagram.GraphElement[]the elements set to be deleted
doDeleteFunctionFunction
Optional.
an optional Function to perform the deletion.
doDeleteAction
Returns ibm_ilog.diagram.editor.undo.DeleteAction: The action to undo the delete operation.

This implementation removes the specified shapes from the diagram graph and dispose them. Note that it does not handle any data store-related tasks.

ParameterTypeDescription
diagramibm_ilog.diagram.widget.DiagramThe diagram instance to remove the shapes from.
shapesibm_ilog.diagram.GraphElement[]An array of ibm_ilog.diagram.GraphElement to remove.
findElementsToDelete
iterate over the elements and add to the result all the children and the connected links.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram from where to delete
elementsarrayof ibm_ilog.diagram.GraphElement the elements set to be deleted
resultarrayof ibm_ilog.diagram.GraphElement the resulting array.
groupElements
Creates a new subgraph, and moves all the elements inside it. This method return a JSObject with the created subgraph and the Undo Action: { subgraph:sg , action:action }
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram from where to group
elementsarrayof ibm_ilog.diagram.GraphElement the elements set to be group
subgraphNameStringthe new subgraph label return: { subgraph: ibm_ilog.diagram.Subgraph , action: ibm_ilog.diagram.editor.undo.GroupAction }
groupReparent
Change the parent of all the elements given by parameter.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram from where to reparent
elementsarrayof ibm_ilog.diagram.GraphElement the elements to be reparented.
newParentibm_ilog.diagram.Subgraphor ibm_ilog.diagram.Graph the new parent
oldParentibm_ilog.diagram.Subgraphor ibm_ilog.diagram.Graph the old parent
invertLink
ParameterTypeDescription
link
prepareDeletedSet
Returns ibm_ilog.diagram.GraphElement[]: the list of GraphElement to delete.

This method processes the specified elements array to ensures children (if any) and connected links are deleted too.

ParameterTypeDescription
diagramibm_ilog.diagram.widget.DiagramThe diagram instance to remove the shapes from.
elementsibm_ilog.diagram.GraphElement[]the elements set to be deleted
reorderSelection
get the selection, and iterates over the selection parents, calling the childrenReorderer function passed as parameter, with each parent element and the list of selected elements ids.
ParameterTypeDescription
selectedElementsarrayof ibm_ilog.diagram.GraphElement the elements to be arranged.
childrenReordererFunctionthe function to be called with each selection parent.
reorderedParents
given a list of GraphElements, return and array list with the parents of the elements, and a dictionary of the elements, with the Id as keys.
ParameterTypeDescription
graphElementsarrayof ibm_ilog.diagram.GraphElement the elements to be processed. return: {parents:dojox.collections.ArrayList,ids:{}}
reparentTransform
Apply the transformation to reparent an element without noticeable transformation change.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram from where to reparent
elementibm_ilog.diagram.GraphElementthe element to be reparented.
newParentibm_ilog.diagram.Subgraphor ibm_ilog.diagram.Graph the new parent
oldParentibm_ilog.diagram.Subgraphor ibm_ilog.diagram.Graph the old parent (can be null)
sendBackward
Send the selected elements one position back.
ParameterTypeDescription
selectedElementsarrayof ibm_ilog.diagram.GraphElement the elements to be arranged.
sendToBack
Send the selected elements to back .
ParameterTypeDescription
selectedElementsarrayof ibm_ilog.diagram.GraphElement the elements to be arranged
setChildrenOrder
order the elements in the order parameter, as they are passed. This cause a reverse z-order (the last element is the Front one, and the other way about).
ParameterTypeDescription
orderarrayof ibm_ilog.diagram.GraphElement the elements to be order
startDropAction
starts a drop action. This method cam be called externally, from the DropInteractor or from an DropAction (redo).
ParameterTypeDescription
droppedItemibm_ilog.diagram.GraphElementthe item that has been dropped.
pPointthe dropping point.
D
elementsarrayof ibm_ilog.diagram.GraphElement the elements that have been detected behind the point
dropActionibm_ilog.diagram.editor.undo.UngroupActionthe droped action involved in the operation
ungroupElements
Deletes the subgraph and moves all its children to its parent.
ParameterTypeDescription
diagramibm_ilog.diagram.widget.Diagramthe diagram from where to ungroup
subgraphibm_ilog.diagram.Subgraphthe subgraph to be ungrouped