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

ibm_ilog.graphlayout.hierarchical.HierarchicalLayout

Object » ibm_ilog.graphlayout.GraphLayout » ibm_ilog.graphlayout.hierarchical.HierarchicalLayout
dojo.require("ibm_ilog.graphlayout.hierarchical.HierarchicalLayout");

The main class for the Hierarchical Layout algorithm.

The Hierarchical Layout arranges the nodes in horizontal or vertical levels such that the majority of the links point in the same direction and the number of link crossings is small.

Here is a sample drawing produced by the Hierarchical Layout algorithm with two levels of nodes that are top-justified within each level:

Sample drawing produced with the Hierarchical Layout

Another sample drawing with eight levels follows. This graph contains a cycle and a self-loop. The direction of the flow is from top to bottom. The nodes are organized in horizontal levels.

Sample drawing produced with the Hierarchical Layout

The Hierarchical Layout algorithm supports different styles of links in the same drawing. The following sample drawing shows orthogonal, straight, and polyline links. The direction of the flow is to the right and the node levels are vertical.

Sample drawing produced with the Hierarchical Layout

The Hierarchical Layout algorithm supports port specifications. The side and index of the port where a link connects to a node can be specified. The following sample drawing shows a drawing with port specifications and orthogonal link style. The direction of the flow is from top to bottom.

Sample drawing produced with the Hierarchical Layout

To simplify the explanations of the layout parameters, we use the compass directions north, south, east, and west. The first level of the layout is the north pole. If the flow direction is top to bottom, north is always upwards, south towards the bottom, west towards the left, and east towards the right side of the layout. If the flow direction is left to right, north is left and south is right.

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:

  • The layout algorithm always takes into account the direction of links.
  • The initial position of the nodes (at the moment you start the layout) does not affect the resulting layout.
  • The algorithm supports self-links, cycles, and multiple links between the same pair of nodes.

Property Summary

  • AUTOMATIC_PINS Automatic connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connector style is automatically selected depending on the global link style.
  • CENTERED_PINS Centered connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connection points of links are placed at the center of the border the link is attached to.
  • CLIPPED_PINS Clipped connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connection points of links are placed such that the link pointing toward the node center is clipped at the node border.
  • DEFAULT_HIERARCHICAL_ALLOWED_TIME
  • EAST East port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the east border of its end node at the "from" or "to" side.
  • EVENLY_SPACED_PINS Evenly spaced connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connection points of links are evenly spaced along the border the link is attached to.
  • FIXED_IN_X_MODE Fixed movement mode for the x direction. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout is free to move the nodes in the y direction but keeps the nodes fixed in the x direction. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'.
  • FIXED_IN_Y_MODE Fixed movement mode for the y direction. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout is free to move the nodes in the x direction but keeps the nodes fixed in the y direction. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'.
  • FIXED_MODE Fixed movement mode. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout keeps all nodes fixed. Only nodes that are marked for incremental repositioning will be moved, and links are rerouted. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'. When this mode is used as the argument of the method ' HierarchicalLayout.setGlobalOriginPointMode()' or ' HierarchicalLayout.setGlobalDestinationPointMode()', the layout must keep the current position of the connection point. To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' HierarchicalLayout.setOriginPointMode()' or ' HierarchicalLayout.setDestinationPointMode()'.
  • FREE_MODE Free movement mode. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout is free to move the nodes. Depending on the various parameters of the incremental mode, the layout shifts the nodes to optimize the space usage, but the shifting does not change the relative order of the nodes and links, so that the diagram after an incremental layout looks very similar to the previous diagram. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'. When this mode is used as the argument of the method ' HierarchicalLayout.setGlobalOriginPointMode()' or ' HierarchicalLayout.setGlobalDestinationPointMode()', the layout is free to choose the appropriate position of the connection points, except for "pinned" connection points (see ' ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()'). To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' HierarchicalLayout.setOriginPointMode()' or ' HierarchicalLayout.setDestinationPointMode()'.
  • HIGHER_LEVELS The leveling strategy that utilizes higher-numbered levels. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'HIGHER_LEVELS', the layout algorithm pulls nodes to the highest-numbered level possible. Root nodes in particular are affected.
  • LOWER_LEVELS The leveling strategy to utilize lower numbered levels. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'LOWER_LEVELS', the layout algorithm pulls nodes to the lowest-numbered level possible. This particularly effects leaf nodes.
  • MIXED_MODE Mixed movement mode. When this mode is used as the argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', each node can have a different movement mode during incremental layout. The mode for an individual node can be set by the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'. When used as the argument of the method ' HierarchicalLayout.setGlobalOriginPointMode()' or ' HierarchicalLayout.setGlobalDestinationPointMode()', the connection point of each link can have a different mode. The mode for the connection points of an individual link can be set by the method ' HierarchicalLayout.setOriginPointMode()' or ' HierarchicalLayout.setDestinationPointMode()'.
  • MIXED_STYLE Mixed link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by ' HierarchicalLayout.setLinkStyle()'.
  • NORTH North port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the north border of its end node at the "from" or "to" side.
  • NO_RESHAPE_STYLE No reshape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', none of the links are reshaped. To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
  • OPTIMAL The optimal leveling strategy. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'OPTIMAL', the layout algorithm tries to minimize the sum of level distances for all edges.
  • ORTHOGONAL_STYLE Orthogonal link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', all links get a shape consisting of a sequence of orthogonal line segments. To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
  • POLYLINE_STYLE Polyline link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', all links get a shape consisting of a sequence of line segments (not necessarily orthogonal). To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
  • SEMI_OPTIMAL The semioptimal leveling strategy. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'SEMI_OPTIMAL', the layout algorithm tries a quick heuristic to minimize the sum of level distances for all edges. The algorithm pulls root nodes to the highest-numbered level possible and leaf nodes to the lowest-numbered level possible.
  • SOUTH South port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the south border of its end node at the "from" or "to" side.
  • SPREAD_OUT The leveling strategy to spread the nodes over all levels. This can be considered as the inverse of the semioptimal leveling strategy. It pulls root nodes to the lowest-numbered level possible and leaf nodes to the highest-numbered level possible.
  • STRAIGHT_LINE_STYLE Straight-line link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', all links get a straight-line shape. To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
  • UNSPECIFIED Unspecified port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link can be connected to any border of its end node at the "from" or "to" side.
  • WEST West port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the west border of its end node at the "from" or "to" side.

Method Summary

  • addConstraint(constraint) Adds a constraint for the hierarchical layout.
  • 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(redraw) 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(a0)
  • 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.
  • getAllowedTime() returns Number Returns the currently allowed time for the layout algorithm in milliseconds.
  • getBalanceSplineCurveThreshold() returns Number Returns the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • getCalcLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region parameter.
  • getCalcNodeLevelIndex(node) returns int Returns the calculated level index of a node after performing a layout.
  • getCalcNodePositionIndex(node) returns int Returns the calculated index of the node position within a level after performing a layout.
  • getConnectorStyle() returns int Returns the style of the connectors.
  • getConstraints() returns ibm_ilog.graphlayout.IIterator Returns the constraints that have been added to the hierarchical layout.
  • getDestinationPointMode(link) Returns the destination point mode of an individual link.
  • getEastNumberOfPorts(node) returns int Returns the number of relative ports on the east side of a node.
  • getFlowDirection() returns int Returns the current direction of the link flow.
  • getFromPortIndex(link) returns int Returns the port index of a link at the "from" side.
  • getFromPortSide(link) Returns the port side of a link at the "from" side.
  • getGlobalDestinationPointMode() returns int Returns the global mode for the connection points of the links on the destination nodes.
  • getGlobalIncrementalNodeMovementMode() returns int Returns the node movement mode used during incremental layout.
  • getGlobalLinkStyle() returns int Returns the global style of the shapes of links.
  • getGlobalOriginPointMode() returns int Returns the global mode for the connection points of the links on the origin nodes.
  • getGraphModel() returns ibm_ilog.graphlayout.AbstractGraphLayoutModel Returns the graph model to lay out if a graph model is attached.
  • getHorizontalLinkOffset() returns Number Returns the horizontal offset between parallel segments of links.
  • getHorizontalNodeLinkOffset() returns Number Returns the horizontal offset between a node and a link segment that is parallel to the node border.
  • getHorizontalNodeOffset() returns Number Returns the horizontal offset between nodes.
  • getIncrementalAbsoluteLevelPositionRange() returns Number Returns the range that is considered very close to the previous node position.
  • getIncrementalAbsoluteLevelPositionTendency() returns Number Returns the percentage of how much the layout algorithm tries to place nodes to absolute positions within the level that are close to the previous positions during incremental layout.
  • getIncrementalNodeBoxForExpand(expandedNode) returns Rectangle Returns the effective bounding rectangle of an expanded node during incremental layout.
  • getIncrementalNodeMovementMode(node) Returns the movement mode of an individual node used during incremental layout.
  • 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.
  • 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.
  • getLevelJustification() returns int Returns the current justification within the levels.
  • getLevelingStrategy() returns int Returns the current hierarchical layout leveling strategy.
  • getLinkConnectionBoxInterface() returns ibm_ilog.graphlayout.ILinkConnectionBoxProvider Returns the link connection box interface used to calculate the connection points of links during layout.
  • getLinkPriority(link) returns Number Returns the priority of a link.
  • getLinkStyle(link) Returns the style for the shape of an individual link.
  • getMaxInterLevelApertureAngle() returns Number Returns the maximum aperture angle of the links incident to a node.
  • 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.
  • getMinEndSegmentLength() returns Number Returns the minimum length of the last segment of each link, that is, the segment that is incident to the "to" node.
  • getMinForkSegmentLength() returns Number Returns the minimum length of the start or end segment of links if a fork shape is used for these links.
  • getMinSplineCurveSize() returns Number Returns the minimum curve size used when optimized spline control points routing is enabled.
  • getMinStartSegmentLength() returns Number Returns the minimum length of the first segment of each link, that is, the segment that is incident to the "from" node.
  • getMultiLinkOptimizationMaxSpread() returns Number Returns the maximum spread width for the bends introduced by the optimization of overlapping multiple links.
  • getMultiLinkOptimizationOffset() returns Number Returns the minimum distance between bends introduced by the optimization of overlapping multiple links.
  • getNodeGroups() returns ibm_ilog.graphlayout.IIterator Returns the node groups that occur in constraints that were added to the hierarchical layout.
  • getNorthNumberOfPorts(node) returns int Returns the number of relative ports on the north side of a node.
  • getNumberOfConstraints() returns int Returns the number of constraints that have been added to the hierarchical layout.
  • getNumberOfLinkCrossingSweeps() returns int Returns the number of layer sweeps to remove link crossings.
  • getNumberOfNodeGroups() returns int Returns the number of node groups that occur in constraints that were added to the hierarchical layout.
  • getNumberOfPorts(node, side) returns int Returns the specified number of relative ports of a node on the specified side.
  • getObjectParameter(graphModel, nodeOrLink, key) returns Object Returns the value of a parameter of the layout instance.
  • getOriginPointMode(link) Returns the origin point mode of an individual link.
  • getParameter(key) returns Object Returns the value of a parameter of the layout instance.
  • getParentLayout() returns ibm_ilog.graphlayout.GraphLayout Returns the parent layout.
  • getPosition() returns Point Returns the specified position of the layout.
  • getPreferredForkAxisLength() returns Number Returns the preferred length of the axis of a fork shape.
  • 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.
  • getSeedValueForRandomGenerator() returns Number Returns the user-defined seed value for the random generator.
  • getSelfLinkFromPortSide() returns int Returns the default port side of a self-link at the "from" side.
  • getSelfLinkToPortSide() returns int Returns the default port side of a self-link at the "to" side.
  • getSouthNumberOfPorts(node) returns int Returns the number of relative ports on the south side of a 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'.
  • getSpecNodeLevelIndex(node) returns int Returns the index of the specified level for a node.
  • getSpecNodePositionIndex(node) returns int Returns the index of the specified position of a node within a level.
  • getSplineLinkFilter() returns ibm_ilog.graphlayout.SplineLinkFilter Returns the filter that detects which links are suitable for optimized spline routing.
  • getToPortIndex(link) returns int Returns the port index of a link at the "to" side.
  • getToPortSide(link) Returns the port side of a link at the "to" side.
  • getVerticalLinkOffset() returns Number Returns the vertical offset between parallel segments of links.
  • getVerticalNodeLinkOffset() returns Number Returns the vertical offset between a node and a link segment that is parallel to the node border.
  • getVerticalNodeOffset() returns Number Returns the vertical offset between nodes.
  • getViewMatrix() Returns the matrix that is applied to the first view attached to this layout.
  • getWestNumberOfPorts(node) returns int Returns the number of relative ports on the west side of a node.
  • increasePercentageComplete(newPercentage) Increases the percentage of completion that is stored in the layout report to the input value.
  • init() Initializes instance variables.
  • isBacktrackCrossingReductionEnabled() returns Boolean Returns 'true' if the backtrack mechanism of the link crossing reduction phase is enabled.
  • isCrossingReductionDuringIncremental() returns Boolean Returns 'true' if crossing reduction during incremental layout is enabled.
  • 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.
  • isFromFork() returns Boolean Returns 'true' if the fork shape is enabled for links that start at the same source point.
  • isGeometryUpToDate() returns Boolean Returns whether the geometry of the graph is up to date.
  • isIncrementalAbsoluteLevelPositioning() returns Boolean Returns 'true' if the algorithm tries to place the nodes within the level to absolute positions that are close to the previous positions during incremental layout.
  • 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 levels.
  • 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.
  • isLinkCrossingFineTuningEnabled() returns Boolean Returns 'true' if the link crossing fine tuning phase is enabled.
  • isLinkStraighteningEnabled() returns Boolean Returns 'true' if the link straightening phase is enabled.
  • isLinkWidthUsed() returns Boolean Returns 'true' if the layout respects the width of links.
  • isLocalRecursiveLayoutNeeded(layoutProvider, recLayout, rootModel, traverse) returns Boolean Checks whether layout is needed when layout is performed recursively on a hierarchy of nested subgraphs.
  • isLongLinkCrossingReductionDuringIncremental() returns Boolean Returns 'true' if the handling of long links by the crossing reduction during incremental layout is enabled.
  • isMedianCrossingValueEnabled() returns Boolean Returns 'true' if the median crossing value is used during crossing reduction.
  • isMultiLinkOptimizationEnabled() returns Boolean Returns 'true' if the optimization of overlapping multiple links is enabled.
  • isNeighborLinksAligned() returns Boolean Returns 'true' if links between neighbor nodes of the same level are aligned so that they are parallel.
  • isNonorthogonalBendEliminationEnabled() returns Boolean Returns 'true' if the bend elimination phase for nonorthogonal links is enabled.
  • isOrthogonalStairCaseEliminationEnabled() returns Boolean Returns 'true' if the stair case elimination phase for orthogonal links is enabled.
  • isParametersUpToDate() returns Boolean Returns whether the layout parameters are up to date.
  • isPolylineLinkOverlapReductionEnabled() returns Boolean Returns 'true' if the optimization of polyline links is enabled to avoid links overlapping large neighbor nodes.
  • 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.
  • isRecursiveLayoutFromAncestorAllowed() returns Boolean Returns 'true' if the layout instance of an ancestor graph is in principle allowed to treat this subgraph in a recursive layout.
  • isRecursiveLayoutMode() returns Boolean Returns 'true' if this layout instance handles all subgraphs recursively that are nested into this graph.
  • isSelfLinksSameSideNested() returns Boolean Returns 'true' if self-links that attach the same side of a node are nested.
  • 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.
  • isToFork() returns Boolean Returns 'true' if the fork shape is enabled for links that end at the same target point.
  • 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 Hierarchical Layout algorithm.
  • markForIncremental(nodeOrLink) Marks the input node or link to be repositioned with the next call of ' ibm_ilog.graphlayout.GraphLayout.performLayout()' if incremental mode is enabled.
  • 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.
  • removeAllConstraints() Removes all the constraints from the hierarchical layout.
  • removeConstraint(constraint) Removes the specified constraint from the hierarchical layout.
  • removeMostRecentConstraint() Removes the constraint that was most recently added from the hierarchical layout.
  • setAllowedTime(time) Sets the upper limit for the duration of the layout algorithm.
  • setBacktrackCrossingReductionEnabled(flag) Sets whether the backtrack mechanism of the link crossing reduction phase is enabled.
  • setBalanceSplineCurveThreshold(threshold) Sets the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • setConnectorStyle(style) Sets the style of connectors.
  • setCrossingReductionDuringIncremental(enable) Sets whether crossing reduction during incremental layout is enabled.
  • setDestinationPointMode(link, mode) Sets the mode for the connection point of an individual link on the destination node.
  • setEastNumberOfPorts(node, numberOfPorts) Sets the number of relative ports on the east side of a node.
  • setFixed(nodeOrLink, fixed) Sets the specified node or link as fixed.
  • setFlowDirection(direction) Sets the direction of the link flow.
  • setFromFork(enable) Sets whether a fork shape is created for links that start at the same source point.
  • setFromPortIndex(link, portIndex) Sets the port index of a link at the "from" side.
  • setFromPortSide(link, side) Sets the port side of a link at the "from" side.
  • setGeometryUpToDate(uptodate) Sets whether the geometry of the graph is up to date.
  • setGlobalDestinationPointMode(mode) Sets the global mode for the connection point of the links on the destination nodes.
  • setGlobalIncrementalNodeMovementMode(mode) Sets the node movement mode used during incremental layout.
  • setGlobalLinkStyle(style) Sets the global style of the shapes of links.
  • setGlobalOriginPointMode(mode) Sets the global mode for the connection point of the links on the origin nodes.
  • setGraphModel(graphModel) Sets the graph model to be laid out.
  • setHorizontalLinkOffset(offset) Sets the horizontal offset between parallel segments of links.
  • setHorizontalNodeLinkOffset(offset) Sets the horizontal offset between a node and a link segment that is parallel to the node border.
  • setHorizontalNodeOffset(offset) Sets the horizontal offset between nodes.
  • setIncrementalAbsoluteLevelPositionRange(range) Sets the range that is considered very close to the previous node position.
  • setIncrementalAbsoluteLevelPositionTendency(percentage) Sets the percentage how much the layout algorithm tries to place nodes to absolute positions within the level that are close to the previous positions during incremental layout.
  • setIncrementalAbsoluteLevelPositioning(enable) Sets whether it is enabled to place nodes within the level to absolute positions that are close to the previous positions during incremental layout.
  • setIncrementalMode(enable) Sets whether the incremental layout mode is enabled.
  • setIncrementalNodeBoxForExpand(expandedNode, rect) Sets the effective bounding rectangle of an expanded node during incremental layout.
  • setIncrementalNodeMovementMode(node, mode) Sets the movement mode of an individual node used during incremental layout.
  • 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 levels.
  • 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.
  • setLevelJustification(justification) Sets the justification within the levels.
  • setLevelingStrategy(strategy) Sets the hierarchical layout leveling strategy.
  • 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.
  • setLinkCrossingFineTuningEnabled(flag) Sets whether the link crossing fine tuning phase is enabled.
  • setLinkPriority(link, priority) Sets the priority of a link.
  • setLinkStraighteningEnabled(flag) Sets whether the link straightening phase is enabled.
  • setLinkStyle(link, style) Sets the style of the shape of an individual link.
  • setLinkWidthUsed(used) Sets whether the layout respects the width of links.
  • setLongLinkCrossingReductionDuringIncremental(enable) Sets whether the handling of long links for crossing reduction during incremental layout is enabled.
  • setMaxInterLevelApertureAngle(angle) Sets the maximum aperture angle of the links incident to a node.
  • setMaxSplineCurveSize(size) Sets the maximum curve size used when optimized spline control point routing is enabled.
  • setMedianCrossingValueEnabled(flag) Sets whether the median crossing value is used during crossing reduction.
  • setMinBusyTime(time) Sets the minimal time that the layout algorithm can be busy.
  • setMinEndSegmentLength(length) Sets the minimum length of the last segment of each link, that is, the segment that is incident to the "to" node.
  • setMinForkSegmentLength(length) Sets the minimum length of the start or end segment of links if a fork shape is used for these links.
  • setMinSplineCurveSize(size) Sets the minimum curve size used when optimized spline control point routing is enabled.
  • setMinStartSegmentLength(length) Sets the minimum length of the first segment of each link, that is, the segment that is incident to the "from" node.
  • setMultiLinkOptimizationEnabled(flag) Sets whether the optimization of overlapping multiple links is enabled.
  • setMultiLinkOptimizationMaxSpread(maxSpread) Sets the maximum spread width for the bends introduced by the optimization of overlapping multiple links.
  • setMultiLinkOptimizationOffset(offset) Sets the minimum distance between bends introduced by the optimization of overlapping multiple links.
  • setNeighborLinksAligned(enable) Sets whether links between neighbor nodes of the same level are aligned so that they are strictly horizontal or vertical.
  • setNonorthogonalBendEliminationEnabled(flag) Sets whether the bend elimination phase for nonorthogonal links is enabled.
  • setNorthNumberOfPorts(node, numberOfPorts) Sets the number of relative ports on the north side of a node.
  • setNumberOfLinkCrossingSweeps(numberOfSweeps) Sets the number of layer sweeps to remove link crossings.
  • setNumberOfPorts(node, side, numberOfPorts) Sets the number of relative ports of a node on a given side.
  • setObjectParameter(graphModel, nodeOrLink, key, value) returns Object Sets the value of a parameter for a node or a link, using a given graph model.
  • setOriginPointMode(link, mode) Sets the mode for the connection point on an individual link on the origin node.
  • setOrthogonalStairCaseEliminationEnabled(flag) Sets whether the stair case elimination phase for orthogonal links is enabled.
  • 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.
  • setParentLayout(parent) Sets the parent layout of this layout instance.
  • setPolylineLinkOverlapReductionEnabled(flag) Sets whether optimization of polyline links to avoid links overlapping large neighbor nodes is enabled.
  • setPosition(point) Sets the position of the layout.
  • setPreferredForkAxisLength(length) Sets the preferred length of the axis of a fork shape.
  • setPreserveFixedLinks(option) Sets whether the layout avoids movement of fixed links.
  • setPreserveFixedNodes(option) Sets whether the layout avoids movement of fixed nodes.
  • setQuickAndUgly(flag) This is a convenience method to set up for a "quick and ugly" layout.
  • setRecursiveLayoutFromAncestorAllowed(flag) Sets whether the layout instance of the ancestor graph is in principle allowed to treat this subgraph in a recursive layout.
  • setRecursiveLayoutMode(flag) Sets whether this layout instance handles all subgraphs recursively that are nested into this graph.
  • setSeedValueForRandomGenerator(seed) Sets the seed value for the random generator.
  • setSelfLinkFromPortSide(side) Sets the default port side of a self-link at the "from" side.
  • setSelfLinkToPortSide(side) Sets the default port side of a self-link at the "to" side.
  • setSelfLinksSameSideNested(flag) Sets whether self-links that attach the same side of a node are nested.
  • setSouthNumberOfPorts(node, numberOfPorts) Sets the number of relative ports on the south side of a node.
  • setSpecNodeLevelIndex(node, index) Sets the index of the specified level for a node.
  • setSpecNodePositionIndex(node, index) Sets the index of the specified position of a node within a level.
  • 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.
  • setToFork(enable) Sets whether a fork shape is created for links that end at the same target point.
  • setToPortIndex(link, portIndex) Sets the port index of a link at the "to" side.
  • setToPortSide(link, side) Sets the port side of a link at the "to" side.
  • setUseSeedValueForRandomGenerator(option) Sets whether the user-defined seed value should be used for the random generator.
  • setVerticalLinkOffset(offset) Sets the vertical offset between parallel segments of links.
  • setVerticalNodeLinkOffset(offset) Sets the vertical offset between a node and a link segment that is parallel to the node border.
  • setVerticalNodeOffset(offset) Sets the vertical offset between nodes.
  • setWestNumberOfPorts(node, numberOfPorts) Sets the number of relative ports on the west side of a 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 layout run.
  • 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 Indicates 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 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.
  • validateConstraints() Performs a validation check for the constraints.

Event Summary

Attached Objects

Properties

AUTOMATIC_PINS
Automatic connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connector style is automatically selected depending on the global link style.
CENTERED_PINS
Centered connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connection points of links are placed at the center of the border the link is attached to.
CLIPPED_PINS
Clipped connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connection points of links are placed such that the link pointing toward the node center is clipped at the node border.
DEFAULT_HIERARCHICAL_ALLOWED_TIME
EAST
East port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the east border of its end node at the "from" or "to" side.
EVENLY_SPACED_PINS
Evenly spaced connection point option. When set at the layout parameter ' HierarchicalLayout.setConnectorStyle()', the connection points of links are evenly spaced along the border the link is attached to.
FIXED_IN_X_MODE
Fixed movement mode for the x direction. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout is free to move the nodes in the y direction but keeps the nodes fixed in the x direction. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'.
FIXED_IN_Y_MODE
Fixed movement mode for the y direction. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout is free to move the nodes in the x direction but keeps the nodes fixed in the y direction. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'.
FIXED_MODE
Fixed movement mode. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout keeps all nodes fixed. Only nodes that are marked for incremental repositioning will be moved, and links are rerouted. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'. When this mode is used as the argument of the method ' HierarchicalLayout.setGlobalOriginPointMode()' or ' HierarchicalLayout.setGlobalDestinationPointMode()', the layout must keep the current position of the connection point. To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' HierarchicalLayout.setOriginPointMode()' or ' HierarchicalLayout.setDestinationPointMode()'.
FREE_MODE
Free movement mode. When this mode is used as an argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', the incremental layout is free to move the nodes. Depending on the various parameters of the incremental mode, the layout shifts the nodes to optimize the space usage, but the shifting does not change the relative order of the nodes and links, so that the diagram after an incremental layout looks very similar to the previous diagram. To specify the mode of an individual node, use this mode as the argument of the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'. When this mode is used as the argument of the method ' HierarchicalLayout.setGlobalOriginPointMode()' or ' HierarchicalLayout.setGlobalDestinationPointMode()', the layout is free to choose the appropriate position of the connection points, except for "pinned" connection points (see ' ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()'). To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' HierarchicalLayout.setOriginPointMode()' or ' HierarchicalLayout.setDestinationPointMode()'.
HIGHER_LEVELS
The leveling strategy that utilizes higher-numbered levels. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'HIGHER_LEVELS', the layout algorithm pulls nodes to the highest-numbered level possible. Root nodes in particular are affected.
LOWER_LEVELS
The leveling strategy to utilize lower numbered levels. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'LOWER_LEVELS', the layout algorithm pulls nodes to the lowest-numbered level possible. This particularly effects leaf nodes.
MIXED_MODE
Mixed movement mode. When this mode is used as the argument of the method ' HierarchicalLayout.setGlobalIncrementalNodeMovementMode()', each node can have a different movement mode during incremental layout. The mode for an individual node can be set by the method ' HierarchicalLayout.setIncrementalNodeMovementMode()'. When used as the argument of the method ' HierarchicalLayout.setGlobalOriginPointMode()' or ' HierarchicalLayout.setGlobalDestinationPointMode()', the connection point of each link can have a different mode. The mode for the connection points of an individual link can be set by the method ' HierarchicalLayout.setOriginPointMode()' or ' HierarchicalLayout.setDestinationPointMode()'.
MIXED_STYLE
Mixed link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by ' HierarchicalLayout.setLinkStyle()'.
NORTH
North port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the north border of its end node at the "from" or "to" side.
NO_RESHAPE_STYLE
No reshape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', none of the links are reshaped. To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
OPTIMAL
The optimal leveling strategy. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'OPTIMAL', the layout algorithm tries to minimize the sum of level distances for all edges.
ORTHOGONAL_STYLE
Orthogonal link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', all links get a shape consisting of a sequence of orthogonal line segments. To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
POLYLINE_STYLE
Polyline link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', all links get a shape consisting of a sequence of line segments (not necessarily orthogonal). To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
SEMI_OPTIMAL
The semioptimal leveling strategy. When the layout parameter of ' HierarchicalLayout.setLevelingStrategy()' is set to 'SEMI_OPTIMAL', the layout algorithm tries a quick heuristic to minimize the sum of level distances for all edges. The algorithm pulls root nodes to the highest-numbered level possible and leaf nodes to the lowest-numbered level possible.
SOUTH
South port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the south border of its end node at the "from" or "to" side.
SPREAD_OUT
The leveling strategy to spread the nodes over all levels. This can be considered as the inverse of the semioptimal leveling strategy. It pulls root nodes to the lowest-numbered level possible and leaf nodes to the highest-numbered level possible.
STRAIGHT_LINE_STYLE
Straight-line link shape option. When set at the layout parameter ' HierarchicalLayout.setGlobalLinkStyle()', all links get a straight-line shape. To specify the shape of an individual link, use it as the argument of the method ' HierarchicalLayout.setLinkStyle()'.
UNSPECIFIED
Unspecified port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link can be connected to any border of its end node at the "from" or "to" side.
WEST
West port side. When used as an argument of the methods ' HierarchicalLayout.setFromPortSide()' or ' HierarchicalLayout.setToPortSide()', the link is connected to the west border of its end node at the "from" or "to" side.

Methods

addConstraint

Adds a constraint for the hierarchical layout. Constraints can be used to force the nodes to be placed in a certain way relative to other nodes. For instance, you can force a node to be placed in the same level as another node, or you can force nodes to be no more than a specified number of levels apart.

If many constraints are specified, it may happen that the constraints are contradicting (for instance, node A cannot be below node B and above node B at the same time). In this case, a constraint conflict resolution is automatically started. It takes the constraint priorities into account when deciding which constraints cannot be satisfied. The more conflicts, the more layout time is necessary. Therefore, it is recommended specifying constraints without obvious conflicts when possible.

When the graph model gets detached, all constraints are removed.

ParameterTypeDescription
constraintibm_ilog.graphlayout.hierarchical.HierarchicalConstraintThe constraint to add.
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 ibm_ilog.graphlayout.AbstractGraphLayoutModel.beforeLayout() . Subclasses can override this method to perform some initialization operations when appropriate.

ParameterTypeDescription
redraw
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, Hierarchical Layout removes all local specifications per link.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to which the '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, Hierarchical Layout removes all local specifications per node. It also removes the calculated level index and calculated position index from the nodes.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to which the '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
a0
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. Hierarchical constraints are not copied. The layout position is not copied. Only the global parameters are 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. Hierarchical constraints are not copied. The layout position is not copied. Only the global parameters are 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 attach. The detach method performs cleaning operations on the graph model. In addition to the cleaning operations in the base class, Hierarchical Layout removes all local specifications per node or link. It also removes the calculated level index and calculated position index from the nodes.

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

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 HierarchicalLayout.layout() to do this.

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

getCalcNodeLevelIndex
Returns int: The calculated level index of the node, or '-1' if no layout has been performed.

Returns the calculated level index of a node after performing a layout. If there was no previous call of performLayout, it returns -1. Nodes are organized in horizontal or vertical levels numbered from 0 to n. If the link flow direction is from top to bottom, the nodes with level index 0 are placed in the topmost level, and the nodes with higher level indexes are placed in the levels below. If the link flow direction is from left to right, the nodes with level index 0 are placed in the leftmost level, and the nodes with higher level indexes are placed in the levels more to the right.

Note the difference between calculated and specified level index: The layout algorithm assigns level indexes to all nodes even if no level index is specified. Therefore, the method HierarchicalLayout.getSpecNodeLevelIndex() returns -1 for nodes that have no level index specified, but the method HierarchicalLayout.getCalcNodeLevelIndex() returns a nonnegative number, that is, the real index of the level after layout.

Note that if the generic connected component layout mechanism of the GraphLayout base class is enabled, each connected component uses its own level structure. If it is disabled, there is only one global level structure.

ParameterTypeDescription
nodeObjectThe node.
getCalcNodePositionIndex
Returns int: The calculated position index of the node, or '-1' if no layout has been performed.

Returns the calculated index of the node position within a level after performing a layout. If there was no previous call of performLayout, it returns -1. Nodes are organized in horizontal or vertical levels. Within each level, the nodes are placed sequentially at relative positions numbered from 0 to n. If the link flow direction is from top to bottom, the node with position index 0 is placed leftmost within its level, and the nodes with higher position indexes are placed farther to the right. If the link flow direction is from right to left, the node with position index 0 is placed topmost within its level, and the nodes with higher position indexes are placed below.

Note the difference between calculated and specified position index: The layout algorithm assigns position indexes to all nodes, even if no position index is specified. Therefore, the method HierarchicalLayout.getSpecNodePositionIndex() returns -1 for nodes that have no position index specified, but the method HierarchicalLayout.getCalcNodePositionIndex() returns a nonnegative number, that is, the real index of the position within its level after layout.

Note, if the generic connected component layout mechanism of the GraphLayout base class is enabled, each connected component uses its own level structure. If it is disabled, there is only one global level structure.

ParameterTypeDescription
nodeObjectThe node.
getConnectorStyle
Returns int
Returns the style of the connectors.
getConstraints
Returns ibm_ilog.graphlayout.IIterator: The constraints that have been added to the hierarchical layout.

Returns the constraints that have been added to the hierarchical layout.

getDestinationPointMode
The mode for the connection point of an individual link on the destination node.
Returns the destination point mode of an individual link.
ParameterTypeDescription
linkObjectThe link.
getEastNumberOfPorts
Returns int: The number of relative ports on the east side of the specified node, or '-1' if the number is unspecified.

Returns the number of relative ports on the east side of a node. The method returns -1 if the number of ports is unspecified.

ParameterTypeDescription
nodeObjectThe node.
getFlowDirection
Returns int
Returns the current direction of the link flow.
getFromPortIndex
Returns int: The port index of the specified link at the "from" side, or '-1' if the port index is unspecified.

Returns the port index of a link at the "from" side. Returns -1 if the port index is unspecified.

ParameterTypeDescription
linkObjectThe link instance.
getFromPortSide
The port side of the specified link at the "from" side.

Returns the port side of a link at the "from" side.

ParameterTypeDescription
linkObjectThe link instance.
getGlobalDestinationPointMode
Returns int
Returns the global mode for the connection points of the links on the destination nodes.
getGlobalIncrementalNodeMovementMode
Returns int

Returns the node movement mode used during incremental layout. This option has no effect if the incremental mode is disabled.

getGlobalLinkStyle
Returns int
Returns the global style of the shapes of links.
getGlobalOriginPointMode
Returns int
Returns the global mode for the connection points of the links on the origin nodes.
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().

getHorizontalLinkOffset
Returns Number
Returns the horizontal offset between parallel segments of links.
getHorizontalNodeLinkOffset
Returns Number
Returns the horizontal offset between a node and a link segment that is parallel to the node border.
getHorizontalNodeOffset
Returns Number
Returns the horizontal offset between nodes.
getIncrementalAbsoluteLevelPositionRange
Returns Number

Returns the range that is considered very close to the previous node position. This value is used by the incremental absolute level positioning.

getIncrementalAbsoluteLevelPositionTendency
Returns Number
Returns the percentage of how much the layout algorithm tries to place nodes to absolute positions within the level that are close to the previous positions during incremental layout.
getIncrementalNodeBoxForExpand
Returns Rectangle: The effective bounding rectangle.

Returns the effective bounding rectangle of an expanded node during incremental layout. Note that this parameter is transient, that is, it is automatically removed after each successful layout and returns null in this case. It returns a meaningful value only when the effective bounding box was set but layout was not yet performed.

ParameterTypeDescription
expandedNodeObjectThe expanded node.
getIncrementalNodeMovementMode
The movement mode of an individual node used during incremental layout.

Returns the movement mode of an individual node used during incremental layout.

ParameterTypeDescription
nodeObjectThe node.
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.
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.
getLevelJustification
Returns int
Returns the current justification within the levels.
getLevelingStrategy
Returns int: The current hierarchical layout leveling strategy.
Returns the current hierarchical layout leveling strategy.
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.

getLinkPriority
Returns Number: The priority of the link. Low priority links are more likely to be longer or to point in the opposite direction to the high-priority links.
Returns the priority of a link.
ParameterTypeDescription
linkObjectThe link instance.
getLinkStyle
The style for the shape of the specified link.
Returns the style for the shape of an individual link.
ParameterTypeDescription
linkObjectThe link.
getMaxInterLevelApertureAngle
Returns Number: The maximum aperture angle of the links incident to a node.

Returns the maximum aperture angle of the links incident to a node. The maximum angle is given in degree.

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.
getMinEndSegmentLength
Returns Number
Returns the minimum length of the last segment of each link, that is, the segment that is incident to the "to" node.
getMinForkSegmentLength
Returns Number
Returns the minimum length of the start or end segment of links if a fork shape is used for these links.
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.
getMinStartSegmentLength
Returns Number
Returns the minimum length of the first segment of each link, that is, the segment that is incident to the "from" node.
getMultiLinkOptimizationMaxSpread
Returns Number

Returns the maximum spread width for the bends introduced by the optimization of overlapping multiple links. These are bends of links in the same bundle between nodes that are directly neighbored.

getMultiLinkOptimizationOffset
Returns Number

Returns the minimum distance between bends introduced by the optimization of overlapping multiple links. These are bends of links in the same bundle between nodes that are directly neighbored.

getNodeGroups
Returns ibm_ilog.graphlayout.IIterator: The node groups that occur in constraints that were added to the hierarchical layout.

Returns the node groups that occur in constraints that were added to the hierarchical layout. Node groups can be shared by different constraints.

getNorthNumberOfPorts
Returns int: The number of relative ports on the north side of the node, or '-1' if the number is unspecified.

Returns the number of relative ports on the north side of a node. The method returns -1 if the number of ports is unspecified.

ParameterTypeDescription
nodeObjectThe node.
getNumberOfConstraints
Returns int: The number of constraints that have been added to the hierarchical layout.

Returns the number of constraints that have been added to the hierarchical layout.

getNumberOfLinkCrossingSweeps
Returns int
Returns the number of layer sweeps to remove link crossings.
getNumberOfNodeGroups
Returns int

Returns the number of node groups that occur in constraints that were added to the hierarchical layout.

getNumberOfPorts
Returns int: The specified number of relative ports of the specified node on the specified side.

Returns the specified number of relative ports of a node on the specified side. Possible values for the side parameter are HierarchicalLayout.EAST, HierarchicalLayout.WEST, HierarchicalLayout.NORTH, HierarchicalLayout.SOUTH. Returns -1 if the number of ports is unspecified.

ParameterTypeDescription
nodeObjectThe node.
sideintThe side of the node.
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.
getOriginPointMode
The mode for the connection point of an individual link on the origin node.
Returns the origin point mode of an individual link.
ParameterTypeDescription
linkObjectThe link.
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.
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

Returns the specified position of the layout.

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

getPreferredForkAxisLength
Returns Number
Returns the preferred length of the axis of a fork shape.
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.

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.

getSelfLinkFromPortSide
Returns int: The default port side of a self-link at the "from" side.

Returns the default port side of a self-link at the "from" side. Self-links are links that start and end at the same node. This is used as port side for those self-links that have no explicit port side specification at the "from" side. It specifies at which side of the node the starting point of the self-link is connected.

getSelfLinkToPortSide
Returns int: The default port side of a self-link at the "to" side.

Returns the default port side of a self-link at the "to" side. Self-links are links that start and end at the same node. This is used as port side for those self-links that have no explicit port side specification at the "to" side. It specifies at which side of the node the end point of the self-link is connected.

getSouthNumberOfPorts
Returns int: The number of relative ports on the south side of the specified node, or '-1' if the number is unspecified.

Returns the number of relative ports on the south side of a node. The method returns -1 if the number of ports is unspecified.

ParameterTypeDescription
nodeObjectThe node.
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).

getSpecNodeLevelIndex
Returns int: The index of the specified level for the given node or a negative number if no level is specified.

Returns the index of the specified level for a node. If no level index is specified for the node, it returns a negative number.

ParameterTypeDescription
nodeObjectThe node instance.
getSpecNodePositionIndex
Returns int: The index of the specified position of the node within a level, or a negative value if no index is specified.

Returns the index of the specified position of a node within a level. If no position index is specified for the node, this method returns a negative number.

ParameterTypeDescription
nodeObjectThe node instance.
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.
getToPortIndex
Returns int: The port index of the specified link at the "to" side, or '-1' if the port index is unspecified.

Returns the port index of a link at the "to" side. Returns -1 if the port index is unspecified.

ParameterTypeDescription
linkObjectThe link instance.
getToPortSide
The port side of the specified link at the "to" side.

Returns the port side of a link at the "to" side.

ParameterTypeDescription
linkObjectThe link instance.
getVerticalLinkOffset
Returns Number
Returns the vertical offset between parallel segments of links.
getVerticalNodeLinkOffset
Returns Number
Returns the vertical offset between a node and a link segment that is parallel to the node border.
getVerticalNodeOffset
Returns Number
Returns the vertical offset between nodes.
getViewMatrix
Returns the matrix that is applied to the first view attached to this layout.
getWestNumberOfPorts
Returns int: The number of relative ports on the west side of the specified node, or '-1' if the number is unspecified.

Returns the number of relative ports on the west side of a node. The method returns -1 if the number of ports is unspecified.

ParameterTypeDescription
nodeObjectThe node.
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.

isBacktrackCrossingReductionEnabled
Returns Boolean
Returns 'true' if the backtrack mechanism of the link crossing reduction phase is enabled.
isCrossingReductionDuringIncremental
Returns Boolean
Returns 'true' if crossing reduction during incremental layout is enabled.
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.
isFromFork
Returns Boolean
Returns 'true' if the fork shape is enabled for links that start at the same source point.
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.

isIncrementalAbsoluteLevelPositioning
Returns Boolean
Returns 'true' if the algorithm tries to place the nodes within the level to absolute positions that are close to the previous positions during incremental layout.
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 levels.
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.
isLinkCrossingFineTuningEnabled
Returns Boolean
Returns 'true' if the link crossing fine tuning phase is enabled.
isLinkStraighteningEnabled
Returns Boolean
Returns 'true' if the link straightening phase is enabled.
isLinkWidthUsed
Returns Boolean
Returns 'true' if the layout respects the width of links.
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()'.
isLongLinkCrossingReductionDuringIncremental
Returns Boolean
Returns 'true' if the handling of long links by the crossing reduction during incremental layout is enabled.
isMedianCrossingValueEnabled
Returns Boolean
Returns 'true' if the median crossing value is used during crossing reduction.
isMultiLinkOptimizationEnabled
Returns Boolean
Returns 'true' if the optimization of overlapping multiple links is enabled.
isNeighborLinksAligned
Returns Boolean
Returns 'true' if links between neighbor nodes of the same level are aligned so that they are parallel.
isNonorthogonalBendEliminationEnabled
Returns Boolean
Returns 'true' if the bend elimination phase for nonorthogonal links is enabled.
isOrthogonalStairCaseEliminationEnabled
Returns Boolean
Returns 'true' if the stair case elimination phase for orthogonal links is enabled.
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.

isPolylineLinkOverlapReductionEnabled
Returns Boolean
Returns 'true' if the optimization of polyline links is enabled to avoid links overlapping large neighbor nodes.
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.

isRecursiveLayoutFromAncestorAllowed
Returns Boolean

Returns true if the layout instance of an ancestor graph is in principle allowed to treat this subgraph in a recursive layout. Whether the layout of the ancestor graph can handle the subgraph attached to this layout instance depends on the parameter settings of the ancestor layout.

isRecursiveLayoutMode
Returns Boolean
Returns 'true' if this layout instance handles all subgraphs recursively that are nested into this graph.
isSelfLinksSameSideNested
Returns Boolean
Returns 'true' if self-links that attach the same side of a node are nested.
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.

isToFork
Returns Boolean
Returns 'true' if the fork shape is enabled for links that end at the same target point.
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 Hierarchical Layout algorithm. To start the layout, call the method ibm_ilog.graphlayout.GraphLayout.performLayout().

markForIncremental

Marks the input node or link to be repositioned with the next call of ibm_ilog.graphlayout.GraphLayout.performLayout() if incremental mode is enabled. Normally, the incremental layout tries to preserve the relative order of nodes and links. By setting a mark on a node, the level assignment and relative position of this node will be calculated from scratch. By setting a mark on a link, this link will be rerouted completely by the next layout. The mark is transient, that is, it is automatically cleared after an incremental layout is done.

ParameterTypeDescription
nodeOrLinkObjectThe input node or link to mark.
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
removeAllConstraints

Removes all the constraints from the hierarchical layout.

removeConstraint

Removes the specified constraint from the hierarchical layout.

ParameterTypeDescription
constraintibm_ilog.graphlayout.hierarchical.HierarchicalConstraintThe constraint to be removed.
removeMostRecentConstraint

Removes the constraint that was most recently added from the hierarchical layout.

setAllowedTime

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

The default value for Hierarchical layout is 100000000 (100000 seconds).

ParameterTypeDescription
timeNumberThe allowed time in milliseconds.
setBacktrackCrossingReductionEnabled

Sets whether the backtrack mechanism of the link crossing reduction phase is enabled. The layout algorithm uses a sweep heuristic to resolve link crossings which includes a backtracking mechanism. If a sweep made the result worse, it sets the results back to the previous situation.

This is an expert option. It is enabled by default. It is normally not necessary to disable the backtrack mechanism, except if you need to speed up the layout.

ParameterTypeDescription
flagBoolean'true' to enable backtracking during link crossing reduction (the default), or 'false' to disable it.
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.
setConnectorStyle

Sets the style of connectors. Valid values are:

  • HierarchicalLayout.CENTERED_PINS - The link connection points are placed in the center of the border the link is attached to.
  • - Each link pointing to the center of the node is clipped at the node border.
  • HierarchicalLayout.EVENLY_SPACED_PINS - The link connection points are evenly spaced along the node border.
  • HierarchicalLayout.AUTOMATIC_PINS - The connector style is selected depending on the link style.

The default value is HierarchicalLayout.AUTOMATIC_PINS.

The connector style is used to place the connection points of links that have the free origin or destination point mode and no specified port index. Links with fixed point mode do not change their connection point at the origin node. Links with specified port indexes are connected to the corresponding connection point of the port instead. The placement of connection points also depends on the link clip interface and 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) 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.
  3. Finally, if a link clip interface was set via ibm_ilog.graphlayout.GraphLayout.setLinkClipInterface(), the connection points are corrected by clipping with that interface.

If you specify port sides but no port numbers for links (see HierarchicalLayout.setFromPortSide() and HierarchicalLayout.setToPortSide()), then it is recommended to avoid , since they do not reflect the port side precisely enough. Only centered or evenly spaced link connection points display the port side precisely.

ParameterTypeDescription
styleintThe connector style.
setCrossingReductionDuringIncremental

Sets whether crossing reduction during incremental layout is enabled. This option has no effect if the incremental mode is disabled. If the incremental mode is enabled and the argument is false, the layout preserves the relative order of the nodes and the links within the levels. If the argument is true, the layout preserves the level structure but reorders the nodes within the levels to avoid link crossings.

It is disabled by default.

ParameterTypeDescription
enableBoolean'true' to enable crossing reduction during incremental layout, or 'false' to disable it.
setDestinationPointMode

Sets the mode for the connection point of an individual link on the destination node. This mode is used only if the global "from" point mode is set to HierarchicalLayout.MIXED_MODE. Otherwise, the connection points on the destination nodes have, for all the links, the mode that is specified as the global destination point mode.

Valid values are:

  • HierarchicalLayout.FREE_MODE - The layout is free to choose, for this link, the appropriate position of the connection point on the destination node, except for "pinned" connection points (see ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()). The choice can further be influenced by specifying the side and the port index of the links.
  • HierarchicalLayout.FIXED_MODE - The layout must keep, for this link, the current position of the connection point on the destination node. This can be useful, in particular, if the node has fixed pins where the link is attached (as, for instance, with ibm_ilog.linkconnector.PinLinkConnector) and the pins should not be moved by the layout algorithm.

    The fixed mode works only if the link connector delivers consistently the same connection point when called multiple times. If a link is not connected to a link connector, or if the ibm_ilog.linkconnector.ClippingLinkConnector is used, the real connection point is calculated on the fly and may change when called multiple times with changing link bends. In this case, the fixed mode cannot ensure a correct routing of the links.

    Note that if the mode is fixed, specifications of the port index of links at the "to" side are ignored.

The default value is HierarchicalLayout.FREE_MODE.

ParameterTypeDescription
linkObjectThe link.
modeintThe mode to set.
setEastNumberOfPorts

Sets the number of relative ports on the east side of a node.

ParameterTypeDescription
nodeObjectThe node.
numberOfPortsintThe number of relative ports.
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 link flow. Valid values are:

  • ibm_ilog.graphlayout.Direction.RIGHT - the majority of the links flow to the right.
  • ibm_ilog.graphlayout.Direction.LEFT - the majority of the links flow to the left.
  • ibm_ilog.graphlayout.Direction.BOTTOM - the majority of the links flow to the bottom.
  • ibm_ilog.graphlayout.Direction.TOP - the majority of the links flow to the top.

This feature sets the direction of the flow for the majority of the links in a directed graph. The layout algorithm may need to direct some links in the opposite direction of the general link flow. If the links flow to the left or right, the nodes are placed in vertical levels. If the links flow to the top or bottom, the nodes are placed in horizontal levels.

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

ParameterTypeDescription
directionintThe direction of the link flow.
setFromFork

Sets whether a fork shape is created for links that start at the same source point. A fork shape is a link shape where several links start at the same point, share a link segment, and then branch into separate link paths. The fork shape is used only in the orthogonal link style, and only in the following cases: if the connector style is HierarchicalLayout.CENTERED_PINS, or if the links start at the same specified port index at the north or south side of a node, or if the links have the fixed origin point mode and are placed at exactly the same coordinate.

The default value is false.

ParameterTypeDescription
enableBoolean'true' to enable fork shape creation, or 'false' to disable it.
setFromPortIndex

Sets the port index of a link at the "from" side. This allows you to specify the relative ports of the links on the node border. Using relative ports is a way to specify the relative order of how the links connect to the "from" node. The specification is only used if the free origin point mode is used for the link.

Port numbers are between 0 and n - 1, where n is the number of ports at the node side where the link is connected. Links with an unspecified or negative port index are connected on the node border according to the global connector style. A link with a specified port index i is connected at the ith relative port, and the connection points of ports are evenly spaced on the corresponding node border.

ParameterTypeDescription
linkObjectThe link.
portIndexintThe relative port index starting from '0'.
setFromPortSide

Sets the port side of a link at the "from" side. This allows you to specify at which side of the node the starting point of the link is connected.

Possible values for the side parameter are HierarchicalLayout.EAST, HierarchicalLayout.WEST, HierarchicalLayout.NORTH, HierarchicalLayout.SOUTH, and the default HierarchicalLayout.UNSPECIFIED.

If a port side is unspecified, the link can connect to any border side of the node. Otherwise, the link connects only to the specified node border.

ParameterTypeDescription
linkObjectThe link.
sideintThe side of the node from which the link is connected.
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
setGlobalDestinationPointMode

Sets the global mode for the connection point of the links on the destination nodes. Valid values are:

  • HierarchicalLayout.FREE_MODE - For all links, the layout is free to choose the appropriate position of the connection point on the destination node, except for "pinned" connection points (see ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()). The choice can further be influenced by specifying the side and the port index of the links.
  • HierarchicalLayout.FIXED_MODE - For all links, the layout must keep the current position of the connection point on the destination node. This can be useful, in particular, if the node has fixed pins where the link is attached (as, for instance, with ibm_ilog.linkconnector.PinLinkConnector) and the pins should not be moved by the layout algorithm.

    The fixed mode works only if the link connector delivers consistently the same connection point when called multiple times. If a link is not connected to a link connector, or if the ibm_ilog.linkconnector.ClippingLinkConnector is used, the real connection point is calculated on the fly and may change when called multiple times with changing link bends. In this case, the fixed mode cannot ensure a correct routing of the links.

    Note that if the mode is fixed, specifications of the port index of links at the "to" side are ignored.

  • HierarchicalLayout.MIXED_MODE - Each link can have a different mode for the connection point on the destination node. The mode of each individual link can be set by the method HierarchicalLayout.setDestinationPointMode().

Unless the global mode is HierarchicalLayout.MIXED_MODE, the connection points on the destination node have the same mode for all the links.

The default value is HierarchicalLayout.FREE_MODE.

ParameterTypeDescription
modeintThe global mode to set.
setGlobalIncrementalNodeMovementMode

Sets the node movement mode used during incremental layout. This option has no effect if the incremental mode is disabled. Valid values are:

  • HierarchicalLayout.FREE_MODE - The incremental layout preserves the relative order of nodes but does not preserve the exact position of nodes. It may move the nodes a little bit to optimize the space usage. The shifting does not change the level structure of the graph. If crossing reduction is disabled during incremental layout (see HierarchicalLayout.setCrossingReductionDuringIncremental()), the shifting also does not change the order of the nodes within the levels.
  • HierarchicalLayout.FIXED_IN_X_MODE - The incremental layout preserves the relative order of nodes and keeps the nodes fixed in the x direction. The nodes may shift in the y direction.
  • HierarchicalLayout.FIXED_IN_Y_MODE - The incremental layout preserves the relative order of nodes and keeps the nodes fixed in the y direction. The nodes may shift in the x direction.
  • HierarchicalLayout.FIXED_MODE - The nodes do not move at all during incremental layout. Only nodes that are marked for incremental repositioning will be moved, and links are rerouted.
  • HierarchicalLayout.MIXED_MODE - Each node that is not marked for incremental can have a different mode. The mode of each individual node can be set by the method HierarchicalLayout.setIncrementalNodeMovementMode(). Mixing fixed and free nodes should only be done in exceptional cases, because it may create overlaps or a messy arrangement.

Nodes that are marked for incremental are placed in a nonincremental way without respecting the previous position. The incremental movement mode has no effect for these nodes. Unless the global mode is HierarchicalLayout.MIXED_MODE, all nodes that are not marked for incremental are placed according to the same mode.

The default mode is HierarchicalLayout.FREE_MODE.

If the incremental mode is enabled and nodes are fixed in the x or y direction, it works well if the graph has a coarsely level structure (for example, if it was created by a previous layout in free mode or in nonincremental mode) but it may create overlaps or a messy arrangement otherwise. Fixing nodes has several consequences: The spacing options are obeyed only if there is enough space between the fixed nodes. The specified position of the layout is not obeyed, because it would require shifting the fixed nodes. The crossing reduction during incremental layout has no effect (see HierarchicalLayout.isCrossingReductionDuringIncremental()). However, you can decide whether to enable the crossing reduction of long links (see HierarchicalLayout.isLongLinkCrossingReductionDuringIncremental()). If the long link crossing reduction is enabled, it will rearrange the long links that span several levels to avoid crossings.

Furthermore, note that if the generic connected component layout mechanism of the GraphLayout base class is enabled, it will move nodes even if they are specified as fixed. Therefore, it is recommended disabling the generic connected component layout mechanism.

ParameterTypeDescription
modeintThe node movement mode to set.
setGlobalLinkStyle

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

  • HierarchicalLayout.POLYLINE_STYLE - All links get a polyline shape, that is, a shape consisting of a sequence of line segments.
  • HierarchicalLayout.ORTHOGONAL_STYLE - All links get an orthogonal shape, that is, a shape consisting of a sequence of orthogonal line segments.
  • HierarchicalLayout.STRAIGHT_LINE_STYLE - All links get a straight-line shape.
  • HierarchicalLayout.NO_RESHAPE_STYLE - No reshape is performed on any link.
  • HierarchicalLayout.MIXED_STYLE - Each link can have a different link style. The style of each individual link can be set by the method HierarchicalLayout.setLinkStyle() so that different link shapes can occur in the same graph.

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

The default value is HierarchicalLayout.POLYLINE_STYLE.

ParameterTypeDescription
styleintThe global style value.
setGlobalOriginPointMode

Sets the global mode for the connection point of the links on the origin nodes. Valid values are:

  • HierarchicalLayout.FREE_MODE - For all links, the layout is free to choose the appropriate position of the connection point on the origin node, except for "pinned" connection points (see ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()). The choice can further be influenced by specifying the side and the port index of the links.
  • HierarchicalLayout.FIXED_MODE - For all links, the layout must keep the current position of the connection point on the origin node. This can be useful, in particular, if the node has fixed pins where the link is attached (as, for instance, with ibm_ilog.linkconnector.PinLinkConnector) and the pins should not be moved by the layout algorithm.

    The fixed mode works only if the link connector delivers consistently the same connection point when called multiple times. If a link is not connected to a link connector, or if the ibm_ilog.linkconnector.ClippingLinkConnector is used, the real connection point is calculated on the fly and may change when called multiple times with changing link bends. In this case, the fixed mode cannot ensure a correct routing of the links.

    Note that if the mode is fixed, specifications of the port index of links at the "from" side are ignored.

  • HierarchicalLayout.MIXED_MODE - Each link can have a different mode for the connection point on the origin node. The mode of each individual link can be set by the method HierarchicalLayout.setOriginPointMode().

Unless the global mode is HierarchicalLayout.MIXED_MODE, the connection points on the origin node have the same mode for all the links.

The default value is HierarchicalLayout.FREE_MODE.

ParameterTypeDescription
modeintThe global mode to set.
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
setHorizontalLinkOffset

Sets the horizontal offset between parallel segments of links. In the orthogonal link style, the segments attached directly to the node may have a smaller offset if the node is too small or the number of incident links is too large to satisfy the specified offset.

The default value is 15.

ParameterTypeDescription
offsetNumberThe horizontal offset value.
setHorizontalNodeLinkOffset

Sets the horizontal offset between a node and a link segment that is parallel to the node border.

The default value is 20.

ParameterTypeDescription
offsetNumberThe horizontal offset value.
setHorizontalNodeOffset

Sets the horizontal offset between nodes. If the levels are horizontal, this is the minimum distance between the nodes of the same level. If the levels are vertical, this is the minimum distance between the nodes of different levels.

The default value is 40.

ParameterTypeDescription
offsetNumberThe horizontal offset value.
setIncrementalAbsoluteLevelPositionRange

Sets the range that is considered very close to the previous node position. This option has an effect only if the incremental absolute level positioning is used.

In nonincremental mode, nodes are placed within the level in order to balance the layout. If the incremental absolute level positioning is used, nodes should be placed close to their previous positions, but the layout should also be balanced. Both criteria compete with each other. The position range influences how the competing criteria are resolved. If a node is placed within this range to its previous position, the balance criteria is used to determine its position. If the node is placed farther away from its previous position, the position tendency is used to determine its position.

A node that is placed within the incremental position range to its previous position is placed at the best balanced position. This avoids having the balance of nodes that are already close to the previous position being disturbed by an additional tendency towards the previous position.

The default value is 20.

ParameterTypeDescription
rangeNumberThe value of the absolute level position range.
setIncrementalAbsoluteLevelPositionTendency

Sets the percentage how much the layout algorithm tries to place nodes to absolute positions within the level that are close to the previous positions during incremental layout. This option has an effect only if the incremental absolute level positioning is used.

In nonincremental mode, nodes are placed within the level in order to balance the layout. If the incremental absolute level positioning is used, nodes should be placed close to their previous positions, but the layout should also be balanced. Both criteria compete with each other. The position tendency influences how the competing criteria are resolved. A high position tendency has the effect that the nodes stay closer to their previous positions, and a low position tendency has the effect that the nodes stay closer to the balanced position. Passing the position tendency 0 has basically the same effect as disabling the incremental absolute level positioning.

The input value is a percentage between 0 and 100. The default value is 70 percent.

ParameterTypeDescription
percentageNumberThe percentage value for the absolute level position tendency, a number between '0' and '100'.
setIncrementalAbsoluteLevelPositioning

Sets whether it is enabled to place nodes within the level to absolute positions that are close to the previous positions during incremental layout. This option has no effect if the incremental mode is disabled. It has also no effect if crossing reduction during incremental layout is enabled.

If the incremental mode is enabled and crossing reduction during incremental layout is disabled, the layout arranges the nodes such that the relative order of the nodes within each level is preserved. If this parameter is set to false, nodes may be placed at absolute positions far from the previous positions, even though their relative order does not change, because the main objective of the algorithm is to produce a balanced layout.

To help the user preserve a mental map of the graph, this parameter should be set to true. In this case, the nodes are placed closer to their previous positions, even though this may result in a less balanced layout.

The freedom of incremental level positioning can be controlled by the tendency to preserve the previous node position (see HierarchicalLayout.setIncrementalAbsoluteLevelPositionTendency()) and the range that is considered to be close enough to the previous node position HierarchicalLayout.setIncrementalAbsoluteLevelPositionRange()).

It is enabled by default.

ParameterTypeDescription
enableBoolean'true' to enable close repositioning of nodes during incremental layout, at the expense of completely balancing the layout. A value of 'false' will give priority to balancing the layout regardless of node displacements.
setIncrementalMode

Sets whether the incremental layout mode is enabled. If the argument is true, the layout respects the current coordinates of nodes and links, and it tries to create a layout with similar positions. Depending on the incremental node movement mode, the layout may need to shift all nodes to optimize the space usage, but the shifting does not change the relative order of the nodes and links, so that the diagram after an incremental layout looks very similar to the previous diagram.

The levels are arranged based on the current coordinates of the nodes. Thus, the specified node level and position indexes are ignored during incremental layout.

The incremental mode is disabled by default.

ParameterTypeDescription
enableBoolean'true' to enable the incremental layout mode, or 'false' to disable it.
setIncrementalNodeBoxForExpand

Sets the effective bounding rectangle of an expanded node during incremental layout.

In this context, we call expand any interactive operation that changes the size of the node to make it very large while preserving the center position of the node. The typical purpose of an expand operation is to change the graphical representation of the node to show more details in the inner of the node. For instance, an expand operation may show a subgraph in the inner of the node. Often, an incremental re-layout is desired after an expand operation.

The challenge of the re-layout after an expand operation consists of the fact that the node may become so large that it overlaps many nodes. This may yield undesired effects during incremental layout, because incremental layout is unable to determine the level structure from the coordinates of the nodes if some node overlaps many other nodes completely.

To facilitate the incremental layout, the old bounding box of the expanded node, as it was before the expand operation, must be specified as the effective bounding box. This helps the incremental layout determine the proper level structure.

The effective bounding box has no effect if incremental layout is disabled, or if the node is marked for incremental recalculation. The effective bounding box is transient, that is, it is automatically removed after each successful layout and not stored into .ivl files.

ParameterTypeDescription
expandedNodeObjectThe expanded node.
rectRectangleThe effective bounding rectangle.
setIncrementalNodeMovementMode

Sets the movement mode of an individual node used during incremental layout. This movement mode is used only if the incremental mode is enabled, the global movement mode is set to HierarchicalLayout.MIXED_MODE, and the node is not marked for incremental recalculation. If the global movement mode is not HierarchicalLayout.MIXED_MODE, all nodes have the mode that is specified as the global movement mode.

Valid values are:

  • HierarchicalLayout.FREE_MODE - The incremental layout preserves the relative order of the node with respect to all other nodes (except those that are marked for incremental recalculation). It does not preserve the exact position. It may move the node a little bit to optimize the space usage. The shifting does not change the level structure of the graph. If the crossing reduction is disabled during incremental layout (see HierarchicalLayout.setCrossingReductionDuringIncremental()), the shifting also does not change the order of the node within the levels with respect to the other nodes.
  • HierarchicalLayout.FIXED_IN_X_MODE - The incremental layout preserves the relative order of the node with respect to all other nodes (except those that are marked for incremental recalculation), and it keeps the node fixed in the x direction. The node may shift in the y direction.
  • HierarchicalLayout.FIXED_IN_Y_MODE - The incremental layout preserves the relative order of the node with respect to all other nodes (except those that are marked for incremental recalculation), and it keeps the node fixed in the y direction. The nodes may shift in the x direction.
  • HierarchicalLayout.FIXED_MODE - The node does not move at all during incremental layout.

The default mode is HierarchicalLayout.FREE_MODE.

If the incremental mode is enabled and some nodes are fixed in the x or y direction, it often works well if the graph has a coarsely level structure (for example, if it was created by a previous layout in free mode or in nonincremental mode) but it may create overlaps or a messy arrangement otherwise, in particular if only few nodes are fixed and many nodes are free to move. Fixing nodes has several consequences: The spacing options are obeyed only if there is enough space between the fixed nodes. The specified position of the layout is not obeyed, because it would require shifting the fixed nodes. The crossing reduction during incremental layout has no effect (see HierarchicalLayout.isCrossingReductionDuringIncremental()). However, you can decide whether to enable the crossing reduction of long links (see HierarchicalLayout.isLongLinkCrossingReductionDuringIncremental()). If the long link crossing reduction is enabled, it will rearrange the long links that span several levels to avoid crossings.

Furthermore, note that if the generic connected component layout mechanism of the GraphLayout base class is enabled, it will move nodes even if they are specified as fixed. Therefore it is recommended disabling the generic connected component layout mechanism.

ParameterTypeDescription
nodeObjectThe node.
modeintThe movement mode to set.
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 levels. If this option is enabled, the algorithm tries to distribute the nodes that represent subgraphs into the levels so that the majority of intergraph links point roughly in the flow direction.

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

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 Hierarchical Layout algorithm does not route intergraph links. They should be routed by applying a Link Layout after the Hierarchical Layout.

ParameterTypeDescription
flagBoolean'true' to set intergraph connectivity mode, or 'false' to disable the 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.
setLevelJustification

Sets the justification within the levels. Valid values are:

  • ibm_ilog.graphlayout.Direction.CENTER
  • ibm_ilog.graphlayout.Direction.LEFT
  • ibm_ilog.graphlayout.Direction.RIGHT
  • ibm_ilog.graphlayout.Direction.TOP
  • ibm_ilog.graphlayout.Direction.BOTTOM

This feature sets the justification of the nodes within each level. 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. If the link flow direction is to the left or right, the nodes can be justified to the left, center, or right. If the link flow direction is to the top or bottom, the nodes can be justified to the top, center, or bottom.

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

ParameterTypeDescription
justificationintThe justification value.
setLevelingStrategy

Sets the hierarchical layout leveling strategy.

This strategy determines how nodes are distributed in the hierarchical levels. Valid values are:

  • HierarchicalLayout.OPTIMAL: the optimal leveling strategy. The layout algorithm tries to minimize the sum of level distances for all edges.
  • HierarchicalLayout.SEMI_OPTIMAL: the semioptimal leveling strategy. This strategy often gives the same result as the optimal strategy. The layout algorithm tries a quick heuristic to minimize the sum of level distances for all edges. It pulls root nodes to the highest-numbered level possible and leaf nodes to the lowest-numbered level possible.
  • HierarchicalLayout.HIGHER_LEVELS: the leveling strategy to utilize higher numbered levels. This layout algorithm pulls nodes to the highest-numbered level possible. Root nodes in particular are effected.
  • HierarchicalLayout.LOWER_LEVELS: the leveling strategy to utilize lower numbered levels. the layout algorithm pulls nodes to the lowest-numbered level possible. Leaf nodes in particular are effected.
  • HierarchicalLayout.SPREAD_OUT: the leveling strategy to spread the nodes out over all levels. This can be considered as the inverse of the semioptimal leveling strategy. It pulls root nodes to the lowest-numbered level possible and leaf nodes to the highest-numbered level possible.
The default value is HierarchicalLayout.SEMI_OPTIMAL.

The calculation of node levels can also be influenced by the following node constraints:

  • HierarchicalRelativeLevelConstraint
  • HierarchicalSameLevelConstraint
  • HierarchicalLevelRangeConstraint

If the incremental mode is switched on, the leveling strategy has no effect. The levels are calculated from the node positions, except for those nodes that are marked for incremental recalculation. See HierarchicalLayout.markForIncremental() for more information.

ParameterTypeDescription
strategyintThe leveling strategy.
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
setLinkCrossingFineTuningEnabled

Sets whether the link crossing fine tuning phase is enabled. This is an additional heuristic that tries to resolve more link crossings.

This is an expert option. It is enabled by default. It is normally not necessary to disable fine tuning, except if you need to speed up the layout.

ParameterTypeDescription
flagBoolean'true' to enable the link crossing fine tuning phase, or 'false' to disable it.
setLinkPriority

Sets the priority of a link. The layout algorithm tries to place the links in such a way that the majority of the links are short and point in the same direction. However, this is not always possible for all links. Low priority links are more likely to be longer or point in the opposite direction than the high priority links. The link priority should be smaller than 10000.

ParameterTypeDescription
linkObjectThe link.
priorityNumberThe link priority value, a number up to 10000.
setLinkStraighteningEnabled

Sets whether the link straightening phase is enabled. This phase analyzes long orthogonal links and tries to remove bends.

This is an expert option. It is enabled by default. It is normally not necessary to disable link straightening, except if you need to speed up the layout.

ParameterTypeDescription
flagBoolean'true' to enable the link straightening phase, or 'false' to disable it.
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 HierarchicalLayout.MIXED_STYLE. Otherwise, all links have the style that is specified as the global link style.

Valid values are:

  • HierarchicalLayout.POLYLINE_STYLE - The link gets a polyline shape, that is, a shape consisting of a sequence of line segments.
  • HierarchicalLayout.ORTHOGONAL_STYLE - The link gets an orthogonal shape, that is, a shape consisting of a sequence of orthogonal line segments.
  • HierarchicalLayout.STRAIGHT_LINE_STYLE - The link gets a straight-line shape.
  • HierarchicalLayout.NO_RESHAPE_STYLE - No reshape is performed on the link.

The default value is HierarchicalLayout.POLYLINE_STYLE.

ParameterTypeDescription
linkObjectThe link.
styleintThe shape style.
setLinkWidthUsed

Sets whether the layout respects the width of links. This option affects the calculation of connection points that must be evenly spaced. It has no effect on the link connection points with the connector style or HierarchicalLayout.CENTERED_PINS.

If true is passed as the argument, the distribution of the connection points varies depending on the link width. The horizontal or vertical offset between pairs of links or links and nodes is with respect to the link border. If false is passed as the argument, the distribution of connection points is independent of the link width. The horizontal or vertical offset between pairs of links or links and nodes is with respect to the link center.

The default is false.

ParameterTypeDescription
usedBoolean'true' to take link width into account when spacing connection points, or 'false' to ignore link width (the default).
setLongLinkCrossingReductionDuringIncremental

Sets whether the handling of long links for crossing reduction during incremental layout is enabled. This option has no effect if the incremental mode is disabled. If the incremental mode is enabled and the argument is false, the layout preserves the relative order of the nodes and the links within the levels. If the argument is true, the layout preserves the level structure and the relative order of the nodes, but reroutes the links in order to avoid link crossings. This means a long link may cross a level between a different pair of nodes than before layout.

It is disabled by default.

ParameterTypeDescription
enableBoolean'true' to enable long link crossing reduction during incremental layout, or 'false' to disable it.
setMaxInterLevelApertureAngle

Sets the maximum aperture angle of the links incident to a node.

This parameter only has an effect if none of the links has the orthogonal link style. It is best suited if the link style is for polyline links. It defines the maximum angle of the link segments that run between the levels of the hierarchical layout.

The maximum angle is given in degrees, it must be between 10 and 90 degrees.

If the flow direction of the layout is vertical, that is, to the bottom or to the top, a strictly vertical link segment has an aperture of 0, and a strictly horizontal link segment has aperture of 90. By limiting the maximum aperture angle, you ensure that the slope of segments between levels is more vertical than horizontal. That is to say, the slope of the link is in the flow direction of the layout. To ensure the slope of the segments, the vertical space between the levels is enlarged.

If the flow direction of the layout is horizontal, that is, to the left or to the right, a strictly vertical link segment has an aperture of 90, and a strictly horizontal link segment has an aperture of 0. By limiting the maximum aperture angle, you ensure that the slope of segments between levels is more horizontal than vertical. To ensure the slope of the segments, the horizontal space between the levels is enlarged.

If the maximum aperture is set to 90, the aperture angle has no influence on the space between levels. This is the default.

Very small maximum aperture angles are not recommended. The resulting layout may waste too much space between the node levels.

ParameterTypeDescription
angleNumberThe maximum aperture angle of the links incident to a node.
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
setMedianCrossingValueEnabled

Sets whether the median crossing value is used during crossing reduction. The layout algorithm uses a heuristic to resolve link crossings. This heuristic uses a "barycenter" weight on the nodes to determine how the crossings are resolved. If this option is enabled, it additionally uses a "median" weight as a tie breaker if two nodes have the same "barycenter" weight. Statistically, this results in fewer crossings.

This is an expert option. It is enabled by default. It is normally not necessary to change this value. However, if many nodes have very high numbers of incoming or outgoing links, the calculation of the "median" weight may slow down the layout. In this case, you can switch this option off.

ParameterTypeDescription
flagBoolean'true' to enable use of the median crossing value, or 'false' to disable it.
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
setMinEndSegmentLength

Sets the minimum length of the last segment of each link, that is, the segment that is incident to the "to" node.

The default value is 0.

ParameterTypeDescription
lengthNumberThe minimum ending link segment.
setMinForkSegmentLength

Sets the minimum length of the start or end segment of links if a fork shape is used for these links.

The default value is 10.

ParameterTypeDescription
lengthNumberThe minimum length of forking segments.
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
setMinStartSegmentLength

Sets the minimum length of the first segment of each link, that is, the segment that is incident to the "from" node.

The default value is 0.

ParameterTypeDescription
lengthNumberThe minimum starting link segment.
setMultiLinkOptimizationEnabled

Sets whether the optimization of overlapping multiple links is enabled. If you have multiple links between the same pair of directly neighbored nodes, and this option is disabled, it may happen that these links overlap. If the option is enabled and the link style of the links allow bend points, then additional bends are introduced to avoid those overlaps. The offset between these bends of the same multilink bundle can be controlled by HierarchicalLayout.setMultiLinkOptimizationOffset().

The optimization is enabled by default.

ParameterTypeDescription
flag
setMultiLinkOptimizationMaxSpread

Sets the maximum spread width for the bends introduced by the optimization of overlapping multiple links. These are bends of links in the same bundle between nodes that are directly neighbored. These bends are shifted relative to each other by the multi link optimization offset unless the number of links times the offset exceeds the max spread value. In that case, the offset is limited by the max spread value.

The default value is 50.

ParameterTypeDescription
maxSpreadNumberThe maximum spread value.
setMultiLinkOptimizationOffset

Sets the minimum distance between bends introduced by the optimization of overlapping multiple links. These are bends of links in the same bundle between nodes that are directly neighbored. These bends are shifted relative to each other by the multi link optimization offset unless the number of links times the offset exceeds the max spread value. In that case, the offset is limited by the max spread value.

The default value is 10.

ParameterTypeDescription
offsetNumberThe offset value.
setNeighborLinksAligned

Sets whether links between neighbor nodes of the same level are aligned so that they are strictly horizontal or vertical. For instance, in a top-down layout, the links between neighbor nodes of the same level can be drawn roughly horizontal while all other links are drawn roughly vertical. However, if one end node is larger than the other end node and both nodes are aligned at the top, the link between both would normally not be drawn strictly horizontal because it connects to the smaller node at a different y coordinate than to the larger node. (Reason: the y coordinate of the center of the nodes is different when they are aligned at the top and do not have the same size). In the orthogonal link style, the link would have a bend. If the alignment mode is enabled, these links between neighbor nodes are connected to the nodes so that they are strictly straight and have no bends. The connector style is ignored for these links.

It is enabled by default.

If neighbor links are not aligned and have the orthogonal style, the spacing between the link segments may be slightly smaller than the specified offset between links. If the incremental node movement mode is fixed, it is not always possible to create aligned links between neighbor nodes, due to the fixed positions of the nodes.

ParameterTypeDescription
enableBoolean'true' to enable alignment of neighbor nodes regardless of link style, or 'false' to disable the strict alignment option.
setNonorthogonalBendEliminationEnabled

Sets whether the bend elimination phase for nonorthogonal links is enabled. This phase analyzes nonorthogonal links and tries to remove bends in the links shape. This is not always desired for very long links since they often look aesthetically better if they are split by two bend into an orthogonal middle part and nonorthogonal end parts.

This is an expert option. It is disabled by default. Enabling the bend elimination produces more straight links but also slows down the algorithm. In recursive mode, it might be useful to enable this option since the recursive mode produces many small link segments between bends.

ParameterTypeDescription
flagBoolean'true' to enable the bend elimination phase, or 'false' to disable it.
setNorthNumberOfPorts

Sets the number of relative ports on the north side of a node.

ParameterTypeDescription
nodeObjectThe node.
numberOfPortsintThe number of relative ports.
setNumberOfLinkCrossingSweeps

Sets the number of layer sweeps to remove link crossings. The layout algorithm uses a sweep algorithm to resolve link crossings. This is a heuristic that cannot always remove all link crossings. The number of sweeps influences the number of crossings that are resolved. However, there is no simple formula to decide whether more sweeps would resolve more crossings or result in the converse. On some occasions it may be useful to increase or decrease the number of sweeps in order to resolve more link crossings.

This is an expert option. The default value is 5. It is normally not necessary to change this value.

ParameterTypeDescription
numberOfSweepsintThe number of sweeps to remove link crossings.
setNumberOfPorts

Sets the number of relative ports of a node on a given side. Possible values for the side parameter are HierarchicalLayout.EAST, HierarchicalLayout.WEST, HierarchicalLayout.NORTH, and HierarchicalLayout.SOUTH.

Using the relative ports is a way to specify the relative order of how the links connect to the node. The ports of a node side can be considered as connection points that are evenly spaced on the node border. Links can connect to specific pins by setting the "from" port index or the "to" port index of the link.

If the "from" port index or the "to" port index of any link connecting to the node is greater than the specified number of ports of this node, the number of ports is automatically adjusted.

ParameterTypeDescription
nodeObjectThe node.
sideintThe side of the node for the ports.
numberOfPortsintThe number of relative ports.
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.
setOriginPointMode

Sets the mode for the connection point on an individual link on the origin node. This mode is used only if the global "from" point mode is set to HierarchicalLayout.MIXED_MODE. Otherwise, the connection points on the origin nodes have, for all the links, the mode that is specified as the global origin point mode.

Valid values are:

  • HierarchicalLayout.FREE_MODE - The layout is free to choose, for this link, the appropriate position of the connection point on the origin node, except for "pinned" connection points (see ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()). The choice can further be influenced by specifying the side and the port index of the links.
  • HierarchicalLayout.FIXED_MODE - The layout must keep, for this link, the current position of the connection point on the origin node. This can be useful, in particular, if the node has fixed pins where the link is attached (as, for instance, with ibm_ilog.linkconnector.PinLinkConnector) and the pins should not be moved by the layout algorithm.

    The fixed mode works only if the link connector delivers consistently the same connection point when called multiple times. If a link is not connected to a link connector, or if the ibm_ilog.linkconnector.ClippingLinkConnector is used, the real connection point is calculated on the fly and may change when called multiple times with changing link bends. In this case, the fixed mode cannot ensure a correct routing of the links.

    Note that if the mode is fixed, specifications of the port index of links at the "from" side are ignored.

The default value is HierarchicalLayout.FREE_MODE.

ParameterTypeDescription
linkObjectThe link.
modeintThe mode to set.
setOrthogonalStairCaseEliminationEnabled

Sets whether the stair case elimination phase for orthogonal links is enabled. This phase analyzes orthogonal links and tries to remove staircase pattens in the links shape.

This is an expert option. It is enabled by default. It is normally not necessary to disable stair case elimination, except if you need to speed up the layout.

ParameterTypeDescription
flagBoolean'true' to enable the stair case elimination phase, or 'false' to disable it.
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
setParentLayout

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

ParameterTypeDescription
parent
setPolylineLinkOverlapReductionEnabled

Sets whether optimization of polyline links to avoid links overlapping large neighbor nodes is enabled. If this option is enabled, the algorithm introduces additional bends if polyline links are routed at a flat angle, to avoid overlapping large neighbor nodes. The option does not affect orthogonal links.

If the graph has a huge number of links, it is recommended switching this optimization off, because it is very time-consuming.

The optimization is enabled by default.

ParameterTypeDescription
flag
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 a position is specified, the layout algorithm places the graph such that the specified point is the upper-left corner. If no position is specified, in incremental mode the layout algorithm places the graph close to its previous position before layout started, and in nonincremental mode it places the graph so that (0, 0) is the upper-left corner.

The default value is null.

ParameterTypeDescription
pointPointThe position.
setPreferredForkAxisLength

Sets the preferred length of the axis of a fork shape. If a fork shape is used for n links that start at the same point, and the flow direction is towards the bottom, then the fork will have a horizontal segment as the axis. This horizontal segment has the preferred length calculated from this parameter multiplied by n.

Note this length is only a hint for the layout algorithm. If there is not enough free space, the layout algorithm decreases the length of the axis below the preferred length. If there is enough free space, it may also increase the length of the axis in order to reduce unnecessary link bends.

The default value is 10.

ParameterTypeDescription
lengthNumberThe preferred length of the axis of a fork shape.
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
setQuickAndUgly

This is a convenience method to set up for a "quick and ugly" layout. If you pass true, it changes various layout parameters so that the algorithm runs maximally fast. However, the quality of the result may decrease. If you pass false, it sets the parameters back to the original values.

It is normally not necessary to use a quick and ugly layout, because the default layout parameters are chosen carefully so that the speed difference should be very small. However, if you lay out a huge graph and the performance is too slow, you can easily test with the quick and ugly layout whether changing parameters would improve the performance noticeably.

ParameterTypeDescription
flagBoolean'true' to enable "QuickAndUgly" flag, or 'false' to disable it.
setRecursiveLayoutFromAncestorAllowed

Sets whether the layout instance of the ancestor graph is in principle allowed to treat this subgraph in a recursive layout. Whether the layout of the ancestor graph can handle the subgraph attached to this layout instance depends on the parameter settings of the ancestor layout. The layout instance of the ancestor graph must also be a hierarchical layout and must have the recursive layout mode enabled, otherwise the ancestor layout does not try to handle this subgraph.

This option is enabled by default.

ParameterTypeDescription
flagBoolean'true' to allow the ancestor layout to treat the subgraph attached to this layout, or 'false' otherwise.
setRecursiveLayoutMode

Sets whether this layout instance handles all subgraphs recursively that are nested into this graph. Normally, the hierarchical layout handles only the flat graph attached to this layout. If the recursive layout is enabled, it handles also all subgraphs recursively nested into this layout and also routes all intergraph links.

In detail: the recursive mode causes the hierarchical layout instances of the subgraphs to delegate the work to this layout. If the layout instance of a subgraph is no HierarchicalLayout, the subgraph is not handled by this layout. Layout parameters per node and link must be set on the layout instance of the subgraph the node or link belongs to.

The recursive mode is ignored if the attached graph is flat (has no subgraphs) or the top-level graph of a nested graph contains subgraphs of type ibm_ilog.diagram.SwimLane.

ParameterTypeDescription
flagBoolean'true' to enable the recursive layout mode, or 'false' to disable the mode.
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
setSelfLinkFromPortSide

Sets the default port side of a self-link at the "from" side. Self-links are links that start and end at the same node. This is used as port side for those self-links that have no explicit port side specification at the "from" side. It specifies at which side of the node the starting point of the self-link is connected.

Possible values for the side parameter are HierarchicalLayout.EAST, HierarchicalLayout.WEST, HierarchicalLayout.NORTH, HierarchicalLayout.SOUTH. The default value is HierarchicalLayout.SOUTH.

ParameterTypeDescription
sideintThe side of the node to which the self-link is connected.
setSelfLinkToPortSide

Sets the default port side of a self-link at the "to" side. Self-links are links that start and end at the same node. This is used as port side for those self-links that have no explicit port side specification at the "to" side. It specifies at which side of the node the end point of the self-link is connected.

Possible values for the side parameter are HierarchicalLayout.EAST, HierarchicalLayout.WEST, HierarchicalLayout.NORTH, HierarchicalLayout.SOUTH. The default value is HierarchicalLayout.WEST.

ParameterTypeDescription
sideintThe side of the node to which the self-link is connected.
setSelfLinksSameSideNested

Sets whether self-links that attach the same side of a node are nested. If multiple self-links attach the same side of a node and they are not nested, they are routed next to each other. If they are nested, they are routed link a multilink bundle.

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

ParameterTypeDescription
flagBoolean'true' to enable the nesting of self-links or 'false' to disable it.
setSouthNumberOfPorts

Sets the number of relative ports on the south side of a node.

ParameterTypeDescription
nodeObjectThe node.
numberOfPortsintThe number of relative ports.
setSpecNodeLevelIndex

Sets the index of the specified level for a node. Nodes are organized in horizontal or vertical levels numbered from 0 to n. If the link flow direction is from top to bottom, the nodes with level index 0 are placed in the topmost level, and the nodes with higher level indexes are placed in the levels below. If the link flow direction is from left to right, the nodes with level index 0 are placed in the leftmost level, and the nodes with higher level indexes are placed in the levels farther to the right.

This method allows you to specify the level where a node should be placed. If the level index of a node is set to a negative value, it means that there is no preference for the level of the node. In this case, the layout algorithm calculates an appropriate level index.

The default level index of a node is -1; that is, the layout algorithm determines the appropriate level automatically.

Note that specified level indexes can cause conflicts to constraints that are solved depending on the constraint priorities. The index specification or some of the constraints may be ignored in this case. Furthermore, note that if the generic connected component layout mechanism of the GraphLayout base class is enabled, each connected component uses its own level structure. If it is disabled, there is only one global level structure.

ParameterTypeDescription
nodeObjectThe node.
indexintThe level index.
setSpecNodePositionIndex

Sets the index of the specified position of a node within a level. Nodes are organized in horizontal or vertical levels. Within each level, the nodes are placed sequentially at relative positions numbered from 0 to n. If the link flow direction is from top to bottom, the node with position index 0 is placed leftmost within its level, and the nodes with higher position indexes are placed farther to the right. If the link flow direction is from right to left, the node with position index 0 is placed topmost within its level, and the nodes with higher position indexes are placed below.

This method allows you to specify the relative position where a node should be placed within its level. If the position index of a node is set to a negative value, it means that there is no preference for the position of the node. In this case, the layout algorithm calculates an appropriate position index. If the position index is higher than the number of nodes in the level, the position index is ignored. If two nodes of the same level have the same position index, one of the indexes is ignored. The layout algorithm calculates an appropriate position index for the nodes that have inappropriate or conflicting position indexes.

The default position index of a node is -1; that is, the layout algorithm determines the appropriate position automatically.

Note that specified position indexes can cause conflicts to constraints that are solved depending on the constraint priorities. The index specification or some of the constraints may be ignored in this case. Furthermore, note that if the generic connected component layout mechanism of the GraphLayout base class is enabled, each connected component uses its own level structure. If it is disabled, there is only one global level structure.

ParameterTypeDescription
nodeObjectThe node.
indexintThe position index within a level, starting from '0'.
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
setToFork

Sets whether a fork shape is created for links that end at the same target point. A fork shape is a link shape where several links join from different branches into a final link segment that ends at the same point. The fork shape is used only in the orthogonal link style, and only in the following cases: if the connector style is HierarchicalLayout.CENTERED_PINS, or if the links start at the same specified port index at the north or south side of a node, or if the links have the fixed origin point mode and are placed at exactly the same coordinate.

The default value is false.

ParameterTypeDescription
enableBoolean'true' to enable fork shape creation, or 'false' to disable it.
setToPortIndex

Sets the port index of a link at the "to" side. This allows you to specify the relative ports of the links on the node border. Using the relative ports is a way to specify the relative order of how the links connect to the "to" node. The specification is only used if the free destination point mode is used for the link.

Port numbers are between 0 and n - 1, where n is the number of ports at the node side where the link is connected. Links with an unspecified or negative port index are connected on the node border according to the global connector style. A link with specified port index i is connected at the ith relative port, and the connection points of ports are evenly spaced on the corresponding node border.

ParameterTypeDescription
linkObjectThe link.
portIndexintThe relative port index starting from '0'.
setToPortSide

Sets the port side of a link at the "to" side. This allows you to specify at which side of the node the end point of the link is connected.

Possible values for the side parameter are HierarchicalLayout.EAST, HierarchicalLayout.WEST, HierarchicalLayout.NORTH, HierarchicalLayout.SOUTH, and the default HierarchicalLayout.UNSPECIFIED.

If a port side is unspecified, the link can connect to any border side of the node. Otherwise, the link connects only to the specified node border.

ParameterTypeDescription
linkObjectThe link.
sideintThe side of the node to which the link is connected.
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
setVerticalLinkOffset

Sets the vertical offset between parallel segments of links. In the orthogonal link style, the segments attached directly to the node may have a smaller offset if the node is too small or the number of incident links is too large to satisfy the specified offset.

The default value is 15.

ParameterTypeDescription
offsetNumberThe vertical offset value.
setVerticalNodeLinkOffset

Sets the vertical offset between a node and a link segment that is parallel to the node border.

The default value is 20.

ParameterTypeDescription
offsetNumberThe vertical offset value.
setVerticalNodeOffset

Sets the vertical offset between nodes. If the levels are vertical, this is the minimum distance between the nodes of the same level. If the levels are horizontal, this is the minimum distance between the nodes of different levels.

The default value is 40.

ParameterTypeDescription
offsetNumberThe vertical offset value.
setWestNumberOfPorts

Sets the number of relative ports on the west side of a node.

ParameterTypeDescription
nodeObjectThe node.
numberOfPortsintThe number of relative ports.
stopImmediately
Returns Boolean: 'true' if stopping the algorithm is possible.

Stops the running layout algorithm as soon as possible. The Hierarchical Layout algorithm has several steps. In the early steps, stopping the algorithm is possible and the method returns true. In the last step, stopping the algorithm is no longer possible 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 Hierarchical 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 on each connected component separately, and uses the layout instance returned by the method ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents() to place 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 previous positions. Nodes of different components with the same specified level index are no longer aligned in levels because each component has an individual level structure.

If the generic connected component layout mechanism is disabled, the algorithm uses its own specialized internal mechanism instead of the generic mechanism. All components are merged into the same global level structure.

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 calculated for all links except those with the no-reshape link style and fixed links. The tangential offsets provided by the link connection box interface are currently ignored.

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 in particular 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 whether the layout class can estimate the percentage of completion during the run of layout. If supported, the percentage is stored in the layout report and can be retrieved by any layout event listener.

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.

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.

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 Hierarchical Layout algorithm, which may lead to node overlaps.

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: This implementation always returns 'true'.

Indicates 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 layout immediately in a controlled way. If the algorithm is stopped before termination of the Hierarchical 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.

validateConstraints

Performs a validation check for the constraints. If nodes are removed from the graph, the constraint manager may still contain constraints that are related to these nodes. These constraints merely waste memory. They are removed by the validation check.

The validation check is automatically performed during layout. In the most cases, it is not necessary to call this method directly. Only in a memory-critical application may you want to perform the validation check explicitly, if you added many constraints and removed many constrained nodes from the graph without performing any layout.

Do not confuse the validation check with the automatic constraint conflict resolution. The validation check removes constraints that no longer make sense in the current graph. After the validation check, there may still be conflicting constraints in the hierarchical layout. The constraint conflict resolution also happens automatically during layout. However, the resolution does not remove conflicting constraints from the layout. It only decides not to satisfy them.

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