../../ibm_ilog/diagram/Node.html
ibm_ilog.diagram.Node
dojo.require("ibm_ilog.diagram.Node");
A Node is a graphic object that can be connected to other nodes using Link objects.
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
- allowsResize()
- beforeDisposing(graphElement) This function is called before disposing the GraphElement
- byShape(shape) Returns the GraphElement that contains the specified shape, or null.
- 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.
- getBaseShape() Gets the base shape of the node.
- getBounds(parent) Returns the bounds of this node in the coordinate space of the specified parent.
- getId()
- 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)
- move(x, y, parent) Moves the node to the specified position.
- removePort(port) Removes a port from this node.
- 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.
- toString()
Event Summary
- onBoundsChanged() This event is called to signal that the bounds of the node have changed.
Attached Objects
Properties
Methods
this method should be called on every dojo.connect done to the graph element that
should be disconnected on dispose.
Parameter | Type | Description |
---|
connection | | |
Adds a port to this node.
Parameter | Type | Description |
---|
port | ibm_ilog.diagram.PortBase | ibm_ilog.diagram.PortBase: The port to add. |
This function free all possible listeners
Parameter | Type | Description |
---|
graphElement | | |
This function is called before disposing the GraphElement
Parameter | Type | Description |
---|
graphElement | | |
Returns the GraphElement that contains the specified shape, or null.
Parameter | Type | Description |
---|
shape | | |
override gfx.connect to add the handle to the internal list
This function is disconnect every dojo.connect attached to this element
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.
Parameter | Type | Description |
---|
options | options.noRecurse: | Do not recurse children |
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.
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.
Parameter | Type | Description |
---|
parent | dojox.gfx.Group | The 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. |
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.
Parameter | Type | Description |
---|
starting | Boolean: | If this argument is not false (e.g., true or undefined), links whose start nodes are equal to this node are returned. |
ending | Boolean: | 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.
An array of PortBase objects.
Note that this method always returns a newly allocated array.
Parameter | Type | Description |
---|
p | | |
graph | | |
tolerance | | |
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
Parameter | Type | Description |
---|
x | number | |
y | number | |
parent | dojox.gfx.Group | |
Removes a port from this node.
Parameter | Type | Description |
---|
port | ibm_ilog.diagram.PortBase | ibm_ilog.diagram.PortBase: The port to remove. |
Changes the transform of this node so that its bounds will be a given rectangle,
in the coordinate space of the specified parent.
Parameter | Type | Description |
---|
rect | A | rectangle (i.e. an object with x/y/width/height properties) containing
the new bounds of the node in the specified coordinate space. |
parent | dojox.gfx.Group | The 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. |
Events
This event is called to signal that the bounds of the node have changed.