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

ibm_ilog.graphlayout.INodeBoxProvider (version 1.1-SNAPSHOT)

Object » ibm_ilog.graphlayout.INodeBoxProvider
dojo.require("ibm_ilog.graphlayout.INodeBoxProvider");

An interface used to define a rectangle associated with a node of a graph.

This interface is useful when a layout algorithm must use a node size that is different from the bounding box (see ibm_ilog.graphlayout.AbstractGraphLayoutModel.boundingBox ).

The following code is an example of the implementation of the method INodeBoxProvider.getBox(). In this example, the height of the node box is never smaller than a predefined value (80). The additional height is added to the bottom of the original bounding box:

function getBox(graphModel, node)
{
var bbox = graphModel.boundingBox(node);
if (bbox.height < 80)
bbox.height = 80;
return bbox;
}
In the second code example, the additional height is added to the top of the original bounding box:
function getBox(graphModel, node)
{
var bbox = graphModel.boundingBox(node);
if (bbox.height < 80) {
bbox.y = bbox.y + bbox.height - 80;
bbox.height = 80;
}
return bbox;
}

Method Summary

  • getBox(graphModel, node) Returns the rectangle associated to 'node'.

Methods

getBox
The rectangle which defines the size of the node

Returns the rectangle associated to node. The rectangle must be in the actual coordinate system of the input node.

Note that when routing intergraph links, the coordinate system of the node is not necessarily the same as the coordinate system of the link.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to which the node belongs
nodeObjectThe node