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

Object » ibm_ilog.diagram.widget._Diagram » ibm_ilog.diagram.widget.Diagram

The purpose of the Dojo Diagrammer component is to display graphs (or diagrams) (that is, graphical representations consisting of nodes connected by links) in a Web browser page. The Dojo Diagrammer component is fully implemented in JavaScript and is based on the Dojo Toolkit. Dojo Diagrammer uses DojoX GFX to render the diagram.

The Diagram widget is the Dijit widget that is commonly used as an entry point to Dojo Diagrammer, and provides the following main features:

  • Data store connection The Diagram widget can load a Dojo data store that implements the dojo.data.api.Read interface. For this, the data store must be set as the 'nodesStore' attribute of the Diagram. Each item of the data store will typically be displayed as a node in the graph. The appearance of the nodes is defined by a template, specified using the 'nodeTemplate' attribute (or the nodeTemplateFunction to define different templates according to each item). The Diagram widget will also create links to represent the relationships between nodes. These relationships must be defined by specifying one or several of the following attributes: childBinding, parentBinding, successorsBinding, predecessorsBinding. For example, if successorsBinding attribute is set to "nextItems", the value if the "nextItems" property of the data items is expected to be an array of identifiers that define the set of items to which the current item should be connected by links.
  • Viewport (scrolling and zooming) If the diagram is larger than the client area of the Diagram, it can be scrolled using the scrollbars or using the mouse (the default interaction for panning is Shift-drag). The diagram can also be zoomed or unzoomed (the default interaction is Control-mouse wheel). Alternately, all viewport actions can be done by code through the viewport object, accessible by the getViewport() method.
  • Selection Nodes and links in the diagram can be selected. The set of selected objects can be accessed and modified through the selection object accessible by the getSelection() method. The appearance of selected objects can be customized through their template.
  • Event handling The Diagram handles mouse and keyboard events through objects called "interactors". Examples of interactors are the SelectionInteractor, the PanInteractor, the ZoomInteractor, etc. The predefined interactors can be enabled or disabled using attributes of the Diagram widget: 'select', 'zoom', 'pan', etc. In addition, the Diagram widget provides events to easily connect to mouse or key events on all the nodes or links of the diagram: onNodeClick, onNodeMouseDown, onLinkClick, etc.
  • Accessibility The Diagram widget provides accessibility services: the diagram can be described by a screen reader, and the user can navigate through the nodes and links using the keyboard.
  • Touch-enablement and mobile support The Diagram widget reacts to touch events on mobile platforms (or other touch-enabled devices): single touch-and-scroll pans the diagram, two-fingers pinch zooms the diagram. Dojo Diagrammer can be used with dojox.mobile. In addition, to optimize download size, some features are disabled on mobile: key events, focus adorners, accessibility, etc. You can explicitly disable these features by setting the 'diagramForMobile' flag to true in djConfig/dojoConfig. If diagramForMobile is not defined, the Diagram widget tries to auto-detect some well-known mobile user agents. Note that diagramForMobile is also set to true if the dojox.mobile module is loaded before the Diagram widget is loaded. You can set diagramForMobile to false explicitly to enable all features even on mobiles.
The Diagram widget uses the following basic graphic objects behind the scene to display the diagram:
  • Graph (class ibm_ilog.diagram.Graph): A subclass of dojox.gfx.Group that contains nodes and links.
  • Node (class ibm_ilog.diagram.Node): Represents a node in a Graph, the contents of a Node are defined by a template.
  • Link (class ibm_ilog.diagram.Link): Represents a link between two nodes.
  • Subgraph (ibm_ilog.diagram.Subgraph): Represents a Node that contains a nested Graph.
It is possible to use the Dojo Diagramer component without using a Diagram widget. For this, you must create a GFX surface (or use an existing one), and create a Graph in it using surface.createGraph(). You can then create nodes, links and subgraphs using the methods createNode, createLink and createSubgraph of the Graph object.

Property Summary

  • EndLinkFieldname
  • StartLinkFieldname
  • adorners enable or disable adorners focus following mouse pointer
  • annotationsEnabled to disable annotations.
  • automaticLinkLayout
  • automaticNodeLayout
  • backMenu optional dijit.Menu for the diagram background (property)
  • centerOnLocation If true, the values provided by xBinding/yBinding atributes represent the center of the node. If false, the values provided by xBinding/yBinding atributes represent the top left-hand corner of the node.
  • childBinding A string that indicates either the data item field name defining the "child" relationship or a function name that returns the origin of a link for the specified data item. cast the value as a String
  • containerNode
  • createAnnotationAdornerFunction to specify what adorner to create for annotating the given GraphElement
  • createLinksForHierarchy If true, the hierarchy is rendered using nodes and links. If false, it is rendered using subgraphs and nodes
  • destroyAnnotationAdornerFunction to the createAnnotationAdornerFunction, this functions destroyed the previously created annotation.
  • disableGraphWai
  • domNode
  • endNodeBinding A string that indicates either the data item field name defining the "end" of a link or a function name that returns the destination of a link for the specified data item. cast the value as a String and set the default as field with name of "end"
  • focus
  • getAssociatedLinkAdornersFunction function which must return the adorners associated with the adorner focus on the given link.
  • getAssociatedNodeAdornersFunction function which must return the adorners associated with the adorner focus on the given node.
  • getAssociatedSubgraphAdornersFunction function which must return the adorners associated with the adorner focus on the given subgraph.
  • getTooltipAroundPlacementFunction function used to compute the graph element bounding box used to compute the tooltip placement.
  • getTooltipContentFunction function used to build the tooltip content associated with the given graph element.
  • hasAnnotationFunction to specify when the adorner needs an annotation adorner created
  • hud Use to disable the entire viewport hud.
  • lastMenuEvent
  • lastMenuTarget entity on which the last/current menu was opened.
  • linkLayout
  • linkLayoutActive
  • linkMenu optional dijit.Menu for links (property)
  • linkStyle A dictionary of property-value pairs that define global properties to apply on links. Properties must obey the Java get/set naming convention in order to be taken into account (i.e. for a property 'myProperty', there must be a getMyProperty and a setMyProperty methods defined on the node).
  • linkTemplate A description object that defines the graphical representation of links.
  • linksGraphBinding A string that indicates either the data item field name defining the "link graphic data" associated with a linksStore data item or a named function that returns the "link graphic data" associated with a linksStore data item. cast the value as a String
  • linksGraphProperties A comma-separated list of properties to save if linksGraphBinding is specified.
  • linksQuery An object providing the query criteria for the links datas store. cast the value as a String
  • linksQueryOptions An object containing additional options for the links query. cast the value as an Object
  • linksStore A data store that provides data item to be represented as Links when the nodes relationship cannot be implicitly deducted from the nodes store data structure. Must implement at least the dojo.data.api.Read and dojo.data.api.Identity interfaces.
  • loadAnnotationsFunction to create the annotations already associated with data already present in the ge.
  • marquee enable or disable marquee selection
  • nodeLayout
  • nodeLayoutActive
  • nodeMenu optional dijit.Menu for nodes (property)
  • nodeStyle A dictionary of property-value pairs that define global properties to apply on nodes. Properties must obey the Java get/set naming convention in order to be taken into account (i.e. for a property 'myProperty', there must be a getMyProperty and a setMyProperty methods defined on the node).
  • nodeTemplate A description object that defines the graphical representation of nodes.
  • nodesGraphBinding A string that indicates either the data item field name defining the "node graphic data" associated with a nodeStore data item or a named function that returns the "node graphic data" associated with a linksStore data item. cast the value as a String
  • nodesGraphProperties A comma-separated list of properties to save if nodesGraphBinding is specified.
  • nodesQuery
  • nodesQueryOptions An object containing additional options for the node query. cast the value as an Object
  • nodesStore A data store that provides data item to be represented as Nodes. Must implement at least the dojo.data.api.Read and dojo.data.api.Identity interfaces.
  • onLinkClick
  • onLinkDblClick
  • onLinkMouseDown
  • onLinkMouseEnter
  • onLinkMouseLeave
  • onLinkMouseMove
  • onLinkMouseOut
  • onLinkMouseOver
  • onLinkMouseUp
  • onNodeClick
  • onNodeDblClick
  • onNodeMouseDown
  • onNodeMouseEnter
  • onNodeMouseLeave
  • onNodeMouseMove
  • onNodeMouseOut
  • onNodeMouseOver
  • onNodeMouseUp
  • onSubgraphClick
  • onSubgraphDblClick
  • onSubgraphMouseDown
  • onSubgraphMouseEnter
  • onSubgraphMouseLeave
  • onSubgraphMouseMove
  • onSubgraphMouseOut
  • onSubgraphMouseOver
  • onSubgraphMouseUp
  • overview Use the embedded overview hud component
  • overviewPan Activate or deactivate panning in the hud overview
  • overviewRenderer Use renderer used in the embedded overview
  • overviewSize The size of the embedded Overview
  • overviewZoom Activate or deactivate panning in the hud overview
  • pan enable or disable panning if clicking on shapes.
  • panOnShapes
  • parentBinding A string that indicates either the data item field name defining the "parent" relationship or a function name that returns the destination of a link for the specified data item. cast the value as a String
  • predecessorsBinding A string that indicates either the data item field name defining the predecessors or a function name that returns the origins of a link for the specified data item. cast the value as a String
  • select enable or disable selecting entities
  • selectionMode
  • showZoomFactor Display the current zoom factor
  • showZoomFeedback Display a visual feedback while zooming with animation
  • startNodeBinding A string that indicates either the data item field name defining the "start" of a link or a function name that returns the origin of a link for the specified data item. cast the value as a String and set the default as field with name of "start"
  • subgraphMenu optional dijit.Menu for subgraphs (property)
  • subgraphStyle A dictionary of property-value pairs that define global properties to apply on subgraphs. Properties must obey the Java get/set naming convention in order to be taken into account (i.e. for a property 'myProperty', there must be a getMyProperty and a setMyProperty methods defined on the node).
  • subgraphTemplate A description object that defines the graphical representation of subgraphs.
  • successorsBinding A string that indicates either the data item field name defining the successors or a function name that returns the destination of a link for the specified data item. cast the value as a String
  • templateString
  • textDir A string that indicates the text direction of displayed text
  • viewportAirFactor The minimum navigable space to the sides of the current content bounds as a percentage with respect to the current model bounding box.
  • viewportAnimated Boolean flag to indicate that viewport movements are animated by default.
  • viewportClass
  • viewportMaxZoom Defines how much the view rectangle can zoom in. Unlimited if 0.
  • viewportMinZoom Defines how much the view rectangle can zoom out. If 0, the limit is based on the contentRectangle.
  • viewportResizeMode Resize mode of the vieport. See Viewport.js
  • wheelPan enable or disable scrolling with the mouse wheel (vertical panning)
  • xBinding A string that indicates either the data item field name defining the "x location" associated with a nodesStore data item or a named function that returns the "x location" associated with a nodesStore data item. cast the value as a String
  • yBinding A string that indicates either the data item field name defining the "y location" associated with a nodesStore data item or a named function that returns the "y location" associated with a nodesStore data item. cast the value as a String
  • zoom enable or disable zooming

Method Summary

  • addAnnotation(ge, kwArgs) The entity being annotated
  • afterGraphElementDispose(graphElement) this method is called after any graph element is disposed
  • asGraphElement(itemOrGraphElement)
  • assignInteractorInputs(iid, assignments)
  • beforeGraphElementDispose(graphElement) this method is called before any graph element is disposed
  • buildRendering()
  • centerOnNode(nodeOrLink, options) Centers the viewport on an object of the graph. Does not change the zoom level.
  • changeAdornersFocus(focus, newFocus, possibleCursors, mustchangeAdornersFocus)
  • connectNodes(start, end, template, linkItem) Connects the specified nodes. This method creates a ibm_ilog.diagram.Link instance invoking the createLink() method and connects its extremities to the specified nodes. Optionally, one may specify the linksStore item associated with this link.
  • constructor()
  • createAdorner(clazz, templates, rootId)
  • createLink(start, end, template, linkItem, linkType) Creates a Link to connect the specified nodes. Optionally, one may specify the linksStore item associated with this link.
  • createLinkFunction() An optional function that creates the ibm_ilog.diagram.Link instance for a given data item. The function receives the following parameters: linkItem : the link data item, if any. startNode: the link start node. endNode: the link end node. templateObj : the template object. graph : the parent graph of the link. diagram : a reference to this diagram widget.
  • createNode(template, item, onGraph, nodeType) Creates a Node that represents the specified data item.
  • createNodeFunction() An optional function that creates the ibm_ilog.diagram.Node instance for a given data item. The function receives the following parameters: item : the data item associated with this node. templateObj : A template object. graph : the target graph to create the node from. diagram : a reference to this diagram widget.
  • createSubgraph(template, item, onGraph, nodeType) Creates a Subgraph that represents the specified data item.
  • createSubgraphFunction() An optional function that creates the ibm_ilog.diagram.Subgraph instance for a given data item. The function receives the following parameters: item : associated with this node. templateObj : the template object. graph : the target graph to create the subgraph from. diagram : a reference to this diagram widget.
  • createTemplatedShape(shapeType, template, onGraph, style, store, item) Creates an instance of the specified type fully initialized.
  • destroy()
  • destroyAdorner(a)
  • enableLowCpuMode(enable)
  • enableMarqueePartialSelection(b)
  • enterStandardMode() TODO TBD. Probably to be renamed also
  • fitToContents(margin, zoomOutOnly)
  • getAnnotationList(ge)
  • getBoundItem(nodeOrLink) Returns the data item, if any, associated with the specified node or link.
  • getFocusAdorner(ge)
  • getFocusedElement()
  • getGraph() Returns the ibm_ilog.diagram.Graph instance that displays the graph.
  • getGraphElementFromDataItem(item) Gets the GFX object, for the given Data Item.
  • getGraphToClientTransform() returns dojox.gfx.matrix.Matrix2D Returns the matrix used to transform coordinates of objects contained in this diagram's graph (returned by <code>getGraph()</code>) to coordinates relative to the client browser's page.
  • getGraphToDiagramTransform() returns dojox.gfx.matrix.Matrix2D Returns the matrix used to transform coordinates of objects contained in this diagram's graph (returned by <code>getGraph()</code>) to coordinates relative to this Diagram object.
  • getGraphTransform() Returns the graph transform.
  • getInteractor(id)
  • getInteractorManager()
  • getLinkAdornersFocus() Returns the current link adorners focus.
  • getNodeAdornersFocus() Returns the current node adorners focus.
  • getNodeRect(node, inClient) returns Object Returns the bounding rectangle of a node of the graph, in client (i.e., browser page) coordinates, or relative to the Diagram.
  • getParent() Returns the parent widget of this widget, assuming the parent specifies isContainer
  • getSelection() Return the selection object
  • getSurface() Returns the dojox.gfx.Surface object displaying the graph.
  • getViewport() Gets the Viewport instance.
  • hideTooltip() Hides the dijit master tooltip, if currently in use by the Diagram.
  • isInitialized() Returns whether the initialization process is done.
  • isLowCpuMode()
  • isMovableFunction() This function is an optional callback to configure how the MoveInteractor tests movability of elements function(graphElement) { // summary: // Return true if the given graph element is allowed to move // graphElement: // The graph element to test. }
  • linkTemplateFunction() an optional function that computes the link template dynamically based on the item. The function receives the following parameters: linkItem : the link data item, if any. startNode: the link start node. endNode: the link end node. diagram : a reference to this diagram widget.
  • load() loads the data stores and creates the diagram.
  • lowCpuModeChanged()
  • moveFunction() This function is an optional callback to configure how the MoveInteractor applies the movement deltas on entities. function(graphElement,originalTransform,delta) { // summary: // Concrete the movement to a graph element. // graphElement: // The graph element to move. // originalTransform: // The matrix representing the location from which the delta is computed. // delta: // The ammount to translate the entity from its original location. },
  • mustFreeAdornersFocus(graphElement, point, margin, outOfBounds)
  • nodeTemplateFunction() an optional function that computes the node template based on the item. The function receives the following parameters: item : the data item to create node from diagram : a reference to this diagram widget.
  • performGraphLayout() Executes the graph layout and/or the link layout specified by the setNodeLayout() and setLinkLayout methods.
  • postCreate()
  • postMixInProperties()
  • postPostCreate() Hook executed just after Diagram postCreate. Used by DiagramEditor subclass.
  • removeAnnotation(annotation)
  • reset()
  • resize(info)
  • resolveLinkTemplate(linkItem, start, end) Returns the link template to represent the specified relationship.
  • resolveNodeTemplate(item) Returns the template to represent the specified node item.
  • resolveSubgraphTemplate(item) Returns the template to represent the specified subgraph item.
  • setFocusedElement(ge)
  • setLinkAdornersFocus(ge) Sets the link adorners focus on a graph element. Used by the adorners focus interactor;
  • setMarqueeMode(b)
  • setNodeAdornersFocus(ge) Sets the node adorners focus on a graph element. Used by the adorners focus interactor;
  • showTooltip(ge, innerHTML, dontHideOnChange) Opens the dijit master tooltip on a graph element.
  • startup()
  • subgraphTemplateFunction() an optional function that computes the subgraph template based on the item. The function receives the following parameters: item : the data item to create subgraph from. diagram : a reference to this diagram widget.
  • toSvg(onComplete, onError, all) Export the graph as an SVG string.
  • useDataStore()
  • visualizeBounds(graphic, options) Makes the bounds of a graph object visible, givin it an extra air between the area and the borders of the viewport if possible. The view may be zoomed out if required, but it is never zoomed in.
  • whenLoaded(cb, eb) Registers a callback to be executed after the instance has been initialized, or executes immediately if already initialized.

Event Summary

Properties

EndLinkFieldname
StartLinkFieldname
adorners
Overrides ibm_ilog.diagram.widget._Diagram
enable or disable adorners focus following mouse pointer
annotationsEnabled
Overrides ibm_ilog.diagram.widget._Diagram
to disable annotations.
automaticLinkLayout
Overrides ibm_ilog.diagram.widget._Diagram
automaticNodeLayout
Overrides ibm_ilog.diagram.widget._Diagram
backMenu
Overrides ibm_ilog.diagram.widget._Diagram
optional dijit.Menu for the diagram background (property)
centerOnLocation
Overrides ibm_ilog.diagram.widget._Diagram
If true, the values provided by xBinding/yBinding atributes represent the center of the node. If false, the values provided by xBinding/yBinding atributes represent the top left-hand corner of the node.
childBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "child" relationship or a function name that returns the origin of a link for the specified data item. cast the value as a String
containerNode
Overrides ibm_ilog.diagram.widget._Diagram
createAnnotationAdornerFunction
Overrides ibm_ilog.diagram.widget._Diagram
to specify what adorner to create for annotating the given GraphElement
createLinksForHierarchy
Overrides ibm_ilog.diagram.widget._Diagram
If true, the hierarchy is rendered using nodes and links. If false, it is rendered using subgraphs and nodes
destroyAnnotationAdornerFunction
Overrides ibm_ilog.diagram.widget._Diagram
to the createAnnotationAdornerFunction, this functions destroyed the previously created annotation.
disableGraphWai
Overrides ibm_ilog.diagram.widget._Diagram
domNode
Overrides ibm_ilog.diagram.widget._Diagram
endNodeBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "end" of a link or a function name that returns the destination of a link for the specified data item. cast the value as a String and set the default as field with name of "end"
focus
Overrides ibm_ilog.diagram.widget._Diagram
getAssociatedLinkAdornersFunction
Overrides ibm_ilog.diagram.widget._Diagram
function which must return the adorners associated with the adorner focus on the given link.
getAssociatedNodeAdornersFunction
Overrides ibm_ilog.diagram.widget._Diagram
function which must return the adorners associated with the adorner focus on the given node.
getAssociatedSubgraphAdornersFunction
Overrides ibm_ilog.diagram.widget._Diagram
function which must return the adorners associated with the adorner focus on the given subgraph.
getTooltipAroundPlacementFunction
Overrides ibm_ilog.diagram.widget._Diagram
function used to compute the graph element bounding box used to compute the tooltip placement.
getTooltipContentFunction
Overrides ibm_ilog.diagram.widget._Diagram
function used to build the tooltip content associated with the given graph element.
hasAnnotationFunction
Overrides ibm_ilog.diagram.widget._Diagram
to specify when the adorner needs an annotation adorner created
hud
Overrides ibm_ilog.diagram.widget._Diagram
Use to disable the entire viewport hud.
lastMenuEvent
Overrides ibm_ilog.diagram.widget._Diagram
lastMenuTarget
Overrides ibm_ilog.diagram.widget._Diagram
entity on which the last/current menu was opened.
linkLayout
Overrides ibm_ilog.diagram.widget._Diagram
linkLayoutActive
Overrides ibm_ilog.diagram.widget._Diagram
linkMenu
Overrides ibm_ilog.diagram.widget._Diagram
optional dijit.Menu for links (property)
linkStyle
Overrides ibm_ilog.diagram.widget._Diagram
A dictionary of property-value pairs that define global properties to apply on links. Properties must obey the Java get/set naming convention in order to be taken into account (i.e. for a property 'myProperty', there must be a getMyProperty and a setMyProperty methods defined on the node).
linkTemplate
Overrides ibm_ilog.diagram.widget._Diagram
A description object that defines the graphical representation of links.
linksGraphBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "link graphic data" associated with a linksStore data item or a named function that returns the "link graphic data" associated with a linksStore data item. cast the value as a String
linksGraphProperties
Overrides ibm_ilog.diagram.widget._Diagram
A comma-separated list of properties to save if linksGraphBinding is specified.
linksQuery
Overrides ibm_ilog.diagram.widget._Diagram
An object providing the query criteria for the links datas store. cast the value as a String
linksQueryOptions
Overrides ibm_ilog.diagram.widget._Diagram
An object containing additional options for the links query. cast the value as an Object
linksStore
Overrides ibm_ilog.diagram.widget._Diagram
A data store that provides data item to be represented as Links when the nodes relationship cannot be implicitly deducted from the nodes store data structure. Must implement at least the dojo.data.api.Read and dojo.data.api.Identity interfaces.
loadAnnotationsFunction
Overrides ibm_ilog.diagram.widget._Diagram
to create the annotations already associated with data already present in the ge.
marquee
Overrides ibm_ilog.diagram.widget._Diagram
enable or disable marquee selection
nodeLayout
Overrides ibm_ilog.diagram.widget._Diagram
nodeLayoutActive
Overrides ibm_ilog.diagram.widget._Diagram
nodeMenu
Overrides ibm_ilog.diagram.widget._Diagram
optional dijit.Menu for nodes (property)
nodeStyle
Overrides ibm_ilog.diagram.widget._Diagram
A dictionary of property-value pairs that define global properties to apply on nodes. Properties must obey the Java get/set naming convention in order to be taken into account (i.e. for a property 'myProperty', there must be a getMyProperty and a setMyProperty methods defined on the node).
nodeTemplate
Overrides ibm_ilog.diagram.widget._Diagram
A description object that defines the graphical representation of nodes.
nodesGraphBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "node graphic data" associated with a nodeStore data item or a named function that returns the "node graphic data" associated with a linksStore data item. cast the value as a String
nodesGraphProperties
Overrides ibm_ilog.diagram.widget._Diagram
A comma-separated list of properties to save if nodesGraphBinding is specified.
nodesQuery
Overrides ibm_ilog.diagram.widget._Diagram
nodesQueryOptions
Overrides ibm_ilog.diagram.widget._Diagram
An object containing additional options for the node query. cast the value as an Object
nodesStore
Overrides ibm_ilog.diagram.widget._Diagram
A data store that provides data item to be represented as Nodes. Must implement at least the dojo.data.api.Read and dojo.data.api.Identity interfaces.
onLinkClick
Overrides ibm_ilog.diagram.widget._Diagram
onLinkDblClick
Overrides ibm_ilog.diagram.widget._Diagram
onLinkMouseDown
Overrides ibm_ilog.diagram.widget._Diagram
onLinkMouseEnter
Overrides ibm_ilog.diagram.widget._Diagram
onLinkMouseLeave
Overrides ibm_ilog.diagram.widget._Diagram
onLinkMouseMove
Overrides ibm_ilog.diagram.widget._Diagram
onLinkMouseOut
Overrides ibm_ilog.diagram.widget._Diagram
onLinkMouseOver
Overrides ibm_ilog.diagram.widget._Diagram
onLinkMouseUp
Overrides ibm_ilog.diagram.widget._Diagram
onNodeClick
Overrides ibm_ilog.diagram.widget._Diagram
onNodeDblClick
Overrides ibm_ilog.diagram.widget._Diagram
onNodeMouseDown
Overrides ibm_ilog.diagram.widget._Diagram
onNodeMouseEnter
Overrides ibm_ilog.diagram.widget._Diagram
onNodeMouseLeave
Overrides ibm_ilog.diagram.widget._Diagram
onNodeMouseMove
Overrides ibm_ilog.diagram.widget._Diagram
onNodeMouseOut
Overrides ibm_ilog.diagram.widget._Diagram
onNodeMouseOver
Overrides ibm_ilog.diagram.widget._Diagram
onNodeMouseUp
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphClick
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphDblClick
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphMouseDown
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphMouseEnter
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphMouseLeave
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphMouseMove
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphMouseOut
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphMouseOver
Overrides ibm_ilog.diagram.widget._Diagram
onSubgraphMouseUp
Overrides ibm_ilog.diagram.widget._Diagram
overview
Overrides ibm_ilog.diagram.widget._Diagram
Use the embedded overview hud component
overviewPan
Overrides ibm_ilog.diagram.widget._Diagram
Activate or deactivate panning in the hud overview
overviewRenderer
Overrides ibm_ilog.diagram.widget._Diagram
Use renderer used in the embedded overview
overviewSize
Overrides ibm_ilog.diagram.widget._Diagram
The size of the embedded Overview
overviewZoom
Overrides ibm_ilog.diagram.widget._Diagram
Activate or deactivate panning in the hud overview
pan
Overrides ibm_ilog.diagram.widget._Diagram
enable or disable panning if clicking on shapes.
panOnShapes
Overrides ibm_ilog.diagram.widget._Diagram
parentBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "parent" relationship or a function name that returns the destination of a link for the specified data item. cast the value as a String
predecessorsBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the predecessors or a function name that returns the origins of a link for the specified data item. cast the value as a String
select
Overrides ibm_ilog.diagram.widget._Diagram
enable or disable selecting entities
selectionMode
Overrides ibm_ilog.diagram.widget._Diagram
showZoomFactor
Overrides ibm_ilog.diagram.widget._Diagram
Display the current zoom factor
showZoomFeedback
Overrides ibm_ilog.diagram.widget._Diagram
Display a visual feedback while zooming with animation
startNodeBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "start" of a link or a function name that returns the origin of a link for the specified data item. cast the value as a String and set the default as field with name of "start"
subgraphMenu
Overrides ibm_ilog.diagram.widget._Diagram
optional dijit.Menu for subgraphs (property)
subgraphStyle
Overrides ibm_ilog.diagram.widget._Diagram
A dictionary of property-value pairs that define global properties to apply on subgraphs. Properties must obey the Java get/set naming convention in order to be taken into account (i.e. for a property 'myProperty', there must be a getMyProperty and a setMyProperty methods defined on the node).
subgraphTemplate
Overrides ibm_ilog.diagram.widget._Diagram
A description object that defines the graphical representation of subgraphs.
successorsBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the successors or a function name that returns the destination of a link for the specified data item. cast the value as a String
templateString
Overrides ibm_ilog.diagram.widget._Diagram
textDir
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates the text direction of displayed text
viewportAirFactor
Overrides ibm_ilog.diagram.widget._Diagram
The minimum navigable space to the sides of the current content bounds as a percentage with respect to the current model bounding box.
viewportAnimated
Overrides ibm_ilog.diagram.widget._Diagram
Boolean flag to indicate that viewport movements are animated by default.
viewportClass
Overrides ibm_ilog.diagram.widget._Diagram
viewportMaxZoom
Overrides ibm_ilog.diagram.widget._Diagram
Defines how much the view rectangle can zoom in. Unlimited if 0.
viewportMinZoom
Overrides ibm_ilog.diagram.widget._Diagram
Defines how much the view rectangle can zoom out. If 0, the limit is based on the contentRectangle.
viewportResizeMode
Overrides ibm_ilog.diagram.widget._Diagram
Resize mode of the vieport. See Viewport.js
wheelPan
Overrides ibm_ilog.diagram.widget._Diagram
enable or disable scrolling with the mouse wheel (vertical panning)
xBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "x location" associated with a nodesStore data item or a named function that returns the "x location" associated with a nodesStore data item. cast the value as a String
yBinding
Overrides ibm_ilog.diagram.widget._Diagram
A string that indicates either the data item field name defining the "y location" associated with a nodesStore data item or a named function that returns the "y location" associated with a nodesStore data item. cast the value as a String
zoom
Overrides ibm_ilog.diagram.widget._Diagram
enable or disable zooming

Methods

addAnnotation
Overrides ibm_ilog.diagram.widget._Diagram
The entity being annotated
ParameterTypeDescription
geibm_ilog.diagram.GraphElementThe entity being annotated
kwArgs
afterGraphElementDispose
Overrides ibm_ilog.diagram.widget._Diagram
this method is called after any graph element is disposed
ParameterTypeDescription
graphElement
asGraphElement
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
itemOrGraphElement
assignInteractorInputs
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
iid
assignments
beforeGraphElementDispose
Overrides ibm_ilog.diagram.widget._Diagram
this method is called before any graph element is disposed
ParameterTypeDescription
graphElement
buildRendering
Overrides ibm_ilog.diagram.widget._Diagram
centerOnNode
Overrides ibm_ilog.diagram.widget._Diagram
Centers the viewport on an object of the graph. Does not change the zoom level.
ParameterTypeDescription
nodeOrLinkNode|Link
options{animate}
changeAdornersFocus
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
focus
newFocus
possibleCursors
mustchangeAdornersFocus
connectNodes
Overrides ibm_ilog.diagram.widget._Diagram
ibm_ilog.diagram.Link
Connects the specified nodes. This method creates a ibm_ilog.diagram.Link instance invoking the createLink() method and connects its extremities to the specified nodes. Optionally, one may specify the linksStore item associated with this link.
ParameterTypeDescription
startibm_ilog.diagram.Node: the link start node.
endibm_ilog.diagram.Nodeibm_ilog.diagram.Node: the link end node.
templateString||ObjectObject or String : the template to use. Optional.
linkItemdojo.data.Itemdojo.data.Item: the data item corresponding to this link, if any. Optional.
constructor
Overrides ibm_ilog.diagram.widget._Diagram
createAdorner
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
clazz
templates
rootId
createLink
Overrides ibm_ilog.diagram.widget._Diagram
a ibm_ilog.diagram.Link instance.

This method only creates the Link instance and does not connect the nodes. Caller may invoke the Diagram.connectNodes() method instead, which invokes this method and perfom the connection.

ParameterTypeDescription
startibm_ilog.diagram.Nodethe link start node.
endibm_ilog.diagram.Nodethe link end node.
templateObjector String the template to use. Optional.
linkItemdojo.data.Itemthe data item corresponding to this link, if any. Optional. nodeType: Function The type of the node instance. Optional.
linkTypeFunction
Optional.
createLinkFunction
Overrides ibm_ilog.diagram.widget._Diagram
An optional function that creates the ibm_ilog.diagram.Link instance for a given data item. The function receives the following parameters: linkItem : the link data item, if any. startNode: the link start node. endNode: the link end node. templateObj : the template object. graph : the parent graph of the link. diagram : a reference to this diagram widget.
createNode
Overrides ibm_ilog.diagram.widget._Diagram
A ibm_ilog.diagram.Node instance.
Creates a Node that represents the specified data item.
ParameterTypeDescription
templateObjector String The template to use for this node. Optional.
itemdojo.data.api.Itema data item associated with this node. Optional.
onGraphibm_ilog.diagram.GraphThe parent graph of the node. If null, the top-level graph is used. Optional.
nodeTypeFunction
Optional.
The type of the node instance. Optional.
createNodeFunction
Overrides ibm_ilog.diagram.widget._Diagram
An optional function that creates the ibm_ilog.diagram.Node instance for a given data item. The function receives the following parameters: item : the data item associated with this node. templateObj : A template object. graph : the target graph to create the node from. diagram : a reference to this diagram widget.
createSubgraph
Overrides ibm_ilog.diagram.widget._Diagram
A ibm_ilog.diagram.Subgraph instance.
Creates a Subgraph that represents the specified data item.
ParameterTypeDescription
templateObjector String The template to use for this subgraph. Optional.
itemdojo.data.api.Itema data item associated with this subgraph. Optional.
onGraphibm_ilog.diagram.GraphThe parent graph of the subgraph. If null, the top-level graph is used. Optional.
nodeTypeFunction
Optional.
The type of the node instance. Optional.
createSubgraphFunction
Overrides ibm_ilog.diagram.widget._Diagram
An optional function that creates the ibm_ilog.diagram.Subgraph instance for a given data item. The function receives the following parameters: item : associated with this node. templateObj : the template object. graph : the target graph to create the subgraph from. diagram : a reference to this diagram widget.
createTemplatedShape
Overrides ibm_ilog.diagram.widget._Diagram

This method creates an instance of the specified type and populates it with the specified template. If the template defines bindings to the shape or the data item (if any), bindings are resolved.

ParameterTypeDescription
shapeTypeFunctionThe type of the instance.
templateString||Object
Optional.
a template defining the shape contents. If no template is specified, the default Subgraph template will be used. Optional.
onGraphibm_ilog.diagram.Graph
Optional.
the parent graph. Optional. store : dojo.data.api.Read a data store. Optional.
styleObject
Optional.
storedojo.data.api.Read
Optional.
itemObject
Optional.
dojo.data.api.Item: a data item associated with this shape. Optional.
destroy
Overrides ibm_ilog.diagram.widget._Diagram
destroyAdorner
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
a
enableLowCpuMode
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
enable
enableMarqueePartialSelection
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
bboolean
enterStandardMode
Overrides ibm_ilog.diagram.widget._Diagram
TODO TBD. Probably to be renamed also
fitToContents
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
margin
zoomOutOnly
getAnnotationList
Overrides ibm_ilog.diagram.widget._Diagram
A dojox.collections.ArrayList with the annotations created for the graph element. note: Creates an empty list if none is registered yet.
ParameterTypeDescription
ge
getBoundItem
Overrides ibm_ilog.diagram.widget._Diagram
Returns the data item, if any, associated with the specified node or link.
ParameterTypeDescription
nodeOrLinkibm_ilog.diagram.Node|| ibm_ilog.diagram.Link || ibm_ilog.diagram.Subgraph: the node, link or subgraph instance.
getFocusAdorner
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
getFocusedElement
Overrides ibm_ilog.diagram.widget._Diagram
getGraph
Overrides ibm_ilog.diagram.widget._Diagram
An ibm_ilog.diagram.Graph instance.
Returns the ibm_ilog.diagram.Graph instance that displays the graph.
getGraphElementFromDataItem
Overrides ibm_ilog.diagram.widget._Diagram
Gets the GFX object, for the given Data Item.
ParameterTypeDescription
item
getGraphToClientTransform
Overrides ibm_ilog.diagram.widget._Diagram
Returns dojox.gfx.matrix.Matrix2D: A dojox.gfx.matrix.Matrix2D instance.
Returns the matrix used to transform coordinates of objects contained in this diagram's graph (returned by <code>getGraph()</code>) to coordinates relative to the client browser's page.
getGraphToDiagramTransform
Overrides ibm_ilog.diagram.widget._Diagram
Returns dojox.gfx.matrix.Matrix2D: A dojox.gfx.matrix.Matrix2D instance.
Returns the matrix used to transform coordinates of objects contained in this diagram's graph (returned by <code>getGraph()</code>) to coordinates relative to this Diagram object.
getGraphTransform
Overrides ibm_ilog.diagram.widget._Diagram
A dojox.gfx.matrix.Matrix2D instance that represents the current graph transform.
Returns the graph transform.
getInteractor
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
id
getInteractorManager
Overrides ibm_ilog.diagram.widget._Diagram
getLinkAdornersFocus
Overrides ibm_ilog.diagram.widget._Diagram
Returns the current link adorners focus.
getNodeAdornersFocus
Overrides ibm_ilog.diagram.widget._Diagram
Returns the current node adorners focus.
getNodeRect
Overrides ibm_ilog.diagram.widget._Diagram
Returns Object: An object with x, y, width and height properties.

This method computes the bounding rectangle of a node contained in this Diagram widget. The returned rectangle is either relative to the whole browser page (if inClient is true or omitted), or relative to the bounds of the Diagram widget (if inClient is false).

ParameterTypeDescription
nodeibm_ilog.diagram.NodeA Node of the Graph displayed in this Diagram.
inClientBooleanIf true (the default), the returned rectangle is relative to the whole browser page. If false, the returned rectangle is relative to the bounds of the Diagram widget.
getParent
Overrides ibm_ilog.diagram.widget._Diagram
Returns the parent widget of this widget, assuming the parent specifies isContainer
getSelection
Overrides ibm_ilog.diagram.widget._Diagram
Return the selection object
getSurface
Overrides ibm_ilog.diagram.widget._Diagram
A dojox.gfx.Surface instance.
Returns the dojox.gfx.Surface object displaying the graph.
getViewport
Overrides ibm_ilog.diagram.widget._Diagram
Gets the Viewport instance.
hideTooltip
Overrides ibm_ilog.diagram.widget._Diagram
Hides the dijit master tooltip, if currently in use by the Diagram.
isInitialized
Returns whether the initialization process is done.
isLowCpuMode
Overrides ibm_ilog.diagram.widget._Diagram
isMovableFunction
Overrides ibm_ilog.diagram.widget._Diagram
This function is an optional callback to configure how the MoveInteractor tests movability of elements function(graphElement) { // summary: // Return true if the given graph element is allowed to move // graphElement: // The graph element to test. }
linkTemplateFunction
Overrides ibm_ilog.diagram.widget._Diagram
an optional function that computes the link template dynamically based on the item. The function receives the following parameters: linkItem : the link data item, if any. startNode: the link start node. endNode: the link end node. diagram : a reference to this diagram widget.
load
Overrides ibm_ilog.diagram.widget._Diagram
loads the data stores and creates the diagram.
lowCpuModeChanged
Overrides ibm_ilog.diagram.widget._Diagram
moveFunction
Overrides ibm_ilog.diagram.widget._Diagram
This function is an optional callback to configure how the MoveInteractor applies the movement deltas on entities. function(graphElement,originalTransform,delta) { // summary: // Concrete the movement to a graph element. // graphElement: // The graph element to move. // originalTransform: // The matrix representing the location from which the delta is computed. // delta: // The ammount to translate the entity from its original location. },
mustFreeAdornersFocus
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
graphElement
point
margin
outOfBounds
nodeTemplateFunction
Overrides ibm_ilog.diagram.widget._Diagram
an optional function that computes the node template based on the item. The function receives the following parameters: item : the data item to create node from diagram : a reference to this diagram widget.
performGraphLayout
Overrides ibm_ilog.diagram.widget._Diagram

If a non-null graph layout has been specified by calling setNodeLayout(), and if the graph layout is active (that is, unless setNodeLayoutActive(false) has been called), then the graph layout algorithm is performed on the contents of this graph. Then, if a non-null link layout has been specified by calling setLinkLayout(), and if the link layout is active (that is, unless setLinkLayoutActive(false) has been called), then the link layout algorithm is performed on the contents of this graph.

postCreate
Overrides ibm_ilog.diagram.widget._Diagram
postMixInProperties
Overrides ibm_ilog.diagram.widget._Diagram
postPostCreate
Overrides ibm_ilog.diagram.widget._Diagram
Hook executed just after Diagram postCreate. Used by DiagramEditor subclass.
removeAnnotation
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
annotation
reset
Overrides ibm_ilog.diagram.widget._Diagram
resize
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
info
resolveLinkTemplate
Overrides ibm_ilog.diagram.widget._Diagram
Returns the link template to represent the specified relationship.
ParameterTypeDescription
linkItemdojo.data.Itemdojo.data.Item: the data item corresponding to this link, if any.
startibm_ilog.diagram.Node: the link start node.
endibm_ilog.diagram.Nodeibm_ilog.diagram.Node: the link end node.
resolveNodeTemplate
Overrides ibm_ilog.diagram.widget._Diagram
Returns the template to represent the specified node item.
ParameterTypeDescription
itemdojo.data.Itemdojo.data.Item: the node data item.
resolveSubgraphTemplate
Overrides ibm_ilog.diagram.widget._Diagram
Returns the template to represent the specified subgraph item.
ParameterTypeDescription
item
setFocusedElement
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
setLinkAdornersFocus
Overrides ibm_ilog.diagram.widget._Diagram
Sets the link adorners focus on a graph element. Used by the adorners focus interactor;
ParameterTypeDescription
ge
setMarqueeMode
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
bint
setNodeAdornersFocus
Overrides ibm_ilog.diagram.widget._Diagram
Sets the node adorners focus on a graph element. Used by the adorners focus interactor;
ParameterTypeDescription
ge
showTooltip
Overrides ibm_ilog.diagram.widget._Diagram

Opens a tooltip for a graph element. The content is get using the getTooltipContentFunction function. Optionally, the content can be overriden using the 'innerHTML' argument.

ParameterTypeDescription
geibm_ilog.diagram.GraphElementthe graph element
innerHTMLString
Optional.
optional argument that overrides the content of the tooltip.
dontHideOnChangebooleanoption to disable auto-hiding of the tooltip then the element reports changes
startup
Overrides ibm_ilog.diagram.widget._Diagram
subgraphTemplateFunction
Overrides ibm_ilog.diagram.widget._Diagram
an optional function that computes the subgraph template based on the item. The function receives the following parameters: item : the data item to create subgraph from. diagram : a reference to this diagram widget.
toSvg
Overrides ibm_ilog.diagram.widget._Diagram

Export the graph as an SVG string. This features requires Dojo 1.4.x or greater.

ParameterTypeDescription
onCompleteFunctionThe callback that receives the resulting SVG.
onErrorFunctionThe function called when the generation fails.
allBooleanIndicates whether the whole graph should be visible in the resulting svg. If false, only the visible area is displayed. The default value is false.
useDataStore
Overrides ibm_ilog.diagram.widget._Diagram
visualizeBounds
Overrides ibm_ilog.diagram.widget._Diagram
Makes the bounds of a graph object visible, givin it an extra air between the area and the borders of the viewport if possible. The view may be zoomed out if required, but it is never zoomed in.
ParameterTypeDescription
graphicNode|Link|SubgraphThe object to make visible
options{expandCurrent:false,airFactor}Viewport options kwArgs
whenLoaded
Registers a callback to be executed after the instance has been initialized, or executes immediately if already initialized.
ParameterTypeDescription
cb
eb

Events

onFocusedElementChanged
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
oldValue
newValue
onLinkAdornersFocusChanged
Overrides ibm_ilog.diagram.widget._Diagram
event that occurs when the link adorners focus has changed.
ParameterTypeDescription
oldValue
newValue
onLinkContextMenu
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
l
e
onLinkCreated
Overrides ibm_ilog.diagram.widget._Diagram
Invoked when the specified link has been created.
ParameterTypeDescription
linkibm_ilog.diagram.Linkibm_ilog.diagram.Link: the new link instance.
startibm_ilog.diagram.Nodeibm_ilog.diagram.Node: the link start node, if any.
endibm_ilog.diagram.Nodeibm_ilog.diagram.Node: the link end node, if any.
diagramibm_ilog.diagram.widget.Diagramibm_ilog.diagram.widget.Diagram: the diagram instance that fired the event.
onLinkTouchEnd
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onLinkTouchMove
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onLinkTouchStart
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onLinksStoreFetchError
ParameterTypeDescription
error
request
onLoaded
Overrides ibm_ilog.diagram.widget._Diagram
Invoked when the diagram has loaded the data.
onNodeAdornersFocusChanged
Overrides ibm_ilog.diagram.widget._Diagram
event that occurs when the adorners focus has changed.
ParameterTypeDescription
oldValue
newValue
onNodeContextMenu
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
n
e
onNodeCreated
Overrides ibm_ilog.diagram.widget._Diagram
Invoked when the specified node has been created.
ParameterTypeDescription
nodeibm_ilog.diagram.Node:the new node instance.
diagramibm_ilog.diagram.widget.Diagram:the diagram instance that fired the event.
onNodeTouchEnd
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onNodeTouchMove
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onNodeTouchStart
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onNodesStoreFetchError
ParameterTypeDescription
error
request
onPropertyChanged
Overrides ibm_ilog.diagram.widget._Diagram
An extension point invoked when a property has changed.
ParameterTypeDescription
nameStringString: the property name.
oldValueObjectObject: the old property value.
newValueObjectObject: the new property value.
onStoreFetchError
ParameterTypeDescription
error
request
onSubgraphContextMenu
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
s
e
onSubgraphCreated
Overrides ibm_ilog.diagram.widget._Diagram
Invoked when the specified subgraph object has been created and initialized. The default implementation does nothing.
ParameterTypeDescription
subgraphibm_ilog.diagram.Subgraphibm_ilog.diagram.Subgraph: the new subgraph instance.
diagramibm_ilog.diagram.widget.Diagramibm_ilog.diagram.widget.Diagram: the diagram instance that fired the event.
onSubgraphTouchEnd
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onSubgraphTouchMove
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event
onSubgraphTouchStart
Overrides ibm_ilog.diagram.widget._Diagram
ParameterTypeDescription
ge
event