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.HierarchicalGroupSpreadConstraint (version 1.1-SNAPSHOT)

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

The class GroupSpreadConstraint is a constraint that forces a group of nodes to be placed no more than a specified number of levels apart.

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 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.

For instance, a constraint with spread size 2 forces the group to be placed such that the group node with smallest level index is no more than 2 levels apart from the group node with largest level index. All remaining nodes are placed in between. Assume that the group consists of the nodes A, B, and C. The group spread constraint is satisfied if the levels of A, B and C are 1, 2, 3. It is also satisfied if the levels of A, B and C are 10, 9, 8, or 10, 10, 12 or 10, 11, 11, or 10, 10, 10. But it is not satisfied if the levels of A, B and C are 10, 13, 12, because the highest node B is in this case more than 2 levels apart from the lowest node A.

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.

Among the constraints, this kind has the highest priority. If several conflicting constraints are specified (such as two nodes must be placed no more than 2 number of levels apart, but in level 1 and 10), the constraints with lower priority are ignored during layout.

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.

The group spread constraint has the same priority as the same level constraint, because both cannot be conflicting. In fact, there are two ways of forcing two nodes to the same level: use the same level constraint, or use a group spread constraint of a group of two nodes with spread size 0.

In recursive layout mode (see HierarchicalLayout.setRecursiveLayoutMode()), all nodes of a group spread 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 group spread constraint containing 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.
  • getSpreadSize() returns int Returns the spread size of this constraint.
  • setPriority(priority) Sets the priority of the constraint.
  • setSpreadSize(spreadSize) Sets the spread size of the group.
  • 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.

getSpreadSize
Returns int

Returns the spread size of this constraint.

setPriority

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

ParameterTypeDescription
priority
setSpreadSize

Sets the spread size of the group.

ParameterTypeDescription
spreadSizeintThe maximum number of levels two nodes of the group can be apart.
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