IBM ILOG Dojo Diagrammer 1.1 API Documentation
Legend: Array Boolean Constructor Date DomNode Error Function Namespace Number Object RegExp Singleton String

ibm_ilog.graphlayout.hierarchical.HierarchicalSideBySideConstraint

Object » ibm_ilog.graphlayout.hierarchical.HierarchicalConstraint » ibm_ilog.graphlayout.hierarchical.HierarchicalSideBySideConstraint
dojo.require("ibm_ilog.graphlayout.hierarchical.HierarchicalSideBySideConstraint");

The class SideBySideConstraint is a constraint that forces a group of nodes that belong to the same level to be placed side by side. It prohibits that other nodes of the same level are placed in the middle of the group. By this, the relative positions of the nodes of the group are close together. It does not affect the order of nodes that belong to different levels.

Nodes are organized in horizontal or vertical levels. Within each level, the nodes are placed sequentially at relative positions numbered from 0 to "n". The constraint specifies that those nodes of the group that belong to the same level are placed in subsequent positions within the level. The constraint is ignored, if all nodes of the group belong to different levels.

For instance, assume the group consists of nodes A, B, C, D, E. If A, B and C belong to one level and D and E to another level, then the side by side constraint forces the nodes A, B, C to be placed side by side, and D and E to be placed side by side. The constraint is satisfied if the positions of A, B, C are 5, 6, 7 and the positions of D and E are 1 and 2. The constraint affects only the nodes that belong to the same level, therefore the constraint affects the subgroup ( A, B, C ) and the subgroup ( D, E ) individually, not the entire group ( A, B, C, D, E ) as a unit. The constraint is not satisfied if the positions of A, B and C are 5, 7 and 8, because in this case, there must be a node between A and B that does not belong to the same group. The node between A and B cannot be D or E, because D and E belong to a different level.

The constraint is evaluated, if the incremental mode is disabled. If the incremental mode is enabled, the constraint is only evaluated if the nodes of the group are marked for incremental recalculation, because otherwise, the incremental positions of the nodes are dominant.

This kind of constraint dominates the relative position constraints. The constraints have priorities. If several conflicting constraints are specified (such as a node must be side by side to three different groups), the constraints with lower priority are ignored during layout. The constraint is dominated by specified position indexes, i.e. it does not change the order of nodes that have specified position indexes, and by swim lane constraints, that is, it is not able to break swim lanes apart.

The automatic conflict resolution can handle conflicting constraints. However, to speed up the layout, it is recommended to specify constraints in a way such that there are no conflicts.

In recursive layout mode (see HierarchicalLayout.setRecursiveLayoutMode()), all nodes of the group of a side by side constraint must belong to the same subgraph, and the constraint must be installed at the layout instance that is attached to this subgraph. It is not possible to have a side by side constraint containing a group of nodes of different subgraphs.

Property Summary

Method Summary

  • actAfterAdd(manager) Acts after the constraint was added to the constraint manager.
  • constructor(a0, a1)
  • copy() returns ibm_ilog.graphlayout.hierarchical.HierarchicalConstraint Copies the constraint.
  • getGroup() returns ibm_ilog.graphlayout.hierarchical.HierarchicalNodeGroup Returns the group of this constraint.
  • getPriority() returns Number Returns the priority of the constraint.
  • setPriority(priority) Sets the priority of the constraint.
  • 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.

Properties

Methods

actAfterAdd
Acts after the constraint was added to the constraint manager.
ParameterTypeDescription
manager
constructor
ParameterTypeDescription
a0
a1
copy
Returns ibm_ilog.graphlayout.hierarchical.HierarchicalConstraint

Copies the constraint.

getGroup
Returns ibm_ilog.graphlayout.hierarchical.HierarchicalNodeGroup
Returns the group of this constraint.
getPriority
Returns Number

Returns the priority of the constraint.

If there are conflicts between constraints, the constraint with the highest priority wins.

setPriority

Sets the priority of the constraint. If there are conflicts between constraints, the constraint with the highest priority wins.

ParameterTypeDescription
priority
validate
Returns <tt>true</tt> if the constraint is valid in the input graph model.
ParameterTypeDescription
model
validateForLayout

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.

ParameterTypeDescription
graph