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

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

Subgraph objects are used to implemented nested graphs, that is, graphs contained in graphs. A Subgraph can be collapsed (i.e., its nested graph is hidden and replaced by a plain node) or expanded (i.e., its nested graph is fully displayed).

Property Summary

  • TID Graph element Type ID, used to distinguish basic graph element types: N = Node S = Subgraph L = Link Usually used as a very fast index into maps based on ibm_diagram graph element types.
  • baseShape
  • defaultTemplate
  • minimumSize
  • nodeType

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
  • allowsResize()
  • applyLayout(rect)
  • applyTemplate(template, context) Applies the specified template on this subgraph.
  • beforeDisposing(graphElement) This function is called before disposing the GraphElement
  • byShape(shape) Returns the GraphElement that contains the specified shape, or null.
  • canCollapse() returns Boolean Indicates if this Subgraph can be collapsed.
  • 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.
  • getPorts() Returns the ports of this node.
  • 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.
  • toString()

Event Summary

Attached Objects

Properties

TID
Graph element Type ID, used to distinguish basic graph element types: N = Node S = Subgraph L = Link Usually used as a very fast index into maps based on ibm_diagram graph element types.
baseShape

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
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
byShape
Defined by dojox.gfx.Group
Returns the GraphElement that contains the specified shape, or null.
ParameterTypeDescription
shape
canCollapse
Returns Boolean: True if this Subgraph can be collapsed, false otherwise.

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
disconnectAll
Defined by dojox.gfx.Group
This function is disconnect every dojo.connect attached to this element
dispose
Overrides dojox.gfx.Group

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.
Example 5
node.getLinks() node.getLinks(true, true) node.getLinks(true) These 3 calls return all the links connected to the node.
Example 6
node.getLinks(true, false) This call returns the links starting at the node.
Example 7
node.getLinks(false) node.getLinks(false, true) These 2 calls return the links ending at the node.
Example 8
node.getLinks(false, false) This call always returns an empty array.
getPorts
An array of PortBase objects.

Note that this method always returns a newly allocated array.

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.
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.