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

Object » graphCreator » dojox.gfx.Group » ibm_ilog.diagram.GraphElement » 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

  • 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.
  • 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()
  • 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

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.
defaultTemplate
minimumSize
nodeType

Methods

addConnection
Defined by dojox.gfx.Group, ibm_ilog.diagram.GraphElement
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, ibm_ilog.diagram.GraphElement

This function free all possible listeners

ParameterTypeDescription
graphElement
allowsResize
beforeDisposing
Defined by dojox.gfx.Group, ibm_ilog.diagram.GraphElement
This function is called before disposing the GraphElement
ParameterTypeDescription
graphElement
byShape
Defined by dojox.gfx.Group, ibm_ilog.diagram.GraphElement
Returns the GraphElement that contains the specified shape, or null.
ParameterTypeDescription
shape
connect
Defined by dojox.gfx.Group, ibm_ilog.diagram.GraphElement
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, ibm_ilog.diagram.GraphElement
This function is disconnect every dojo.connect attached to this element
dispose
Defined by dojox.gfx.Group, ibm_ilog.diagram.GraphElement

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
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.
getId
Defined by dojox.gfx.Group, ibm_ilog.diagram.GraphElement
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.
getPorts
An array of PortBase objects.

Note that this method always returns a newly allocated array.

hitTest
ParameterTypeDescription
p
graph
tolerance
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
removePort
Removes a port from this node.
ParameterTypeDescription
portibm_ilog.diagram.PortBaseibm_ilog.diagram.PortBase: The port to remove.
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.
toString
Defined by dojox.gfx.Group, ibm_ilog.diagram.GraphElement

Events

onBoundsChanged
This event is called to signal that the bounds of the node have changed.