public class IlpHierarchicalLayoutParameters extends IlpGraphLayoutParameters
To customize per-object properties, the graph layout renderer must be enabled and configured to customize per-object properties.
IlvHierarchicalLayout
Constructor and Description |
---|
IlpHierarchicalLayoutParameters()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
apply(IlvGraphLayout layout,
IlpRepresentationObject ro,
IlvGraphic layoutProxy)
Applies the configuration that is stored in this bean into
the given layout for the given node.
|
int |
getDestinationPointMode()
Returns the mode for the connection point on an individual link
on the destination node.
|
int |
getEastNumberOfPorts()
Returns the number of relative ports on the east side of a node.
|
int |
getFromPortIndex()
Returns the port index of a link at the "from" side.
|
int |
getFromPortSide()
Returns the port side of a link at the "from" side.
|
int |
getIncrementalNodeMovementMode()
Sets the movement mode of an individual node used during incremental
layout.
|
float |
getLinkPriority()
Returns the priority of a link.
|
int |
getLinkStyle()
Returns the style of the shape of an individual link.
|
int |
getNorthNumberOfPorts()
Returns the number of relative ports on the north side of a node.
|
int |
getOriginPointMode()
Returns the mode for the connection point on an individual link
on the origin node.
|
int |
getSouthNumberOfPorts()
Returns the number of relative ports on the south side of a node.
|
int |
getSpecNodeLevelIndex()
Returns the index of the specified level for a node.
|
int |
getSpecNodePositionIndex()
Returns the index of the specified position of a node within a level.
|
int |
getToPortIndex()
Returns the port index of a link at the "to" side.
|
int |
getToPortSide()
Returns the port side of a link at the "to" side.
|
int |
getWestNumberOfPorts()
Returns the number of relative ports on the west side of a node.
|
boolean |
isMarkedForIncremental()
Marks the input node or link to be repositioned with the next call of
performLayout if incremental mode is enabled. |
void |
reset()
Resets the configuration in this bean.
|
void |
setDestinationPointMode(int mode)
Sets the mode for the connection point on an individual link
on the destination node.
|
void |
setEastNumberOfPorts(int numberOfPorts)
Sets the number of relative ports on the east side of a node.
|
void |
setFromPortIndex(int portIndex)
Sets the port index of a link at the "from" side.
|
void |
setFromPortSide(int side)
Sets the port side of a link at the "from" side.
|
void |
setIncrementalNodeMovementMode(int mode)
Sets the movement mode of an individual node used during incremental
layout.
|
void |
setLinkPriority(float priority)
Sets the priority of a link.
|
void |
setLinkStyle(int style)
Sets the style of the shape of an individual link.
|
void |
setMarkedForIncremental(boolean flag)
Marks the input node or link to be repositioned with the next call of
performLayout if incremental mode is enabled. |
void |
setNorthNumberOfPorts(int numberOfPorts)
Sets the number of relative ports on the north side of a node.
|
void |
setOriginPointMode(int mode)
Sets the mode for the connection point on an individual link
on the origin node.
|
void |
setSouthNumberOfPorts(int numberOfPorts)
Sets the number of relative ports on the south side of a node.
|
void |
setSpecNodeLevelIndex(int index)
Sets the index of the specified level for a node.
|
void |
setSpecNodePositionIndex(int index)
Sets the index of the specified position of a node within a level.
|
void |
setToPortIndex(int portIndex)
Sets the port index of a link at the "to" side.
|
void |
setToPortSide(int side)
Sets the port side of a link at the "to" side.
|
void |
setWestNumberOfPorts(int numberOfPorts)
Sets the number of relative ports on the west side of a node.
|
isFixed, isLayoutIgnored, setFixed, setLayoutIgnored
public IlpHierarchicalLayoutParameters()
public void reset()
reset
in class IlpGraphLayoutParameters
public boolean apply(IlvGraphLayout layout, IlpRepresentationObject ro, IlvGraphic layoutProxy)
apply
in class IlpGraphLayoutParameters
layout
- Graph Layoutro
- Object to which the configuration will be appliedlayoutProxy
- Layout graphic object for a node or linkpublic void setDestinationPointMode(int mode)
This mode is used only if the global "from" point mode is set to
IlvHierarchicalLayout.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:
IlvHierarchicalLayout.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(java.lang.Object, boolean)
).
The choice can further be
influenced by specifying the side and the port index of the links.
IlvHierarchicalLayout.FIXED_MODE
-
The layout must keep, for this link, the current position of the
connection point on the destination node.
Note that if the mode is fixed, specifications of the port index of links at the "to" side are ignored.
The default value is IlvHierarchicalLayout.FREE_MODE
.
mode
- The mode to set.IlvHierarchicalLayout.setDestinationPointMode(java.lang.Object, int)
,
getDestinationPointMode()
,
setToPortIndex(int)
public int getDestinationPointMode()
setDestinationPointMode(int)
public void setEastNumberOfPorts(int numberOfPorts)
numberOfPorts
- The number of relative ports.IlvHierarchicalLayout.setEastNumberOfPorts(java.lang.Object, int)
,
getEastNumberOfPorts()
public int getEastNumberOfPorts()
setEastNumberOfPorts(int)
public void setFromPortIndex(int portIndex)
This allows you to specify the relative ports of the links on the node border. Using relative ports is a way to specify the relative order of how the links connect to the "from" node. The specification is only used if the free origin point mode is used for the link.
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.
portIndex
- The relative port index starting from 0
.IlvHierarchicalLayout.setFromPortIndex(java.lang.Object, int)
,
getFromPortIndex()
,
setToPortIndex(int)
,
setFromPortSide(int)
,
setOriginPointMode(int)
public int getFromPortIndex()
setFromPortIndex(int)
public void setFromPortSide(int side)
Possible values for the side
parameter
are IlvHierarchicalLayout.EAST
,
IlvHierarchicalLayout.WEST
,
IlvHierarchicalLayout.NORTH
,
IlvHierarchicalLayout.SOUTH
, and
the default IlvHierarchicalLayout.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.
side
- The side of the node from which the link is connected.IlvHierarchicalLayout.setFromPortSide(java.lang.Object, int)
,
getFromPortSide()
,
setToPortSide(int)
,
setFromPortIndex(int)
public int getFromPortSide()
setFromPortSide(int)
public void setIncrementalNodeMovementMode(int mode)
This movement mode is used only if the incremental mode is enabled,
the global movement mode is set to 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
IlvHierarchicalLayout.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 IlvHierarchicalLayout.isCrossingReductionDuringIncremental()
).
However, you can decide whether to enable the crossing reduction of
long links (see IlvHierarchicalLayout.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 IlvGraphLayout
is enabled, it will move nodes even
if they are specified as fixed. Therefore it is recommended disabling
the generic connected component layout mechanism.
mode
- The movement mode to set.IlvHierarchicalLayout.setIncrementalNodeMovementMode(java.lang.Object, int)
,
getIncrementalNodeMovementMode()
public int getIncrementalNodeMovementMode()
setIncrementalNodeMovementMode(int)
public void setLinkPriority(float priority)
The layout algorithm tries to place the links in such a way that the majority of the links are short and point in the same direction. However, this is not always possible for all links. Low priority links are more likely to be longer or point in the opposite direction than the high priority links. The link priority should be smaller than 10000.
priority
- The link priority value, a number up to 10000.IlvHierarchicalLayout.setLinkPriority(java.lang.Object, float)
,
getLinkPriority()
public float getLinkPriority()
setLinkPriority(float)
public void setLinkStyle(int style)
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
.
style
- The shape style.IlvHierarchicalLayout.setLinkStyle(java.lang.Object, int)
,
getLinkStyle()
public int getLinkStyle()
setLinkStyle(int)
public void setNorthNumberOfPorts(int numberOfPorts)
numberOfPorts
- The number of relative ports.IlvHierarchicalLayout.setNorthNumberOfPorts(java.lang.Object, int)
,
getNorthNumberOfPorts()
public int getNorthNumberOfPorts()
setNorthNumberOfPorts(int)
public void setOriginPointMode(int mode)
This mode is used only if the global "from" point mode is set to
IlvHierarchicalLayout.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:
IlvHierarchicalLayout.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(java.lang.Object, boolean)
).
The choice can further be
influenced by specifying the side and the port index of the links.
IlvHierarchicalLayout.FIXED_MODE
-
The layout must keep, for this link, the current position of the
connection point on the origin node.
Note that if the mode is fixed, specifications of the port index of links at the "from" side are ignored.
The default value is IlvHierarchicalLayout.FREE_MODE
.
mode
- The mode to set.IlvHierarchicalLayout.setOriginPointMode(java.lang.Object, int)
,
getOriginPointMode()
public int getOriginPointMode()
setOriginPointMode(int)
public void setSouthNumberOfPorts(int numberOfPorts)
numberOfPorts
- The number of relative ports.IlvHierarchicalLayout.setSouthNumberOfPorts(java.lang.Object, int)
,
getSouthNumberOfPorts()
public int getSouthNumberOfPorts()
setSouthNumberOfPorts(int)
public void setSpecNodeLevelIndex(int index)
Nodes are organized in horizontal or vertical levels numbered from
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 indices 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 indices 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 indices 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 IlvGraphLayout
is enabled, each connected component uses
its own level structure. If it is disabled, there is only one global
level structure.
index
- The level index.IlvHierarchicalLayout.setSpecNodeLevelIndex(java.lang.Object, int)
public int getSpecNodeLevelIndex()
setSpecNodeLevelIndex(int)
public void setSpecNodePositionIndex(int index)
Nodes are organized in horizontal or vertical levels. Within each level,
the nodes are placed sequentially at relative positions numbered from
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 indices 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 indices 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 indices is ignored. The layout algorithm calculates an appropriate position index for the nodes that have inappropriate or conflicting position indices.
The default position index of a node is -1
; that is, the
layout algorithm determines the appropriate position automatically.
Note that specified position indices 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 IlvGraphLayout
is enabled, each connected component uses
its own level structure. If it is disabled, there is only one global
level structure.
index
- The position index within a level, starting from
0
.IlvHierarchicalLayout.setSpecNodePositionIndex(java.lang.Object, int)
public int getSpecNodePositionIndex()
setSpecNodePositionIndex(int)
public void setToPortIndex(int portIndex)
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.
portIndex
- The relative port index starting from 0
.IlvHierarchicalLayout.setToPortIndex(java.lang.Object, int)
,
getToPortIndex()
,
setFromPortIndex(int)
,
setToPortSide(int)
public int getToPortIndex()
setToPortIndex(int)
public void setToPortSide(int side)
Possible values for the side
parameter
are IlvHierarchicalLayout.EAST
,
IlvHierarchicalLayout.WEST
,
IlvHierarchicalLayout.NORTH
,
IlvHierarchicalLayout.SOUTH
, and
the default IlvHierarchicalLayout.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.
side
- The side of the node to which the link is connected.IlvHierarchicalLayout.setToPortSide(java.lang.Object, int)
,
getToPortSide()
,
setFromPortSide(int)
public int getToPortSide()
setToPortSide(int)
public void setWestNumberOfPorts(int numberOfPorts)
numberOfPorts
- The number of relative ports.IlvHierarchicalLayout.setWestNumberOfPorts(java.lang.Object, int)
,
getWestNumberOfPorts()
public int getWestNumberOfPorts()
setWestNumberOfPorts(int)
public void setMarkedForIncremental(boolean flag)
performLayout
if incremental mode is enabled.
Normally, the incremental layout tries to preserve the relative order
of nodes and links. By setting a mark on a node, the level assignment
and relative position of this node will be calculated from scratch.
By setting a mark on a link, this link will be rerouted completely
by the next layout. The mark is transient, that is, it is automatically
cleared after an incremental layout is done.flag
- Indicating if this node or link is marked for incremental modepublic boolean isMarkedForIncremental()
performLayout
if incremental mode is enabled.
Normally, the incremental layout tries to preserve the relative order
of nodes and links. By setting a mark on a node, the level assignment
and relative position of this node will be calculated from scratch.
By setting a mark on a link, this link will be rerouted completely
by the next layout. The mark is transient, that is, it is automatically
cleared after an incremental layout is done.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.