Link style (TL)

When using the Tree layout, it is preferable to use link connectors of type IlvFreeLinkConnector and links of type IlvPolylineLinkImage or IlvSplineLinkImage. The links can be straight or have a specific shape with intermediate points. You can specify that the links be reshaped into an “orthogonal” form. You can set the link style globally, in which case all links have the same shape, or locally on each link, in which case different link shapes occur in the same drawing.

Link style and link shapes

Link styles work only when you use links that can be reshaped. Subclasses of IlvPolylineLinkImage or of IlvSplineLinkImage, (such as IlvGeneralLink ) can be reshaped. Furthermore, link styles work only if free link connectors are installed. Free link connectors are subclasses of IlvFreeLinkConnector. If you use a diagram component, the free link connectors are automatically installed when necessary unless specified differently. If you call layout in Java™ on an IlvGrapher instance directly, the layout algorithm may raise an IlvInappropriateLinkException if links are neither a subclass of IlvPolylineLinkImage nor of IlvSplineLinkImage, or if connectors are not a subclass of IlvFreeLinkConnector . In this case, you can use the methods EnsureAppropriateLinkTypes , EnsureAppropriateLinkConnectors , or EnsureAppropriateLinks defined in IlvGraphLayoutUtil to replace inappropriate links or link connectors automatically, either before layout or when the IlvInappropriateLinkException is caught. For details on these methods, see the Java API Reference Manual. For details on the graph model, see Using the graph model.

Global link style

To specify the global link style:
In CSS
Add this statement to the GraphLayout section:
globalLinkStyle: "STRAIGHT_LINE_STYLE";
In Java
Use the method:
void setGlobalLinkStyle(int style);    
The valid values for style are:
In CSS, you omit the prefix IlvTreeLayout when specifying the value of the link style.

Individual link style

All links have the same style of shape unless the global link style is MIXED_STYLE . Only when the global link style is set to MIXED_STYLE can each link have an individual link style.
A sample
graph with different link styles in each subtree
Different link styles mixed in the same drawing
To specify the style of an individual link:
In CSS
First set the global link style to MIXED_STYLE, then specify a rule that selects the link, for instance:
GraphLayout {
   globalLinkStyle: "MIXED_STYLE";
}
#link1{
  LinkStyle: "ORTHOGONAL_STYLE";
}
In Java
Use the methods:
The valid values for style are:
  • IlvTreeLayout.STRAIGHT_LINE_STYLE (the default)
  • IlvTreeLayout.NO_RESHAPE_STYLE
  • IlvTreeLayout.ORTHOGONAL_STYLE
Note
The link style of a Tree Layout graph requires links in an IlvGrapher that can be reshaped. Links of type IlvLinkImage, IlvOneLinkImage, IlvDoubleLinkImage, IlvOneSplineLinkImage, and IlvDoubleSplineLinkImage cannot be reshaped. You should use the class IlvPolylineLinkImage or IlvSplineLinkImage instead.