ibm_ilog.graphlayout.hierarchical.HierarchicalSwimLaneConstraint
The class SwimLaneConstraint
is a constraint that
forces a group of nodes to be placed in the same column or row.
Swim lanes are orthogonal to the levels. If the link flow direction
is towards bottom or top, the levels are horizontal rows and the swim
lanes are vertical columns. If the flow direction is towards left or
right, the levels are vertical columns and the swim lanes are
horizontal rows.
The nodes of the same swim lane are placed so that it is possible to draw a surrounding rectangle around them. Swim lanes allow to organize the graph in a table-like manner. For instance, you may have a workflow diagram where nodes represent actions, then the swim lanes could represent the departments that perform these actions. Each node can only belong to one swim lane.
A swim lane constraint is always evaluated, even if the incremental mode is enabled. The constraint has a higher priority than the relative position constraint and the side by side constraint. You can specify side by side constraints for a group of nodes that belong to the same swim lane, but side by side constraints of nodes of different swim lanes are ignored. You can specify relative position constraints between nodes of the same swim lane. You can also specify relative position constraints between one entire swimlane group and another swimlane group, which effectively orders the swimlanes. But relative position constraints are ignored if they would require to break the swimlanes apart. The swim lane constraint dominates the specified position indexes and the extremity constraints, i.e., if a swim lane constraint is used, you cannot specify position indexes or east/west extremity constraints for any node.
The automatic conflict resolution can handle conflicting constraints. However, to speedup the layout, it is recommended to specify constraints in a way such that there are no conflicts.
Swim lane constraints work in flat graphs. It is not possible to
spread a subgraph among multiple swim lanes. Swim lane constraints do
not work in recursive layout mode
HierarchicalLayout.setRecursiveLayoutMode()
.
Method Summary
- actAfterAdd(manager) Acts after the constraint was added to the constraint manager.
- constructor(a0, a1, a2, a3, a4)
- copy() returns ibm_ilog.graphlayout.hierarchical.HierarchicalConstraint Copies the constraint.
- getCalcBoundingBox() returns Rectangle Returns the calculated bounding box of the swim lane.
- getCalcPositionIndex() returns int Returns the calculated position index of the swim lane.
- getEastMinMargin() returns Number Returns the specified minimal margin of the swim lane at the east side.
- getGroup() returns ibm_ilog.graphlayout.hierarchical.HierarchicalNodeGroup Returns the group of this constraint.
- getMinMargin() returns Number Returns the specified minimal margin of the swim lane.
- getPriority() returns Number Returns the priority of the constraint.
- getRelativeSize() returns Number Returns the specified relative size of the swim lane.
- getSpecPositionIndex() returns int Returns the specified position index of the swim lane.
- getWestMinMargin() returns Number Returns the specified minimal margin of the swim lane at the west side.
- setEastMinMargin(margin) Sets the minimal margin of the swim lane at the east side.
- setMinMargin(margin) Sets the minimal margin of the swim lane.
- setPriority(priority) Sets the priority of the constraint.
- setRelativeSize(relativeSize) Sets the relative size of the swim lane.
- setSpecPositionIndex(positionIndex) Sets the specified position index of the swim lane.
- setWestMinMargin(margin) Sets the minimal margin of the swim lane at the west side.
- validate(model) Returns <tt>true</tt> if the constraint is valid in the input graph model.
- validateForLayout(graph) Sets the valid flag of the constraint during layout.
Methods
Parameter | Type | Description |
---|---|---|
manager |
Parameter | Type | Description |
---|---|---|
a0 | ||
a1 | ||
a2 | ||
a3 | ||
a4 |
Copies the constraint.
Returns the calculated bounding box of the swim lane. The bounding box is available after layout, and can be used to draw a surrounding rectangle for the swim lane. The coordinates of the rectangle are in manager or view coordinates, depending on the coordinate mode of the layout instance.
Returns the calculated position index of the swim lane.
This index is available after layout. The calculated position index
is the same as the specified position index unless -1
was specified.
Returns the priority of the constraint.
If there are conflicts between constraints, the constraint with the highest priority wins.
Sets the minimal margin of the swim lane at the east side. If the link flow direction is towards bottom, the swim lanes are columns in the layout and the margin is at the right side. If the link flow direction is towards top, the swim lanes are columns in the layout and the margin is at the left side. If the link flow direction is towards left, the swim lanes are rows in the layout and the margin is at the bottom side. If the link flow direction is towards right, the swim lanes are rows in the layout and the margin is at the top side.
The default margin is 0
.
Parameter | Type | Description |
---|---|---|
margin |
Sets the minimal margin of the swim lane. If the link flow direction is towards bottom or top, the swim lanes are columns in the layout and the margin is at the left and right side. If the flow direction is towards left or right, the swim lanes are rows in the layout and the margin is at the top and bottom side.
The default margin is 0
.
Parameter | Type | Description |
---|---|---|
margin |
Sets the priority of the constraint. If there are conflicts between constraints, the constraint with the highest priority wins.
Parameter | Type | Description |
---|---|---|
priority |
Sets the relative size of the swim lane. If the link flow direction is towards bottom or top, the swim lanes are columns in the layout and the relative size indicates the width of the column. If all swim lanes have the same relative size, the layout arranges the swim lanes so that they have the same width. If for instance a swim lane has relative size 3, then its width is three times larger than a swim lane with relative size 1. If you do not want to restrict the width of the columns, specify the relative size 0, which indicates that the layout calculate an appropriate width of the column that is independent from the width of the other columns.
If the flow direction is towards left or right, the swim lanes are rows in the layout and the relative size indicates the height of the row.
The relative size of a swim lane may be ignored in incremental mode
if the node movement mode is FIXED_MODE
.
Parameter | Type | Description |
---|---|---|
relativeSize |
Sets the specified position index of the swim lane.
Similar as nodes have position indexes, the swim lanes are placed
sequentially at relative positions numbered from 0
to
n
. In a top-down layout, the swim lane with position 0
is the leftmost swim lane, and the swim lanes with higher position
indexes are placed farther to the right. If the swim lanes has the
position index -1
, the layout algorithm determines the
appropriate position automatically.
Parameter | Type | Description |
---|---|---|
positionIndex |
Sets the minimal margin of the swim lane at the west side. If the link flow direction is towards bottom, the swim lanes are columns in the layout and the margin is at the left side. If the link flow direction is towards top, the swim lanes are columns in the layout and the margin is at the right side. If the link flow direction is towards left, the swim lanes are rows in the layout and the margin is at the top side. If the link flow direction is towards right, the swim lanes are rows in the layout and the margin is at the bottom side.
The default margin is 0
.
Parameter | Type | Description |
---|---|---|
margin |
Parameter | Type | Description |
---|---|---|
model |
Sets the valid flag of the constraint during layout.
The purpose is the same as validate, but this is used temporarily
during layout while HierarchicalConstraint.validate()
is used to remove invalid constraints completely.
Parameter | Type | Description |
---|---|---|
graph |