Shape policies
Link shape policies control the shape of an individual link. They
are a way to ensure that a link keeps a specific shape. See the
class IlvLinkShapePolicy for details.
Links may stay orthogonal or they may
cross and you can set the aspect of link crossings.
Rogue Wave® JViews
Framework proposes the following predefined link shape policies:
- The class IlvOrthogonalLinkShapePolicy keeps links orthogonal.
- The class IlvCrossingLinkShapePolicy calculates how crossings are displayed.
- The class IlvBundleLinkShapePolicy organizes multilinks and self links in bundles.
These link shape policies are for internal use by the class IlvEnhancedPolylineLinkImage,. This class
is a subclass of
IlvPolylineLinkImage
designed to provide support for link shape policies. By hiding
the implementation and computation details, this class makes link
shape policies easier for you to use.
The orthogonal mode and the crossing mode of the class IlvEnhancedPolylineLinkImage are
implemented by link shape policies.
By default, orthogonal mode and crossing mode are switched off.
In this case, the class
IlvEnhancedPolylineLinkImage
behaves exactly like
IlvPolylineLinkImage
.
Orthogonal links
If you set the method setOrthogonal
setOrthogonal
. of the class
IlvEnhancedPolylineLinkImage
to
true
, the link stays orthogonal, even if you try to reshape it
interactively. You can add or remove bends, or move bends
interactively, the link always reorganizes the adjacent bends so
that the link keeps an orthogonal shape, as illustrated in Orthogonal link between two nodes.
![OrthogonalMode.gif](../../JViews_Framework/usressfwork/_media/OrthogonalMode_default.gif)
Orthogonal link between two nodes
The accessor
isOrthogonal
returns whether the link is in orthogonal mode.
When the orthogonal mode is switched on, the class IlvOrthogonalLinkShapePolicy automatically
controls the shape policy.
Crossing modes
The method setCrossingMode of the class
IlvEnhancedPolylineLinkImage
enables you to select the aspect of the image of the link at the
place where two links cross. To do so, set the
mode
parameter to one of the following options:
NO_CROSSINGS
: crossings are not displayed in any particular way (default).TUNNEL_CROSSINGS
: crossings are displayed with a tunnel shape, as illustrated in Tunnel-shaped Crossing Mode.
![TunnelCrossing.gif](../../JViews_Framework/usressfwork/_media/TunnelCrossing_default.gif)
Tunnel-shaped Crossing Mode
BRIDGE_CROSSINGS
: crossings are displayed with a bridge shape, as illustrated in Bridge-shaped Crossing Mode.
![BridgeCrossing.gif](../../JViews_Framework/usressfwork/_media/BridgeCrossing_default.gif)
Bridge-shaped Crossing Mode
The accessor
getCrossingMode
returns the current crossing mode.
When a crossing mode other than
NO_CROSSINGS
is set, the class IlvCrossingLinkShapePolicy automatically
controls the shape policy.