The IlvRotatedGraphModel class is a concrete
subclass of IlvGraphModel. It wraps a graph model and
provides a transformed coordinate space of the original graph
model. This capability is useful, for example, when you want a Tree
Layout or a Hierarchical Layout with a diagonal flow direction.
![Transformed
coordinate space of a graph model giving a diagonal flow direction.](../../../GraphLayout/_media/JVDiag_RotatedGraphModel_default.png)
To allocate and attach a rotated graph
model, call:
IlvGraphModel originalModel = ... any graph model ... IlvRotatedGraphModel rotatedModel = new IlvRotatedGraphModel(originalModel, owned, center, angle); layout.attach(rotatedModel);
The graph layout is now performed in the coordinate space of the
rotated model. The original model can be, for example, an IlvGrapherAdapter object. The center point
and angle define the rotation. The owned
parameter of IlvRotatedGraphModel
indicates whether the original model is owned by the rotated model
or whether the lifetime of the original model is independent from
the rotated model. If the original model is owned by the rotated
model, it is automatically disposed when the rotated model is
disposed.
The class IlvRotatedGraphModel can be
used with any transform, but looks best with rotations or shear
transforms. It transforms the node positions and the bend points of
links, but it does not rotate the node shapes. If the node shapes
must be transformed as well, it is more suitable to rotate the
entire view instead of using IlvRotatedGraphModel.
To allocate a rotated graph model with an arbitrary transform,
call:
IlvRotatedGraphModel rotatedModel = new IlvRotatedGraphModel(originalModel, owned, tranformer);
When the graph layout uses a clip link
interface, node box, or link connection box interface, the
implementations of these interfaces must take into account the
rotation. The easiest way to obtain an appropriate implementation
is to implement the interface for the original model and then
obtain a rotated variant of the interface by calling:
IlvLinkClipInterface linkClipper = ... implementation for originalModel ... IlvLinkClipInterface rotatedLinkClipper = rotatedModel.getLinkClipInterface(linkClipper); layout.attach(rotatedModel); layout.setLinkClipInterface(rotatedLinkClipper);
The class IlvRotatedGraphModel is
suitable for layout of flat graphs. It is not suitable for the
recursive layout mode of Hierarchical Layout or Tree Layout for
nested graphs.