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

ibm_ilog.diagram.SwimLane

Object » graphCreator » dojox.gfx.Group » ibm_ilog.diagram.GraphElement » ibm_ilog.diagram.Node » ibm_ilog.diagram.Subgraph » ibm_ilog.diagram.SwimLane
dojo.require("ibm_ilog.diagram.SwimLane");

The SwimLane object is a special type of Subgraph used to divide a diagram into horizontal or vertical "stripes" that typically represent the different participants in a business process or workflow diagram. The differences with a plain Subgraph object are:

  • The swim lane has its own position and size, it does not adapt automatically to its contents.
  • The position and orientation of the title bar can be changed using the setVertical() and setRightToLeft() methods.
  • Nested swim lanes (that is, swim lanes contained in another swim lane) can be automatically stacked inside their parent lane (see setStackSublanes).

Property Summary

Method Summary

  • addConnection(connection) this method should be called on every dojo.connect done to the graph element that should be disconnected on dispose.
  • addPort(port) Adds a port to this node.
  • afterDisposing(graphElement) This function is called after disposing the GraphElement
  • afterHierarchicalLayout(graph, hl, swimlanes) Called if automaticHierarchicalLayout is set to false after a Hierarchical layout is performed on the graph.
  • allowsResize()
  • applyLayout(rect)
  • applyTemplate(template, context) Applies the specified template on this subgraph.
  • beforeDisposing(graphElement) This function is called before disposing the GraphElement
  • beforeHierarchicalLayout(graph, hl) returns Array Called if automaticHierarchicalLayout is set to false before a Hierarchical layout is performed on the graph.
  • byShape(shape) Returns the GraphElement that contains the specified shape, or null.
  • canCollapse() returns Boolean Returns false if this swim lane is nested.
  • connect() override gfx.connect to add the handle to the internal list
  • constructor()
  • disconnectAll() This function is disconnect every dojo.connect attached to this element
  • dispose(options) Dispose this GraphElement.
  • getAnimate() Returns whether the expand/collapse operation is animated.
  • getBaseShape() Gets the base shape of the node.
  • getBounds(parent) Returns the bounds of this node in the coordinate space of the specified parent.
  • getCollapsedPort(link, port) Gets a port to which the specified intergraph link will be connected when this subgraph is collapsed.
  • getFixedPosition() Gets the fixed position used to realign the subgraph when it is expanded/collapsed.
  • getGraph() Gets the nested graph contained in this Subgraph.
  • getId()
  • getIntergraphLinks() return all the intergraph links return array of ibm_ilog.diagram.Link
  • getLinks(starting, ending) returns Array Gets the links whose start and/or end nodes are equal to this node.
  • getNested() Returns true if this swim lane is a nested lane contained in another swim lane.
  • getPorts() Returns the ports of this node.
  • getRightToLeft() Gets the horizontal direction of the swim lane.
  • getStackSublanes() Gets the sub-lane stacking mode.
  • getVertical() Gets the orientation of the swim lane.
  • hitTest(p, graph, tolerance)
  • isCollapsed() Gets the collapsed state of this Subgraph.
  • layoutShape(target, forceDoLayout)
  • move(x, y, parent) Moves the node to the specified position.
  • propagateTextDir(textdir) propagate a new text direction to children (nodes, links)
  • removePort(port) Removes a port from this node.
  • setAnimate(value) Sets whether the expand/collapse operation is animated. The default value is true.
  • setBounds(rect, parent) Changes the transform of this node so that its bounds will be a given rectangle, in the coordinate space of the specified parent.
  • setCollapsed(collapsed, animate) Collapses or expands this subgraph.
  • setExplicitSize(sz) Does nothing, Subgraphs cannot have an explicit size, their size is determined by their children.
  • setFixedPosition(position) Sets a fixed position used to realign the subgraph when it is expanded/collapsed.
  • setRightToLeft(rightToLeft) Sets the horizontal direction of the swim lane.
  • setStackSublanes(stack) Sets the sub-lane stacking mode.
  • setVertical(vertical) Sets the orientation of the swim lane.
  • toString()

Event Summary

Attached Objects

Properties

Methods

addConnection
Defined by dojox.gfx.Group
this method should be called on every dojo.connect done to the graph element that should be disconnected on dispose.
ParameterTypeDescription
connection
addPort
Adds a port to this node.
ParameterTypeDescription
portibm_ilog.diagram.PortBaseibm_ilog.diagram.PortBase: The port to add.
afterDisposing
Defined by dojox.gfx.Group

This function free all possible listeners

ParameterTypeDescription
graphElement
afterHierarchicalLayout

Called if automaticHierarchicalLayout is set to false after a Hierarchical layout is performed on the graph. This method should perform a custom layout on the swim lanes.

ParameterTypeDescription
graphibm_ilog.diagram.GraphThe toplevel graph on which the layout is performed.
hlibm_ilog.graphlayout.hierarchical.HierarchicalLayoutThe hierarchical layout that is being performed.
swimlanesArrayThe array of SwimLane obejcts that was returned by beforeHierarchicalLayout.
applyLayout
ParameterTypeDescription
rect
applyTemplate
Applies the specified template on this subgraph.
ParameterTypeDescription
templateString||Object
contextObject||ibm_ilog.diagram.data.dtlbinding.BoundContext
beforeDisposing
Defined by dojox.gfx.Group
This function is called before disposing the GraphElement
ParameterTypeDescription
graphElement
beforeHierarchicalLayout
Returns Array: An array of Swimlane objects that will be passed back to afterHierarchicalLayout.

Called if automaticHierarchicalLayout is set to false before a Hierarchical layout is performed on the graph. This method must return an array of swim lanes, that will be passed back to afterHierarchicalLayout.

ParameterTypeDescription
graphibm_ilog.diagram.GraphThe toplevel graph on which the layout is performed.
hlibm_ilog.graphlayout.hierarchical.HierarchicalLayoutThe hierarchical layout that is being performed.
byShape
Defined by dojox.gfx.Group
Returns the GraphElement that contains the specified shape, or null.
ParameterTypeDescription
shape
canCollapse
Returns Boolean: True if this SwimLane is not nested, false if it is nested.

Indicates if this Subgraph can be collapsed. This method always returns true for the Subgraph class, it can be overridden in subclasses that do not support collapsing.

connect
Defined by dojox.gfx.Group
override gfx.connect to add the handle to the internal list
constructor
Overrides dojox.gfx.Group, ibm_ilog.diagram.GraphElement
disconnectAll
Defined by dojox.gfx.Group
This function is disconnect every dojo.connect attached to this element
dispose

This function should be called when the GraphElement is completely deleted, that is, when it is removed from its parent graph and it will never be used again.

ParameterTypeDescription
optionsoptions.noRecurse:Do not recurse children
getAnimate
Returns whether the expand/collapse operation is animated.
getBaseShape

The base shape for various purposes, for example links will typically be connected to the base shape instead of the overall bounding rectangle of the node. By default, the base shape is the shape contained in the node template whose dojoAttachPoint property is set to "baseShape". In the default template, this is a rounded rectangle. If not baseshape exists in the template, the Node itself is returned.

getBounds
A rectangle (i.e. an object with x/y/width/height properties) containing the bounds of the node in the specified coordinate space.
Returns the bounds of this node in the coordinate space of the specified parent.
ParameterTypeDescription
parentdojox.gfx.GroupThe parent object that determines the coordinate space the bounds are relative to. If null or undefined, the bounds of the node relative to its parent are returned.
getCollapsedPort

When a subgraph is collapsed, intergraph links connected to nodes contained in the subgraph are automatically reconnected to a port of the collapsed subgraph itself. This method lets you customize which port will be used for this. If this method returns null (the default), an AutomaticPort will be used by default.

ParameterTypeDescription
linkibm_ilog.diagram.Link:The intergraph link connected to a node contained in this subgraph.
portibm_ilog.diagram.PortBase:The port to which the intergraph link is normally connected when this subgraph is expanded.
getFixedPosition
An object with 'x' and 'y' properties representing a ratio (between 0 and 1) of the subgraph width/height.
Gets the fixed position used to realign the subgraph when it is expanded/collapsed.
getGraph
ibm_ilog.diagram.Graph The Graph object contained in this Subgraph.
Gets the nested graph contained in this Subgraph.
getId
Defined by dojox.gfx.Group
getIntergraphLinks
return all the intergraph links return array of ibm_ilog.diagram.Link
getLinks
Returns Array: An array of ibm_ilog.diagram.Link objects.

If starting is not false, the method returns all the links whose start nodes are this node. If ending is not false, the method returns all the links whose end nodes are this node.

ParameterTypeDescription
startingBoolean:If this argument is not false (e.g., true or undefined), links whose start nodes are equal to this node are returned.
endingBoolean:If this argument is not false (e.g., true or undefined), links whose end nodes are equal to this node are returned.
Example 1
node.getLinks() node.getLinks(true, true) node.getLinks(true) These 3 calls return all the links connected to the node.
Example 2
node.getLinks(true, false) This call returns the links starting at the node.
Example 3
node.getLinks(false) node.getLinks(false, true) These 2 calls return the links ending at the node.
Example 4
node.getLinks(false, false) This call always returns an empty array.
getNested
Returns true if this swim lane is a nested lane contained in another swim lane.
getPorts
An array of PortBase objects.

Note that this method always returns a newly allocated array.

getRightToLeft

Gets the horizontal direction of the swim lane (see setRightToLeft().

getStackSublanes

Gets the sub-lane stacking mode (see setStackSublanes()).

getVertical

Gets the orientation of the swim lane (see setVertical).

hitTest
ParameterTypeDescription
p
graph
tolerance
isCollapsed
Boolean: True if the subgraph is collapsed, or false if the subgraph is expanded.
Gets the collapsed state of this Subgraph.
layoutShape
ParameterTypeDescription
targetObject
forceDoLayout
move

This function changes the node's transform so that the top-left of its bounds (in the parent coordinate space) will be the specified 'x'and 'y' arguments

ParameterTypeDescription
xnumber
ynumber
parentdojox.gfx.Group
propagateTextDir
propagate a new text direction to children (nodes, links)
ParameterTypeDescription
textdirStringString, text direction
removePort
Removes a port from this node.
ParameterTypeDescription
portibm_ilog.diagram.PortBaseibm_ilog.diagram.PortBase: The port to remove.
setAnimate
Sets whether the expand/collapse operation is animated. The default value is true.
ParameterTypeDescription
valueBooleanIndicates whether the expand/collapse operation is animated.
setBounds
Changes the transform of this node so that its bounds will be a given rectangle, in the coordinate space of the specified parent.
ParameterTypeDescription
rectArectangle (i.e. an object with x/y/width/height properties) containing the new bounds of the node in the specified coordinate space.
parentdojox.gfx.GroupThe parent object that determines the coordinate space the bounds are relative to. If null or undefined, the bounds of the node relative to its parent are changed.
setCollapsed
Collapses or expands this subgraph.
ParameterTypeDescription
collapsedBooleanBoolean: If true, the subgraph is collapsed, otherwise it is expanded.
animateBooleanIf specified, indicates whether the expand/collapse operation is animated. If this argument is not specified, the <code>getAnimate()</code> flag is used instead.
setExplicitSize
Does nothing, Subgraphs cannot have an explicit size, their size is determined by their children.
ParameterTypeDescription
sz
setFixedPosition

When a subgraph is expanded or collapsed, it is automatically realigned so that its position in the new state (expanded or collapsed) matches the position in the previous state. This method specifies how the subgraph will be realigned by defining a fixed position relative to the subgraph width/height. For example, setFixedPosition({x:0, y:0}) (the default value) realigns the subgraph so that its top-left corner stays at the same position, and setFixedPosition({x:0.5, y:0.5}) realigns the subgraph so that its center stays at the same position.

ParameterTypeDescription
positionAnobject with 'x' and 'y' properties representing a ratio (between 0 and 1) of the subgraph width/height.
setRightToLeft

Sets the horizontal direction of the swim lane.

This property has an effect only if isVertical() is false.

ParameterTypeDescription
rightToLeftBoolean:If <code>false</code>, the title of the swim lane will be displayed on the left of the graph. If <code>rightToLeft</code> is <code>true</code>, the title of the swim lane will be displayed on the right of the graph.
setStackSublanes

Sets the sub-lane stacking mode.

Sub-lanes (that is, SwimLane objects contained in this SwimLane) are stacked vertically if getVertical() is false, or horizontally if getVertical() is true.

ParameterTypeDescription
stackBoolean:If <code>true</code>, sub-lanes will be stacked, otherwise they will be left to their current position and size.
setVertical

Sets the orientation of the swim lane.

ParameterTypeDescription
verticalBoolean:If <code>true</code>, the title of the swim lane will be displayed at the top of the graph. If <code>false</code>, the title of the swim lane will be displayed (vertically) on the left (if <code>isRightToLeft()</code> is <code>false</code>) or on the right (if <code>isRightToLeft()</code> is <code>true</code>) of the graph.
toString
Defined by dojox.gfx.Group

Events

onBoundsChanged
This event is called to signal that the bounds of the node have changed.
onCollapsedAnimated
Called when the subgraph is about to be been expanded or collapsed.
onCollapsedChanged
Called when the subgraph has been expanded or collapsed.