public class IlvShortLinkLayout extends IlvGraphLayout
This algorithm reshapes the links of a graph without moving the nodes.
By default, the algorithm computes orthogonal links (that is, links
composed of alternating horizontal and vertical segments). Optionally,
direct links can be computed. (See #setGlobalLinkStyle(int)
and #setLinkStyle(java.lang.Object, int)
.)
The links are placed freely in the plane by choosing the best shape from a fixed number of link shapes. Orthogonal links can a maximum of 4 bends. Direct links have 3 bends.
This layout algorithm is recommended when any of the following apply:
IlvLongLinkLayout
may be more
suitable.
Here are sample drawings produced by the Short Link Layout algorithm:
See the corresponding chapter of the User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features and limitations, code samples, and so on.
Note the following points:
#setPreserveFixedLinks(boolean)
is enabled or links that have the link style #NO_RESHAPE_STYLE
are not reshaped. The incremental mode cannot be used for intergraph
links.SDM {
LinkLayout : true;
}
LinkLayout {
graphLayout : @#layout;
// optional settings for the link layout renderer
}
Subobject#layout {
class : "ilog.views.graphlayout.link.shortlink.IlvShortLinkLayout";
allowedNumberOfIterations : "2";
allowedTime : "3";
animate : "false";
bypassDistance : "3.0";
combinedInterGraphLinksMode : "false";
coordinatesMode : "MANAGER_COORDINATES";
evenlySpacedPinsMarginRatio : "3.0";
globalConnectorStyle : "FIXED_OFFSET_PINS";
globalDestinationPointMode : "FREE_MODE";
globalIncrementalModifiedLinkReshapeMode : "FREE_MODE";
globalIncrementalUnmodifiedLinkReshapeMode : "FREE_MODE";
globalLinkStyle : "ORTHOGONAL_STYLE";
globalOriginPointMode : "FREE_MODE";
globalSelfLinkStyle : "TWO_BENDS_ORTHOGONAL_STYLE";
incrementalMode : "false";
interGraphLinksMode : "false";
linkBundlesMode : "IMPROVED_FIRST_LAST_SEGMENT";
linkOffset : "3.0";
linkOverlapNodesForbidden : "false";
linkToLinkCrossingPenalty : "3.0";
linkToNodeCrossingPenalty : "3.0";
minBusyTime : "3";
minFinalSegmentLength : "3.0";
sameShapeForMultipleLinks : "false";
}
link.tag {
DestinationPointMode : "FREE_MODE";
IncrementalModifiedLinkReshapeMode : "FREE_MODE";
IncrementalUnmodifiedLinkReshapeMode : "FREE_MODE";
LinkStyle : "ORTHOGONAL_STYLE";
OriginPointMode : "FREE_MODE";
}
node.tag {
ConnectorStyle : "FIXED_OFFSET_PINS";
}
The following table lists the per-object rendering properties of the GraphLayout
renderer:
Property | Type | Default | Description |
---|---|---|---|
GraphLayout | IlvGraphLayout | null | Lets you define a different graph layout algorithm for each subgraph. If one is not specified, the same algorithm is applied recursively to all subgraphs. |
LayoutFixed | String | false | Deprecated, replaced by Fixed. |
Fixed | String | false | Lets you specify that the node or link must not be moved or reshaped by the layout algorithm. |
LayoutGroup | String | null | Lets you apply the algorithm to different groups of objects, one group after the other. |
LayoutIgnored | boolean | false | If true , the object is ignored by the layout. |
The per-node and per-link layout parameters are specified in the style sheet through the CSS rules for nodes and links, not through the CSS rule for graph layout. For instance:
link.tag {
LinkStyle : "ORTHOGONAL_STYLE";
}
Note that the names of the node and link layout parameters use an initial capital, unlike the regular properties.
Additional per-object properties are defined by the LinkLayoutRenderer
(which also inherits the properties defined by the GraphLayoutRenderer
):
IlvLinkLayoutRenderer.
Modifier and Type | Property and Description |
---|---|
int |
allowedNumberOfIterations
Sets the maximum number of iterations of the layout algorithm. |
long |
allowedTime
Sets the upper limit for the duration of the layout algorithm. |
boolean |
animate
If the argument is true , specifies that layout algorithms
that support the animation mechanism will require the graph model to
redraw the graph after each iteration or step. |
double |
bypassDistance
Sets the minimum distance between the origin and destination node for which a link shape going directly from one node to another is allowed. |
java.lang.String |
class
Default constructor. |
boolean |
combinedInterGraphLinksMode
Sets the routing of normal links in addition to intergraph links. |
int |
ConnectorStyle
Sets the connector style of an individual node. |
int |
coordinatesMode
Sets the coordinates mode to be used during layout. |
int |
DestinationPointMode
Sets the mode for the connection point of an individual link on the destination node. |
double |
evenlySpacedPinsMarginRatio
Sets the margin ratio for the evenly spaced pins connector style. |
int |
globalConnectorStyle
Sets the global style of connectors. |
int |
globalDestinationPointMode
Sets the global mode for the connection point of the links on the destination nodes. |
int |
globalIncrementalModifiedLinkReshapeMode
Sets the reshape mode used during the incremental layout of modified links, that is, links that have already been laid out in the previous layout execution and for which either the bounding box (see #getNodeBoxInterface() or the "link connection box" (see #getLinkConnectionBoxInterface() ) of their origin and destination
nodes has been modified. |
int |
globalIncrementalUnmodifiedLinkReshapeMode
Sets the reshape mode used during the incremental layout of unmodified links, that is, links that have already been laid out in the previous layout execution and for which neither the bounding box (see #getNodeBoxInterface() nor the "link connection box" (see #getLinkConnectionBoxInterface ) of their origin and destination
nodes have been modified. |
int |
globalLinkStyle
Sets the global style of the shape of the links. |
int |
globalOriginPointMode
Sets the global mode for the connection point of the links on the origin nodes. |
int |
globalSelfLinkStyle
Sets the global style of the shape of the self-links. |
boolean |
incrementalMode
Sets the incremental layout mode. |
int |
IncrementalModifiedLinkReshapeMode
Sets the reshape mode of an individual link used during the incremental layout of modified links, that is, links that have already been laid out in the previous layout execution and for which either the bounding box (see #getNodeBoxInterface() or the
"link connection box" (see #getLinkConnectionBoxInterface() )
of their origin and destination nodes has been modified. |
int |
IncrementalUnmodifiedLinkReshapeMode
Sets the reshape mode of an individual link used during the incremental layout of unmodified links, that is, links that have already been laid out in the previous layout execution and for which neither the bounding box (see #getNodeBoxInterface() nor the
"link connection box" (see #getLinkConnectionBoxInterface() )
of their origin and destination nodes have been modified. |
boolean |
interGraphLinksMode
Sets the routing of intergraph links. |
int |
linkBundlesMode
Sets the link bundles mode. |
double |
linkOffset
Sets the offset between links connected on the same side of the node. |
boolean |
linkOverlapNodesForbidden
Sets whether it is forbidden for the layout to reshape links such that they overlap nodes. |
int |
LinkStyle
Sets the style of the shape of an individual link. |
double |
linkToLinkCrossingPenalty
Sets the link-to-link crossing penalty factor. |
double |
linkToNodeCrossingPenalty
Sets the link-to-node crossing penalty factor. |
long |
minBusyTime
Sets the minimal time that the layout algorithm can be busy. |
double |
minFinalSegmentLength
Sets the minimum length of the final (first and last) segment of the links. |
int |
OriginPointMode
Sets the mode for the connection point on an individual link on the origin node. |
boolean |
sameShapeForMultipleLinks
Sets whether the layout algorithm must make sure that all multiple links have the same type of shape, that is, a shape with the same number of bends and with parallel segments. |
public java.lang.String class
class : "ilog.views.graphlayout.link.shortlink.IlvShortLinkLayout";
public int allowedNumberOfIterations
The default value is 3
.
allowedNumberOfIterations : "2";
public long allowedTime
When an iterative layout algorithm is used, the iterations can be
stopped when this time is exceeded. Noniterative algorithms can also
use this parameter as an upper limit for the computation time. The
default value is normally 32000
(32 seconds). Subclasses
that support this feature can use a different default value depending
on their particular behavior. Layout algorithms that are stopped in
this way set the result code of the layout report either to IlvGraphLayoutReport#STOPPED_AND_VALID
or to IlvGraphLayoutReport#STOPPED_AND_INVALID
.
When the connected components of disconnected graphs are laid out
separately (see #supportsLayoutOfConnectedComponents()
), the
specified allowed time is considered as the total time for the layout
of all the connected components plus the time for the connected
components layout.
Note that the layout algorithm may not obey exactly the allowed time specification.
Note for implementers of layout algorithms: the method #performLayout(boolean, boolean, boolean)
does NOT automatically
stop the layout when the allowed time is exceeded. It is the sole
responsibility of the implementation of the method #layout(boolean)
to do this.
A RuntimeException
is thrown if the layout does not
support this mechanism.
allowedTime : "3";
public boolean animate
true
, specifies that layout algorithms
that support the animation mechanism will require the graph model to
redraw the graph after each iteration or step.
The default value is false
.
A RuntimeException
is thrown if the layout does not
support this option.
Note that to obtain a redraw of an IlvGrapher
after each
iteration or step, the method #performLayout(boolean, boolean,
boolean)
must be called with the value true
for the
redraw
argument.
animate : "false";
public double bypassDistance
If the specified value is strictly negative, the value of the
parameter #getMinFinalSegmentLength()
is used as the bypass
distance. This allows the automatic adjustment of the bypass distance
according to the current value of #getMinFinalSegmentLength()
. This behavior is suitable in most
cases. However, you can specify a non-negative value in order to
override the default behavior.
The default value is a negative value.
bypassDistance : "3.0";
public boolean combinedInterGraphLinksMode
true
, both normal links and intergraph links are routed
in the same pass. Otherwise, only the intergraph links are routed.
The default value is true
.
combinedInterGraphLinksMode : "false";
interGraphLinksMode
public int ConnectorStyle
#MIXED_STYLE
. Otherwise, all nodes have the connector style that is
specified as the global connector style.
Valid values are:
#FIXED_OFFSET_PINS
- The link connector pins are spaced
along the node border at a distance equal to the link offset
(see #getLinkOffset()
).#EVENLY_SPACED_PINS
- The link connector pins are evenly
spaced along the node border, preserving a margin which is determined
by #getEvenlySpacedPinsMarginRatio()
.#AUTOMATIC_PINS
- Uses the connector style #FIXED_OFFSET_PINS
except if this pushes a connection point outside
the border the link is attached to, in which case it uses the
connector style #EVENLY_SPACED_PINS
.
The default value is #AUTOMATIC_PINS
.
Note that when the graph attached to the layout is of type IlvGrapher
, the effect of the connector style
depends on the type of the connectors installed at the node. For
links that have free origin or destination point mode, you are
recommended to use link connectors of type IlvFreeLinkConnector
. Other connector types
may cause an IlvInappropriateLinkException
during layout. You
can use the method IlvGraphLayoutUtil#EnsureAppropriateLinks
when the exception is caught to install the appropriate connectors.
ConnectorStyle : "FIXED_OFFSET_PINS";
Allowed values: |
FIXED_OFFSET_PINS |
EVENLY_SPACED_PINS |
AUTOMATIC_PINS |
globalConnectorStyle
public int coordinatesMode
Valid values are:
ilog.views.graphlayout.IlvGraphLayout#MANAGER_COORDINATES
- The
geometry of the graph is computed using the coordinate space of the
manager (that is, the attached IlvGrapher
) without applying
any transformation.
This mode should be used if you visualize the graph at zoom level 1, or you do not visualize it at all, or the graph contains only fully zoomable objects. In all these cases there is no need to take the transformer into account during the layout.
Note that in this mode the dimensional parameters of the layout algorithms are considered as being specified in manager coordinates.
ilog.views.graphlayout.IlvGraphLayout#VIEW_COORDINATES
-
The geometry of the graph is computed in the coordinate space of the
manager view. More exactly, all the coordinates are transformed using
the current reference transformer.
This mode should be used if you want the dimensional parameters of the layout algorithms to be considered as being specified in manager view coordinates.
ilog.views.graphlayout.IlvGraphLayout#INVERSE_VIEW_COORDINATES
- The
geometry of the graph is computed using the coordinate space of the
manager view and then applying the inverse transformation. This mode
is equivalent to the "manager coordinates" mode if the geometry of
the graphic objects strictly obeys the transformer. (A small
difference may exist because of the limited precision of the
computations.)
On the contrary, if some graphic objects are either nonzoomable (see
IlvGraphic#zoomable
) or semizoomable (for example, links with
a maximum line width), this mode gives different results than the
manager coordinates mode. These results are optimal if the graph is
visualized using the same transformer as the one taken into account
during the layout.
Note that in this mode the dimensional parameters of the layout algorithms are considered as being specified in manager coordinates.
The default value is IlvGraphLayout#INVERSE_VIEW_COORDINATES
.
This option is useful only if the attached graph model is an IlvGrapherAdapter
(or a subclass). Otherwise, it has no effect.
Note: the coordinates mode of the layout is used only while this
layout is running. If layout is not running, operations on the
grapher adapter use the coordinates mode that was set on the grapher
adapter directly (see IlvGrapherAdapter#setCoordinatesMode
).
coordinatesMode : "MANAGER_COORDINATES";
Allowed values: |
MANAGER_COORDINATES |
VIEW_COORDINATES |
INVERSE_VIEW_COORDINATES |
public int DestinationPointMode
#MIXED_MODE
. Otherwise, the connection points
on the destination nodes have, for all the links, the mode that is
specified as the global destination point mode.
Valid values are:
#FREE_MODE
- The layout is free to choose, for this
link, the appropriate position of the connection point on the
destination node, except for "pinned" connection points (see IlvGraphModel#hasPinnedConnectionPoint(Object, boolean)
).#FIXED_MODE
- The layout must keep, for this link, the
current position of the connection point on the destination node.
This can be useful, in particular, if the node has fixed pins where
the link is attached (as, for instance, with IlvPinLinkConnector
) and the pins should not be moved by the layout
algorithm.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode #FREE_MODE
.
The fixed mode works only if the link connector delivers consistently
the same connection point when called multiple times. If a link is
not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
The default value is #FREE_MODE
.
DestinationPointMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_MODE |
Fixed |
globalDestinationPointMode
public double evenlySpacedPinsMarginRatio
#FIXED_OFFSET_PINS
is used.
In evenly spaced pins connector style (see #setGlobalConnectorStyle(int)
), the connection points of the links
are evenly spaced along the node border, preserving a margin at each
extremity of the node border. The size of this margin is controlled
by the margin ratio, and is computed by multiplying the offset
between the links by the ratio.
The input value must be a positive or zero value. A ratio of
0
means no margin; a ratio of 1
means a
margin equal to the offset between the links; a ratio of
0.5
means a margin equal to half the offset between the
links; a ratio of 2
means a margin equal to twice the
offset between the links and so on. There is no upper bound for the
ratio; however, the margin which is obtained has an upper bound equal
to (node-side-dimension - total-width-of-links) / 2
.
The default value for the ratio is 0.5
.
evenlySpacedPinsMarginRatio : "3.0";
globalConnectorStyle
public int globalConnectorStyle
#FIXED_OFFSET_PINS
- The link connector pins are spaced
along the node border at a distance equal to the link offset
(see #getLinkOffset()
).#EVENLY_SPACED_PINS
- The link connector pins are evenly
spaced along the node border, preserving a margin which is determined
by #getEvenlySpacedPinsMarginRatio()
.#AUTOMATIC_PINS
- Uses the connector style #FIXED_OFFSET_PINS
except if this pushes a connection point outside
the border to which the link is attached, in which case it uses the
connector style #EVENLY_SPACED_PINS
.#MIXED_STYLE
: each node can have a different connector
style. The style of each individual node can be set by the method
#setConnectorStyle(Object, int)
so that different connector
styles can occur in the same graph.
Unless the global connector style is #MIXED_STYLE
, all links
have the same connector style.
The default value is #AUTOMATIC_PINS
.
The connector style is used to place the connector pins of links that have the free origin-point or destination-point mode and no specified port index. Links with fixed-point mode do not change their connection point at the origin node. The placement of connector pins also depends on the connection box interface in the following way:
IlvGraphLayout#setLinkConnectionBoxInterface(IlvLinkConnectionBoxInterface)
,
the bounding box and offsets are delivered by that interface.
Otherwise, the node bounding box delivered by the graph model (see
IlvGraphModel#boundingBox(Object)
) is used.
When the graph attached to the layout is of type IlvGrapher
, the effect of the connector style
depends on the type of the connectors installed at the node. For
links that have free origin-point or destination-point mode, you are
recommended to use link connectors of type IlvFreeLinkConnector
. Other connector types
may cause an IlvInappropriateLinkException
during layout. You
can use the method IlvGraphLayoutUtil#EnsureAppropriateLinks
when the exception is caught to install the appropriate connectors.
globalConnectorStyle : "FIXED_OFFSET_PINS";
Allowed values: |
FIXED_OFFSET_PINS |
EVENLY_SPACED_PINS |
AUTOMATIC_PINS |
MIXED_STYLE |
public int globalDestinationPointMode
#FREE_MODE
- For all links, the layout is free to choose
the appropriate position of the connection point on the destination
node, except for "pinned" connection points (see IlvGraphModel#hasPinnedConnectionPoint
).#FIXED_MODE
- For all links, the layout must keep the
current position of the connection point on the destination node.
This can be useful, in particular, if the node has fixed pins where
the link is attached (as, for instance, with IlvPinLinkConnector
) and the pins should not be moved by the layout
algorithm.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode #FREE_MODE
.
The fixed mode works only if the link connector delivers consistently
the same connection point when called multiple times. If a link is
not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
#MIXED_MODE
- Each link can have a different mode for
the connection point on the destination node. The mode of each
individual link can be set by the method #setDestinationPointMode(Object, int)
.
Unless the global mode is #MIXED_MODE
, the connection points
on the destination node have the same mode for all the links.
The default value is #FREE_MODE
.
globalDestinationPointMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_MODE |
Fixed | |
MIXED_MODE |
Mixed |
public int globalIncrementalModifiedLinkReshapeMode
#getNodeBoxInterface()
or the "link connection box" (see #getLinkConnectionBoxInterface()
) of their origin and destination
nodes has been modified.
This mode has no effect if incremental layout is disabled.
Valid values are:
#FIXED_SHAPE_TYPE_MODE
- Incremental layout preserves the
shape type of the link. This means that both the number of bends and
the node sides to which the link is connected are preserved.#FIXED_NODE_SIDES_MODE
- Incremental layout preserves the
node sides to which the links are connected.#FIXED_CONNECTION_POINTS_MODE
- Incremental layout
preserves the connection points of the links.#FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.#FREE_MODE
- Incremental layout is allowed to freely
reshape the links. This is equivalent to nonincremental behavior for
all the links, hence it is recommended to disable incremental layout
({link #setIncrementalMode(boolean)
) instead of setting
#FREE_MODE
as the global incremental reshape mode. Any
settings done using #isFixed(Object)
, #getGlobalOriginPointMode()
, and #getGlobalDestinationPointMode()
are still obeyed.#MIXED_MODE
- Each link can have a different mode. The
mode of each individual link can be set by the method #setIncrementalUnmodifiedLinkReshapeMode(Object, int)
.
Unless the global mode is #MIXED_MODE
, all links are reshaped
according to the same mode.
The default mode is #FREE_MODE
.
globalIncrementalModifiedLinkReshapeMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_SHAPE_TYPE_MODE |
Fixed shape type | |
FIXED_NODE_SIDES_MODE |
Fixed node sides | |
FIXED_CONNECTION_POINTS_MODE |
Fixed connection points | |
FIXED_MODE |
Fixed | |
MIXED_MODE |
Mixed |
public int globalIncrementalUnmodifiedLinkReshapeMode
#getNodeBoxInterface()
nor the "link connection box" (see #getLinkConnectionBoxInterface
) of their origin and destination
nodes have been modified.
This mode has no effect if the incremental mode is disabled.
Valid values are:
#FIXED_SHAPE_TYPE_MODE
- The incremental layout preserves
preserves the shape type of the link. This means that both the number
of bends and the node sides to which the link is connected are
preserved.#FIXED_NODE_SIDES_MODE
- The incremental layout preserves
the node sides to which the links are connected.#FIXED_CONNECTION_POINTS_MODE
- The incremental layout
preserves the connection points of the links.#FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.#FREE_MODE
- The incremental layout is allowed to freely
reshape the links. This is equivalent to a non-incremental behavior
for all the links, hence it is recommended to disable the incremental
mode (#setIncrementalMode(boolean)
) instead of setting #FREE_MODE
as global incremental reshape mode. (Of course, settings
that may have been done using #isFixed(Object)
, #getGlobalOriginPointMode()
and #getGlobalDestinationPointMode()
are still obeyed.)#MIXED_MODE
- Each link can have a different mode. The
mode of each individual link can be set by the method #setIncrementalUnmodifiedLinkReshapeMode(Object, int)
.
Unless the global mode is #MIXED_MODE
, all links are reshaped
according to the same mode.
The default mode is #FIXED_SHAPE_TYPE_MODE
.
globalIncrementalUnmodifiedLinkReshapeMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_SHAPE_TYPE_MODE |
Fixed shape type | |
FIXED_NODE_SIDES_MODE |
Fixed node sides | |
FIXED_CONNECTION_POINTS_MODE |
Fixed connection points | |
FIXED_MODE |
Fixed | |
MIXED_MODE |
Mixed |
public int globalLinkStyle
#DIRECT_STYLE
: the shape of the links is a polyline
composed of a straight-line segment between the end nodes with two
horizontal or vertical segments at its extremities (their length is
controlled by #setMinFinalSegmentLength(double)
and may be
0).#ORTHOGONAL_STYLE
: the shape of the links is a polyline
composed of alternating horizontal and vertical segments.#MIXED_STYLE
: each link can have a different link style.
The style of each individual link can be set by the method #setLinkStyle(Object, int)
so that different link shapes can occur
in the same graph.
Unless the global link style is #MIXED_STYLE
, all links have
the same style of shape.
The default value is #ORTHOGONAL_STYLE
.
Note that when the graph attached to the layout is of type IlvGrapher
, the effect of the link reshaping depends on
the type of the links and the connectors installed at the node. For
all link styles, we recommend using links of type IlvPolylineLinkImage
and link connectors of type
IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the methods IlvGraphLayoutUtil#EnsureAppropriateLinkTypes(IlvGraphLayout,
boolean)
and IlvGraphLayoutUtil#EnsureAppropriateLinkConnectors(IlvGraphLayout,
boolean)
before layout, or the method IlvGraphLayoutUtil#EnsureAppropriateLinks(IlvGraphLayout, boolean)
when the exception is caught, to convert all links and connectors to
an appropriate type.
globalLinkStyle : "ORTHOGONAL_STYLE";
Allowed values: | ||
ORTHOGONAL_STYLE |
Orthogonal links | |
DIRECT_STYLE |
Direct links | |
MIXED_STYLE |
Mixed links |
public int globalOriginPointMode
#FREE_MODE
- For all links, the layout is free to choose
the appropriate position of the connection point on the origin node,
except for "pinned" connection points (see IlvGraphModel#hasPinnedConnectionPoint(Object, boolean)
).#FIXED_MODE
- For all links, the layout must keep the
current position of the connection point on the origin node. This can
be useful, in particular, if the node has fixed pins where the link
is attached (as, for instance, with IlvPinLinkConnector
) and
the pins should not be moved by the layout algorithm.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode #FREE_MODE
.
The fixed mode works only if the link connector delivers consistently
the same connection point when called multiple times. If a link is
not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
#MIXED_MODE
- Each link can have a different mode for
the connection point on the origin node. The mode of each individual
link can be set by the method #setOriginPointMode(Object,
int)
.
Unless the global mode is #MIXED_MODE
, the connection points
on the origin node have the same mode for all the links.
The default value is #FREE_MODE
.
globalOriginPointMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_MODE |
Fixed | |
MIXED_MODE |
Mixed |
public int globalSelfLinkStyle
Valid values are the following:
#TWO_BENDS_ORTHOGONAL_STYLE
: the shape of the links is a
polyline composed of three alternating horizontal and vertical
segments, connected to the same side of the node.#THREE_BENDS_ORTHOGONAL_STYLE
: the shape of the links is
a polyline composed of four alternating horizontal and vertical
segments, connected to two adjacent sides of the node.
The default value is #TWO_BENDS_ORTHOGONAL_STYLE
.
Note that when the graph attached to the layout is of type IlvGrapher
, the effect of the link reshaping depends on
the type of the links and the connectors installed at the node. For
all link styles, we recommend using links of type IlvPolylineLinkImage
and link connectors of type
IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the methods IlvGraphLayoutUtil#EnsureAppropriateLinkTypes(IlvGraphLayout,
boolean)
and IlvGraphLayoutUtil#EnsureAppropriateLinkConnectors(IlvGraphLayout,
boolean)
before layout, or the method IlvGraphLayoutUtil#EnsureAppropriateLinks(IlvGraphLayout, boolean)
when the exception is caught, to convert all links and connectors to
an appropriate type.
globalSelfLinkStyle : "TWO_BENDS_ORTHOGONAL_STYLE";
Allowed values: | ||
TWO_BENDS_ORTHOGONAL_STYLE |
Two bends | |
THREE_BENDS_ORTHOGONAL_STYLE |
Three bends |
public boolean incrementalMode
true
, the algorithm tries to create a layout with
similar shapes for the links that were already laid out in the last
layout execution, in order to preserve the "mental map" of the user
as much as possible.
The exact incremental behavior is controlled by the
"incremental link reshape" mode. For details, see #setGlobalIncrementalUnmodifiedLinkReshapeMode(int)
and #setGlobalIncrementalModifiedLinkReshapeMode(int)
.
Incremental layout works only if the intergraph links mode is disabled or if there are no intergraph links. Also, incremental layout has no effect if the layout parameters have been changed since the previous layout.
Incremental layout is disabled by default.
incrementalMode : "false";
public int IncrementalModifiedLinkReshapeMode
#getNodeBoxInterface()
or the
"link connection box" (see #getLinkConnectionBoxInterface()
)
of their origin and destination nodes has been modified.
This link reshape mode is used only if incremental layout is enabled
and the global link reshape mode is set to #MIXED_MODE
. If
the global mode is not #MIXED_MODE
, all links have the mode
that is specified as the global link-reshape mode.
Valid values are:
#FIXED_SHAPE_TYPE_MODE
- Incremental layout preserves
the shape type of the link. This means that both the number of bends
and the node sides to which the link is connected are preserved.#FIXED_NODE_SIDES_MODE
- Incremental layout preserves
the node sides to which the links are connected.#FIXED_CONNECTION_POINTS_MODE
- Incremental layout
preserves the connection points of the links.#FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.#FREE_MODE
- Incremental layout is allowed to freely
reshape the links. This is equivalent to nonincremental behavior for
the link
argument. Any settings done using #isFixed(Object)
, #getGlobalOriginPointMode()
, and #getGlobalDestinationPointMode()
are still obeyed.
The default mode is #FREE_MODE
.
IncrementalModifiedLinkReshapeMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_SHAPE_TYPE_MODE |
Fixed shape type | |
FIXED_NODE_SIDES_MODE |
Fixed node sides | |
FIXED_CONNECTION_POINTS_MODE |
Fixed connection points | |
FIXED_MODE |
Fixed |
public int IncrementalUnmodifiedLinkReshapeMode
#getNodeBoxInterface()
nor the
"link connection box" (see #getLinkConnectionBoxInterface()
)
of their origin and destination nodes have been modified.
This reshape mode is used only if incremental layout is enabled and
the global link-reshape mode is set to #MIXED_MODE
. If the
global mode is not #MIXED_MODE
, all links have the mode that
is specified as the global link reshape mode.
Valid values are:
#FIXED_SHAPE_TYPE_MODE
- Incremental layout preserves
the shape type of the link. This means that both the number of bends
and the node sides to which the link is connected are preserved.#FIXED_NODE_SIDES_MODE
- Incremental layout preserves
the node sides to which the links are connected.#FIXED_CONNECTION_POINTS_MODE
- Incremental layout
preserves the connection points of the links.#FIXED_MODE
- The links are not reshaped at all during
incremental layout. Only newly added links are rerouted.#FREE_MODE
- Incremental layout is allowed to reshape
the links freely. This is equivalent to nonincremental behavior for
the link
argument. Any settings done using #isFixed
, #getGlobalOriginPointMode()
and #getGlobalDestinationPointMode()
are still obeyed.
The default mode is #FIXED_SHAPE_TYPE_MODE
.
IncrementalUnmodifiedLinkReshapeMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_SHAPE_TYPE_MODE |
Fixed shape type | |
FIXED_NODE_SIDES_MODE |
Fixed node sides | |
FIXED_CONNECTION_POINTS_MODE |
Fixed connection points | |
FIXED_MODE |
Fixed |
public boolean interGraphLinksMode
true
, the intergraph links are routed; otherwise, only
the normal links are routed. An intergraph link is a link stored in
one graph that has an origin or destination not stored in the same
graph. If the combined intergraph link routing is enabled in
addition, this means that normal links and intergraph links are
routed together; otherwise only the intergraph links are routed.
The default value is true
.
If the intergraph link mode is enabled and the graph does contain some intergraph links, there are some restrictions:
IlvGrapher
(or IlvGrapherAdapter
), the top-level grapher must have a manager view
attached because of the coordinate transformations of the
subgraphers. If you create your own subclass of IlvGraphModel
instead of IlvGrapherAdapter
to route intergraph links, you
must make sure that all graph models of all subgraphers use the same
coordinate system through appropriate coordinate
transformations.interGraphLinksMode : "false";
public int linkBundlesMode
#NO_BUNDLE
: Several links connected to the same side of
a node share the same connection point, that is, the middle of the
node side. The final segments of the links overlap. No bundles are
created and the link offset parameter is ignored.#FIRST_LAST_SEGMENT
: The connection points of several
links connected to the same side of a node are distributed according
to the link offset value. With the orthogonal link style, the
algorithm additionally ensures that the first and last segments of
the links are always orthogonal to the side of the node to which they
are connected.#IMPROVED_FIRST_LAST_SEGMENT
: The algorithm additionally
tries to avoid overlapping the second segment and the segment next to
the last. Note that with the direct link style, this mode is
equivalent to #FIRST_LAST_SEGMENT
.
The default value is #IMPROVED_FIRST_LAST_SEGMENT
.
linkBundlesMode : "IMPROVED_FIRST_LAST_SEGMENT";
Allowed values: | ||
IMPROVED_FIRST_LAST_SEGMENT |
Better | |
FIRST_LAST_SEGMENT |
First/last segment | |
NO_BUNDLE |
None |
public double linkOffset
The default value is 2
.
linkOffset : "3.0";
public boolean linkOverlapNodesForbidden
The default value of this parameter is false
.
If overlaps are not forbidden, the algorithm tries to avoid overlaps anyway. However, it may create overlaps if, for example, it needs to prevent a link from crossing other links.
If overlaps are forbidden, the algorithm uses the auxiliary long link
layout (see #getAuxiliaryLongLinkLayout()
to lay out links
that would otherwise overlap nodes in an orthogonal shape.
The auxiliary long link layout works on a grid and the default grid
size may need to be reduced to allow this algorithm to avoid overlaps
(see IlvLongLinkLayout#setHorizontalGridOffset(double)
and
IlvLongLinkLayout#setVerticalGridOffset(double)
).
Forbidding overlaps can slow down the layout and can produce additional link bends and link crossings.
linkOverlapNodesForbidden : "false";
public int LinkStyle
#MIXED_STYLE
.
Otherwise, all links have the style that is specified as the global
link style.
Valid values are:
#ORTHOGONAL_STYLE
- the link gets an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments.#DIRECT_STYLE
- the link gets a straight-line
shape.#NO_RESHAPE_STYLE
- the link is not reshaped.
The default value is #ORTHOGONAL_STYLE
.
IlvGrapher
, the effect of link reshaping depends on the
type of link. For the following link types, the reshaping has no
effect:
IlvLinkImage
IlvOneLinkImage
IlvDoubleLinkImage
IlvOneSplineLinkImage
IlvDoubleSplineLinkImage
For all link styles, you are recommended to use links of type IlvPolylineLinkImage
and link connectors of type
IlvFreeLinkConnector
. Other link or
connector types may cause an IlvInappropriateLinkException
during layout. You can use the method IlvGraphLayoutUtil#EnsureAppropriateLinks
before layout or when the
exception is caught to convert all links and link connectors to an
appropriate type.
LinkStyle : "ORTHOGONAL_STYLE";
Allowed values: | ||
ORTHOGONAL_STYLE |
Orthogonal links | |
DIRECT_STYLE |
Direct links |
globalLinkStyle
public double linkToLinkCrossingPenalty
linkToLinkCrossingPenalty : "3.0";
public double linkToNodeCrossingPenalty
linkToNodeCrossingPenalty : "3.0";
public long minBusyTime
#layoutStepPerformed()
when the
method #callLayoutStepPerformedIfNeeded()
is used.
The objective is to avoid the overhead of #layoutStepPerformed()
becoming too high if the method is called too
often. Internal routines of layout algorithms usually call #callLayoutStepPerformedIfNeeded()
, which calls #layoutStepPerformed()
if the time since the last call was at least
the minimal busy time.
The default value is 50 (milliseconds).
minBusyTime : "3";
public double minFinalSegmentLength
The default value is 10
.
minFinalSegmentLength : "3.0";
public int OriginPointMode
#MIXED_MODE
. Otherwise, the connection points on the
origin nodes have, for all the links, the mode that is specified as
the global origin point mode.
Valid values are:
#FREE_MODE
- The layout is free to choose, for this
link, the appropriate position of the connection point on the origin
node, except for "pinned" connection points (see IlvGraphModel#hasPinnedConnectionPoint(Object, boolean)
).#FIXED_MODE
- The layout must keep, for this link, the
current position of the connection point on the origin node. This can
be useful, in particular, if the node has fixed pins where the link
is attached (as, for instance, with IlvPinLinkConnector
) and
the pins should not be moved by the layout algorithm.
Note that, in this mode, the layout algorithm has less freedom for
the choice of a link shape. Hence, this mode usually produces more
crossings and overlaps than the mode #FREE_MODE
.
The fixed mode works only if the link connector delivers consistently
the same connection point when called multiple times. If a link is
not connected to a link connector, or if the IlvClippingLinkConnector
is used, the real connection point is
calculated on the fly and may change when called multiple times with
changing link bends. In this case, the fixed mode cannot ensure a
correct routing of the links.
The default value is #FREE_MODE
.
OriginPointMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_MODE |
Fixed |
globalOriginPointMode
public boolean sameShapeForMultipleLinks
Multiple links are links that have the same origin and destination nodes.
If the argument is true
, additional work is done to make
sure that multiple links are reshaped in the same manner.
The default value is false
.
For some categories of links, it cannot be guaranteed that they will be given the same type of shape as the other links with the same origin and destination nodes:
#setIncrementalMode(boolean)
.#setFixed(Object, boolean)
.#setGlobalOriginPointMode(int)
, #setGlobalDestinationPointMode(int)
, #setOriginPointMode(Object, int)
, #setDestinationPointMode(Object, int)
).sameShapeForMultipleLinks : "false";
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.