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

Object » ibm_ilog.graphlayout.GraphLayout » ibm_ilog.graphlayout.tree.TreeLayout
dojo.require("ibm_ilog.graphlayout.tree.TreeLayout");

The main class for the Tree Layout algorithm.

The Tree Layout algorithm places the nodes of a tree starting from the root of the tree to the leaves. If the graph has parts that are disconnected, it arranges each connected component as an individual tree. The Tree Layout algorithm is primarily designed for a forest of pure trees. In a tree, each node except the root has a parent node. All the nodes that have the same parent are called children with respect to the parent and siblings with respect to each other. The Tree Layout algorithm can also be used for non-trees (for example, cyclic graphs). In this case, the layout algorithm ignores those links that violate the tree structure and takes only the spanning tree of the graph into account.

The algorithm has several layout modes:

  • The nodes can be arranged freely in a horizontal or vertical way. This is suitable for a graph with a large variation of node sizes.
  • The nodes can be arranged in horizontal or vertical levels. This is suitable for a graph that contains nodes of approximately the same size.
  • The nodes can be arranged radially on concentric circles or on ellipses around the root of the tree.
  • The nodes can be arranged radially around parents like balloons.
To simplify the explanations of the layout parameters, we use the compass directions north, south, east, and west. The center of the root node of a tree is the north pole. If the root node is placed at the top border, north is always upwards, south towards the bottom, west towards the left, and east towards the right side of the layout. If the root node is placed at the left border, north is left and south is right. In radial mode, the root is placed in the center, and so the notation of north and south depends on where a node is placed relative to the root. The north side of any node is the side that is closer to the root and the south side is the side that is farther away from the root. In balloon mode, the compass directions make no sense.

Several alignment options are provided. In particular, the free layout mode allows the tip-over alignment, which means that subtrees are arranged serially rather than in parallel. If the subtrees starting at one node are normally arranged horizontally, the tip-over alignment arranges them vertically. The tree layout provides layout modes that automatically adapt the tip-over alignment to best fit the layout to a given aspect ratio.

The following sample drawings are produced by the Tree Layout algorithm. The left drawing uses the level layout mode. The flow direction of the links is towards the bottom, and the nodes are south-justified (that is, they are aligned to the bottom) within each level. The right drawing is the same tree in free layout mode (which always uses north level alignment):

Sample drawing produced with the Tree Layout

Here is another sample drawing in free layout mode with the tip-over alignment at some leaf nodes:

Sample drawing produced with the Tree Layout

The following are two sample drawings in the two radial layout modes. The normal radial mode in the left drawing places the nodes of the same level on a circle around the root node. The alternating radial mode in the right drawing places the nodes of the same level alternating on two circles around the root node. This results in better usage of the space.

Sample drawing produced with the Tree Layout

In nonradial layout modes, the Tree Layout algorithm supports different styles of links in the same drawing. The following sample drawing shows orthogonal and straight-line links. It also shows nodes that are aligned to the center (see the red nodes), to the east (green), and to the west (blue) of their children. The drawing was created by the free layout mode with the link flow direction to the right, and so north is to the left.

Sample drawing produced with the Tree Layout

The Tree Layout algorithm supports node neighboring in all modes. The following sample drawing shows a tree layout with the flow direction towards the top. Some nodes are not placed as children but rather as neighbors at the same level as the corresponding parent node. The red links, which are perpendicular to the flow direction, are between nodes that were specified as neighbored.

Sample drawing produced with the Tree Layout

See the corresponding chapter of the User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features and limitations, code samples, and so on.

Note the following points:

  • If no root node is specified, the layout algorithm takes the direction of links into account to calculate a root node. Other than that, the direction of links does not affect the layout.
  • The layout algorithm has an incremental mode that is designed to be stable when incremental changes are made. If nodes are added or removed after a layout, the next layout uses a heuristic to try to adjust the layout only minimally and to avoid major structural reorganization.
  • In incremental mode, the initial position of the nodes (at the moment you start the layout) affects the resulting layout because the algorithm tries to preserve the relative order of the children on incremental changes.

Property Summary

  • ALTERNATING_RADIAL Alternating radial layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', the root node is in the center and the links flow radially away from the center. The nodes are placed in circular layers around the root node. To optimize space, siblings may be placed alternating in several different circular layers. The alternating radial mode differs only from the radial mode if the alternating placement produces smaller circles.
  • AUTOMATIC_PINS Automatic connection point option. When used as the argument of the method ' TreeLayout.setConnectorStyle()', the connector style is automatically selected depending on the global link style.
  • BALLOON Balloon layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', the root node is in the center and the subtrees are arranged as balloon circles around the root. Each subtree froms its own balloon recursively.
  • BORDER_CENTER Border center alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are centered with respect to the border of their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
  • CENTER Center alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are centered with respect to their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'. When used in level layout mode as the argument of the method ' TreeLayout.setLevelAlignment()', the nodes of the same level are justified to their centers.
  • CENTERED_PINS Centered connection point option. When used as the argument of the method ' TreeLayout.setConnectorStyle()', the connection points of links are placed at the center of the border to which the link is attached.
  • CLIPPED_PINS Clipped connection point option. When used as the argument of the method ' TreeLayout.setConnectorStyle()', the connection points of links are placed such that the link pointing toward the node center is clipped at the node border.
  • EAST East alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are aligned to the east border of their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
  • EAST_NEIGHBOR East neighbor child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child passed as argument is made a neighbor at the east side of its parent node.
  • EVENLY_SPACED_PINS Evenly spaced connection point option. When used as the argument of the method method ' TreeLayout.setConnectorStyle()', the connection points of links are evenly spaced along the border to which the link is attached.
  • FAST_PROPORTIONAL Fast proportional angle spacing. When used as the argument of the method ' TreeLayout.setBalloonAngleSpacing()' in balloon layout mode, the available angle range at a node is proprionally split so that larger subtrees at the node can occupy larger angles. The algorithm uses a fast heuristic to calculate the angle ranges.
  • FREE Free layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. Parents and sibling nodes are aligned according to the specified alignment option, but nodes of different tree branches are not justified with each other,
  • LEVEL Level layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. All nodes are organized in levels and are justified to their borders or centered according to the level alignment option. Tip-over node alignment is not possible; all other alignment options are possible.
  • MIXED Mixed alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', each node can have a different alignment. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
  • MIXED_STYLE Mixed link shape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by ' TreeLayout.setLinkStyle()'.
  • NORTH North alignment option. When used in level layout mode as the argument of the method ' TreeLayout.setLevelAlignment()', the nodes of the same level are justified to the north side (towards the root).
  • NO_RESHAPE_STYLE No reshape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', none of the links are reshaped. To specify the shape of an individual link, use this option as the argument of the method ' TreeLayout.setLinkStyle()'.
  • OPTIMIZED_UNIFORM_LEAVES_RADIUS Optimized uniform balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radiuses of all leaves that are children of the same node are uniform. The radius of balloons that contain more than one node can still vary. An additional optimization heuristic reduces the radius. This has the advantage of smaller space requirements but looses symmetries in the diagram.
  • OPTIMIZED_VARIABLE_RADIUS Optimized variable balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radius of different child balloons at the same parent node can vary. An additional optimization heuristic reduces the radius. This has the advantage of smaller space requirements but looses symmetries in the diagram.
  • ORTHOGONAL_STYLE Orthogonal link shape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', all links that are part of the spanning tree get a shape consisting of a sequence of orthogonal line segments. To specify the shape of an individual link, use this option as the argument of the method ' TreeLayout.setLinkStyle()'.
  • PROPORTIONAL Slow proportional angle spacing. When used as the argument of the method ' TreeLayout.setBalloonAngleSpacing()' in balloon layout mode, the available angle range at a node is proprionally split so that larger subtrees at the node can occupy larger angles. The algorithm uses a slow heuristic to calculate the angle ranges, which is often more precise than the fast heuristic.
  • RADIAL Radial layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', the root node is in the center and the links flow radially away from the center. The nodes are placed in circular layers around the root node.
  • REGULAR Regular angle spacing. When used as the argument of the method ' TreeLayout.setBalloonAngleSpacing()' in balloon layout mode, the available angle range at a node is evenly split so that each subtrees at the node can occupy the same angle.
  • SOUTH South alignment option. When used in level layout mode as the argument of the method ' TreeLayout.setLevelAlignment()', the nodes of the same level are justified to the south side (away from the root).
  • STRAIGHT_LINE_STYLE Straight-line link shape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', all links that are part of the spanning tree get a straight-line shape. To specify the shape of an individual link, use this option as the argument of the method ' TreeLayout.setLinkStyle()'.
  • TIP_LEAVES_OVER Tip-over layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a heuristic that checks whether leaf nodes (and their immediate parent nodes) should be tipped over. It checks only the alignment mode ' TreeLayout.TIP_OVER_EAST', but not ' TreeLayout.TIP_OVER_BOTH_SIDES' or other variants.
  • TIP_OVER Tip-over alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', it behaves like ' TreeLayout.TIP_OVER_EAST'. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. In this layout mode, the algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a fast heuristic.
  • TIP_OVER_ASSOCIATE_BOTH_SIDES Associate child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child is laid out like an associate node of its parent node. Associate nodes occur alternating on the east or west side of its parent node.
  • TIP_OVER_ASSOCIATE_EAST Associate east child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child is laid out like an associate node of its parent node. This associate nodes occurs on the east side of its parent node.
  • TIP_OVER_ASSOCIATE_WEST Associate west child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child is laid out like an associate node of its parent node. This associate nodes occurs on the west side of its parent node.
  • TIP_OVER_BOTH_SIDES Tip-over to both sides alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the child nodes are arranged in pairs serially rather than in parallel. This style is very similar to the style ' TreeLayout.TIP_OVER_EAST_WEST', because both the east and west sides are used. However, the algorithm does not try to optimize the space used on both sides; instead it always puts the odd-numbered child nodes to the west and the even-numbered child nodes to the east. The pairs of child nodes, one on the east side and one on the west side, are aligned with one another. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'.
  • TIP_OVER_EAST Tip-over east alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the children are arranged serially rather than in parallel, on the east side of the parent node.. For instance, if the children are normally arranged horizontally below each parent node, the tip-over alignment arranges them vertically on the east side below the parent node. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'.
  • TIP_OVER_EAST_WEST Tip-over east and west alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the children are arranged serially rather than in parallel, alternating on the east and on the west side of the parent node. This is basically a combination of ' TreeLayout.TIP_OVER_EAST' and ' TreeLayout.TIP_OVER_WEST'. The first child is placed on the east side. Further children are placed on the east or west side, so that the space usage on both sides is roughly the same, i.e., the subtrees on the east side have roughly the same sum of height than the subtrees on the west side. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'. Since this alignment option decides between east and west side depending on subtree sizes, it is not well suited in incremental mode (see ' TreeLayout.setIncrementalMode()'), since little changes in the graph can cause big changes in the layout even if the incremental mode is switched on.
  • TIP_OVER_WEST Tip-over west alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the children are arranged serially rather than in parallel, on the west side of the parent node.. For instance, if the children are normally arranged horizontally below each parent node, the tip-over alignment arranges them vertically on the west side below the parent node. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'.
  • TIP_ROOTS_AND_LEAVES_OVER Tip-over layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a heuristic that checks whether root nodes and leaf nodes should be tipped over. It checks only the alignment mode ' TreeLayout.TIP_OVER_EAST', but not ' TreeLayout.TIP_OVER_BOTH_SIDES' or other variants.
  • TIP_ROOTS_OVER Tip-over layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a heuristic that checks whether root nodes (and their immediate children nodes) should be tipped over. It checks only the alignment mode ' TreeLayout.TIP_OVER_EAST', but not ' TreeLayout.TIP_OVER_BOTH_SIDES' or other variants.
  • UNIFORM_LEAVES_RADIUS Uniform balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radiuses of all leaves that are children of the same node are uniform. The radius of balloons that contain more than one node can still vary.
  • UNIFORM_RADIUS Uniform radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radiuses of all subtree balloons that are children of the same node are uniform.
  • UNSPECIFIED Unspecified child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child passed as argument uses the alignment of the parent node.
  • VARIABLE_RADIUS Variable balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radius of different child balloons at the same parent node can vary.
  • WEST West alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are aligned to the west border of their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
  • WEST_NEIGHBOR West neighbor child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child passed as argument is made a neighbor at the west side of its parent node.

Method Summary

  • addAssociate(parentNode, associateNode) Sets one node as associate of another node.
  • afterLayoutOfSubgraph(subgraph) Performs postprocessing operations after the layout of each subgraph or connected component.
  • attach(graphModel) Sets the graph model to be laid out.
  • beforeLayout() Performs preprocessing operations before the layout of the entire graph.
  • beforeLayoutOfSubgraph(subgraph) Performs preprocessing operations before the layout of each subgraph or connected component.
  • callLayoutStepPerformedIfNeeded() Calls 'onLayoutStepPerformed' when necessary.
  • cleanGraphModel(graphModel) Cleans a graph model.
  • cleanLink(graphModel, link) Cleans a link.
  • cleanNode(graphModel, node) Cleans a node.
  • connectAllLinksToCenter() Connects all links to the enter of their end nodes.
  • connectLinkToCenter(link, atFromSide, atToSide) Connects the link to the node center at both end nodes by using the link connection box interface.
  • constructor(source)
  • contentsChanged(event) Called when the structure or the geometry of the graph changes.
  • copy() returns ibm_ilog.graphlayout.GraphLayout Copies the layout instance.
  • copyParameters(source) Copies the parameters from a given layout instance.
  • createLayoutReport() returns ibm_ilog.graphlayout.GraphLayoutReport Returns a new instance of the layout report.
  • detach() Detaches the graph model from the layout instance.
  • getAlignment(node) returns int Returns the local alignment option of the node.
  • getAllowedTime() returns Number Returns the currently allowed time for the layout algorithm in milliseconds.
  • getAspectRatio() returns Number Returns the aspect ratio specified for the layout.
  • getAssociateOffset() returns Number Returns the minimum offset between associates and the orthogonal link segment starting at the parent.
  • getAssociateParent(node) returns Object Returns the parent node for which the input node is an associate.
  • getAssociates(parentNode) returns ibm_ilog.graphlayout.IIterator Returns all associate nodes of the input parent node.
  • getBalanceSplineCurveThreshold() returns Number Returns the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • getBalloonAngleSpacing() returns int Returns the current angle spacing for balloon layout mode.
  • getBalloonInnerChildrenAngle() returns int Returns the maximum angle for children of inner nodes in balloon mode.
  • getBalloonLeafChildrenAngle() returns int Returns the maximum angle for children of nodes that have only leaves as children in balloon mode.
  • getBalloonRadiusMode() returns int Returns the radius mode for balloon layout mode.
  • getBalloonRootChildrenAngle() returns int Returns the maximum angle for children of the root node in balloon mode.
  • getBalloonStartAngle() returns int Returns the start angle of the layout in balloon mode.
  • getBranchOffset() returns Number Returns the minimum offset between neighbor nodes that belong to different branches in the tree.
  • getCalcBackwardTreeLinks() returns ibm_ilog.graphlayout.IIterator Returns the backward links that were used in the reverse direction as part of the spanning tree during layout.
  • getCalcForwardTreeLinks() returns ibm_ilog.graphlayout.IIterator Returns the forward links that were used as part of the spanning tree during layout.
  • getCalcLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region parameter.
  • getCalcNonTreeLinks() returns ibm_ilog.graphlayout.IIterator Returns the links that were neither forward nor backward links in the spanning tree during layout.
  • getCalcRoots() returns ibm_ilog.graphlayout.IIterator Returns the nodes that were used as roots during layout.
  • getChildAlignment(node) returns int Returns the child alignment option of the node.
  • getConnectorStyle() returns int Returns the style of the connectors.
  • getEastNeighbor(node) returns Object Returns the specified east neighbor node of the input node, or 'null' if none was specified.
  • getEastSubtreeBlockMargin(node) returns Number Returns the margin on the east side of the subtree starting at the input node.
  • getFlowDirection() returns int Returns the current direction of the flow.
  • getGlobalAlignment() returns int Returns the global alignment option.
  • getGlobalLinkStyle() returns int Returns the global style of the shapes of links.
  • getGraphModel() returns ibm_ilog.graphlayout.AbstractGraphLayoutModel Returns the graph model to lay out if a graph model is attached.
  • getInstanceId() returns int A utility method that returns a unique integer value for each layout instance.
  • getLayout(subgraph) returns ibm_ilog.graphlayout.GraphLayout Returns the layout instance for a subgraph of the nested graph encapsulated by the graph model of this layout instance.
  • getLayoutMode() returns int Returns the current layout mode.
  • getLayoutOfConnectedComponents() returns ibm_ilog.graphlayout.GraphLayout Returns the layout instance that lays out the connected components of the graph.
  • getLayoutOfConnectedComponentsReport() returns ibm_ilog.graphlayout.GraphLayoutReport Returns the layout report containing information about the behavior of the connected components layout.
  • getLayoutRegion() Returns a copy of the rectangle that defines the layout region, as specified using the method ' ibm_ilog.graphlayout.GraphLayout.layoutRegion', or 'null' if no rectangle has been specified, or the specified rectangle was 'null'.
  • getLayoutRegionMode() Gets the layout region mode.
  • getLayoutReport() returns ibm_ilog.graphlayout.GraphLayoutReport Returns the layout report, that is, the object that contains information about the behavior of the layout algorithm.
  • getLayouts(preOrder) returns ibm_ilog.graphlayout.IIterator Returns the instances of 'GraphLayout' for the nested graph encapsulated by the graph model of this layout instance.
  • getLevelAlignment() returns int Returns the current alignment within the levels.
  • getLinkConnectionBoxInterface() returns ibm_ilog.graphlayout.ILinkConnectionBoxProvider Returns the link connection box interface used to calculate the connection points of links during layout.
  • getLinkStyle(link) returns int Returns the style of the shape of an individual link.
  • getMaxChildrenAngle() returns int Returns the maximum angle for children that are placed in radial mode.
  • getMaxSplineCurveSize() returns Number Returns the maximum curve size used when spline control point optimization routing is enabled.
  • getMinBusyTime() returns Number Returns the minimal time that the layout algorithm can be busy between two calls of ' ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed()' when the method ' ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded()' is used.
  • getMinSplineCurveSize() returns Number Returns the minimum curve size used when optimized spline control points routing is enabled.
  • getNodeComparator() returns Function Returns the comparator used for sorting the nodes.
  • getNorthSubtreeBlockMargin(node) returns Number Returns the margin on the north side of the subtree starting at the input node.
  • getNumberOfAlternatingCircles() returns int Returns the number of alternating circles.
  • getObjectParameter(graphModel, nodeOrLink, key) returns Object Returns the value of a parameter of the layout instance.
  • getOrthForkPercentage() returns Number Returns the percentage of the parent-child offset that determines the location where the orthogonal link routing places the bends in order to fork the routing towards the children.
  • getOverlapPercentage() returns Number Returns the percentage for which a node is considered smaller in the flow direction.
  • getParameter(key) returns Object Returns the value of a parameter of the layout instance.
  • getParentChildAssociateOffset() returns Number Returns the minimum offset between the parent and the first associate.
  • getParentChildOffset() returns Number Returns the minimum offset between a parent and its children.
  • getParentLayout() returns ibm_ilog.graphlayout.GraphLayout Returns the parent layout.
  • getPosition() returns Point Returns the specified position of the layout.
  • getRecursiveLayout() returns ibm_ilog.graphlayout.RecursiveLayout Returns the instance of Recursive Layout that is used to perform this layout recursively when you call ' ibm_ilog.graphlayout.GraphLayout.performLayout()' with the traverse flag set to 'true'.
  • getRemainingAllowedTime() returns Number Returns the remaining allowed time.
  • getRootPreference(node) returns int Returns the specified preference of the node to become root node.
  • getSeedValueForRandomGenerator() returns Number Returns the user-defined seed value for the random generator.
  • getSiblingOffset() returns Number Returns the minimum offset between siblings.
  • getSouthSubtreeBlockMargin(node) returns Number Returns the margin on the south side of the subtree starting at the input node.
  • getSpecLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region, as specified using the method ' ibm_ilog.graphlayout.GraphLayout.layoutRegion'.
  • getSpecRoots() returns ibm_ilog.graphlayout.IIterator Returns the nodes that were specified as root.
  • getSplineLinkFilter() returns ibm_ilog.graphlayout.SplineLinkFilter Returns the filter that detects which links are suitable for optimized spline routing.
  • getSubtreeBlockMargin(node, side) returns Number Returns the margin on the specified side of the subtree starting at the input node.
  • getTipOverBranchOffset() returns Number Returns the minimum offset in the flow direction between neighbor nodes that belong to different branches in the tree.
  • getViewMatrix() Returns the matrix that is applied to the first view attached to this layout.
  • getWestNeighbor(node) returns Object Returns the specified west neighbor node of the input node, or 'null' if none was specified.
  • getWestSubtreeBlockMargin(node) returns Number Returns the margin on the west side of the subtree starting at the input node.
  • increasePercentageComplete(newPercentage) Increases the percentage of completion that is stored in the layout report to the input value.
  • init() Initializes instance variables.
  • initPropertiesNames()
  • isAllLevelsAlternating() returns Boolean Returns 'true' if at all levels, nodes are forced into alternating circular layers.
  • isCalcRoot(node) returns Boolean Returns 'true' if the input node was used as root during layout.
  • isCategorizingLinks() returns Boolean Returns 'true' if the layout algorithm stores the categorization of links into forward, backward, and non-tree links.
  • isCategorizingLinksWithoutLayout() returns Boolean Returns 'true' if the layout algorithm does not really perform a full layout.
  • isFirstCircleEvenlySpacing() returns Boolean Returns 'true' if the nodes on the first circle must be evenly spaced in radial mode.
  • isFitToViewEnabled() returns Boolean Returns 'true' if the graph drawing must fit (exactly or approximately) an area of a specific view.
  • isFixed(nodeOrLink) returns Boolean Returns whether the node or link is specified as fixed.
  • isGeometryUpToDate() returns Boolean Returns whether the geometry of the graph is up to date.
  • isIncrementalMode() returns Boolean Returns 'true' if the incremental mode is enabled.
  • isInputCheckEnabled() returns Boolean Returns 'true' if the checks for the nodes and/or links are enabled.
  • isIntergraphConnectivityMode() returns Boolean Returns 'true' if the intergraph link connectivity is considered for the partitioning of the layout into subtrees.
  • isInvisibleRootUsed() returns Boolean Returns 'true' if an invisible root is used to combine components that are disconnected from each other.
  • isLayoutNeeded() returns Boolean Verifies that it is necessary to perform the layout.
  • isLayoutOfConnectedComponentsEnabled() returns Boolean Indicates whether the connected component layout mechanism is enabled.
  • isLayoutOfConnectedComponentsEnabledByDefault() returns Boolean Returns 'true' if the connected components layout mechanism is enabled by default.
  • isLayoutRunning(checkParents) returns Boolean Indicates whether this layout algorithm is running or not.
  • isLayoutTimeElapsed() returns Boolean Returns 'true' if, at the moment the method is called, the allowed layout time is exceeded; returns 'false' otherwise.
  • isLinkClipping() Gets whether links should be clipped at the shape of the end nodes.
  • isLocalRecursiveLayoutNeeded(layoutProvider, recLayout, rootModel, traverse) returns Boolean Checks whether layout is needed when layout is performed recursively on a hierarchy of nested subgraphs.
  • isNonTreeLinksStraight() returns Boolean Returns 'true' if all non-tree links that don't have the no-reshape link style and that are not fixed and are not incident to fixed nodes are reshaped to be straight.
  • isParametersUpToDate() returns Boolean Returns whether the layout parameters are up to date.
  • isPreserveFixedLinks() returns Boolean Returns 'true' if the layout is not allowed to reshape the links indicated as fixed by the user.
  • isPreserveFixedNodes() returns Boolean Returns 'true' if the layout is not allowed to move the nodes indicated as fixed by the user.
  • isRespectNodeSizes() returns Boolean Returns 'true' if the algorithm tries to respect the size of the nodes, and 'false' otherwise.
  • isRootPosition() returns Boolean Returns 'true' if the specified position means the position of the root node.
  • isSpecRoot(node) returns Boolean Returns 'true' if the input node was specified as root.
  • isSplineRoutingEnabled() returns Boolean Tests whether the calculation of optimized spline control points is enabled.
  • isStoppedImmediately() returns Boolean Returns 'true' if the method ' ibm_ilog.graphlayout.GraphLayout.stopImmediately()' was called.
  • isStructureUpToDate() returns Boolean Returns whether the structure of the graph is up to date.
  • isUseSeedValueForRandomGenerator() returns Boolean Returns 'true' if the user-defined seed value is used for the random generator and 'false' otherwise.
  • layout() Computes the layout using the Tree Layout algorithm.
  • performLayout(force, traverse) returns int Starts the layout algorithm using the currently attached graph model and the current settings for the layout parameters.
  • performSublayout(subgraph, layout, force) Starts the input layout algorithm.
  • removeAllAssociates(parentNode) Removes all the associate nodes from the input parent node.
  • removeAssociate(parentNode, associateNode) Removes the associate node from its parent node.
  • setAlignment(node, alignment) Sets the alignment option of an individual node.
  • setAllLevelsAlternating(enable) Sets whether at all levels, nodes are forced into alternating circular layers.
  • setAllowedTime(time) Sets the upper limit for the duration of the layout algorithm.
  • setAspectRatio(aspectRatio) Sets the aspect ratio for the layout.
  • setAssociateOffset(offset) Sets the minimum offset between associates and the orthogonal link segment starting at the parent.
  • setBalanceSplineCurveThreshold(threshold) Sets the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • setBalloonAngleSpacing(angleSpacing) Sets the current angle spacing for balloon layout mode.
  • setBalloonInnerChildrenAngle(angle) Sets the maximum angle for children of inner nodes in balloon mode.
  • setBalloonLeafChildrenAngle(angle) Sets the maximum angle for children of nodes that have only leaves as children in balloon mode.
  • setBalloonRadiusMode(radiusMode) Sets the current radius mode for balloon layout mode.
  • setBalloonRootChildrenAngle(angle) Sets the maximum angle for children of the root node in balloon mode.
  • setBalloonStartAngle(angle) Sets the start angle of the layout in balloon mode.
  • setBranchOffset(offset) Sets the minimum offset between neighbor nodes that belong to different branches in the tree.
  • setCategorizingLinks(flag) Sets whether the layout algorithm stores the categorization of links into forward, backward, and non-tree links.
  • setCategorizingLinksWithoutLayout(flag) Sets whether the layout algorithm does not really perform a full layout.
  • setChildAlignment(node, alignment) Sets the child alignment option of the node.
  • setConnectorStyle(style) Sets the style of the connectors.
  • setEastSubtreeBlockMargin(node, margin) Sets the margin on the east side of the subtree starting at the input node.
  • setEastWestNeighboring(eastNode, westNode) Creates an east-west neighboring of two nodes.
  • setFirstCircleEvenlySpacing(enable) Sets whether the nodes on the first circle must be evenly spaced in radial mode.
  • setFixed(nodeOrLink, fixed) Sets the specified node or link as fixed.
  • setFlowDirection(direction) Sets the direction of the flow.
  • setGeometryUpToDate(uptodate) Sets whether the geometry of the graph is up to date.
  • setGlobalAlignment(alignment) Sets the global alignment option.
  • setGlobalLinkStyle(style) Sets the global style of the shapes of links.
  • setGraphModel(graphModel) Sets the graph model to be laid out.
  • setIncrementalMode(enable) Sets the incremental mode.
  • setInputCheckEnabled(enable) Sets whether the checks for the nodes and/or links provided as arguments for the different methods of the layout algorithms are enabled.
  • setIntergraphConnectivityMode(flag) Sets whether the intergraph link connectivity is considered for the partitioning of the layout into subtrees.
  • setInvisibleRootUsed(flag) Sets whether an invisible root is used to combine components that are disconnected from each other.
  • setLayoutMode(mode) Sets the layout mode.
  • setLayoutOfConnectedComponents(layout) Sets the layout instance that lays out the connected components of the graph.
  • setLayoutOfConnectedComponentsEnabled(enable) Sets whether the generic connected component layout mechanism is enabled.
  • setLayoutRegion(rect) Sets the layout region as a rectangle 'rect'), with the dimensions of the rectangle being given in container (graph model) coordinates.
  • setLayoutRegionMode(value) Sets the layout region mode.
  • setLayoutReport(report) Sets the layout report, that is, the object that contains information about the behavior of the layout algorithm.
  • setLayoutRunning(running, fromParents) Sets whether layout is running.
  • setLevelAlignment(alignment) Sets the alignment within the levels.
  • setLinkClipping(value) Sets whether links should be clipped at the shape of the end nodes.
  • setLinkConnectionBoxInterface(linkConnectionBoxInterface) Sets the link connection box interface for the connection points of links.
  • setLinkStyle(link, style) Sets the style of the shape of an individual link.
  • setMaxChildrenAngle(angle) Sets the maximum angle for children that are placed in radial mode.
  • setMaxSplineCurveSize(size) Sets the maximum curve size used when optimized spline control point routing is enabled.
  • setMinBusyTime(time) Sets the minimal time that the layout algorithm can be busy.
  • setMinSplineCurveSize(size) Sets the minimum curve size used when optimized spline control point routing is enabled.
  • setNodeComparator(comparator) Sets the comparator used for sorting the nodes.
  • setNonTreeLinksStraight(enable) Sets whether all non-tree links that don't have the no-reshape link style and that are not fixed and are not incident to fixed nodes are reshaped to be straight.
  • setNorthSubtreeBlockMargin(node, margin) Sets the margin on the north side of the subtree starting at the input node.
  • setNumberOfAlternatingCircles(numCircles) Sets the number of alternating circles.
  • setObjectParameter(graphModel, nodeOrLink, key, value) returns Object Sets the value of a parameter for a node or a link, using a given graph model.
  • setOrthForkPercentage(percentage) Sets the percentage of the parent-child offset that determines the location where the orthogonal link routing places the bends in order to fork the routing towards the children.
  • setOverlapPercentage(percentage) Sets the percentage for which a node is considered smaller in the flow direction.
  • setParameter(key, value) returns Object Sets the value of a property for the layout instance.
  • setParametersUpToDate(uptodate) Sets whether the parameters of the graph layout are up to date.
  • setParentChildAssociateOffset(offset) Sets the minimum offset between the parent and the first associate.
  • setParentChildOffset(offset) Sets the minimum offset between a parent and its children.
  • setParentLayout(parent) Sets the parent layout of this layout instance.
  • setPosition(point, isRootPosition) Sets the position of the layout.
  • setPreserveFixedLinks(option) Sets whether the layout avoids movement of fixed links.
  • setPreserveFixedNodes(option) Sets whether the layout avoids movement of fixed nodes.
  • setRespectNodeSizes(respect) Sets whether the algorithm must try to respect the size of the nodes.
  • setRoot(node) Allows you to specify the root(s) of the tree.
  • setRootPosition(isRootPosition) Sets the meaning of the specified position.
  • setRootPreference(node, preference) Specifies the preference of the node to become root node.
  • setSeedValueForRandomGenerator(seed) Sets the seed value for the random generator.
  • setSiblingOffset(offset) Sets the minimum offset between siblings, that is, between nodes that have the same parent in the tree structure.
  • setSouthSubtreeBlockMargin(node, margin) Sets the margin on the south side of the subtree starting at the input node.
  • setSplineLinkFilter(filter) Sets the filter that detects which links are suitable for optimized spline routing.
  • setSplineRoutingEnabled(flag) Sets whether the calculation of optimized spline control points is enabled.
  • setStructureUpToDate(uptodate) Sets whether the structure of the graph is up to date.
  • setSubtreeBlockMargin(node, side, margin) Sets the margin on the specified side of the subtree starting at the input node.
  • setTipOverBranchOffset(offset) Sets the minimum offset in the flow direction between neighbor nodes that belong to different branches in the tree.
  • setUseSeedValueForRandomGenerator(option) Sets whether the user-defined seed value should be used for the random generator.
  • setWestEastNeighboring(westNode, eastNode) Creates an east-west neighboring of two nodes.
  • setWestSubtreeBlockMargin(node, margin) Sets the margin on the west side of the subtree starting at the input node.
  • stopImmediately() returns Boolean Stops the running layout algorithm as soon as possible.
  • supportsAllowedTime() returns Boolean Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded.
  • supportsLayoutOfConnectedComponents() returns Boolean Indicates that this layout class can use the generic connected component layout mechanism of the 'GraphLayout' base class.
  • supportsLayoutRegion() returns Boolean Indicates whether the layout class can control the position and/or size of the graph drawing according to a user-defined region (a rectangle) or a user-defined area of a manager view.
  • supportsLinkConnectionBox() returns Boolean Indicates that this layout class can use a link connection box interface to calculate the end points of links.
  • supportsPercentageComplete() returns Boolean Indicates that this layout class can estimate the percentage of completion during the run of the layout.
  • supportsPreserveFixedLinks() returns Boolean Indicates that this layout class allows the user to specify fixed links.
  • supportsPreserveFixedNodes() returns Boolean Indicates that this layout class allows the user to specify fixed nodes.
  • supportsRandomGenerator() returns Boolean Indicates whether the layout class uses randomly generated numbers (or randomly chosen parameters) for which it can accept a user-defined seed value.
  • supportsSplineRouting() returns Boolean Tests if this class supports the generic optimization of spline control points.
  • supportsStopImmediately() returns Boolean Indicates that this layout class can interrupt the current run of the layout immediately in a controlled way.
  • toString() returns String Returns a printable string representing this layout instance.
  • unfixAllLinks() Removes the fixed attribute from all links in the graph model.
  • unfixAllNodes() Removes the fixed attribute from all nodes in the graph model.

Event Summary

Attached Objects

Properties

ALTERNATING_RADIAL
Alternating radial layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', the root node is in the center and the links flow radially away from the center. The nodes are placed in circular layers around the root node. To optimize space, siblings may be placed alternating in several different circular layers. The alternating radial mode differs only from the radial mode if the alternating placement produces smaller circles.
AUTOMATIC_PINS
Automatic connection point option. When used as the argument of the method ' TreeLayout.setConnectorStyle()', the connector style is automatically selected depending on the global link style.
BALLOON
Balloon layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', the root node is in the center and the subtrees are arranged as balloon circles around the root. Each subtree froms its own balloon recursively.
BORDER_CENTER
Border center alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are centered with respect to the border of their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
CENTER
Center alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are centered with respect to their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'. When used in level layout mode as the argument of the method ' TreeLayout.setLevelAlignment()', the nodes of the same level are justified to their centers.
CENTERED_PINS
Centered connection point option. When used as the argument of the method ' TreeLayout.setConnectorStyle()', the connection points of links are placed at the center of the border to which the link is attached.
CLIPPED_PINS
Clipped connection point option. When used as the argument of the method ' TreeLayout.setConnectorStyle()', the connection points of links are placed such that the link pointing toward the node center is clipped at the node border.
EAST
East alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are aligned to the east border of their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
EAST_NEIGHBOR
East neighbor child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child passed as argument is made a neighbor at the east side of its parent node.
EVENLY_SPACED_PINS
Evenly spaced connection point option. When used as the argument of the method method ' TreeLayout.setConnectorStyle()', the connection points of links are evenly spaced along the border to which the link is attached.
FAST_PROPORTIONAL
Fast proportional angle spacing. When used as the argument of the method ' TreeLayout.setBalloonAngleSpacing()' in balloon layout mode, the available angle range at a node is proprionally split so that larger subtrees at the node can occupy larger angles. The algorithm uses a fast heuristic to calculate the angle ranges.
FREE
Free layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. Parents and sibling nodes are aligned according to the specified alignment option, but nodes of different tree branches are not justified with each other,
LEVEL
Level layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. All nodes are organized in levels and are justified to their borders or centered according to the level alignment option. Tip-over node alignment is not possible; all other alignment options are possible.
MIXED
Mixed alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', each node can have a different alignment. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
MIXED_STYLE
Mixed link shape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by ' TreeLayout.setLinkStyle()'.
NORTH
North alignment option. When used in level layout mode as the argument of the method ' TreeLayout.setLevelAlignment()', the nodes of the same level are justified to the north side (towards the root).
NO_RESHAPE_STYLE
No reshape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', none of the links are reshaped. To specify the shape of an individual link, use this option as the argument of the method ' TreeLayout.setLinkStyle()'.
OPTIMIZED_UNIFORM_LEAVES_RADIUS
Optimized uniform balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radiuses of all leaves that are children of the same node are uniform. The radius of balloons that contain more than one node can still vary. An additional optimization heuristic reduces the radius. This has the advantage of smaller space requirements but looses symmetries in the diagram.
OPTIMIZED_VARIABLE_RADIUS
Optimized variable balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radius of different child balloons at the same parent node can vary. An additional optimization heuristic reduces the radius. This has the advantage of smaller space requirements but looses symmetries in the diagram.
ORTHOGONAL_STYLE
Orthogonal link shape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', all links that are part of the spanning tree get a shape consisting of a sequence of orthogonal line segments. To specify the shape of an individual link, use this option as the argument of the method ' TreeLayout.setLinkStyle()'.
PROPORTIONAL
Slow proportional angle spacing. When used as the argument of the method ' TreeLayout.setBalloonAngleSpacing()' in balloon layout mode, the available angle range at a node is proprionally split so that larger subtrees at the node can occupy larger angles. The algorithm uses a slow heuristic to calculate the angle ranges, which is often more precise than the fast heuristic.
RADIAL
Radial layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', the root node is in the center and the links flow radially away from the center. The nodes are placed in circular layers around the root node.
REGULAR
Regular angle spacing. When used as the argument of the method ' TreeLayout.setBalloonAngleSpacing()' in balloon layout mode, the available angle range at a node is evenly split so that each subtrees at the node can occupy the same angle.
SOUTH
South alignment option. When used in level layout mode as the argument of the method ' TreeLayout.setLevelAlignment()', the nodes of the same level are justified to the south side (away from the root).
STRAIGHT_LINE_STYLE
Straight-line link shape option. When used as the argument of the method ' TreeLayout.setGlobalLinkStyle()', all links that are part of the spanning tree get a straight-line shape. To specify the shape of an individual link, use this option as the argument of the method ' TreeLayout.setLinkStyle()'.
TIP_LEAVES_OVER
Tip-over layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a heuristic that checks whether leaf nodes (and their immediate parent nodes) should be tipped over. It checks only the alignment mode ' TreeLayout.TIP_OVER_EAST', but not ' TreeLayout.TIP_OVER_BOTH_SIDES' or other variants.
TIP_OVER
Tip-over alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', it behaves like ' TreeLayout.TIP_OVER_EAST'. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. In this layout mode, the algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a fast heuristic.
TIP_OVER_ASSOCIATE_BOTH_SIDES
Associate child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child is laid out like an associate node of its parent node. Associate nodes occur alternating on the east or west side of its parent node.
TIP_OVER_ASSOCIATE_EAST
Associate east child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child is laid out like an associate node of its parent node. This associate nodes occurs on the east side of its parent node.
TIP_OVER_ASSOCIATE_WEST
Associate west child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child is laid out like an associate node of its parent node. This associate nodes occurs on the west side of its parent node.
TIP_OVER_BOTH_SIDES
Tip-over to both sides alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the child nodes are arranged in pairs serially rather than in parallel. This style is very similar to the style ' TreeLayout.TIP_OVER_EAST_WEST', because both the east and west sides are used. However, the algorithm does not try to optimize the space used on both sides; instead it always puts the odd-numbered child nodes to the west and the even-numbered child nodes to the east. The pairs of child nodes, one on the east side and one on the west side, are aligned with one another. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'.
TIP_OVER_EAST
Tip-over east alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the children are arranged serially rather than in parallel, on the east side of the parent node.. For instance, if the children are normally arranged horizontally below each parent node, the tip-over alignment arranges them vertically on the east side below the parent node. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'.
TIP_OVER_EAST_WEST
Tip-over east and west alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the children are arranged serially rather than in parallel, alternating on the east and on the west side of the parent node. This is basically a combination of ' TreeLayout.TIP_OVER_EAST' and ' TreeLayout.TIP_OVER_WEST'. The first child is placed on the east side. Further children are placed on the east or west side, so that the space usage on both sides is roughly the same, i.e., the subtrees on the east side have roughly the same sum of height than the subtrees on the west side. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'. Since this alignment option decides between east and west side depending on subtree sizes, it is not well suited in incremental mode (see ' TreeLayout.setIncrementalMode()'), since little changes in the graph can cause big changes in the layout even if the incremental mode is switched on.
TIP_OVER_WEST
Tip-over west alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', the children are arranged serially rather than in parallel, on the west side of the parent node.. For instance, if the children are normally arranged horizontally below each parent node, the tip-over alignment arranges them vertically on the west side below the parent node. The alignment of an individual parent node can be set by ' TreeLayout.setAlignment()'.
TIP_ROOTS_AND_LEAVES_OVER
Tip-over layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a heuristic that checks whether root nodes and leaf nodes should be tipped over. It checks only the alignment mode ' TreeLayout.TIP_OVER_EAST', but not ' TreeLayout.TIP_OVER_BOTH_SIDES' or other variants.
TIP_ROOTS_OVER
Tip-over layout mode. When used as the argument of the method ' TreeLayout.setLayoutMode()', all links flow roughly in the flow direction. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio by calculating which individual nodes need tip-over alignment and which nodes can use the specified alignment. The layout algorithm uses a heuristic that checks whether root nodes (and their immediate children nodes) should be tipped over. It checks only the alignment mode ' TreeLayout.TIP_OVER_EAST', but not ' TreeLayout.TIP_OVER_BOTH_SIDES' or other variants.
UNIFORM_LEAVES_RADIUS
Uniform balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radiuses of all leaves that are children of the same node are uniform. The radius of balloons that contain more than one node can still vary.
UNIFORM_RADIUS
Uniform radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radiuses of all subtree balloons that are children of the same node are uniform.
UNSPECIFIED
Unspecified child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child passed as argument uses the alignment of the parent node.
VARIABLE_RADIUS
Variable balloon radius mode. When used as the argument of the method ' TreeLayout.setBalloonRadiusMode()' in balloon layout mode, the radius of different child balloons at the same parent node can vary.
WEST
West alignment option. When used as the argument of the method ' TreeLayout.setGlobalAlignment()', all parent nodes are aligned to the west border of their children. The alignment of an individual node can be set by ' TreeLayout.setAlignment()'.
WEST_NEIGHBOR
West neighbor child alignment option. When used as the argument of the method ' TreeLayout.setChildAlignment()', the child passed as argument is made a neighbor at the west side of its parent node.

Methods

addAssociate

Sets one node as associate of another node. Associate nodes are placed as children of the parent node below the parent node. They are arranged in a tip over style. Different to all other children, the alignment of the associates does not obey the alignment option of the parent node. By default, associates are aligned in style TreeLayout.TIP_OVER_ASSOCIATE_BOTH_SIDES. It is further possible to specify the child alignment TreeLayout.TIP_OVER_ASSOCIATE_EAST and TreeLayout.TIP_OVER_ASSOCIATE_WEST for associate nodes.

Associates can be laid out in free and level mode, but not in radial mode.

Associate nodes are possible even though there is no link between the associate node and its parent node. The layout algorithm considers both nodes as if they were conceptually connected by a link.

For instance, in free layout mode and with the flow direction towards the bottom, the first associate is placed to the left below the parent, the second associate at approximately the same y coordinate to the right below the parent, the third associate to the left below the first one, the forth to the right below the second one and so on. A link between parent and its associate node is always routed orthogonally.

A parent can have many associate nodes, but each associate node can only have one parent.

ParameterTypeDescription
parentNodeObjectThe parent node of the 'associateNode'.
associateNodeObjectThe associate node of the 'parentNode'.
afterLayoutOfSubgraph

Performs postprocessing operations after the layout of each subgraph or connected component.

The default implementation does nothing. Subclasses can override this method to perform some cleanup operations when appropriate.

ParameterTypeDescription
subgraphibm_ilog.graphlayout.AbstractGraphLayoutModelSubgraph or connected component where layout has just been performed.
attach

Sets the graph model to be laid out.

You must attach the graph model before performing the layout, that is, before calling the method ibm_ilog.graphlayout.GraphLayout.performLayout(), and before specifying layout parameters for specific nodes or links.

This method first calls ibm_ilog.graphlayout.GraphLayout.detach() if a graph model is already attached. After attaching the model, the method onAttached is called, passing this layout instance as argument. The method does nothing if the graph model is already attached.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to lay out.
beforeLayout

Performs preprocessing operations before the layout of the entire graph. This is called in each layout run once per graph.

The default implementation calls IGraphLayoutModel.beforeLayout(GraphLayout). Subclasses can override this method to perform some initialization operations when appropriate.

beforeLayoutOfSubgraph

Performs preprocessing operations before the layout of each subgraph or connected component. This method is called in each layout run once for each connected component.

The default implementation does nothing. Subclasses can override this method to perform some initialization operations when appropriate.

ParameterTypeDescription
subgraphibm_ilog.graphlayout.AbstractGraphLayoutModelSubgraph where layout is about to be performed.
callLayoutStepPerformedIfNeeded

Calls onLayoutStepPerformed when necessary.

This method is provided for convenience in the implementation of layout algorithms. It calls ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed() when the last call finished earlier than the minimal busy time before this call. It avoids calling ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed() when the layout time has elapsed or when the layout is notified to stop immediately, if the algorithm supports these features.

This mechanism is used by some algorithms to avoid the overhead of ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed() becoming too high if it is called too often. Internal routines of layout algorithms can use this method often without worrying that too many layout events are raised.

Layout algorithms call ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed() directly instead of using this method when it is necessary to report a specific state (for example, when the layout report sets the code GraphLayoutReport.LAYOUT_STARTED or GraphLayoutReport.LAYOUT_FINISHED).

cleanGraphModel

Cleans a graph model. This method removes any data that has been stored by the layout algorithm on a graph model.

Subclasses can override this method to remove additional information stored in the graph model.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to be cleaned.
cleanLink

Cleans a link. This method removes any data that has been stored by the layout algorithm on a link. In addition to the cleaning operations in the base class, Tree Layout removes the link style settings from the nodes.

Subclasses can override this method to remove additional information stored in the links.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to which 'link' belongs.
linkObjectThe link to be cleaned.
cleanNode

Cleans a node. This method removes any data that has been stored by the layout algorithm on a node. In addition to the cleaning operations in the base class, Tree Layout removes the root node preference and the alignment and east/west attachment settings from the nodes.

Subclasses can override this method to remove additional information stored in the nodes.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to which 'node' belongs.
nodeObjectThe node to be cleaned.
connectAllLinksToCenter

Connects all links to the enter of their end nodes. This method is provided for convenience in the implementation of layout algorithms. The method can be called by a layout algorithm to connect links to node centers after the end nodes are placed at their final positions and the link has its final shape.

If a link connection box is set, it uses the virtual center of the connection box instead of the center of the bounding boxes of the end nodes. The virtual center is defined as the center of the connection box shifted by the average of the tangential "top" and "bottom" offset in the horizontal direction and by the average of the tangential "left" and "right" offset in the vertical direction. For instance, if the tangential offset is 20 at the top side and 10 at all other sides, the average shift offset is (20 + 10)/2 = 15 in the horizontal direction and (10 + 10)/2 = 10 in the vertical direction; hence the virtual center is at connectionBox.center() + (15, 10).

redraw: Boolean Whether the links need to be redrawn.

connectLinkToCenter

Connects the link to the node center at both end nodes by using the link connection box interface. This method is provided for convenience in the implementation of layout algorithms. The method can be called by a layout algorithm to connect links to node centers after the end nodes are placed at their final positions and the link has its final shape.

If a link connection box is set, it uses the virtual center of the connection box instead of the center of the bounding boxes of the end nodes. The virtual center is defined as the center of the connection box shifted by the average of the tangential "top" and "bottom" offset in the horizontal direction and by the average of the tangential "left" and "right" offset in the vertical direction. For instance, if the tangential offset is 20 at the top side and 10 at all other sides, the average shift offset is (20 + 10)/2 = 15 in the horizontal direction and (10 + 10)/2 = 10 in the vertical direction; hence the virtual center is at connectionBox.center() + (15, 10).

ParameterTypeDescription
linkObjectThe link to be connected.
atFromSideBoolean'true' if the link should be connected at its source node.
atToSideBoolean'true' if the link should be connected at its target node. redraw: Boolean Whether the link needs to be redrawn.
constructor
ParameterTypeDescription
source
contentsChanged

Called when the structure or the geometry of the graph changes.

If the type of the event is GraphLayoutModelEvent.STRUCTURE_CHANGED, the method ibm_ilog.graphlayout.GraphLayout.setStructureUpToDate() is called with a false argument. Or, if the type of the event is GraphLayoutModelEvent.GEOMETRY_CHANGED, the method ibm_ilog.graphlayout.GraphLayout.setGeometryUpToDate() is called with a false argument.

The method then calls ibm_ilog.graphlayout.GraphLayout.cleanNode() if the type of the event is GraphLayoutModelEvent.NODE_REMOVED or ibm_ilog.graphlayout.GraphLayout.cleanLink() if the type of the event is GraphLayoutModelEvent.LINK_REMOVED. The node or link that is passed to the method called is obtained using GraphLayoutModelEvent.getNodeOrLink().

ParameterTypeDescription
eventibm_ilog.graphlayout.GraphLayoutModelEventThe event indicating the change that has occurred in the graph model.
copy
Returns ibm_ilog.graphlayout.GraphLayout: A copy of the layout instance.

Copies the layout instance.

This method copies the layout instance by calling the copy constructor.

When performing a recursive layout of a nested graph, this method is used by ibm_ilog.graphlayout.ILayoutProvider to "clone" the layout instance of a parent graph. Note that the parameters which are specific to a node or a link are not copied. Only the global parameters are copied. The layout position is not copied.

copyParameters

Copies the parameters from a given layout instance.

Note that the parameters which are specific to a node or a link are not copied. Only the global parameters are copied. The layout position is not copied.

ParameterTypeDescription
sourceibm_ilog.graphlayout.GraphLayoutThe layout instance from which the parameters are copied.
createLayoutReport
Returns ibm_ilog.graphlayout.GraphLayoutReport: A new instance of the layout report.

Returns a new instance of the layout report. The default implementation returns a new instance of GraphLayoutReport.

You can overwrite this method in order to create subclasses of GraphLayoutReport.

This method is called by ibm_ilog.graphlayout.GraphLayout.performLayout(). The returned object is stored internally in the layout instance and will be returned by the method ibm_ilog.graphlayout.GraphLayout.performLayout().

Use this method to obtain information about the behavior of the layout algorithm if the information is added to the layout report in the implementation of the ibm_ilog.graphlayout.GraphLayout.layout() method, where it can be obtained using ibm_ilog.graphlayout.GraphLayout.getLayoutReport().

While the ibm_ilog.graphlayout.GraphLayout.layout() method is running, you can also obtain the layout report outside this method using the layout event listener mechanism .

detach

Detaches the graph model from the layout instance. When you attach a new graph model to the layout instance, you do not need to detach the old graph model because this is done automatically when you call ibm_ilog.graphlayout.GraphLayout.attach(). The detach method performs cleaning operations on the graph model. In addition to the cleaning operations in the base class, the Tree Layout removes the alignment, root preference, and node neighboring specifications of individual nodes, and the link style specifications of individual links.

Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.

getAlignment
Returns int: The local alignment of the given node.

Returns the local alignment option of the node.

ParameterTypeDescription
nodeObjectThe node instance.
getAllowedTime
Returns Number

Returns the currently allowed time for the layout algorithm in milliseconds.

Note that the method performLayout does NOT automatically stop the layout when the allowed time is exceeded. It is entirely the responsibility of the implementation of the method ibm_ilog.graphlayout.GraphLayout.layout() to do this.

getAspectRatio
Returns Number

Returns the aspect ratio specified for the layout. This is the ratio width / height of the desired layout region.

getAssociateOffset
Returns Number

Returns the minimum offset between associates and the orthogonal link segment starting at the parent. This offset is used if a parent has associate nodes.

getAssociateParent
Returns Object: The parent node for which the given node is an associate or 'null' if the node was never added as an associate of a parent.

Returns the parent node for which the input node is an associate. Returns null if the node was never added as an associate of a parent.

ParameterTypeDescription
nodeObjectThe node instance.
getAssociates
Returns ibm_ilog.graphlayout.IIterator: All associate nodes of the given parent node.

Returns all associate nodes of the input parent node. The returned nodes have the input node as associate parent. It returns only the associate nodes specified by TreeLayout.addAssociate(), but not the associate nodes that were only specified by TreeLayout.setChildAlignment().

ParameterTypeDescription
parentNodeObjectThe node instance.
getBalanceSplineCurveThreshold
Returns Number: The threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
Returns the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
getBalloonAngleSpacing
Returns int

Returns the current angle spacing for balloon layout mode.

getBalloonInnerChildrenAngle
Returns int

Returns the maximum angle for children of inner nodes in balloon mode.

getBalloonLeafChildrenAngle
Returns int

Returns the maximum angle for children of nodes that have only leaves as children in balloon mode. Basically, it is the maximum angle for the leaf balloons.

getBalloonRadiusMode
Returns int

Returns the radius mode for balloon layout mode.

getBalloonRootChildrenAngle
Returns int

Returns the maximum angle for children of the root node in balloon mode.

getBalloonStartAngle
Returns int

Returns the start angle of the layout in balloon mode.

getBranchOffset
Returns Number

Returns the minimum offset between neighbor nodes that belong to different branches in the tree. This is the offset between neighbor nodes that are not siblings. The offset is in the opposite direction of the link flow.

getCalcBackwardTreeLinks
Returns ibm_ilog.graphlayout.IIterator: The backward links that were used in the reverse direction as part of the spanning tree during layout.

Returns the backward links that were used in the reverse direction as part of the spanning tree during layout. This method can be called after layout if the link categorization option was set to true before the layout by using the method TreeLayout.setCategorizingLinks().

The backward tree links have the property that the "to" node is the parent of the "from" node in the tree layout. These links are reshaped by the layout algorithm.

If the graph was not a tree, some links will not be part of the spanning tree that forms the base structure for the layout. These links are not part of this enumeration. Also, links that do not need to be reversed but form the spanning tree are not part of this enumeration.

Depending on whether recursive leaf mode is set, the enumeration may contain intergraph links:

  • If recursive leaf mode is switched off, only normal links are categorized. Intergraph links are not categorized as backward tree links, even if TreeLayout.setIntergraphConnectivityMode() is set to true.
  • If recursive leaf mode is switched on, intergraph links that were reshaped by the tree layout are categorized as forward or backward links.

getCalcForwardTreeLinks
Returns ibm_ilog.graphlayout.IIterator: The forward links that were used as part of the spanning tree during layout.

Returns the forward links that were used as part of the spanning tree during layout. This can be called after layout if the link categorization option was set to true before layout by using the method TreeLayout.setCategorizingLinks().

The forward tree links have the property that the "from" node is the parent of the "to" node in the tree layout. These links are reshaped by the layout algorithm.

If the graph was not a tree, some links will not be part of the spanning tree that forms the base structure for the layout. If the graph was not a directed tree, some links need to be reversed to form the spanning tree. These links are not part of this enumeration.

Depending on whether recursive leaf mode is set, the enumeration may or may not contain intergraph links:

  • If recursive leaf mode is switched off, only normal links are categorized. Intergraph links are not categorized as forward tree links, even if TreeLayout.setIntergraphConnectivityMode() is set to true.
  • If recursive leaf mode is switched on, intergraph links that were reshaped by the tree layout are categorized as forward or backward links.

getCalcLayoutRegion
Returns Rectangle: A copy of the rectangle that defines the layout region parameter.

Returns a copy of the rectangle that defines the layout region parameter.

This method first tries to use the layout region specification by calling ibm_ilog.graphlayout.GraphLayout.getSpecLayoutRegion(). If this method returns a non-null rectangle, the rectangle is returned. Otherwise, the method tries to estimate an appropriate layout region according to the number and size of the nodes in the attached graph. If no graph is attached or the attached graph is empty, this method returns a default rectangle (0, 0, 1000, 1000).

getCalcNonTreeLinks
Returns ibm_ilog.graphlayout.IIterator: The links that were neither forward nor backward links in the spanning tree during layout.

Returns the links that were neither forward nor backward links in the spanning tree during layout. This can be called after the layout if the link categorization option was set to true before the layout by using the method TreeLayout.setCategorizingLinks().

The non-tree links have the property that neither the "from" node is the parent of the "to" node nor the "to" node is the parent of the "from" node in the tree layout. These links are not reshaped by the layout algorithm.

If the graph was not a tree, some links will not be part of the spanning tree that forms the base structure for the layout. Only these links are part of this enumeration. If necessary, they can be treated by a link routing layout algorithm after the tree layout (for example, by ibm_ilog.graphlayout.link.LinkLayout ).

Note that links that are removed by a layout filter, and links that are specified as fixed links or that are adjacent to fixed nodes, are not part of this enumeration even though they are also not part of the spanning tree.

Depending on the recursive leaf mode, it may contain intergraph links. If the recursive leaf mode is switched off, only only normal links are categorized. Intergraph links are not categorized as non-tree links, even if TreeLayout.setIntergraphConnectivityMode() is set to true. However if the recursive leaf mode is switched on, intergraph links that could not get reshaped by the tree layout are categorized as non-tree links.

getCalcRoots
Returns ibm_ilog.graphlayout.IIterator: The nodes that were used as roots during layout.

Returns the nodes that were used as roots during layout.

This method can be called after layout. If more than one connected component exists, each component has a root. If no root was specified, the layout algorithm automatically selects an appropriate node. If too many roots were specified, some specified roots will not become calculated roots during layout.

getChildAlignment
Returns int: The child alignment of the input node.

Returns the child alignment option of the node.

ParameterTypeDescription
nodeObjectThe node instance.
getConnectorStyle
Returns int

Returns the style of the connectors.

getEastNeighbor
Returns Object: The specified east neighbor node of the given node.

Returns the specified east neighbor node of the input node, or null if none was specified. It returns only the neighbor node if it was specified by TreeLayout.setEastWestNeighboring() or TreeLayout.setWestEastNeighboring(), but not if the neighbor node was only specified by TreeLayout.setChildAlignment().

ParameterTypeDescription
nodeObjectThe node object.
getEastSubtreeBlockMargin
Returns Number: The margin on the east side of the subtree starting at the input node.

Returns the margin on the east side of the subtree starting at the input node.

ParameterTypeDescription
nodeObjectThe node instance.
getFlowDirection
Returns int

Returns the current direction of the flow.

getGlobalAlignment
Returns int

Returns the global alignment option.

getGlobalLinkStyle
Returns int

Returns the global style of the shapes of links.

getGraphModel
Returns ibm_ilog.graphlayout.AbstractGraphLayoutModel: The graph model to lay out if one is attached.

Returns the graph model to lay out if a graph model is attached. Otherwise, the method returns null.

During the layout of a disconnected graph by a layout class that supports the connected components layout mechanism (see ibm_ilog.graphlayout.GraphLayout.supportsLayoutOfConnectedComponents()) and for which this mechanism is enabled (see ibm_ilog.graphlayout.GraphLayout.isLayoutOfConnectedComponentsEnabled()), the method ibm_ilog.graphlayout.GraphLayout.getGraphModel() may return a different graph model from the one originally attached using the method ibm_ilog.graphlayout.GraphLayout.attach(). For details, see the method ibm_ilog.graphlayout.GraphLayout.performLayout().

getInstanceId
Returns int: A unique integer value for each layout instance.

A utility method that returns a unique integer value for each layout instance. Use this method to obtain names for properties that are unique for each layout instance.

getLayout
Returns ibm_ilog.graphlayout.GraphLayout: The layout instance.

Returns the layout instance for a subgraph of the nested graph encapsulated by the graph model of this layout instance. The returned layout instance is a clone of this layout instance.

This method is equivalent to getRecursiveLayout().getLayout(subgraph). This is an expert feature, available when the graph layout is laying out a model that is not displayed in a Graph or Diagram.

ParameterTypeDescription
subgraphObjectThe subgraph object. This must not be the root graph.
getLayoutMode
Returns int

Returns the current layout mode.

getLayoutOfConnectedComponents
Returns ibm_ilog.graphlayout.GraphLayout

Returns the layout instance that lays out the connected components of the graph.

The method returns null if the layout instance does not support the layout of connected components. that is, if the method ibm_ilog.graphlayout.GraphLayout.supportsLayoutOfConnectedComponents() returns false.

Otherwise, if a layout instance has been specified using the method ibm_ilog.graphlayout.GraphLayout.setLayoutOfConnectedComponents(), this instance is returned. If no layout instance has been specified using the method ibm_ilog.graphlayout.GraphLayout.setLayoutOfConnectedComponents(), the method returns an instance of ibm_ilog.graphlayout.grid.GridLayout. Its layout region parameter is set by default to the rectangle (0, 0, 800, 800). The layout mode parameter is set to ibm_ilog.graphlayout.grid.GridLayout.TILE_TO_ROWS. Note that the layout instance returned by this method cannot be used independently as long as it is set as a connected component layout.

getLayoutOfConnectedComponentsReport
Returns ibm_ilog.graphlayout.GraphLayoutReport: The layout report containing information about the behavior of the connected components layout.

Returns the layout report containing information about the behavior of the connected components layout.

This method returns the instance of the layout report created by the connected components layout instance.

If the last run of the layout did not use the connected components layout (because either the graph was connected, or the layout does not support this feature, or this feature was disabled, or an exception occurred during the layout process), the method returns null.

getLayoutRegion

Returns a copy of the rectangle that defines the layout region, as specified using the method ibm_ilog.graphlayout.GraphLayout.layoutRegion, or null if no rectangle has been specified, or the specified rectangle was null.

getLayoutRegionMode
Gets the layout region mode.
getLayoutReport
Returns ibm_ilog.graphlayout.GraphLayoutReport: The layout report that contains information about the behavior of the layout algorithm.

Returns the layout report, that is, the object that contains information about the behavior of the layout algorithm.

If this method is called after the method ibm_ilog.graphlayout.GraphLayout.performLayout() was called for the first time on this layout instance, it returns the instance of the layout report created by ibm_ilog.graphlayout.GraphLayout.createLayoutReport(). Otherwise, it returns null.

getLayouts
Returns ibm_ilog.graphlayout.IIterator: This layout instance and recursively the layout instances for all subgraphs that are clones of this layout instance.

Returns the instances of GraphLayout for the nested graph encapsulated by the graph model of this layout instance.

This method returns this layout instance and recursively the layout instances for all subgraphs that are clones of this layout instance. The order of the enumeration can be preorder (that is, the layout of the parent graph comes before the layout of the subgraphs) or postorder (that is, the layout of the subgraphs comes before the layout of the parent graph).

This method is equivalent to getRecursiveLayout().getLayouts(preOrder). This is an expert feature, available when the graph layout is laying out a model that is not displayed in a Graph or Diagram.

ParameterTypeDescription
preOrderBooleanIf 'true', the layout instances are returned in preorder, otherwise in postorder.
getLevelAlignment
Returns int

Returns the current alignment within the levels.

getLinkConnectionBoxInterface
Returns ibm_ilog.graphlayout.ILinkConnectionBoxProvider

Returns the link connection box interface used to calculate the connection points of links during layout.

Returns null if none is specified.

getLinkStyle
Returns int: The style of the link shape.

Returns the style of the shape of an individual link.

ParameterTypeDescription
linkObjectThe individual link.
getMaxChildrenAngle
Returns int

Returns the maximum angle for children that are placed in radial mode.

getMaxSplineCurveSize
Returns Number: The maximum curve size used when spline control point optimization routing is enabled.
Returns the maximum curve size used when spline control point optimization routing is enabled.
getMinBusyTime
Returns Number
Returns the minimal time that the layout algorithm can be busy between two calls of ' ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed()' when the method ' ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded()' is used.
getMinSplineCurveSize
Returns Number: The minimum curve size used when optimized spline control points routing is enabled.
Returns the minimum curve size used when optimized spline control points routing is enabled.
getNodeComparator
Returns Function

Returns the comparator used for sorting the nodes.

getNorthSubtreeBlockMargin
Returns Number: The margin on the north side of the subtree starting at the input node.

Returns the margin on the north side of the subtree starting at the input node.

ParameterTypeDescription
nodeObjectThe node instance.
getNumberOfAlternatingCircles
Returns int

Returns the number of alternating circles. This option has only an effect in layout mode TreeLayout.ALTERNATING_RADIAL.

getObjectParameter
Returns Object: The value of the parameter.

Returns the value of a parameter of the layout instance. This method returns null if the does not exist.

The method does not check that the specified node or link belongs to the specified graphModel. Also, the specified graph model does not need to be the graph model currently attached to this layout instance.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model used for storing the parameter.
nodeOrLinkObjectThe node or link for which the parameter is to be retrieved.
keyStringThe key string for the parameter.
getOrthForkPercentage
Returns Number

Returns the percentage of the parent-child offset that determines the location where the orthogonal link routing places the bends in order to fork the routing towards the children.

getOverlapPercentage
Returns Number

Returns the percentage for which a node is considered smaller in the flow direction.

getParameter
Returns Object: The value stored for 'key'.

Returns the value of a parameter of the layout instance. The method returns null if the parameter does not exist.

ParameterTypeDescription
keyStringThe key string for the parameter.
getParentChildAssociateOffset
Returns Number

Returns the minimum offset between the parent and the first associate. This offset is used if a parent has associate nodes.

getParentChildOffset
Returns Number

Returns the minimum offset between a parent and its children.

getParentLayout
Returns ibm_ilog.graphlayout.GraphLayout

Returns the parent layout. If a layout instance A creates or uses another layout instance B to accomplish a part of or the total layout work, the layout instance A is called the "parent" of the layout instance B. The parent layout instance is responsible for declaring itself as a parent of B by calling the method ibm_ilog.graphlayout.GraphLayout.setParentLayout() on it. The layout instance B is called a sublayout of A.

Sublayouts never have their own local layout listeners. Layout events have parent layouts as the source.

The method returns null if the layout instance has no parent.

getPosition
Returns Point: The specified position of the layout.

Returns the specified position of the layout. This can be used if connected component processing is disabled, or if the graph is fully connected. It has no effect otherwise.

getRecursiveLayout
Returns ibm_ilog.graphlayout.RecursiveLayout: The recursive layout instance responsible for performing the layout when traversing the graph hierarchy.

Returns the instance of Recursive Layout that is used to perform this layout recursively when you call ibm_ilog.graphlayout.GraphLayout.performLayout() with the traverse flag set to true. The returned instance of Recursive Layout uses this layout as a reference layout, and it is attached to the same graph model as this graph model. You should call this method only when a graph model is attached. You should not detach the returned layout nor attach it to any other graph model.

The returned instance always uses the reference layout mode (see ibm_ilog.graphlayout.RecursiveLayout.getLayoutMode()). This is an expert feature, available when the graph layout is laying out a model that is not displayed in a Graph or Diagram.

getRemainingAllowedTime
Returns Number: A negative number is returned if one of the following conditions is met:
  • The allowed time has elapsed.
  • The layout does not support the allowed time.
  • This method is called when the layout report is not yet available.
  • This method is called when the layout report is no longer available.

Returns the remaining allowed time. The remaining allowed time is the difference between the allowed time given by ibm_ilog.graphlayout.GraphLayout.getAllowedTime(), and the time elapsed since the beginning of layout execution.

getRootPreference
Returns int: The specified preference of the node to become a root.

Returns the specified preference of the node to become root node. The higher the preference, the more likely the node will be selected as root node. If no preference is specified for the node, it returns -1.

ParameterTypeDescription
nodeObjectThe node instance.
getSeedValueForRandomGenerator
Returns Number

Returns the user-defined seed value for the random generator.

An Error is thrown if the layout does not support this mechanism.

getSiblingOffset
Returns Number

Returns the minimum offset between siblings.

getSouthSubtreeBlockMargin
Returns Number: The margin on the south side of the subtree starting at the input node.

Returns the margin on the south side of the subtree starting at the input node.

ParameterTypeDescription
nodeObjectThe node instance.
getSpecLayoutRegion
Returns Rectangle: Returns a copy of the rectangle that defines the layout region.

Returns a copy of the rectangle that defines the layout region, as specified using the method ibm_ilog.graphlayout.GraphLayout.layoutRegion.

The implementation of the method ibm_ilog.graphlayout.GraphLayout.layout() in subclasses of GraphLayout is solely responsible for whether the rectangle returned by this method is taken into account when calculating the layout, and in which manner. The method returns null in the following cases:

  • The layout region mechanism is not supported (that is, ibm_ilog.graphlayout.GraphLayout.supportsLayoutRegion() returns false).
  • You do not call setLayoutRegion and no graph model is attached to the layout

Note that, except when specified using ibm_ilog.graphlayout.GraphLayout.layoutRegion, the layout region can change with time (for example, because the size of the view passed as the argument to ibm_ilog.graphlayout.GraphLayout.setLayoutRegion() changes, or its transformer is changed).

getSpecRoots
Returns ibm_ilog.graphlayout.IIterator: The nodes that were specified as root.

Returns the nodes that were specified as root. Note that this does not necessarily mean that these nodes are selected as real roots, because the specification may have conflicts (for example, each connected component can only have one root, thus specifying two roots for the same connected component causes a conflict). To retrieve the nodes that were really used as roots during the layout, call the method TreeLayout.getCalcRoots().

getSplineLinkFilter
Returns ibm_ilog.graphlayout.SplineLinkFilter: The filter that detects which links are suitable for optimized spline routing.
Returns the filter that detects which links are suitable for optimized spline routing.
getSubtreeBlockMargin
Returns Number: The margin on the specified side of the subtree starting at the input node.

Returns the margin on the specified side of the subtree starting at the input node. Possible values for the side parameter are TreeLayout.EAST, TreeLayout.WEST, TreeLayout.NORTH, and TreeLayout.SOUTH.

ParameterTypeDescription
nodeObjectThe node instance.
sideintThe subtree side.
getTipOverBranchOffset
Returns Number

Returns the minimum offset in the flow direction between neighbor nodes that belong to different branches in the tree. This offset is used to separate the branches if their common parent node has tip-over alignment.

getViewMatrix
Returns the matrix that is applied to the first view attached to this layout.
getWestNeighbor
Returns Object: The specified west neighbor node of the given node.

Returns the specified west neighbor node of the input node, or null if none was specified. It returns only the neighbor node if it was specified by TreeLayout.setEastWestNeighboring() or TreeLayout.setWestEastNeighboring(), but not if the neighbor node was only specified by TreeLayout.setChildAlignment().

ParameterTypeDescription
nodeObjectThe node instance.
getWestSubtreeBlockMargin
Returns Number: The margin on the west side of the subtree starting at the input node.

Returns the margin on the west side of the subtree starting at the input node.

ParameterTypeDescription
nodeObjectThe node instance.
increasePercentageComplete

Increases the percentage of completion that is stored in the layout report to the input value. Layout algorithms that support the percentage complete feature should call this method during the running of the layout. This method does not set the percentage to a lower value than the previous value. It also does not set the value to more than 100%. It silently ignores wrong input values.

ParameterTypeDescription
newPercentageintNew percentage of completion
init

Initializes instance variables.

You should not call this method directly. The method is called internally by the constructor without arguments and by the copy constructor. The method must be overridden by subclasses that need to initialize additional instance variables.

initPropertiesNames
isAllLevelsAlternating
Returns Boolean

Returns true if at all levels, nodes are forced into alternating circular layers.

isCalcRoot
Returns Boolean: 'true' if the input node was used as root during layout.

Returns true if the input node was used as root during layout. This method can be called after the layout. If more than one connected component exists, each component has a root. If no root was specified, the layout algorithm automatically selects an appropriate node. If too many roots were specified, some specified roots will not become calculated roots during layout.

ParameterTypeDescription
nodeObjectThe node instance.
isCategorizingLinks
Returns Boolean

Returns true if the layout algorithm stores the categorization of links into forward, backward, and non-tree links.

Note that a run of the layout is necessary to make the categorization available. Even if this method returns true, the methods TreeLayout.getCalcForwardTreeLinks(), TreeLayout.getCalcBackwardTreeLinks(), and TreeLayout.getCalcNonTreeLinks() return empty enumerations if there was no run of the layout.

isCategorizingLinksWithoutLayout
Returns Boolean

Returns true if the layout algorithm does not really perform a full layout. It only calculates a spanning tree but does not move nodes or links. If categorizing links is additionally enabled, it stores the calculated root nodes and the categorization of links into forward, backward, and non-tree links. Since intergraph links are never categorized, this works only in nonrecursive mode.

Note that a run of the layout is necessary to make the categorization available. Otherwise, the methods TreeLayout.getCalcForwardTreeLinks(), TreeLayout.getCalcBackwardTreeLinks(), and TreeLayout.getCalcNonTreeLinks() return empty enumerations if there was no run of the layout.

isFirstCircleEvenlySpacing
Returns Boolean

Returns true if the nodes on the first circle must be evenly spaced in radial mode.

isFitToViewEnabled
Returns Boolean: 'true' if the graph drawing must fit (exactly or approximately) an area of the diagram view.

Returns true if the graph drawing must fit (exactly or approximately) an area of a specific view. Otherwise, the method returns false.

isFixed
Returns Boolean: 'true' if the node or link is specified as fixed.
Returns whether the node or link is specified as fixed.
ParameterTypeDescription
nodeOrLinkObjectNode or link instance present in the graph model attached to this layout.
isGeometryUpToDate
Returns Boolean

Returns whether the geometry of the graph is up to date.

Returns false if at least one node or link was moved or reshaped since the last time the layout was successfully performed on the same graph model or if the layout has never been performed successfully on the same graph model.

Returns true if no changes occurred.

This method is automatically called by ibm_ilog.graphlayout.GraphLayout.isLayoutNeeded().

Note that when the layout is performed successfully (that is, GraphLayoutReport.getCode() called on the layout report returns GraphLayoutReport.LAYOUT_DONE), the layout instance is automatically notified that the geometry of the graph is now up-to-date.

isIncrementalMode
Returns Boolean

Returns true if the incremental mode is enabled.

isInputCheckEnabled
Returns Boolean

Returns true if the checks for the nodes and/or links are enabled. Returns false otherwise.

isIntergraphConnectivityMode
Returns Boolean
Returns 'true' if the intergraph link connectivity is considered for the partitioning of the layout into subtrees.
isInvisibleRootUsed
Returns Boolean

Returns true if an invisible root is used to combine components that are disconnected from each other.

isLayoutNeeded
Returns Boolean: 'true' if it is necessary to perform the layout, 'false' otherwise.

Verifies that it is necessary to perform the layout.

Basically, the method returns false if no changes occurred on the graph model (no nodes or links were inserted, removed, reshaped, or moved) and no parameters changed since the last time the layout was successfully performed using this layout instance. Otherwise, the method returns true.

isLayoutOfConnectedComponentsEnabled
Returns Boolean

Indicates whether the connected component layout mechanism is enabled.

The default value is the value returned by the method ibm_ilog.graphlayout.GraphLayout.isLayoutOfConnectedComponentsEnabledByDefault().

isLayoutOfConnectedComponentsEnabledByDefault
Returns Boolean: 'true' if the connected components layout mechanism is enabled by default.

Returns true if the connected components layout mechanism is enabled by default. Otherwise, the method returns false.

The default implementation always returns false.

Subclasses can override this method in order to return true, that is, to indicate that the connected components layout is enabled by default.

isLayoutRunning
Returns Boolean: 'true' if this layout is currently running or (if 'checkParents' is enabled) if any parent layout is currently running.

Indicates whether this layout algorithm is running or not.

If the parameter checkParents is false, this method returns true if this layout has been started and is not yet completed. If the parameter checkParents is true, this method additionally checks whether any controlling parent layout is currently running.

ParameterTypeDescription
checkParentsBooleanIndicates that this method should also check whether any controlling parent layout is currently running.
isLayoutTimeElapsed
Returns Boolean: 'false' if the layout does not support this mechanism.

Returns true if, at the moment the method is called, the allowed layout time is exceeded; returns false otherwise.

You can call this method inside the implementation of the method ibm_ilog.graphlayout.GraphLayout.layout().

isLinkClipping
Gets whether links should be clipped at the shape of the end nodes.
isLocalRecursiveLayoutNeeded
Returns Boolean: 'true' if it is necessary to perform the layout, 'false' otherwise.

Checks whether layout is needed when layout is performed recursively on a hierarchy of nested subgraphs.

This method is called on the layout of the parent graph before the layout of the subgraphs is started. This allows the parent layout to negotiate with the subgraph layouts whether the parent layout treats the subgraphs as well, or whether the layouts of the subgraphs must run individually. If this method returns false, this layout is not performed, because some parent layout can handle the subgraph already.

The method is only called during a recursive layout (started by ibm_ilog.graphlayout.RecursiveLayout ). The default implementation returns always true. This is an expert feature, available when the graph layout is laying out a model that is not displayed in a Graph or Diagram.

ParameterTypeDescription
layoutProvideribm_ilog.graphlayout.ILayoutProviderThe object that provides a layout instance to be used for laying out each subgraph.
recLayoutibm_ilog.graphlayout.GraphLayoutThe recursive layout that started the recursive application of layouts. This can be 'null'.
rootModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model that is the root of the nesting hierarchy of graph models.
traverseBooleanIf 'false', this layout is intended to be only applied to its own graph model. If 'true', this layout is intended to be applied to its graph model and the layout instances provided by the 'layoutProvider' are intended to be applied recursively to all nested subgraph models. The traverse flag is basically passed through from the call of ' ibm_ilog.graphlayout.GraphLayout.performLayout()'.
isNonTreeLinksStraight
Returns Boolean

Returns true if all non-tree links that don't have the no-reshape link style and that are not fixed and are not incident to fixed nodes are reshaped to be straight. Otherwise, the non-tree links are not changed at all.

isParametersUpToDate
Returns Boolean

Returns whether the layout parameters are up to date.

Returns false if at least one parameter was modified since the last time the layout was successfully performed on the same graph or if the layout has never been performed successfully on the same graph.

Returns true if no parameters changed since the last time the layout was successfully performed on the same graph model.

If a layout class supports the layout of the connected components (that is, ibm_ilog.graphlayout.GraphLayout.supportsLayoutOfConnectedComponents() returns true) and if this mechanism is enabled (that is, ibm_ilog.graphlayout.GraphLayout.isLayoutOfConnectedComponentsEnabled() returns true), an additional test is performed to check that the layout of the connected components is up-to-date. Therefore, the method returns false if the graph is disconnected and the method ibm_ilog.graphlayout.GraphLayout.isParametersUpToDate() called on the layout instance returned by ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents() returns false.

If a layout class supports the layout region mechanism (that is, ibm_ilog.graphlayout.GraphLayout.supportsLayoutRegion() returns true) and if a view must be taken into account for the computation of the layout region in container coordinates (see ibm_ilog.graphlayout.GraphLayout.getCalcLayoutRegion()), an additional test is performed to verify that the size of the view has changed. The method returns false if a change occurred.

This method is automatically called by ibm_ilog.graphlayout.GraphLayout.isLayoutNeeded().

Note that when the layout is performed successfully (that is, GraphLayoutReport.getCode() called on the layout report returns GraphLayoutReport.LAYOUT_DONE), the layout instance is automatically notified that the parameters are now up-to-date.

isPreserveFixedLinks
Returns Boolean

Returns true if the layout is not allowed to reshape the links indicated as fixed by the user. Returns false if the layout is free to reshape all the links.

Always returns false if the layout does not support this option.

isPreserveFixedNodes
Returns Boolean

Returns true if the layout is not allowed to move the nodes indicated as fixed by the user. Returns false if the layout is free to move all the nodes.

Always returns false if the layout does not support this option.

Note that fixed nodes can be handled differently by different layout algorithms. Some layout algorithms can adapt the layout of the nonfixed nodes to take into account the current positions of the fixed nodes. For details, refer to the documentation of the layout algorithm.

isRespectNodeSizes
Returns Boolean
Returns 'true' if the algorithm tries to respect the size of the nodes, and 'false' otherwise.
isRootPosition
Returns Boolean

Returns true if the specified position means the position of the root node. Otherwise, it means the position of the top-left border of the layout. This can be used if connected component processing is disabled, or if the graph is fully connected. It has no effect otherwise.

isSpecRoot
Returns Boolean: 'true' if the input node was specified as root.

Returns true if the input node was specified as root. This does not necessarily mean that this node is selected as real root, because the specification may have conflicts (for example, each connected component can only have one root, so specifying two roots for the same connected component causes a conflict). To check whether the node was really used as root during the layout, call the method TreeLayout.isCalcRoot().

ParameterTypeDescription
nodeObjectThe node instance.
isSplineRoutingEnabled
Returns Boolean: If the calculation of optimized spline control points is enabled, 'true' is returned.
Tests whether the calculation of optimized spline control points is enabled.
isStoppedImmediately
Returns Boolean: 'true' if the method 'stopImmediately' was called.

Returns true if the method ibm_ilog.graphlayout.GraphLayout.stopImmediately() was called. Layout algorithm classes can use this method to recognize that it was requested to stop the current layout run.

isStructureUpToDate
Returns Boolean

Returns whether the structure of the graph is up to date.

Returns false if at least one modification occurred in the structure of the graph model (a node or link was added or removed) since the last time the layout was successfully performed on the same graph model using this layout instance or if the layout has never been performed successfully on the same graph model. The following are considered to be modifications of the structure: adding or removing a node or link .

Returns true if no changes occurred.

This method is automatically called by ibm_ilog.graphlayout.GraphLayout.isLayoutNeeded().

Note that when the layout is performed successfully (that is, GraphLayoutReport.getCode() called on the layout report returns GraphLayoutReport.LAYOUT_DONE), the layout instance is automatically notified that the structure is now up-to-date. It is also automatically notified of the topological modifications of the graph model using a manager-contents-changed listener.

isUseSeedValueForRandomGenerator
Returns Boolean

Returns true if the user-defined seed value is used for the random generator and false otherwise.

An error is thrown An Error is thrown if the layout does not support this mechanism.

layout

Computes the layout using the Tree Layout algorithm. To start the layout, call the method ibm_ilog.graphlayout.GraphLayout.performLayout().

performLayout
Returns int: The layout code (see ibm_ilog.graphlayout.GraphLayoutReport.getCode()).
Starts the layout algorithm using the currently attached graph model and the current settings for the layout parameters.
ParameterTypeDescription
forceBooleanIf 'true', the method isLayoutNeeded is not called. No check is made to determine if it is necessary to perform the layout.
traverseBooleanIf 'true', the layout is applied to the attached graph model and recursively to all subgraph models of the attached graph model. Otherwise, it is only applied on the attached graph model.
performSublayout

This is used when this layout controls the input layout as sublayout. Layout classes can override this method if changes are needed with respect to the way how the input layout is started.

You should not call this method directly.

ParameterTypeDescription
subgraph
layout
force
removeAllAssociates

Removes all the associate nodes from the input parent node.

ParameterTypeDescription
parentNodeObjectThe parent node of the 'associateNode'.
removeAssociate

Removes the associate node from its parent node.

ParameterTypeDescription
parentNodeObjectThe parent node of the 'associateNode'.
associateNodeObjectThe associate node of the 'parentNode'.
setAlignment

Sets the alignment option of an individual node. This alignment option is used only if the global alignment is set to TreeLayout.MIXED. Otherwise, all nodes have the alignment that is specified as the global alignment. This option has no effect in balloon layout mode.

Valid values are:

  • TreeLayout.CENTER - the node is centered with respect to the centers of its child nodes.
  • TreeLayout.BORDER_CENTER - the node is centered with respect to the border of its child nodes.
  • TreeLayout.EAST - the node is aligned to the border of its easternmost child node.
  • TreeLayout.WEST - the node is aligned to the border of its westernmost child node.
  • TreeLayout.TIP_OVER_EAST - a parent is outside the border of the child nodes, and the child nodes are placed sequentially instead of in parallel on the east side of the parent. This alignment option is not possible in the radial or level layout modes.
  • TreeLayout.TIP_OVER_WEST - a parent is outside the border of the child nodes, and the child nodes are placed sequentially instead of in parallel on the west side of the parent. This alignment option is not possible in the radial or level layout modes.
  • TreeLayout.TIP_OVER_EAST_WEST - similar to TreeLayout.TIP_OVER_EAST or TreeLayout.TIP_OVER_WEST, but the child nodes are arranged on both sides of the link segment that starts at the parent node. The first child is placed on the east side. Further child nodes are placed on the east or west side, so that the space used on both sides is roughly the same, that is, the subtrees on the east side have roughly the same sum of heights as the subtrees on the west side. This alignment option is not possible in the radial or level layout modes.
  • TreeLayout.TIP_OVER_BOTH_SIDES - similar to TreeLayout.TIP_OVER_EAST or TreeLayout.TIP_OVER_WEST, but the child nodes are arranged in pairs on both sides of the link segment that starts at the parent node. Unlike the behavior with TreeLayout.TIP_OVER_EAST_WEST, the algorithm does not try to optimize the space used on both sides but always puts the odd-numbered child nodes to the west and the even-numbered child nodes to the east, and the pairs of child nodes, one on the east side and one on the west side, are aligned with one another. This alignment option is not possible in the radial or level layout modes.

The default value is TreeLayout.CENTER.

ParameterTypeDescription
nodeObjectThe node instance.
alignmentintThe alignment option of the individual node.
setAllLevelsAlternating

Sets whether at all levels, nodes are forced into alternating circular layers.

This option has only an effect in layout mode TreeLayout.ALTERNATING_RADIAL. Alternating placement means that the nodes of one level are placed alternating in several (normally 2) circular layers. Nonalternating placement means that the nodes of one level are placed in one circular layer. Normally, the layout analyses which levels must use the alternating placement in order to optimize space. If the alternating placement of a level does not improve the space usage, the nonalternating placement is used for the level even in alternating radial layout mode.

This option allows to change this behavior: if the option is enabled, all levels use the alternating placement even if the alternating placement uses more space than the nonalternating placement. The option is ignored if the number of alternating circles is set to 0, because in that more, the number of alternating circles is automatically determined from the space usage.

The option is disabled by default.

ParameterTypeDescription
enable
setAllowedTime

Sets the upper limit for the duration of the layout algorithm.

When an iterative layout algorithm is used, the iterations can be stopped when this time is exceeded. Noniterative algorithms can also use this parameter as an upper limit for the computation time. The default value is normally 32000 (32 seconds). Subclasses that support this feature can use a different default value depending on their particular behavior. Layout algorithms that are stopped in this way set the result code of the layout report either to GraphLayoutReport.STOPPED_AND_VALID or to GraphLayoutReport.STOPPED_AND_INVALID.

When the connected components of disconnected graphs are laid out separately (see ibm_ilog.graphlayout.GraphLayout.supportsLayoutOfConnectedComponents()), the specified allowed time is considered as the total time for the layout of all the connected components plus the time for the connected components layout.

Note that the layout algorithm may not obey exactly the allowed time specification.

Note for implementers of layout algorithms: the method ibm_ilog.graphlayout.GraphLayout.performLayout() does NOT automatically stop the layout when the allowed time is exceeded. It is the sole responsibility of the implementation of the method ibm_ilog.graphlayout.GraphLayout.layout() to do this.

An Error is thrown if the layout does not support this mechanism.

ParameterTypeDescription
timeNumberThe allowed time in milliseconds.
setAspectRatio

Sets the aspect ratio for the layout. This is the ratio width / height of the desired layout region.

The effect of the aspect ratio depends on the layout mode:

  • In layout modes TreeLayout.RADIAL and TreeLayout.ALTERNATING_RADIAL, the nodes are placed in circular layers if the aspect ratio is 1. Otherwise, they are placed in elliptical layers.
  • In layout modes TreeLayout.BALLOON, the nodes are placed in circular balloons if the aspect ratio is 1. Otherwise, they are placed in elliptical ballons.
  • In layout modes TreeLayout.TIP_OVER, TreeLayout.TIP_ROOTS_OVER, TreeLayout.TIP_LEAVES_OVER, and TreeLayout.TIP_ROOTS_AND_LEAVES_OVER, the nodes are placed as in in free mode, but local tip-over alignments are automatically added to better fit the layout to the aspect ratio.
  • The aspect ratio has no effect in other layout modes.

ParameterTypeDescription
aspectRatio
setAssociateOffset

Sets the minimum offset between associates and the orthogonal link segment starting at the parent. This offset is used if a parent has associate nodes. This method has no effect if the layout mode is radial or if no associates occur.

If the flow direction is toward the top or bottom, the orthogonal link segment starting at the parent is vertical, and the associates are placed left or right of this link segment. Hence it is a horizontal offset. If the flow direction is toward the left or right, the orthogonal link segment starting at the parent is horizontal, and the associates are placed above or below this link segment. Hence it is a vertical offset.

If the Respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.

The default value is 30.

ParameterTypeDescription
offset
setBalanceSplineCurveThreshold

Sets the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.

The parameter works only if the layout supports generic spline optimization routing, and if it is enabled.

Bends in a spline have a size that is described roughly by the triangle the surrounds the curve part of a bend.

If the side length of the triangle is larger than the threshold, the algorithm tries to create a isosceles triangle. This results in more balanced bend curves.

If the side length of the triangle is smaller than the threshold, it uses non-isosceles triangles. Using isosceles triangles, the bend curve looks too sharp.

The default value is 10.

ParameterTypeDescription
thresholdNumberThe balance spline curve threshold.
setBalloonAngleSpacing

Sets the current angle spacing for balloon layout mode. This setting has only an effect when the layout mode is TreeLayout.BALLOON. Valid values are:

  • TreeLayout.REGULAR - the available angle range at a node is evenly split so that each subtrees balloon at the node can occupy the same angle.
  • TreeLayout.FAST_PROPORTIONAL - the available angle range at a node is proportonally split so that larger subtrees balloons at the node can occupy larger angles. The algorithm uses a fast heuristic to calculate the angle ranges. This heuristic is not very precise.
  • TreeLayout.PROPORTIONAL - the available angle range at a node is proportonally split so that larger subtrees balloons at the node can occupy larger angles. The algorithm uses a slower heuristic to calculate the angle ranges. This heuristic is more precise than the fast heuristic.

The default value is TreeLayout.PROPORTIONAL.

ParameterTypeDescription
angleSpacing
setBalloonInnerChildrenAngle

Sets the maximum angle for children of inner nodes in balloon mode. This is the maximum angle between the two rays from the parent to its two outermost children. If the angle is 360 degree, outermost children do not really esist as the children cover the entire circle around the node. The angle must be between 1 and 360 degrees.

The default value is 360.

This is an expert option. It has no effect in layout modes other than balloon.

ParameterTypeDescription
angle
setBalloonLeafChildrenAngle

Sets the maximum angle for children of nodes that have only leaves as children in balloon mode. Basically, it is the maximum angle for the leaf balloons. This is the maximum angle between the two rays from the parent to its two outermost children. If the angle is 360 degree, outermost children do not really esist as the children cover the entire circle around the node. The angle must be between 1 and 360 degrees.

The default value is 360.

This is an expert option. It has no effect in layout modes other than balloon.

ParameterTypeDescription
angle
setBalloonRadiusMode

Sets the current radius mode for balloon layout mode. This setting has only an effect when the layout mode is TreeLayout.BALLOON. Valid values are:

  • TreeLayout.VARIABLE_RADIUS - the radius of different child balloons at the same parent node can vary.
  • TreeLayout.OPTIMIZED_VARIABLE_RADIUS - the radius of different child balloons at the same parent node can vary. An additional optimization heuristic reduces the radius. This has the advantage of smaller space requirements but looses symmetries in the diagram.
  • TreeLayout.UNIFORM_LEAVES_RADIUS - the radiuses of all leaves that are children of the same node are uniform. The radius of balloons that contain more than one node can still vary. Use this mode if symmetries of the layout are important.
  • TreeLayout.OPTIMIZED_UNIFORM_LEAVES_RADIUS - the radiuses of all leaves that are children of the same node are uniform. The radius of balloons that contain more than one node can still vary. An additional optimization heuristic reduces the radius. This has the advantage of smaller space requirements but looses symmetries in the diagram.
  • TreeLayout.UNIFORM_RADIUS - the radiuses of all subtree balloons that are children of the same node are uniform. This mode requires the most area but also shows the most symmetries in the layout.

The default value is TreeLayout.OPTIMIZED_UNIFORM_LEAVES_RADIUS.

ParameterTypeDescription
radiusMode
setBalloonRootChildrenAngle

Sets the maximum angle for children of the root node in balloon mode. This is the maximum angle between the two rays from the parent to its two outermost children. If the angle is 360 degree, outermost children do not really esist as the children cover the entire circle around the root. The angle must be between 1 and 360 degrees.

The default value is 360.

This is an expert option. It has no effect in layout modes other than balloon.

ParameterTypeDescription
angle
setBalloonStartAngle

Sets the start angle of the layout in balloon mode. The angle must be between 0 and 360 degrees.

The default value is 0.

The angle orientation is clockwise for flow direction left and top and counter clockwise for flow direction right and bottom. The start angle 0 is always towards the right.

This is an expert option. It has no effect in layout modes other than balloon.

ParameterTypeDescription
angle
setBranchOffset

Sets the minimum offset between neighbor nodes that belong to different branches in the tree. This is the offset between neighbor nodes that are not siblings. The offset is in the opposite direction of the link flow.

If the flow direction is towards the top or bottom and the layout mode is not radial or balloon, this is a horizontal offset. If the flow direction is towards the left or right and the layout mode is not radial or balloon, this is a vertical offset. If the layout mode is radial, this is an offset tangential to the circles or ellipses.

If the layout mode is balloon, this is the minimal offset between nodes in all directions. The balloon mode does not distinguish between siblings and branches, hence the branch offset is used for all nodes.

If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.

The default value is 40.

ParameterTypeDescription
offset
setCategorizingLinks

Sets whether the layout algorithm stores the categorization of links into forward, backward, and non-tree links. If true, the next run of the layout algorithm makes the link categorization available through the methods TreeLayout.getCalcForwardTreeLinks(), TreeLayout.getCalcBackwardTreeLinks(), and TreeLayout.getCalcNonTreeLinks(). If false, the link categorization is not made available. This saves memory and is faster. In this case, the methods TreeLayout.getCalcForwardTreeLinks(), TreeLayout.getCalcBackwardTreeLinks(), and TreeLayout.getCalcNonTreeLinks() will return empty enumerations.

Note that only normal links can be categorized. Intergraph links are never categorized, even if TreeLayout.setIntergraphConnectivityMode() is set to true.

The default value is false.

ParameterTypeDescription
flag
setCategorizingLinksWithoutLayout

Sets whether the layout algorithm does not really perform a full layout. It only calculates a spanning tree but does not move nodes or links. If categorizing links is additionally enabled, it stores the calculated root nodes and the categorization of links into forward, backward, and non-tree links. Since intergraph links are never categorized, this works only in nonrecursive mode.

Note that a run of the layout is necessary to make the categorization available. Otherwise, the methods TreeLayout.getCalcForwardTreeLinks(), TreeLayout.getCalcBackwardTreeLinks(), and TreeLayout.getCalcNonTreeLinks() return empty enumerations if there was no run of the layout.

The default value is false.

ParameterTypeDescription
flag
setChildAlignment

Sets the child alignment option of the node. This child alignment option is used to specify exceptional alignments for the child that differ from the alignment specified at the parent for all child nodes. This method always overwrites the aligment specified using TreeLayout.setAlignment() and TreeLayout.setGlobalAlignment() at the parent. Child alignments only take effect in free and level mode but not in radial or balloon mode, and only if the child node is not a root node of a tree.

Valid values are:

  • TreeLayout.UNSPECIFIED - no exceptional alignment is specified for this child node.
  • TreeLayout.EAST_NEIGHBOR - the child node is made a neighbor on the east side of its parent node.
  • TreeLayout.WEST_NEIGHBOR - the child node is made a neighbor on the west side of its parent node.
  • TreeLayout.TIP_OVER_ASSOCIATE_BOTH_SIDES - the child is laid out like an associate node of its parent node. Associate nodes occur alternating on the east and west sides of their parent node.
  • TreeLayout.TIP_OVER_ASSOCIATE_EAST - the child is laid out like an associate node of its parent node. This associate nodes occurs on the east side of its parent node.
  • TreeLayout.TIP_OVER_ASSOCIATE_WEST - the child is laid out like an associate node of its parent node. This associate nodes occurs on the west side of its parent node.

The default value is TreeLayout.UNSPECIFIED.

ParameterTypeDescription
nodeObjectThe node instance.
alignmentintThe child alignment option of the input node. This child alignment option is used to specify exceptional alignments for the child node that differ from the alignment specified at the parent for all child nodes.
setConnectorStyle

Sets the style of the connectors.

Valid values are:

  • TreeLayout.CENTERED_PINS - the link connection points are placed in the center of the border of the node bounding box to which the link is attached.
  • TreeLayout.CLIPPED_PINS - each link pointing to the center of the node is clipped at the bounding box of the node. This style affects straight links; it behaves like centered connection points for orthogonal links.
  • TreeLayout.EVENLY_SPACED_PINS - the link connection points are evenly spaced along the border of the node bounding box.
  • TreeLayout.AUTOMATIC_PINS - the connector style is selected depending on the link style.

The default value is TreeLayout.AUTOMATIC_PINS.

The connector style is ignored in the radial layout modes because clipped pins are always used in this case . The placement of connection points also depends on the connection box interface, in the following way:

  1. First, the bounding box of an end node is obtained. If a link connection box interface was set via ibm_ilog.graphlayout.GraphLayout.setLinkConnectionBoxInterface(), the bounding box and offsets are delivered by that interface. Otherwise, the node bounding box delivered by the graph model (see IGraphLayoutModel.getObjectBounds(Object)) is used.
  2. Next, the initial connection point of the link is placed at this bounding box in the manner specified by the connector style.

ParameterTypeDescription
style
setEastSubtreeBlockMargin

Sets the margin on the east side of the subtree starting at the input node. If the value is set to a positive number, the subtree starting at this node is considered a rectangular block, and other nodes not belonging to this subtree are moved at least the specified margin away from this block. Specifying subtree block margins is useful if you plan to draw a rectangle around the subtree, since it ensures that unrelated nodes do not extend into the rectangle.

The default value is -1, which means no margin.

ParameterTypeDescription
nodeObjectThe node instance.
marginNumberThe margin on the east side of the subtree starting at the input node.
setEastWestNeighboring

Creates an east-west neighboring of two nodes. The westNode is placed as the first neighbor on the same level to the west of the eastNode. This implies, conversely, that the eastNode is the first neighbor on the same level to the east of the westNode.

For instance, in free layout mode and with the flow direction towards the bottom, the east node is placed as the immediate neighbor to the right of the west node at approximately the same y coordinate. A link between both nodes is routed as a straight horizontal line between both nodes. In radial layout mode, the east node is placed as the immediate neighbor in the same circle as the west node. A link between both nodes is routed tangentially to the node circle as a straight line.

Note that each node can have at most one east neighbor and one west neighbor.

East-west neighboring is possible even though there is no link between both nodes. The layout algorithm considers both nodes as if they were conceptually connected by a link.

ParameterTypeDescription
eastNodeObjectThe east neighbor of the 'westNode'.
westNodeObjectThe west neighbor of the 'eastNode'.
setFirstCircleEvenlySpacing

Sets whether the nodes on the first circle must be evenly spaced in radial mode.

By default, all nodes are placed as close as possible according to the offset parameters. In radial mode, this may cause the first circle to be only partially filled (that is, all nodes are placed close together at one part of the circle and there is a larger gap in another part of the circle).

To avoid this effect, you can enable the evenly spacing of the first circle. In this case, the children of the root node are placed such that their centers are approximately evenly spaced on the first circle, filling the entire circle. This may, however, cause the final result to waste much more space on the other circles.

It is disabled by default.

This is an expert option. It has no effect in layout modes other than radial. If there is east-west neighboring of the nodes in the first circle, these neighbors will not be equally spaced.

ParameterTypeDescription
enable
setFixed

Sets the specified node or link as fixed.

Fixed nodes are not moved during the layout only if the method isPreserveFixedNodes() returns true. By default, no node is fixed.

Fixed links are not reshaped during the layout only if the method isPreserveFixedLinks() returns true. By default, no link is fixed.

ParameterTypeDescription
nodeOrLinkObjectNode or link instance which is part of the graph model.
fixedBooleanIndicates whether the object should remain fixed or not.
setFlowDirection

Sets the direction of the flow. Valid values are:

  • ibm_ilog.graphlayout.Direction.RIGHT - the root is on the left and the links flow to the right.
  • ibm_ilog.graphlayout.Direction.LEFT - the root is on the right and the links flow to the left.
  • ibm_ilog.graphlayout.Direction.BOTTOM - the root is at the top and the links flow to the bottom.
  • ibm_ilog.graphlayout.Direction.TOP - the root is at the bottom and the links flow to the top.

Note that except for the radial layout modes, the compass direction TreeLayout.SOUTH is identical to the flow direction.

In the radial layout modes, all links flow radially from the center of the root outward. If connected component processing is disabled, the flow direction affects only the arrangement of disconnected trees in the radial modes.

The default value is ibm_ilog.graphlayout.Direction.RIGHT .

ParameterTypeDescription
direction
setGeometryUpToDate

Sets whether the geometry of the graph is up to date.

If the argument is false, notifies the layout instance that the geometry of the graph was changed since the last time the layout was successfully performed.

Usually you do not need to call this method. The method is automatically called with a true argument each time the layout is successfully performed.

ParameterTypeDescription
uptodate
setGlobalAlignment

Sets the global alignment option. This option has no effect in balloon layout mode. Valid values are:

  • TreeLayout.CENTER - a parent is centered above its child nodes, taking the center of the child nodes into account.
  • TreeLayout.BORDER_CENTER - a parent is centered above its child nodes, taking the border of the child nodes into account. This differs from the alignment TreeLayout.CENTER if the Respect node sizes option is enabled.
  • TreeLayout.EAST - a parent is aligned to the border of its easternmost child node.
  • TreeLayout.WEST - a parent is aligned to the border of its westernmost child node.
  • TreeLayout.TIP_OVER_EAST - a parent is outside the border of the child nodes, and the child nodes are placed sequentially instead of in parallel. The child nodes are on the east side of the parent. This alignment option is not possible in the radial or level layout modes.
  • TreeLayout.TIP_OVER_WEST - a parent is outside the border of the child nodes, and the child nodes are placed sequentially instead of in parallel. The child nodes are on the west side of the parent. This alignment option is not possible in the radial or level layout modes.
  • TreeLayout.TIP_OVER_EAST_WEST - similar to TreeLayout.TIP_OVER_EAST or TreeLayout.TIP_OVER_WEST, but the child nodes are arranged on both sides of the link segment that starts at the parent node. The first child node is placed on the east side. Further child nodes are placed on the east or west side, so that the space used on both sides is roughly the same, that is, the subtrees on the east side have roughly the same sum of heights as the subtrees on the west side. This alignment option is not possible in the radial or level layout modes.
  • TreeLayout.TIP_OVER_BOTH_SIDES - similar to TreeLayout.TIP_OVER_EAST or TreeLayout.TIP_OVER_WEST, but the child nodes are arranged in pairs on both sides of the link segment that starts at the parent node. Unlike TreeLayout.TIP_OVER_EAST_WEST, this style does not try to optimize the space used on both sides but always puts the odd-numbered child nodes to the west and the even-numbered child nodes to the east. The pairs of child nodes, one on the east side and one on the west side, are aligned with one another. This alignment option is not possible in the radial or level layout modes.
  • TreeLayout.MIXED - each node can have a different alignment option. The alignment of each individual node can be set by the method TreeLayout.setAlignment() so that different alignments can occur in the same graph.

The default value is TreeLayout.CENTER.

ParameterTypeDescription
alignment
setGlobalLinkStyle

Sets the global style of the shapes of links. Valid values are:

  • TreeLayout.ORTHOGONAL_STYLE - all links have an orthogonal shape, that is, a shape consisting of a sequence of orthogonal line segments. This option is not available for the radial layout modes.
  • TreeLayout.STRAIGHT_LINE_STYLE - all links have a straight-line shape.
  • TreeLayout.NO_RESHAPE_STYLE - no reshape is performed on any link.
  • TreeLayout.MIXED_STYLE - each link can have a different link style. The style of each individual link can be set by the method TreeLayout.setLinkStyle() so that different link shapes can occur in the same graph.

Unless the global link style is TreeLayout.MIXED_STYLE, all links have the same shape style.

The default value is TreeLayout.STRAIGHT_LINE_STYLE.

ParameterTypeDescription
style
setGraphModel

Sets the graph model to be laid out. You should not call this method. Instead, use the method ibm_ilog.graphlayout.GraphLayout.attach().

ParameterTypeDescription
graphModel
setIncrementalMode

Sets the incremental mode.

If the incremental mode is enabled, the algorithm tries to preserve the relative order of the children on incremental changes, unless a node comparator is specified. The logical order of children of nodes in the tree is calculated from their coordinates. In this case, the layout is stable when incremental changes are made. If nodes are added or removed after a layout, the next layout uses a heuristic to try to adjust the layout only minimally and to avoid major structural reorganization.

If the incremental mode is disabled, the algorithm calculates the logical order of children of nodes in the tree by using the order in which nodes are returned by ibm_ilog.graphlayout.AbstractGraphLayoutModel.getNodes().

If a node comparator is specified, the algorithm calculate the logical order of children of nodes in the tree from the node comparator, independent from whether the incremental mode is enabled or disabled.

The incremental mode is enabled by default.

ParameterTypeDescription
enable
setInputCheckEnabled

Sets whether the checks for the nodes and/or links provided as arguments for the different methods of the layout algorithms are enabled.

If enabled, methods that require a node or a link as an argument check whether the object they receive is really a node or a link in the attached graph (using the methods AbstractGraphLayoutModel.isNode() and AbstractGraphLayoutModel.isLink()).

The checks can be disabled to avoid their overhead cost. The default value is true.

ParameterTypeDescription
enable
setIntergraphConnectivityMode

Sets whether the intergraph link connectivity is considered for the partitioning of the layout into subtrees. This affects nodes that represent subgraphs and that are only connected to other nodes by intergraph links (i.e. there are no normal intragraph links between the node and other nodes). If the option is disabled, these nodes are considered disconnected and are placed like disconnected nodes. If the option is enabled, the nodes are considered connected and arranged inside the tree structure (for instance as parent and child).

Note that this option has no effect if the generic disconnected node placement is enabled (see ibm_ilog.graphlayout.GraphLayout.setLayoutOfConnectedComponentsEnabled()).

Even if this option is enabled, the Tree Layout algorithm does not route intergraph links. They should be routed by applying a Link Layout after the Tree Layout.

ParameterTypeDescription
flagBoolean'true' to set intergraph connectivity mode, or 'false' to disable the mode.
setInvisibleRootUsed

Sets whether an invisible root is used to combine components that are disconnected from each other. The roots that are specified by TreeLayout.setRoot() or TreeLayout.setRootPreference() are the roots of each individual component. If an invisible root is used, all roots of each individual component are added as children to an invisible dummy node and the layout is performed on the resulting connected graph. By doing this, the components are arranged in the same global structure. In particular, this is useful for the radial layout modes to fit all components into the same global circular layer structure instead of generating an individual circular layer structure for each component.

Note that the layout is no longer stable on incremental changes if an invisible root is used. The layout heuristic cannot preserve the relative order of the components in this case. This means that the order of the components may change in subsequent layouts, and hence the next layout may look very different from the previous layout.

The default value is false.

ParameterTypeDescription
flag
setLayoutMode

Sets the layout mode. Valid values are:

  • TreeLayout.FREE - all links flow roughly in the flow direction. Nodes of different tree branches (that is, nodes with a different parent node) are not justified to each other; therefore, the level alignment parameter is ignored. Tip-over alignment is possible if specified as alignment. All link styles are possible. The aspect ratio is ignored.
  • TreeLayout.LEVEL - all links flow roughly in the flow direction. Nodes are organized in levels and are justified to their borders or centered according to the level alignment parameter. Tip-over alignment is not possible, but all link styles are possible. The aspect ratio is ignored.
  • TreeLayout.TIP_OVER - similar to the mode TreeLayout.FREE. However, in mode TreeLayout.TIP_OVER, the algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio. Using a fast heuristic, it chooses the local alignment TreeLayout.TIP_OVER_EAST for some nodes but keeps the alignment of all other nodes as specified. This heuristic is a fast compromise between the modes TreeLayout.TIP_LEAVES_OVER, TreeLayout.TIP_ROOTS_OVER, and TreeLayout.TIP_ROOTS_AND_LEAVES_OVER.
  • TreeLayout.TIP_LEAVES_OVER - similar to the mode TreeLayout.TIP_OVER. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio. This slow heuristic tries to tip over beginning with the leaves and then chooses the best layout. It checks the alignment mode TreeLayout.TIP_OVER_EAST, but not TreeLayout.TIP_OVER_BOTH_SIDES or other variants. It keeps the alignment of all nodes close to the root as specified.
  • TreeLayout.TIP_ROOTS_OVER - similar to the mode TreeLayout.TIP_OVER. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio. This slow heuristic tries to tip over beginning with the roots and then chooses the best layout. It checks the alignment mode TreeLayout.TIP_OVER_EAST, but not TreeLayout.TIP_OVER_BOTH_SIDES or other variants. It keeps the alignment of all nodes close to the leaves as specified.
  • TreeLayout.TIP_ROOTS_AND_LEAVES_OVER - similar to the mode TreeLayout.TIP_OVER. The algorithm tries to optimize the layout to automatically fit best to the specified aspect ratio. This slow heuristic tries to tip over beginning with the roots and with the leaves, and then chooses the best layout. It checks the alignment mode TreeLayout.TIP_OVER_EAST, but not TreeLayout.TIP_OVER_BOTH_SIDES or other variants. It keeps the alignment of all nodes in the middle between roots and leaves as specified.
  • TreeLayout.RADIAL - the root node is in the center, the links flow radially away from the center, and the nodes are placed in circular layers around the root node according to the level alignment. Tip-over alignment and orthogonal link styles are not possible. Clipped connection points are used as the connector style. If an aspect ratio is specified, the layers are ellipses around the center.
  • TreeLayout.ALTERNATING_RADIAL - this is the same as mode TreeLayout.RADIAL, with the exception that children of the same node are placed alternating in different circular layers when this results in a smaller radius and better usage of the space. Tip-over alignment and orthogonal link styles are not possible. Clipped connection points are used as the connector style. If an aspect ratio is specified, the layers are ellipses around the center.
  • TreeLayout.BALLOON - the root node is in the center and the subtrees are arranged as balloon circles around the root. It is very similar to the mode TreeLayout.RADIAL, however each subtree froms its own balloon recursively. If an aspect ratio is specified, the balloons are ellipses instead of circles. Tip-over alignment and orthogonal link styles are not possible. Clipped connection points are used as the connector style. The recursive leaf layout mode is not supported in combination with the balloon mode.

The default value is TreeLayout.FREE.

Note that the tip-over layout modes work best if the node sizes are respected during layout.

ParameterTypeDescription
mode
setLayoutOfConnectedComponents

Sets the layout instance that lays out the connected components of the graph. When this method is not called, a default layout instance (see ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents() is used. You can call this method with a null argument to return to the default connected components layout instance.

Note the following points:

  • The layout instance passed as the argument cannot be used independently as long as it is set as a connected component layout.
  • The connected component layout is not used if the graph is connected.

ParameterTypeDescription
layoutibm_ilog.graphlayout.GraphLayoutThe layout instance to set, or 'null' to return to the default layout instance.
setLayoutOfConnectedComponentsEnabled

Sets whether the generic connected component layout mechanism is enabled. If enabled on a layout class that supports this mechanism (see ibm_ilog.graphlayout.GraphLayout.supportsLayoutOfConnectedComponents()), the method ibm_ilog.graphlayout.GraphLayout.performLayout() cuts the attached graph model into connected components and lays out each connected component separately. Then the connected components are placed using the layout instance returned by the method ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents().

Notice that the connected component layout is not used if the graph is connected.

The default value is the value returned by the method ibm_ilog.graphlayout.GraphLayout.isLayoutOfConnectedComponentsEnabledByDefault().

ParameterTypeDescription
enableBooleanSet to 'true' to enable the connected component layout mechanism, or 'false' to disable.
setLayoutRegion

Sets the layout region as a rectangle rect), with the dimensions of the rectangle being given in container (graph model) coordinates. The region's new position is specified by rect.x and rect.y, and its new size is specified by rect.width and rect.height.

For subclasses that support this parameter, the layout region is usually the rectangle that the graph must fit (exactly or approximately) after the layout is performed, or the rectangle which influences the position and/or size of the resulting layout. The way the layout region parameter is taken into account is the sole responsibility of the subclasses.

You should use this method if you want to perform the layout with no manager view attached to the graph model or if you want to define the region to fit in the manager coordinates. If you want the layout to fit a region of a manager view, with its dimensions in manager view coordinates, use the method ibm_ilog.graphlayout.GraphLayout.setLayoutRegion(). If you want to revert to the default layout region, that is the layout region which is computed by default if no layout region has been previously specified, you can call this method with a null argument.

An Error is thrown if the layout does not support this mechanism, or if the width or height of rect is 0.

ParameterTypeDescription
rectRectangleThe rectangle for the layout region, or 'null'.
setLayoutRegionMode
Sets the layout region mode.
ParameterTypeDescription
value
setLayoutReport

Sets the layout report, that is, the object that contains information about the behavior of the layout algorithm.

This method is called automatically by ibm_ilog.graphlayout.GraphLayout.performLayout() with the layout report created using the method ibm_ilog.graphlayout.GraphLayout.createLayoutReport(). Subclasses can override this method to perform additional actions.

ParameterTypeDescription
reportibm_ilog.graphlayout.GraphLayoutReportNew layout report.
setLayoutRunning

Sets whether layout is running. The method is part of IBM ILOG Dojo Diagrammer internals. You should not use it.

ParameterTypeDescription
runningBooleanWhether layout is running or not.
fromParentsBooleanWhether this is a notification from a parent layout or from this layout instance.
setLevelAlignment

Sets the alignment within the levels. Valid values are:

  • TreeLayout.CENTER
  • TreeLayout.NORTH
  • TreeLayout.SOUTH

This feature sets the alignment of the nodes within each level. It can be used in layout modes TreeLayout.LEVEL, TreeLayout.RADIAL, and TreeLayout.ALTERNATING_RADIAL. It has an effect only if the respect node sizes option is enabled.

If the nodes are center-justified, all nodes of the same level are placed with their centers along a line. Otherwise, all nodes of the same level are placed with the specified border justified to a line. For instance, if the link flow direction is to the right, the alignment TreeLayout.NORTH means that the nodes are justified to the left and the alignment TreeLayout.SOUTH means that the nodes are justified to the right.

In the radial layout modes, the alignment TreeLayout.NORTH means that the nodes are aligned along a circle with the border that is closer to the root, and the alignment TreeLayout.SOUTH means that the nodes are aligned along a circle with the border that is farther away from the root.

The default value is TreeLayout.CENTER.

ParameterTypeDescription
alignment
setLinkClipping
Sets whether links should be clipped at the shape of the end nodes.
ParameterTypeDescription
value
setLinkConnectionBoxInterface

Sets the link connection box interface for the connection points of links. The link connection box interface is an object that provides the rectangle to which the links are connected for each node and the tangential shift offset at each side for the connection points.

By default, the layout algorithm places the connection points of the links relative to the bounding box of the nodes (see ).

By setting a link connection box interface, the links can be connected relative to a different box (see ILinkConnectionBoxProvider.getBox()). It is furthermore possible to "shift" the links tangentially by using the method ILinkConnectionBoxProvider.getTangentialOffset() from the interface ILinkConnectionBoxProvider:

  • On the "top" and "bottom" sides of a node, the connection points are moved to the right if the offset is positive and to the left if the offset is negative.
  • On the "left" and "right" sides of a node, the connection points are moved to the bottom if the offset is positive and to the top if the offset is negative.
The details of how the link connection box is used depend on the specific layout algorithm.

You can call this method with a null argument to restore the default behavior.

An Error is thrown if the layout does not support this mechanism.

ParameterTypeDescription
linkConnectionBoxInterface
setLinkStyle

Sets the style of the shape of an individual link. This link style is used only if the global link style is set to TreeLayout.MIXED_STYLE and the link is part of the spanning tree. If the global link style is not TreeLayout.MIXED_STYLE, all links of the spanning tree have the style that is specified as the global link style. Links that are not part of the spanning tree have the link style TreeLayout.NO_RESHAPE_STYLE.

Valid values are:

  • TreeLayout.ORTHOGONAL_STYLE - the link has an orthogonal shape, that is, a shape consisting of a sequence of orthogonal line segments. This option is not available for the radial layout modes.
  • TreeLayout.STRAIGHT_LINE_STYLE - the link has a straight-line shape.
  • TreeLayout.NO_RESHAPE_STYLE - no reshape is performed on the link.

The default value is TreeLayout.STRAIGHT_LINE_STYLE.

ParameterTypeDescription
linkObjectThe link object.
styleintThe style of the link shape.
setMaxChildrenAngle

Sets the maximum angle for children that are placed in radial mode. This is the maximum angle between the two rays from the parent to its two outermost children. The angle must be between 0 and 360 degrees. The angle 0 means that the angle is unspecified,

The default value is 0.

In radial mode, children of a single node may cover nearly completely one circular layer. This sometime appears to be unbalanced, in particular because the links from the node to its outermost children are likely to cross other nodes. To avoid this effect, a maximum angle can be specified so that the children are placed more in the same direction and are not spread too widely around the parent. This angular restriction is applied to all children except the children of the root node. As a side effect, specifying a small maximum children angle enlarges the radius of the circles.

It is recommended choosing a value between 30 and 180 degrees for good results. The algorithm uses a heuristic that has precision deviations below 30 degrees and above 180 degrees. If an aspect ratio is specified, the layout algorithm uses ellipses instead of circles. In this case, precision deviations may occur as well.

This is an expert option. It has no effect in layout modes other than radial.

ParameterTypeDescription
angle
setMaxSplineCurveSize

Sets the maximum curve size used when optimized spline control point routing is enabled.

The parameter works only if the layout supports the generic spline optimization routing, and if it is enabled.

Bends in a spline have a size that is described roughly by the triangle the surrounds the curve part of a bend. Spline routing tries to set the side length of this triangle at each bend between the minimum curve size and the maximum curve size.

The default value is 30.

ParameterTypeDescription
sizeNumberThe maximum spline curve size
setMinBusyTime

Sets the minimal time that the layout algorithm can be busy. This is the time between two calls of ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed() when the method ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded() is used.

The objective is to avoid the overhead of ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed() becoming too high if the method is called too often. Internal routines of layout algorithms usually call ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded(), which calls ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed() if the time since the last call was at least the minimal busy time.

The default value is 50 (milliseconds).

ParameterTypeDescription
time
setMinSplineCurveSize

Sets the minimum curve size used when optimized spline control point routing is enabled.

The parameter works only if the layout supports the generic spline optimization routing, and if it is enabled.

Bends in a spline have a size that is described roughly by the triangle the surrounds the curve part of a bend. Spline routing tries to set the side length of this triangle at each bend between the minimum curve size and the maximum curve size.

The default value is 5.

ParameterTypeDescription
sizeNumberThe minimum spline curve size
setNodeComparator

Sets the comparator used for sorting the nodes. If the value null is passed, no comparator is used. If a node comparator is specified, the algorithm calculates the logical order of children of nodes in the tree by using this comparator.

The default value is null (no comparator).

ParameterTypeDescription
comparator
setNonTreeLinksStraight

Sets whether all non-tree links that don't have the no-reshape link style and that are not fixed and are not incident to fixed nodes are reshaped to be straight. Otherwise, the non-tree links are not changed at all.

This option is disabled by default. When disabled, the tree layout only routes the links of the spanning tree, but no other link. When enabled, the tree layout iterates over the links obtained by TreeLayout.getCalcNonTreeLinks() and makes them straight.

It obeys the link clip interface and the link connection box interface when making the non-tree links straight. The tree layout can only obey the link style and the connector style of the tree links but not of the non-tree links. In particular, it is not able to route non-tree links orthogonally. Only tree-links can be routed orthogonally. Usually it is recommended to apply an additional link layout to the non-tree links if there are any. However, if the non-tree links should just be straight, this option comes in handy since an additional link layout can be omitted in this case.

ParameterTypeDescription
enable
setNorthSubtreeBlockMargin

Sets the margin on the north side of the subtree starting at the input node. If the value is set to a positive number, the subtree starting at this node is considered a rectangular block, and other nodes not belonging to this subtree are moved at least the specified margin away from this block. Specifying subtree block margins is useful if you plan to draw a rectangle around this subtree, since it ensures that unrelated nodes do not extend into the rectangle.

The default value is -1, means no margin.

ParameterTypeDescription
nodeObjectThe node instance.
marginNumberThe margin on the north side of the subtree starting at the input node.
setNumberOfAlternatingCircles

Sets the number of alternating circles.

This option has only an effect in layout mode TreeLayout.ALTERNATING_RADIAL. Alternating placement means that the nodes of one level are placed alternating in several circular layers. By default, it uses 2 circular layers for the alternating placement. Nonalternating placement means that the nodes of one level are placed in one circular layer.

This option allows to define how many alternating layers are maximally used. You cannot have more layers than nodes in the level, hence it is only the maximum number of layers. Furthermore, the layout analyses which levels must use the alternating placement in order to optimize space, unless the option TreeLayout.isAllLevelsAlternating() returns true.

If you set the number to a positive value and TreeLayout.isAllLevelsAlternating() returns true, each level has exactly that many circular layers, unless the level has not sufficient nodes. If you set the number to a positive value and TreeLayout.isAllLevelsAlternating() returns false, each level has either exactly that many circular layers or one circular layer, depending on which version uses the space better. If you set the number to 0, a heuristic tries to determine for each level how many circular layers are needed in order to optimize the space. In this case, different levels can have different number of circular layers, and the value of TreeLayout.isAllLevelsAlternating() is ignored.

Note that the layout may have link crossings if a huge number of alternating circles per level is used.

The default value is 2.

ParameterTypeDescription
numCircles
setObjectParameter
Returns Object: The value that was previously stored for 'key', or 'null' if none.

Sets the value of a parameter for a node or a link, using a given graph model.

If value is null, the parameter is removed. Otherwise, the parameter value is set to value.

Notice that the method does not check whether the node or link actually belongs to graphModel. The input graph model does not need to be the graph model currently attached to this layout instance.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model used for storing the parameter.
nodeOrLinkObjectThe node or link for which the parameter is to be set.
keyStringThe key string for the parameter.
valueObjectThe new value of the parameter.
setOrthForkPercentage

Sets the percentage of the parent-child offset that determines the location where the orthogonal link routing places the bends in order to fork the routing towards the children. This has an effect only if the orthogonal link style is chosen.

The default value is 45%.

This is an expert option. In all normal cases, it is not necessary to change the option. It is recommended choosing an orthogonal fork percentage that is always larger than the overlap percentage to obtain a good layout.

ParameterTypeDescription
percentage
setOverlapPercentage

Sets the percentage for which a node is considered smaller in the flow direction. This allows nodes to be placed closer together. However, in layout modes TreeLayout.FREE, TreeLayout.TIP_OVER, TreeLayout.TIP_ROOTS_OVER, TreeLayout.TIP_LEAVES_OVER, and TreeLayout.TIP_ROOTS_AND_LEAVES_OVER, outgoing links of a node may, in rare cases, cross the neighbor leaf nodes if the overlap percentage is high. To avoid this, set the parameter to 0%.

The default value is 30%, which is a good compromise for many graphs between wasting space and the risk of having links cross nodes.

This is an expert option. In all normal cases, it is not necessary to change the option. It is recommended choosing an orthogonal fork percentage that is always larger than the overlap percentage to obtain a good layout.

This option has no effect if the respect node sizes option is disabled.

ParameterTypeDescription
percentage
setParameter
Returns Object: The value that was previously stored for 'key', or 'null' if none.

Sets the value of a property for the layout instance. If value is null, the parameter is removed. Otherwise, the parameter value is set to value.

ParameterTypeDescription
keyStringThe key string for the parameter.
valueObjectThe new value of the parameter.
setParametersUpToDate

Sets whether the parameters of the graph layout are up to date.

If the argument is false, notifies the layout instance that a parameter value was changed.

This method is automatically called with a false argument each time the value of a parameter is changed using the methods provided in this class or in its subclasses provided in IBM ILOG Dojo Diagrammer.

The method is automatically called with a true argument each time the layout is successfully performed.

ParameterTypeDescription
uptodate
setParentChildAssociateOffset

Sets the minimum offset between the parent and the first associate. This offset is used if a parent has associate nodes. This method has no effect if the layout mode is radial or if no associates occur.

If the flow direction is toward the top or bottom, the orthogonal link segment starting at the parent is vertical, and the associates are placed left or right of this link segment. In this case, it is a vertical offset between parent and child. If the flow direction is toward the left or right, the orthogonal link segment starting at the parent is horizontal, and the associates are placed above or below this link segment. In this case, it is a horizontal offset between parent and child.

If the Respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.

The default value is 30.

ParameterTypeDescription
offset
setParentChildOffset

Sets the minimum offset between a parent and its children.

If the flow direction is towards the top or bottom and the layout mode is not radial or balloon, this is a vertical offset. If the flow direction is towards the left or right and the layout mode is not radial or balloon, this is a horizontal offset. If the layout mode is radial or balloon, this is an offset radial to the circle or ellipses. In balloon mode, it corresponds to the minimal radius of the balloon.

If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.

The default value is 40.

ParameterTypeDescription
offset
setParentLayout

Sets the parent layout of this layout instance. You should not call this method directly.

ParameterTypeDescription
parent
setPosition

Sets the position of the layout. This can be used if connected component processing is disabled, or if the graph is fully connected. It has no effect otherwise.

If no position is specified, the layout algorithm keeps the position of the first root node unchanged.

ParameterTypeDescription
pointPointThe position.
isRootPositionBooleanIf 'true', it specifies the position of the first root node. This is useful in incremental mode. If 'false', it specifies the position of the top-left border of the layout.
setPreserveFixedLinks

Sets whether the layout avoids movement of fixed links. If the argument is true, specifies that the layout is not allowed to reshape the links indicated as fixed by the user. If the argument is false, the layout is free to reshape all the links of the graph. (This does not change the setting for the fixed links, which can still be used at any time in the future.)
The default value is false.

An Error is thrown if the layout class does not support this option.

ParameterTypeDescription
option
setPreserveFixedNodes

Sets whether the layout avoids movement of fixed nodes. If the argument is true, specifies that the layout is not allowed to move the nodes indicated as fixed by the user. If the argument is false, the layout is free to move all the nodes of the graph. (This does not change the setting for the fixed nodes, which can still be used at any time in the future.)

The default value is false.

Note that fixed nodes can be handled differently by different layout algorithms. Some layout algorithms can adapt the layout of the nonfixed nodes to take into account the current positions of the fixed nodes. For details, refer to the documentation of the layout algorithm.

ParameterTypeDescription
option
setRespectNodeSizes

Sets whether the algorithm must try to respect the size of the nodes. If the argument is true, the spacing parameters are interpreted as the minimum distance between the node borders. If the argument is false, the spacing parameters are interpreted as the minimum distance between the node centers.

If respecting node sizes is disabled, the level alignment option has no effect.

This is an expert option. The default is true. It makes sense to switch this option off only if all nodes already have approximately the same size and the spacing parameters are larger than the largest node. If the option is switched off, large nodes may otherwise overlap. In particular, it is recommended keeping the option enabled if orthogonal links are used.

ParameterTypeDescription
respect
setRoot

Allows you to specify the root(s) of the tree. If more than one connected component exists, it is possible to select a root for each component. If no root is specified, an appropriate node is automatically selected as root. For a directed tree, the canonical root node with degree 0 is selected unless otherwise specified.

Setting the root node by this method is identical to setting the root preference of this node to 10000.

ParameterTypeDescription
nodeObjectThe root of the tree.
setRootPosition

Sets the meaning of the specified position. The specified position is the one that can be obtained from TreeLayout.getPosition(). If passed true the specified position means the position of the root node. Otherwise, it means the position of the top-left border of the layout. This can be used if connected component processing is disabled, or if the graph is fully connected. It has no effect otherwise.

ParameterTypeDescription
isRootPosition
setRootPreference

Specifies the preference of the node to become root node. The higher the preference, the more likely the node will be selected as root node.

If a negative value is passed as input, the preference of the node is unspecified. In this case, the algorithm calculates a preference so that for directed trees the canonical root nodes with degree 0 have the highest preference.

ParameterTypeDescription
nodeObjectThe node instance.
preferenceintThe preference of the node to become a root node.
setSeedValueForRandomGenerator

Sets the seed value for the random generator. The default value is 0. The user-defined seed value is used only if you call setUseSeedValueForRandomGenerator(boolean) with a true argument.

An Error is thrown if the layout does not support this mechanism.

ParameterTypeDescription
seed
setSiblingOffset

Sets the minimum offset between siblings, that is, between nodes that have the same parent in the tree structure.

If the flow direction is towards the top or bottom and the layout mode is not radial, this is a horizontal offset. If the flow direction is towards the left or right and the layout mode is not radial, this is a vertical offset. If the layout mode is radial, this is an offset tangential to the circles or ellipses.

This offset has no effect in balloon layout mode. Use the branch offset to control the spacing between all nodes in balloon layout mode.

If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.

The default value is 40.

ParameterTypeDescription
offset
setSouthSubtreeBlockMargin

Sets the margin on the south side of the subtree starting at the input node. If the value is set to a positive number, the subtree starting at this node is considered a rectangular block, and other nodes not belonging to this subtree are moved at least the specified margin away from this block. Specifying subtree block margins is useful if you plan to draw a rectangle around this subtree, since it ensures that unrelated nodes do not reach into the rectangle.

The default value is -1, which means no margin.

ParameterTypeDescription
nodeObjectThe node instance.
marginNumberThe margin on the south side of the subtree starting at the input node.
setSplineLinkFilter

Sets the filter that detects which links are suitable for optimized spline routing.

The parameter works only if the layout supports the generic spline optimization routing, and if it is enabled.

The filter detects which objects are splines, so that the optimized spline routing is only applied to splines, not to normal polyline links.

ParameterTypeDescription
filter
setSplineRoutingEnabled

Sets whether the calculation of optimized spline control points is enabled.

If the layout algorithm supports generic spline optimization, this option enables the optimization of spline control points. Such optimization improves the result only if the splines use a smoothness between 0.1 and 0.9. It does not affect links that are not reshaped by the layout algorithm or that are routed as straight lines.

This is an expert option. It is disabled by default.

ParameterTypeDescription
flagBooleanSet to 'true' to enable the optimization of spline control points.
setStructureUpToDate

Sets whether the structure of the graph is up to date.

If the argument is false, notifies the layout instance that the structure of the graph was changed since the last time the layout was successfully performed.

Usually you do not need to call this method. The method is automatically called with a true argument each time the layout is successfully performed.

ParameterTypeDescription
uptodate
setSubtreeBlockMargin

Sets the margin on the specified side of the subtree starting at the input node. Possible values for the side parameter are TreeLayout.EAST, TreeLayout.WEST, TreeLayout.NORTH, and TreeLayout.SOUTH. If the value is set to a positive number, the subtree starting at this node is considered a rectangular block, and other nodes not belonging to this subtree are moved at least the specified margin away from this block. Specifying subtree block margins is useful if you plan to draw a rectangle around this subtree, since it ensures that unrelated nodes do not extend into the rectangle.

The default value is -1, which means no margin on the specified side.

ParameterTypeDescription
nodeObjectThe node instance.
sideintThe subtree side.
marginNumberThe margin on the specified side of the subtree starting at the input node.
setTipOverBranchOffset

Sets the minimum offset in the flow direction between neighbor nodes that belong to different branches in the tree. This offset is used to separate the branches if their common parent node has tip-over alignment. It has no effect if the layout mode is radial or if no tip-over alignment occurs.

If the flow direction is towards the top or bottom, this is a vertical offset. If the flow direction is towards the left or right, this is a horizontal offset.

If the respect node sizes option is enabled, this is the minimum offset between node borders; otherwise, it is the minimum offset between node centers.

The default value is 40.

ParameterTypeDescription
offset
setUseSeedValueForRandomGenerator

Sets whether the user-defined seed value should be used for the random generator.

An Error is thrown if the layout does not support this mechanism.

ParameterTypeDescription
option
setWestEastNeighboring

Creates an east-west neighboring of two nodes. The westNode is placed as the first neighbor on the same level to the west of the eastNode. This implies, conversely, that the eastNode is the first neighbor on the same level to the east of the westNode.

This method is identical to TreeLayout.setEastWestNeighboring() with a reversed argument order, and is provided for convenience. Note that, for instance, when the flow direction is towards the bottom, east is to the right of west, and therefore resembles more the argument order of setWestEastNeighboring. When the flow direction is towards the top, east is to the left of west, and therefore resembles more the argument order of setEastWestNeighboring.

ParameterTypeDescription
westNodeObjectThe west neighbor of the 'eastNode'.
eastNodeObjectThe east neighbor of the 'westNode'.
setWestSubtreeBlockMargin

Sets the margin on the west side of the subtree starting at the input node. If the value is set to a positive number, the subtree starting at this node is considered a rectangular block, and other nodes not belonging to this subtree are moved at least the specified margin away from this block. Specifying subtree block margins is useful if you plan to draw a rectangle around this subtree, since it ensures that unrelated nodes do not extend into this rectangle.

The default value is -1, means no margin.

ParameterTypeDescription
nodeObjectThe node instance.
marginNumberThe margin on the west side of the subtree starting at the input node.
stopImmediately
Returns Boolean: 'true' during the early steps of the layout algorithm and 'false' in the last step when the layout algorithm cannot be stopped.

Stops the running layout algorithm as soon as possible. The Tree Layout algorithm has several steps. During the early steps, the layout algorithm can be stopped and the method returns true. In the last step, the layout algorithm cannot be stopped and the method returns false.

supportsAllowedTime
Returns Boolean

Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded. If the allowed time elapses before termination of the Tree Layout algorithm, the nodes and links are not moved and remain at the same position as before the start of the algorithm. The result code in the layout report is ibm_ilog.graphlayout.GraphLayoutReport.STOPPED_AND_INVALID in this case.

supportsLayoutOfConnectedComponents
Returns Boolean

Indicates that this layout class can use the generic connected component layout mechanism of the GraphLayout base class. This mechanism cuts the attached graph into connected components, applies itself to each connected component separately, and then uses the layout instance returned by the method ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents() to position the connected components. By default, this layout is an instance of ibm_ilog.graphlayout.grid.GridLayout which can be customized as needed.

The generic connected component layout mechanism has the disadvantage that it moves connected components completely. Fixed nodes within a component do not preserve their old positions, and the resulting layout may be unstable on incremental changes in incremental mode, depending on which layout instance is used for the component layout.

If the generic connected component layout mechanism is disabled, the algorithm uses its own specialized internal mechanism instead of the generic mechanism to lay out each component as a separate tree. This is usually faster and more stable on incremental changes than the generic mechanism. In addition, it enables the user to set the position of the layout.

supportsLayoutRegion
Returns Boolean

Indicates whether the layout class can control the position and/or size of the graph drawing according to a user-defined region (a rectangle) or a user-defined area of a manager view.

The default implementation always returns false.

Subclasses can override this method in order to return true, that is, to indicate that this option is supported.

supportsLinkConnectionBox
Returns Boolean

Indicates that this layout class can use a link connection box interface to calculate the end points of links. The link connection box interface is an object that provides the rectangle to which the links are connected for each node and the tangential shift offset at each side for the connection points. This is useful if the connection points of the links at a node should be relative to a rectangle that is smaller or larger than the real bounding box of the node.

Link connection points are not calculated for links that have the no-reshape link style, that are fixed, or that are not tree links. Only the connection points of reshapeable tree links are calculated.

If a connection box interface object is set using the method ibm_ilog.graphlayout.GraphLayout.setLinkConnectionBoxInterface(), the layout algorithm uses this object together with the connector style to calculate the connection points for links.

If a link clip interface is set additionally, the layout algorithm calculates the initial connection points at the node boxes with the link connection box interface and the connector style and obtains the final connection points at the border of the node shapes by clipping with the link clip interface. This works well particularly if the node box obtained by the link connection box interface is smaller than the real bounding box of the node.

supportsPercentageComplete
Returns Boolean

Indicates that this layout class can estimate the percentage of completion during the run of the layout.

supportsPreserveFixedLinks
Returns Boolean

Indicates that this layout class allows the user to specify fixed links. Fixed links are not reshaped during the layout if the method ibm_ilog.graphlayout.GraphLayout.setPreserveFixedLinks() is called with a true argument. Fixed links are ignored by the Tree Layout algorithm, which may lead to overlaps. The effect is very similar to the effect when the link is filtered during layout.

supportsPreserveFixedNodes
Returns Boolean

Indicates that this layout class allows the user to specify fixed nodes.

Fixed nodes are not moved during the layout if the method ibm_ilog.graphlayout.GraphLayout.setPreserveFixedNodes() is called with a true argument. Links that are incident to fixed nodes are not reshaped during the layout. Fixed nodes are ignored by the Tree Layout algorithm, which may lead to node overlaps. The effect is very similar to the effect when the node is filtered during layout.

supportsRandomGenerator
Returns Boolean

Indicates whether the layout class uses randomly generated numbers (or randomly chosen parameters) for which it can accept a user-defined seed value. When you perform the same layout on the same graph several times and use the same user-defined seed value (or some other constant value), the same random numbers are generated and, if the algorithm is deterministic, you obtain the same drawing of the graph model. If you want different drawings each time you perform the layout, you can modify the seed value and call the method ibm_ilog.graphlayout.GraphLayout.setUseSeedValueForRandomGenerator() with a true argument.

The default implementation always returns false.

Subclasses can override this method in order to return true, that is, to indicate that this option is supported.

supportsSplineRouting
Returns Boolean

Tests if this class supports the generic optimization of spline control points.

Due to the nature of a tree, the optimized spline routing is less seldom needed for tree layout, while it is highly useful for other layout styles such as hierarchical layout. Optimized spline routing is offered for tree layout for consistency reasons.

supportsStopImmediately
Returns Boolean

Indicates that this layout class can interrupt the current run of the layout immediately in a controlled way. If the algorithm is stopped before termination of the Tree Layout algorithm, the nodes and links are not moved and remain at the same position as before the start of the algorithm. The result code in the layout report is ibm_ilog.graphlayout.GraphLayoutReport.STOPPED_AND_INVALID in this case.

toString
Returns String: A printable string representing this layout instance.

Returns a printable string containing the fully qualified class name and the identifier returned by the method getInstanceId().

unfixAllLinks

Removes the fixed attribute from all links in the graph model.

An Error is thrown if the layout class does not support this option or if there is no attached graph model.

unfixAllNodes

Removes the fixed attribute from all nodes in the graph model. An Error is thrown if the layout class does not support this option or if there is no attached graph model.

Events

onLayoutStepPerformed

This method can be called by the layout classes when a step (or iteration) of the layout algorithm has been performed.

ParameterTypeDescription
layoutStarted
layoutFinished
onObjectParameterChanged

Called when a layout parameter for a specific node or link has changed.

It calls ibm_ilog.graphlayout.GraphLayout.setParametersUpToDate() with a false argument to notify the layout instance that the layout is not up-to-date. It also fires a graph layout parameter event.

If you add new parameters for specific nodes and links to your own subclass of GraphLayout, you should call this method each time they are modified.

ParameterTypeDescription
nodeOrLinkObjectNode or link instance for which a parameter has been changed.
parameterNameStringName of the parameter whose value has been changed.
onParameterChanged

Called when a global layout parameter has changed.

Global layout parameters affect all or many nodes and links. It calls ibm_ilog.graphlayout.GraphLayout.setParametersUpToDate() with a false argument to notify the layout instance that the layout is not anymore up to date. It also fires a graph layout parameter event.

If you add new global parameters in your own subclass of GraphLayout, you should call this method each time they are modified.

ParameterTypeDescription
parameterNameStringName of the parameter whose value has been changed.
onParameterChangedImpl
ParameterTypeDescription
nodeOrLink
parameterName