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

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

The class LevelRangeConstraint is a constraint that forces the node to be placed at a level with index within the specified range.

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 level range constraint with minimum index 5 and maximum index 7 causes the node to be placed at level with index 5, 6, or 7. A level range with minimum index 6 and maximum index 6 causes the node to be placed exactly at level 6. This has the same effect as specifying the node level index 6 by HierarchicalLayout.setSpecNodeLevelIndex().

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

This kind of constraint is dominated by same level constraints and group spread constraints, that is, two nodes cannot have different level ranges while being forced to the same level. The constraint has higher priority than any relative level constraints.

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.

Note that empty levels are invisible after layout. For instance a node with level range constraint to be placed at level 2 may appear to be placed in the topmost level, if level 0 and 1 don't contain any other nodes.

In recursive layout mode (see HierarchicalLayout.setRecursiveLayoutMode()), all nodes of the group of a level 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 level spread 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, a2)
  • copy() returns ibm_ilog.graphlayout.hierarchical.HierarchicalConstraint Copies the constraint.
  • getMaxLevel() returns int Returns the maximum level index suitable for the subject of this constraint (that is, for the node or the group of nodes).
  • getMinLevel() returns int Returns the minimum level index suitable for the subject of this constraint (that is, for the node or the group of nodes).
  • getPriority() returns Number Returns the priority of the constraint.
  • getSubject() returns Object Returns the subject of this constraint.
  • setLevelRange(minLevel, maxLevel) Sets the level range suitable for the subject of this constraint (that is, for the node or the group of nodes).
  • setMaxLevel(maxLevel) Sets the maximum level index suitable for the subject of this constraint, that is, for the node or the group of nodes.
  • setMinLevel(minLevel) Sets the minimum level index suitable for the subject of this constraint, that is, for the node or the group of nodes.
  • 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
a2
copy
Returns ibm_ilog.graphlayout.hierarchical.HierarchicalConstraint

Copies the constraint.

getMaxLevel
Returns int

Returns the maximum level index suitable for the subject of this constraint (that is, for the node or the group of nodes).

getMinLevel
Returns int

Returns the minimum level index suitable for the subject of this constraint (that is, for the node or the group of nodes).

getPriority
Returns Number

Returns the priority of the constraint.

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

getSubject
Returns Object

Returns the subject of this constraint. This is either the constraint node, or the instance of HierarchicalNodeGroup that describes a group of nodes.

setLevelRange

Sets the level range suitable for the subject of this constraint (that is, for the node or the group of nodes). Examples:

constraint1.setLevelRange(5, 7);
constraint2.setLevelRange(5, HierarchicalLayout.UNSPECIFIED);
constraint3.setLevelRange(HierarchicalLayout.UNSPECIFIED, 7);
The first statement forces the node or node group to be level 5, 6, or 7. The second statement forces the node or node group to be in a level with index greater or equal to 5. The third statement forces the node or node group to be in a level with index smaller or equal to 7.

ParameterTypeDescription
minLevelintThe lower bound of the level range, or ' HierarchicalLayout.UNSPECIFIED' if no lower bound is needed.
maxLevelintThe upper bound of the level range, or ' HierarchicalLayout.UNSPECIFIED' if no upper bound is needed.
setMaxLevel

Sets the maximum level index suitable for the subject of this constraint, that is, for the node or the group of nodes.

ParameterTypeDescription
maxLevelintThe maximum level index suitable for the subject of this constraint.
setMinLevel

Sets the minimum level index suitable for the subject of this constraint, that is, for the node or the group of nodes.

ParameterTypeDescription
minLevelintThe minimum level index suitable for the subject 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
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