public interface IlvNodeBoxInterface
This interface is useful when a layout algorithm must use a node size
that is different from the bounding box (see IlvGraphModel.boundingBox(Object)
).
The following code is an example of the implementation of the method
getBox(IlvGraphModel, Object)
. 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:
public IlvRect getBox(IlvGraphModel graphModel, Object node) { IlvRect 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:
public IlvRect getBox(IlvGraphModel graphModel, Object node) { IlvRect bbox = graphModel.boundingBox(node); if (bbox.height) < 80) { bbox.y = bbox.y + bbox.height - 80; bbox.height = 80; } return bbox; }
Modifier and Type | Method and Description |
---|---|
IlvRect |
getBox(IlvGraphModel graphModel,
Object node)
Returns the rectangle associated to
node . |
IlvRect getBox(IlvGraphModel graphModel, Object node)
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. If the input graph model is a grapher adapter (instance of
IlvGrapherAdapter
), the returned rectangle value should
depend on the actual coordinate mode that can be queried from the
input model by IlvGrapherAdapter.getCoordinatesMode()
.
graphModel
- The graph model to which the node belongsnode
- The node© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.