public class IlvHierarchicalLayout extends IlvGraphLayout
The Hierarchical Layout arranges the nodes in horizontal or vertical levels such that the majority of the links point in the same direction and the number of link crossings is small.
Here is a sample drawing produced by the Hierarchical Layout algorithm with two levels of nodes that are top-justified within each level:
Another sample drawing with eight levels follows. This graph contains a cycle and a self-loop. The direction of the flow is from top to bottom. The nodes are organized in horizontal levels.
The Hierarchical Layout algorithm supports different styles of links in the same drawing. The following sample drawing shows orthogonal, straight, and polyline links. The direction of the flow is to the right and the node levels are vertical.
The Hierarchical Layout algorithm supports port specifications. The side and index of the port where a link connects to a node can be specified. The following sample drawing shows a drawing with port specifications and orthogonal link style. The direction of the flow is from top to bottom.
To simplify the explanations of the layout parameters, we use the compass directions north, south, east, and west. The first level of the layout is the north pole. If the flow direction is top to bottom, north is always upwards, south towards the bottom, west towards the left, and east towards the right side of the layout. If the flow direction is left to right, north is left and south is right.
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:
SDM {
GraphLayout : true;
}
GraphLayout {
graphLayout : @#layout;
// optional settings for the graph layout renderer
}
Subobject#layout {
class : "ilog.views.graphlayout.hierarchical.IlvHierarchicalLayout";
allowedTime : "3";
backtrackCrossingReductionEnabled : "false";
connectorStyle : "2";
coordinatesMode : "MANAGER_COORDINATES";
crossingReductionDuringIncremental : "false";
flowDirection : "2";
fromFork : "false";
globalDestinationPointMode : "2";
globalIncrementalNodeMovementMode : "2";
globalLinkStyle : "2";
globalOriginPointMode : "2";
horizontalLinkOffset : "3.0";
horizontalNodeLinkOffset : "3.0";
horizontalNodeOffset : "3.0";
incrementalAbsoluteLevelPositioning : "false";
incrementalAbsoluteLevelPositionRange : "3.0";
incrementalAbsoluteLevelPositionTendency : "3.0";
incrementalMode : "false";
intergraphConnectivityMode : "false";
labelLayoutEnabledDuringRecLayoutMode : "false";
layoutOfConnectedComponentsEnabled : "false";
levelingStrategy : "2";
levelJustification : "2";
linkCrossingFineTuningEnabled : "false";
linkStraighteningEnabled : "false";
linkWidthUsed : "false";
longLinkCrossingReductionDuringIncremental : "false";
maxInterLevelApertureAngle : "3.0";
medianCrossingValueEnabled : "false";
minBusyTime : "3";
minEndSegmentLength : "3.0";
minForkSegmentLength : "3.0";
minStartSegmentLength : "3.0";
multiLinkOptimizationEnabled : "false";
multiLinkOptimizationMaxSpread : "3.0";
multiLinkOptimizationOffset : "3.0";
neighborLinksAligned : "false";
nonorthogonalBendEliminationEnabled : "false";
numberOfLinkCrossingSweeps : "2";
orthogonalStairCaseEliminationEnabled : "false";
polylineLinkOverlapReductionEnabled : "false";
position : "10,10";
preferredForkAxisLength : "3.0";
recursiveLayoutFromAncestorAllowed : "false";
recursiveLayoutMode : "false";
selfLinkFromPortSide : "EAST";
selfLinksSameSideNested : "false";
selfLinkToPortSide : "EAST";
toFork : "false";
verticalLinkOffset : "3.0";
verticalNodeLinkOffset : "3.0";
verticalNodeOffset : "3.0";
}
link.tag {
DestinationPointMode : "FREE_MODE";
FromPortIndex : "2";
FromPortSide : "EAST";
LinkPriority : "2.0";
LinkStyle : "POLYLINE_STYLE";
OriginPointMode : "FREE_MODE";
ToPortIndex : "2";
ToPortSide : "EAST";
}
node.tag {
EastNumberOfPorts : "2";
IncrementalNodeBoxForExpand : "10,10,400,400";
IncrementalNodeMovementMode : "FREE_MODE";
NorthNumberOfPorts : "2";
SouthNumberOfPorts : "2";
SpecNodeLevelIndex : "2";
SpecNodePositionIndex : "2";
WestNumberOfPorts : "2";
}
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.
See also the documentation of the classes
IlvGraphLayoutRenderer, IlvSwimLanesRenderer, IlvLaneRenderer.Modifier and Type | Property and Description |
---|---|
long |
allowedTime
Sets the upper limit for the duration of the layout algorithm. |
boolean |
backtrackCrossingReductionEnabled
Sets whether the backtrack mechanism of the link crossing reduction phase is enabled. |
java.lang.String |
class
Default constructor. |
int |
connectorStyle
Sets the style of connectors. |
int |
coordinatesMode
Sets the coordinates mode to be used during layout. |
boolean |
crossingReductionDuringIncremental
Sets whether crossing reduction during incremental layout is enabled. |
int |
DestinationPointMode
Sets the mode for the connection point of an individual link on the destination node. |
int |
EastNumberOfPorts
Sets the number of relative ports on the east side of a node. |
int |
flowDirection
Sets the direction of the link flow. |
boolean |
fromFork
Sets whether a fork shape is created for links that start at the same source point. |
int |
FromPortIndex
Sets the port index of a link at the "from" side. |
int |
FromPortSide
Sets the port side of a link at the "from" side. |
int |
globalDestinationPointMode
Sets the global mode for the connection point of the links on the destination nodes. |
int |
globalIncrementalNodeMovementMode
Sets the node movement mode used during incremental layout. |
int |
globalLinkStyle
Sets the global style of the shapes of links. |
int |
globalOriginPointMode
Sets the global mode for the connection point of the links on the origin nodes. |
double |
horizontalLinkOffset
Sets the horizontal offset between parallel segments of links. |
double |
horizontalNodeLinkOffset
Sets the horizontal offset between a node and a link segment that is parallel to the node border. |
double |
horizontalNodeOffset
Sets the horizontal offset between nodes. |
boolean |
incrementalAbsoluteLevelPositioning
Sets whether it is enabled to place nodes within the level to absolute positions that are close to the previous positions during incremental layout. |
double |
incrementalAbsoluteLevelPositionRange
Sets the range that is considered very close to the previous node position. |
double |
incrementalAbsoluteLevelPositionTendency
Sets the percentage how much the layout algorithm tries to place nodes to absolute positions within the level that are close to the previous positions during incremental layout. |
boolean |
incrementalMode
Sets whether the incremental layout mode is enabled. |
ilog.views.IlvRect |
IncrementalNodeBoxForExpand
Sets the effective bounding rectangle of an expanded node during incremental layout. |
int |
IncrementalNodeMovementMode
Sets the movement mode of an individual node used during incremental layout. |
boolean |
intergraphConnectivityMode
Sets whether the intergraph link connectivity is considered for the partitioning of the layout into levels. |
boolean |
labelLayoutEnabledDuringRecLayoutMode
Sets whether the recursive layout mode places also the labels of the graph. |
boolean |
layoutOfConnectedComponentsEnabled
Sets whether the generic connected component layout mechanism is enabled. |
int |
levelingStrategy
Sets the hierarchical layout leveling strategy. |
int |
levelJustification
Sets the justification within the levels. |
boolean |
linkCrossingFineTuningEnabled
Sets whether the link crossing fine tuning phase is enabled. |
float |
LinkPriority
Sets the priority of a link. |
boolean |
linkStraighteningEnabled
Sets whether the link straightening phase is enabled. |
int |
LinkStyle
Sets the style of the shape of an individual link. |
boolean |
linkWidthUsed
Sets whether the layout respects the width of links. |
boolean |
longLinkCrossingReductionDuringIncremental
Sets whether the handling of long links for crossing reduction during incremental layout is enabled. |
double |
maxInterLevelApertureAngle
Sets the maximum aperture angle of the links incident to a node. |
boolean |
medianCrossingValueEnabled
Sets whether the median crossing value is used during crossing reduction. |
long |
minBusyTime
Sets the minimal time that the layout algorithm can be busy. |
double |
minEndSegmentLength
Sets the minimum length of the last segment of each link, that is, the segment that is incident to the "to" node. |
double |
minForkSegmentLength
Sets the minimum length of the start or end segment of links if a fork shape is used for these links. |
double |
minStartSegmentLength
Sets the minimum length of the first segment of each link, that is, the segment that is incident to the "from" node. |
boolean |
multiLinkOptimizationEnabled
Sets whether the optimization of overlapping multiple links is enabled. |
double |
multiLinkOptimizationMaxSpread
Sets the maximum spread width for the bends introduced by the optimization of overlapping multiple links. |
double |
multiLinkOptimizationOffset
Sets the minimum distance between bends introduced by the optimization of overlapping multiple links. |
boolean |
neighborLinksAligned
Sets whether links between neighbor nodes of the same level are aligned so that they are strictly horizontal or vertical. |
boolean |
nonorthogonalBendEliminationEnabled
Sets whether the bend elimination phase for nonorthogonal links is enabled. |
int |
NorthNumberOfPorts
Sets the number of relative ports on the north side of a node. |
int |
numberOfLinkCrossingSweeps
Sets the number of layer sweeps to remove link crossings. |
int |
OriginPointMode
Sets the mode for the connection point on an individual link on the origin node. |
boolean |
orthogonalStairCaseEliminationEnabled
Sets whether the stair case elimination phase for orthogonal links is enabled. |
boolean |
polylineLinkOverlapReductionEnabled
Sets whether optimization of polyline links to avoid links overlapping large neighbor nodes is enabled. |
ilog.views.IlvPoint |
position
Sets the position of the layout. |
double |
preferredForkAxisLength
Sets the preferred length of the axis of a fork shape. |
boolean |
recursiveLayoutFromAncestorAllowed
Sets whether the layout instance of the ancestor graph is in principle allowed to treat this subgraph in a recursive layout. |
boolean |
recursiveLayoutMode
Sets whether this layout instance handles all subgraphs recursively that are nested into this graph. |
int |
selfLinkFromPortSide
Sets the default port side of a self-link at the "from" side. |
boolean |
selfLinksSameSideNested
Sets whether self-links that attach the same side of a node are nested. |
int |
selfLinkToPortSide
Sets the default port side of a self-link at the "to" side. |
int |
SouthNumberOfPorts
Sets the number of relative ports on the south side of a node. |
int |
SpecNodeLevelIndex
Sets the index of the specified level for a node. |
int |
SpecNodePositionIndex
Sets the index of the specified position of a node within a level. |
boolean |
toFork
Sets whether a fork shape is created for links that end at the same target point. |
int |
ToPortIndex
Sets the port index of a link at the "to" side. |
int |
ToPortSide
Sets the port side of a link at the "to" side. |
double |
verticalLinkOffset
Sets the vertical offset between parallel segments of links. |
double |
verticalNodeLinkOffset
Sets the vertical offset between a node and a link segment that is parallel to the node border. |
double |
verticalNodeOffset
Sets the vertical offset between nodes. |
int |
WestNumberOfPorts
Sets the number of relative ports on the west side of a node. |
public java.lang.String class
class : "ilog.views.graphlayout.hierarchical.IlvHierarchicalLayout";
public long allowedTime
The default value for Hierarchical layout is 100000000
(100000 seconds).
allowedTime : "3";
public boolean backtrackCrossingReductionEnabled
This is an expert option. It is enabled by default. It is normally not necessary to disable the backtrack mechanism, except if you need to speed up the layout.
backtrackCrossingReductionEnabled : "false";
public int connectorStyle
#CENTERED_PINS
- The link connector pins are placed in
the center of the border the link is attached to. #CLIPPED_PINS
- Each link pointing to the center of the
node is clipped at the node border. #EVENLY_SPACED_PINS
- The link connector pins are evenly
spaced along the node border. #AUTOMATIC_PINS
- The connector style is selected
depending on the link style.
The default value is #AUTOMATIC_PINS
.
The connector style is used to place the connector pins of links that have the free origin or destination point mode and no specified port index. Links with fixed point mode do not change their connection point at the origin node. Links with specified port indexes are connected to the corresponding connector pin of the port instead. The placement of connector pins also depends on the link clip interface and the connection box interface, in the following way:
IlvGraphLayout#setLinkConnectionBoxInterface
, 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. IlvGraphLayout#setLinkClipInterface(IlvLinkClipInterface)
, the
connector pins are corrected by clipping with that interface.
If you specify port sides but no port numbers for links (see
#setFromPortSide(Object, int)
and #setToPortSide(Object, int)
), then it is recommended to avoid #CLIPPED_PINS
, since they do not reflect the port side precisely
enough. Only centered or evenly spaced link connector pins display
the port side precisely.
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, we recommend using 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 : "2";
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 boolean crossingReductionDuringIncremental
false
,
the layout preserves the relative order of the nodes and the links
within the levels. If the argument is true
, the layout
preserves the level structure but reorders the nodes within the
levels to avoid link crossings.
It is disabled by default.
crossingReductionDuringIncremental : "false";
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)
). The choice
can further be influenced by specifying the side and the port index
of the links. #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.
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.
Note that if the mode is fixed, specifications of the port index of links at the "to" side are ignored.
The default value is #FREE_MODE
.
DestinationPointMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_MODE |
Fixed |
globalDestinationPointMode
public int EastNumberOfPorts
EastNumberOfPorts : "2";
public int flowDirection
IlvDirection#Right
- the majority of the links flow to
the right. IlvDirection#Left
- the majority of the links flow to
the left. IlvDirection#Bottom
- the majority of the links flow to
the bottom. IlvDirection#Top
- the majority of the links flow to the
top. This feature sets the direction of the flow for the majority of the links in a directed graph. The layout algorithm may need to direct some links in the opposite direction of the general link flow. If the links flow to the left or right, the nodes are placed in vertical levels. If the links flow to the top or bottom, the nodes are placed in horizontal levels.
The default value is IlvDirection#Right
.
flowDirection : "2";
public boolean fromFork
#CENTERED_PINS
, or if the links start at the same
specified port index at the north or south side of a node, or if the
links have the fixed origin point mode and are placed at exactly the
same coordinate.
The default value is false
.
fromFork : "false";
public int FromPortIndex
Port numbers are between 0
and n - 1
, where
n
is the number of ports at the node side where the link
is connected. Links with an unspecified or negative port index are
connected on the node border according to the global connector style.
A link with a specified port index i
is connected at the
ith relative port, and the connector pins of ports are evenly
spaced on the corresponding node border.
FromPortIndex : "2";
public int FromPortSide
Possible values for the side
parameter are #EAST
, #WEST
, #NORTH
, #SOUTH
, and the
default #UNSPECIFIED
.
If a port side is unspecified, the link can connect to any border side of the node. Otherwise, the link connects only to the specified node border.
FromPortSide : "EAST";
Allowed values: |
EAST |
WEST |
NORTH |
SOUTH |
UNSPECIFIED |
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(Object, boolean)
). The choice
can further be influenced by specifying the side and the port index
of the links. #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.
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.
Note that if the mode is fixed, specifications of the port index of links at the "to" side are ignored.
#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 : "2";
public int globalIncrementalNodeMovementMode
#FREE_MODE
- The incremental layout preserves the
relative order of nodes but does not preserve the exact position of
nodes. It may move the nodes a little bit to optimize the space
usage. The shifting does not change the level structure of the graph.
If crossing reduction is disabled during incremental layout (see
#setCrossingReductionDuringIncremental(boolean)
), the
shifting also does not change the order of the nodes within the
levels. #FIXED_IN_X_MODE
- The incremental layout preserves the
relative order of nodes and keeps the nodes fixed in the x direction.
The nodes may shift in the y direction. #FIXED_IN_Y_MODE
- The incremental layout preserves the
relative order of nodes and keeps the nodes fixed in the y direction.
The nodes may shift in the x direction. #FIXED_MODE
- The nodes do not move at all during
incremental layout. Only nodes that are marked for incremental
repositioning will be moved, and links are rerouted. #MIXED_MODE
- Each node that is not marked for
incremental can have a different mode. The mode of each individual
node can be set by the method #setIncrementalNodeMovementMode(Object, int)
. Mixing fixed and free
nodes should only be done in exceptional cases, because it may create
overlaps or a messy arrangement.
Nodes that are marked for incremental are placed in a nonincremental
way without respecting the previous position. The incremental
movement mode has no effect for these nodes. Unless the global mode
is #MIXED_MODE
, all nodes that are not marked for incremental
are placed according to the same mode.
The default mode is #FREE_MODE
.
If the incremental mode is enabled and nodes are fixed in the x or y
direction, it works well if the graph has a coarsely level structure
(for example, if it was created by a previous layout in free mode or
in nonincremental mode) but it may create overlaps or a messy
arrangement otherwise. Fixing nodes has several consequences: The
spacing options are obeyed only if there is enough space between the
fixed nodes. The specified position of the layout is not obeyed,
because it would require shifting the fixed nodes. The crossing
reduction during incremental layout has no effect (see #isCrossingReductionDuringIncremental()
). However, you can decide
whether to enable the crossing reduction of long links (see #isLongLinkCrossingReductionDuringIncremental()
). If the long link
crossing reduction is enabled, it will rearrange the long links that
span several levels to avoid crossings.
Furthermore, note that if the generic connected component layout
mechanism of the IlvGraphLayout
base class is enabled,
it will move nodes even if they are specified as fixed. Therefore, it
is recommended disabling the generic connected component layout
mechanism.
globalIncrementalNodeMovementMode : "2";
public int globalLinkStyle
#POLYLINE_STYLE
- All links get a polyline shape, that
is, a shape consisting of a sequence of line segments. #ORTHOGONAL_STYLE
- All links get an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments. #STRAIGHT_LINE_STYLE
- All links get a straight-line
shape. #NO_RESHAPE_STYLE
- No reshape is performed on any link.
#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 #POLYLINE_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, for links that have
free origin or destination point mode, 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.
globalLinkStyle : "2";
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)
). The choice
can further be influenced by specifying the side and the port index
of the links. #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.
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.
Note that if the mode is fixed, specifications of the port index of links at the "from" side are ignored.
#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 : "2";
public double horizontalLinkOffset
The default value is 15
.
horizontalLinkOffset : "3.0";
public double horizontalNodeLinkOffset
The default value is 20
.
horizontalNodeLinkOffset : "3.0";
public double horizontalNodeOffset
The default value is 40
.
horizontalNodeOffset : "3.0";
public boolean incrementalAbsoluteLevelPositioning
If the incremental mode is enabled and crossing reduction during
incremental layout is disabled, the layout arranges the nodes such
that the relative order of the nodes within each level is preserved.
If this parameter is set to false
, nodes may be placed
at absolute positions far from the previous positions, even though
their relative order does not change, because the main objective of
the algorithm is to produce a balanced layout.
To help the user preserve a mental map of the graph, this parameter
should be set to true
. In this case, the nodes are
placed closer to their previous positions, even though this may
result in a less balanced layout.
The freedom of incremental level positioning can be controlled by the
tendency to preserve the previous node position (see #setIncrementalAbsoluteLevelPositionTendency(double)
) and the range
that is considered to be close enough to the previous node position
#setIncrementalAbsoluteLevelPositionRange(double)
).
It is enabled by default.
incrementalAbsoluteLevelPositioning : "false";
public double incrementalAbsoluteLevelPositionRange
In nonincremental mode, nodes are placed within the level in order to balance the layout. If the incremental absolute level positioning is used, nodes should be placed close to their previous positions, but the layout should also be balanced. Both criteria compete with each other. The position range influences how the competing criteria are resolved. If a node is placed within this range to its previous position, the balance criteria is used to determine its position. If the node is placed farther away from its previous position, the position tendency is used to determine its position.
A node that is placed within the incremental position range to its previous position is placed at the best balanced position. This avoids having the balance of nodes that are already close to the previous position being disturbed by an additional tendency towards the previous position.
The default value is 20
.
incrementalAbsoluteLevelPositionRange : "3.0";
public double incrementalAbsoluteLevelPositionTendency
In nonincremental mode, nodes are placed within the level in order to balance the layout. If the incremental absolute level positioning is used, nodes should be placed close to their previous positions, but the layout should also be balanced. Both criteria compete with each other. The position tendency influences how the competing criteria are resolved. A high position tendency has the effect that the nodes stay closer to their previous positions, and a low position tendency has the effect that the nodes stay closer to the balanced position. Passing the position tendency 0 has basically the same effect as disabling the incremental absolute level positioning.
The input value is a percentage between 0
and
100
. The default value is 70
percent.
incrementalAbsoluteLevelPositionTendency : "3.0";
public boolean incrementalMode
true
, the layout respects the current coordinates of
nodes and links, and it tries to create a layout with similar
positions. Depending on the incremental node movement mode, the
layout may need to shift all nodes to optimize the space usage, but
the shifting does not change the relative order of the nodes and
links, so that the diagram after an incremental layout looks very
similar to the previous diagram.
The levels are arranged based on the current coordinates of the nodes. Thus, the specified node level and position indexes are ignored during incremental layout.
The incremental mode is disabled by default.
incrementalMode : "false";
public ilog.views.IlvRect IncrementalNodeBoxForExpand
In this context, we call expand any interactive operation that changes the size of the node to make it very large while preserving the center position of the node. The typical purpose of an expand operation is to change the graphical representation of the node to show more details in the inner of the node. For instance, an expand operation may show a subgraph in the inner of the node. Often, an incremental re-layout is desired after an expand operation.
The challenge of the re-layout after an expand operation consists of the fact that the node may become so large that it overlaps many nodes. This may yield undesired effects during incremental layout, because incremental layout is unable to determine the level structure from the coordinates of the nodes if some node overlaps many other nodes completely.
To facilitate the incremental layout, the old bounding box of the expanded node, as it was before the expand operation, must be specified as the effective bounding box. This helps the incremental layout determine the proper level structure.
The effective bounding box has no effect if incremental layout is
disabled, or if the node is marked for incremental recalculation. The
effective bounding box is transient, that is, it is automatically
removed after each successful layout and not stored into
.ivl
files.
IncrementalNodeBoxForExpand : "10,10,400,400";
public int IncrementalNodeMovementMode
#MIXED_MODE
, and
the node is not marked for incremental recalculation. If the global
movement mode is not #MIXED_MODE
, all nodes have the mode
that is specified as the global movement mode.
Valid values are:
#FREE_MODE
- The incremental layout preserves the
relative order of the node with respect to all other nodes (except
those that are marked for incremental recalculation). It does not
preserve the exact position. It may move the node a little bit to
optimize the space usage. The shifting does not change the level
structure of the graph. If the crossing reduction is disabled during
incremental layout (see #setCrossingReductionDuringIncremental(boolean)
), the shifting also
does not change the order of the node within the levels with respect
to the other nodes. #FIXED_IN_X_MODE
- The incremental layout preserves the
relative order of the node with respect to all other nodes (except
those that are marked for incremental recalculation), and it keeps
the node fixed in the x direction. The node may shift in the y
direction. #FIXED_IN_Y_MODE
- The incremental layout preserves the
relative order of the node with respect to all other nodes (except
those that are marked for incremental recalculation), and it keeps
the node fixed in the y direction. The nodes may shift in the x
direction. #FIXED_MODE
- The node does not move at all during
incremental layout.
The default mode is #FREE_MODE
.
If the incremental mode is enabled and some nodes are fixed in the x
or y direction, it often works well if the graph has a coarsely level
structure (for example, if it was created by a previous layout in
free mode or in nonincremental mode) but it may create overlaps or a
messy arrangement otherwise, in particular if only few nodes are
fixed and many nodes are free to move. Fixing nodes has several
consequences: The spacing options are obeyed only if there is enough
space between the fixed nodes. The specified position of the layout
is not obeyed, because it would require shifting the fixed nodes. The
crossing reduction during incremental layout has no effect (see
#isCrossingReductionDuringIncremental()
). However, you can
decide whether to enable the crossing reduction of long links (see
#isLongLinkCrossingReductionDuringIncremental()
). If the long
link crossing reduction is enabled, it will rearrange the long links
that span several levels to avoid crossings.
Furthermore, note that if the generic connected component layout
mechanism of the IlvGraphLayout
base class is enabled,
it will move nodes even if they are specified as fixed. Therefore it
is recommended disabling the generic connected component layout
mechanism.
IncrementalNodeMovementMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_MODE |
Fixed |
globalIncrementalNodeMovementMode
public boolean intergraphConnectivityMode
This is an expert option. It is disabled by default.
Note that this option has no effect if the generic disconnected node
placement is enabled (see #setLayoutOfConnectedComponentsEnabled(boolean)
).
Even if this option is enabled, the Hierarchical Layout algorithm does not route intergraph links. They should be routed by applying a Link Layout after the Hierarchical Layout.
intergraphConnectivityMode : "false";
public boolean labelLayoutEnabledDuringRecLayoutMode
#getLabelLayout()
, which is attached at the same grapher as this
layout instance. The placement of labels is enabled by default.
labelLayoutEnabledDuringRecLayoutMode : "false";
public boolean layoutOfConnectedComponentsEnabled
#supportsLayoutOfConnectedComponents()
), the method
#performLayout(boolean, boolean, boolean)
cuts the attached
graph model into connected components and lays out each connected
component separately. Then the connected components are placed using
the layout instance returned by the method #getLayoutOfConnectedComponents()
.
Notice that the connected component layout is not used if the graph is connected.
A RuntimeException
is thrown if the layout does not
support this mechanism.
The default value is the value returned by the method #isLayoutOfConnectedComponentsEnabledByDefault()
.
CSS example:
layoutOfConnectedComponentsEnabled : "false";
public int levelingStrategy
This strategy determines how nodes are distributed in the hierarchical levels. Valid values are:
#OPTIMAL
: the optimal leveling strategy. The layout
algorithm tries to minimize the sum of level distances for all edges.
#SEMI_OPTIMAL
: the semioptimal leveling strategy. This
strategy often gives the same result as the optimal strategy. The
layout algorithm tries a quick heuristic to minimize the sum of level
distances for all edges. It pulls root nodes to the highest-numbered
level possible and leaf nodes to the lowest-numbered level possible.
#HIGHER_LEVELS
: the leveling strategy to utilize higher
numbered levels. This layout algorithm pulls nodes to the
highest-numbered level possible. Root nodes in particular are
effected. #LOWER_LEVELS
: the leveling strategy to utilize lower
numbered levels. the layout algorithm pulls nodes to the
lowest-numbered level possible. Leaf nodes in particular are
effected. #SPREAD_OUT
: the leveling strategy to spread the nodes
out over all levels. This can be considered as the inverse of the
semioptimal leveling strategy. It pulls root nodes to the
lowest-numbered level possible and leaf nodes to the highest-numbered
level possible. #SEMI_OPTIMAL
.
The calculation of node levels can also be influenced by the following node constraints:
IlvRelativeLevelConstraint
IlvSameLevelConstraint
IlvLevelRangeConstraint
If the incremental mode is switched on, the leveling strategy has no
effect. The levels are calculated from the node positions, except for
those nodes that are marked for incremental recalculation. See #markForIncremental(Object)
for more information.
levelingStrategy : "2";
public int levelJustification
IlvDirection#Center
IlvDirection#Left
IlvDirection#Right
IlvDirection#Top
IlvDirection#Bottom
This feature sets the justification of the nodes within each level. If the nodes are center-justified, all nodes of the same level are placed with their centers along a line. Otherwise, all nodes of the same level are placed with the specified border justified to a line. If the link flow direction is to the left or right, the nodes can be justified to the left, center, or right. If the link flow direction is to the top or bottom, the nodes can be justified to the top, center, or bottom.
The default value is IlvDirection#Center
.
levelJustification : "2";
public boolean linkCrossingFineTuningEnabled
This is an expert option. It is enabled by default. It is normally not necessary to disable fine tuning, except if you need to speed up the layout.
linkCrossingFineTuningEnabled : "false";
public float LinkPriority
LinkPriority : "2.0";
public boolean linkStraighteningEnabled
This is an expert option. It is enabled by default. It is normally not necessary to disable link straightening, except if you need to speed up the layout.
linkStraighteningEnabled : "false";
public int LinkStyle
#MIXED_STYLE
.
Otherwise, all links have the style that is specified as the global
link style.
Valid values are:
#POLYLINE_STYLE
- The link gets a polyline shape, that
is, a shape consisting of a sequence of line segments. #ORTHOGONAL_STYLE
- The link gets an orthogonal shape,
that is, a shape consisting of a sequence of orthogonal line
segments. #STRAIGHT_LINE_STYLE
- The link gets a straight-line
shape. #NO_RESHAPE_STYLE
- No reshape is performed on the link.
The default value is #POLYLINE_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, for links that have
free origin or destination point mode, 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 to an appropriate type.
LinkStyle : "POLYLINE_STYLE";
Allowed values: | ||
POLYLINE_STYLE |
Polyline links | |
ORTHOGONAL_STYLE |
Orthogonal links | |
STRAIGHT_LINE_STYLE |
Straight-line links | |
NO_RESHAPE_STYLE |
No link reshape |
globalLinkStyle
public boolean linkWidthUsed
#CLIPPED_PINS
or #CENTERED_PINS
.
If true
is passed as the argument, the distribution of
the connector pins varies depending on the link width. The horizontal
or vertical offset between pairs of links or links and nodes is with
respect to the link border. If false
is passed as the
argument, the distribution of connector pins is independent of the
link width. The horizontal or vertical offset between pairs of links
or links and nodes is with respect to the link center.
The default is false
.
linkWidthUsed : "false";
public boolean longLinkCrossingReductionDuringIncremental
false
, the layout preserves the relative
order of the nodes and the links within the levels. If the argument
is true
, the layout preserves the level structure and
the relative order of the nodes, but reroutes the links in order to
avoid link crossings. This means a long link may cross a level
between a different pair of nodes than before layout.
It is disabled by default.
longLinkCrossingReductionDuringIncremental : "false";
public double maxInterLevelApertureAngle
This parameter only has an effect if none of the links has the orthogonal link style. It is best suited if the link style is for polyline links. It defines the maximum angle of the link segments that run between the levels of the hierarchical layout.
The maximum angle is given in degrees, it must be between 10 and 90 degrees.
If the flow direction of the layout is vertical, that is, to the bottom or to the top, a strictly vertical link segment has an aperture of 0, and a strictly horizontal link segment has aperture of 90. By limiting the maximum aperture angle, you ensure that the slope of segments between levels is more vertical than horizontal. That is to say, the slope of the link is in the flow direction of the layout. To ensure the slope of the segments, the vertical space between the levels is enlarged.
If the flow direction of the layout is horizontal, that is, to the left or to the right, a strictly vertical link segment has an aperture of 90, and a strictly horizontal link segment has an aperture of 0. By limiting the maximum aperture angle, you ensure that the slope of segments between levels is more horizontal than vertical. To ensure the slope of the segments, the horizontal space between the levels is enlarged.
If the maximum aperture is set to 90, the aperture angle has no influence on the space between levels. This is the default.
Very small maximum aperture angles are not recommended. The resulting layout may waste too much space between the node levels.
maxInterLevelApertureAngle : "3.0";
public boolean medianCrossingValueEnabled
This is an expert option. It is enabled by default. It is normally not necessary to change this value. However, if many nodes have very high numbers of incoming or outgoing links, the calculation of the "median" weight may slow down the layout. In this case, you can switch this option off.
medianCrossingValueEnabled : "false";
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 minEndSegmentLength
The default value is 0
.
minEndSegmentLength : "3.0";
public double minForkSegmentLength
The default value is 10
.
minForkSegmentLength : "3.0";
public double minStartSegmentLength
The default value is 0
.
minStartSegmentLength : "3.0";
public boolean multiLinkOptimizationEnabled
#setMultiLinkOptimizationOffset
.
The optimization is enabled by default.
multiLinkOptimizationEnabled : "false";
public double multiLinkOptimizationMaxSpread
The default value is 50
.
multiLinkOptimizationMaxSpread : "3.0";
multiLinkOptimizationEnabled
public double multiLinkOptimizationOffset
The default value is 10
.
multiLinkOptimizationOffset : "3.0";
multiLinkOptimizationEnabled
public boolean neighborLinksAligned
It is enabled by default.
If neighbor links are not aligned and have the orthogonal style, the spacing between the link segments may be slightly smaller than the specified offset between links. If the incremental node movement mode is fixed, it is not always possible to create aligned links between neighbor nodes, due to the fixed positions of the nodes.
neighborLinksAligned : "false";
public boolean nonorthogonalBendEliminationEnabled
This is an expert option. It is disabled by default. Enabling the bend elimination produces more straight links but also slows down the algorithm. In recursive mode, it might be useful to enable this option since the recursive mode produces many small link segments between bends.
nonorthogonalBendEliminationEnabled : "false";
public int NorthNumberOfPorts
NorthNumberOfPorts : "2";
public int numberOfLinkCrossingSweeps
This is an expert option. The default value is 5. It is normally not necessary to change this value.
numberOfLinkCrossingSweeps : "2";
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)
). The choice
can further be influenced by specifying the side and the port index
of the links. #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.
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.
Note that if the mode is fixed, specifications of the port index of links at the "from" side are ignored.
The default value is #FREE_MODE
.
OriginPointMode : "FREE_MODE";
Allowed values: | ||
FREE_MODE |
Free | |
FIXED_MODE |
Fixed |
globalOriginPointMode
public boolean orthogonalStairCaseEliminationEnabled
This is an expert option. It is enabled by default. It is normally not necessary to disable stair case elimination, except if you need to speed up the layout.
orthogonalStairCaseEliminationEnabled : "false";
public boolean polylineLinkOverlapReductionEnabled
If the graph has a huge number of links, it is recommended switching this optimization off, because it is very time-consuming.
The optimization is enabled by default.
polylineLinkOverlapReductionEnabled : "false";
public ilog.views.IlvPoint position
If a position is specified, the layout algorithm places the graph
such that the specified point is the upper-left corner. If no
position is specified, in incremental mode the layout algorithm
places the graph close to its previous position before layout
started, and in nonincremental mode it places the graph so that
(0, 0)
is the upper-left corner.
The default value is null
.
position : "10,10";
public double preferredForkAxisLength
Note this length is only a hint for the layout algorithm. If there is not enough free space, the layout algorithm decreases the length of the axis below the preferred length. If there is enough free space, it may also increase the length of the axis in order to reduce unnecessary link bends.
The default value is 10
.
preferredForkAxisLength : "3.0";
public boolean recursiveLayoutFromAncestorAllowed
This option is enabled by default.
recursiveLayoutFromAncestorAllowed : "false";
public boolean recursiveLayoutMode
In detail: the recursive mode causes the hierarchical layout
instances of the subgraphs to delegate the work to this layout. If
the layout instance of a subgraph is no
IlvHierarchicalLayout
, the subgraph is not handled by
this layout. Layout parameters per node and link must be set on the
layout instance of the subgraph the node or link belongs to.
recursiveLayoutMode : "false";
public int selfLinkFromPortSide
Possible values for the side
parameter are #EAST
, #WEST
, #NORTH
, #SOUTH
. The default
value is #SOUTH
.
selfLinkFromPortSide : "EAST";
Allowed values: |
EAST |
WEST |
NORTH |
SOUTH |
public boolean selfLinksSameSideNested
This is an expert option. It is enabled by default.
selfLinksSameSideNested : "false";
public int selfLinkToPortSide
Possible values for the side
parameter are #EAST
, #WEST
, #NORTH
, #SOUTH
. The default
value is #WEST
.
selfLinkToPortSide : "EAST";
Allowed values: |
EAST |
WEST |
NORTH |
SOUTH |
public int SouthNumberOfPorts
SouthNumberOfPorts : "2";
public int SpecNodeLevelIndex
0
to
n
. If the link flow direction is from top to bottom, the
nodes with level index 0
are placed in the topmost
level, and the nodes with higher level indexes are placed in the
levels below. If the link flow direction is from left to right, the
nodes with level index 0
are placed in the leftmost
level, and the nodes with higher level indexes are placed in the
levels farther to the right.
This method allows you to specify the level where a node should be placed. If the level index of a node is set to a negative value, it means that there is no preference for the level of the node. In this case, the layout algorithm calculates an appropriate level index.
The default level index of a node is -1
; that is, the
layout algorithm determines the appropriate level automatically.
Note that specified level indexes can cause conflicts to constraints
that are solved depending on the constraint priorities. The index
specification or some of the constraints may be ignored in this case.
Furthermore, note that if the generic connected component layout
mechanism of the IlvGraphLayout
base class is enabled,
each connected component uses its own level structure. If it is
disabled, there is only one global level structure.
SpecNodeLevelIndex : "2";
public int SpecNodePositionIndex
0
to n
. If the link flow
direction is from top to bottom, the node with position index
0
is placed leftmost within its level, and the nodes
with higher position indexes are placed farther to the right. If the
link flow direction is from right to left, the node with position
index 0
is placed topmost within its level, and the
nodes with higher position indexes are placed below.
This method allows you to specify the relative position where a node should be placed within its level. If the position index of a node is set to a negative value, it means that there is no preference for the position of the node. In this case, the layout algorithm calculates an appropriate position index. If the position index is higher than the number of nodes in the level, the position index is ignored. If two nodes of the same level have the same position index, one of the indexes is ignored. The layout algorithm calculates an appropriate position index for the nodes that have inappropriate or conflicting position indexes.
The default position index of a node is -1
; that is, the
layout algorithm determines the appropriate position automatically.
Note that specified position indexes can cause conflicts to
constraints that are solved depending on the constraint priorities.
The index specification or some of the constraints may be ignored in
this case. Furthermore, note that if the generic connected component
layout mechanism of the IlvGraphLayout
base class is
enabled, each connected component uses its own level structure. If it
is disabled, there is only one global level structure.
SpecNodePositionIndex : "2";
public boolean toFork
#CENTERED_PINS
, or if the links start at the same specified port
index at the north or south side of a node, or if the links have the
fixed origin point mode and are placed at exactly the same
coordinate.
The default value is false
.
toFork : "false";
public int ToPortIndex
Port numbers are between 0
and n - 1
, where
n
is the number of ports at the node side where the link
is connected. Links with an unspecified or negative port index are
connected on the node border according to the global connector style.
A link with specified port index i
is connected at the
ith relative port, and the connector pins of ports are evenly
spaced on the corresponding node border.
ToPortIndex : "2";
public int ToPortSide
Possible values for the side
parameter are #EAST
, #WEST
, #NORTH
, #SOUTH
, and the
default #UNSPECIFIED
.
If a port side is unspecified, the link can connect to any border side of the node. Otherwise, the link connects only to the specified node border.
ToPortSide : "EAST";
Allowed values: |
EAST |
WEST |
NORTH |
SOUTH |
UNSPECIFIED |
public double verticalLinkOffset
The default value is 15
.
verticalLinkOffset : "3.0";
public double verticalNodeLinkOffset
The default value is 20
.
verticalNodeLinkOffset : "3.0";
public double verticalNodeOffset
The default value is 40
.
verticalNodeOffset : "3.0";
public int WestNumberOfPorts
WestNumberOfPorts : "2";
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.