ibm_ilog.graphlayout.INodeBoxProvider (version 1.1-SNAPSHOT)
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
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.
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model to which the node belongs |
node | Object | The node |