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

Object » ibm_ilog.graphlayout.GraphLayout » ibm_ilog.graphlayout.shortlink.ShortLinkLayout
dojo.require("ibm_ilog.graphlayout.shortlink.ShortLinkLayout");

This class is the main class for the Short Link Layout algorithm.

This algorithm reshapes the links of a graph without moving the nodes. By default, the algorithm computes orthogonal links (that is, links composed of alternating horizontal and vertical segments). Optionally, direct links can be computed. (See ShortLinkLayout.setGlobalLinkStyle() and ShortLinkLayout.setLinkStyle().)

The links are placed freely in the plane by choosing the best shape from a fixed number of link shapes. Orthogonal links can a maximum of 4 bends. Direct links have 3 bends.

This layout algorithm is recommended when any of the following apply:

  • Most of the links are short, and it is not fatal if long links overlap some nodes.
  • The link routes must be placed freely and cannot be restricted to a grid.
  • It is important to limit the number of bends.
Otherwise, the ibm_ilog.graphlayout.longlink.LongLinkLayout may be more suitable.

Here are sample drawings produced by the Short Link Layout algorithm:

Sample drawing produced with the Short Link Layout

Sample drawing produced with the Short Link Layout

Sample drawing produced with the Short Link Layout

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

Note the following points:

  • The algorithm never moves any nodes. It only reshapes links.
  • The algorithm normally routes normal links. It has a special mode to route the intergraph links of the graph model.
  • The algorithm has an incremental mode and a nonincremental mode. In nonincremental mode, the initial shape of the links (at the moment you start the layout) does not affect the resulting layout. However, links specified as fixed while ibm_ilog.graphlayout.GraphLayout.setPreserveFixedLinks() is enabled or links that have the link style ShortLinkLayout.NO_RESHAPE_STYLE are not reshaped. The incremental mode cannot be used for intergraph links.
  • In incremental mode, the initial shape of the link does affect the resulting layout. The algorithm tries to preserve the shape of links that already fit the layout situation.
  • The algorithm supports self-links and multiple links between the same pair of nodes.

Property Summary

  • AUTOMATIC_PINS Automatic pin style. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', the connector style of all nodes is automatically selected as follows. The connection points are dispatched using the style ' ShortLinkLayout.FIXED_OFFSET_PINS' if in so doing no connection point goes outside the border to which the link is attached. Otherwise, the connection points are dispatched using the style ' ShortLinkLayout.EVENLY_SPACED_PINS'. To specify automatic pins for an individual node, use automatic pin style as the argument of the method ' ShortLinkLayout.setConnectorStyle()'.
  • DIRECT_STYLE Direct link style. When used as the argument of the method ' ShortLinkLayout.setGlobalLinkStyle()', all links get a (semi)direct shape. To specify the style of an individual link, use this style as the argument of the method ' ShortLinkLayout.setLinkStyle()'.
  • EVENLY_SPACED_PINS Evenly spaced pin style. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', the connection points of all the links are evenly spaced along the node border to which the link is attached. To specify evenly spaced pins for an individual node, use evenly spaced pin style as the argument of the method ' ShortLinkLayout.setConnectorStyle()'.
  • FIRST_LAST_SEGMENT Simple link bundles. When used as the argument of the method ' ShortLinkLayout.setLinkBundlesMode()', only first and last segments of the links are bundled.
  • FIXED_CONNECTION_POINTS_MODE Fixed connection-points mode. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or the ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout preserves the connection points of the links. To specify the mode for the incremental reshape of an individual link, use fixed connection-points mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.
  • FIXED_MODE Fixed mode. This value can be used for the following: <ul> <li>Connection-point mode. When fixed mode is used as the argument of the method ' ShortLinkLayout.setGlobalOriginPointMode()' or ' ShortLinkLayout.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 fixed mode as the argument of the method ' ShortLinkLayout.setOriginPointMode()' or ' ShortLinkLayout.setDestinationPointMode()'. </li> <li>Incremental link-reshape mode. When fixed mode is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout is not allowed to reshape the links in any way. To specify the mode for the incremental reshape of an individual link, use fixed mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.</li> </ul>
  • FIXED_NODE_SIDES_MODE Fixed node-side mode. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or the ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout preserves the node sides to which the links are connected. To specify the mode for the incremental reshape of an individual link, use fixed node-side mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.
  • FIXED_OFFSET_PINS Fixed-offset pin style. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', the connection points of all the links are placed at a fixed distance, given by the method ' ShortLinkLayout.getLinkOffset()'. To specify fixed-offset pina for an individual node, use fixed-offset pin style as the argument of the method ' ShortLinkLayout.setConnectorStyle()'.
  • FIXED_SHAPE_TYPE_MODE Fixed shape-type mode. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or the ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout preserves the shape type of the link. This means that both the number of bends and the node sides to which the links are connected are preserved. To specify the mode for the incremental reshape of an individual link, use fixed shape-type mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.
  • FREE_MODE Free mode. This value can be used for the following: <ul> <li>Connection-point mode. When free mode is used as the argument of the method ' ShortLinkLayout.setGlobalOriginPointMode()' or ' ShortLinkLayout.setGlobalDestinationPointMode()', the layout is free to choose the appropriate position for 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 free mode as the argument of the method ' ShortLinkLayout.setOriginPointMode()' or ' ShortLinkLayout.setDestinationPointMode()'.</li> <li>Incremental link-reshape mode. When free mode is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setGlobalIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout is allowed to reshape the links freely. Any settings done using ' ibm_ilog.graphlayout.GraphLayout.isFixed()', ' ShortLinkLayout.getGlobalOriginPointMode()' and ' ShortLinkLayout.getGlobalDestinationPointMode()' are still obeyed. To specify the mode for the incremental reshape of an individual link, use free mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.</li> </ul>
  • IMPROVED_FIRST_LAST_SEGMENT Improved link bundles. When used as the argument of the method ' ShortLinkLayout.setLinkBundlesMode()', the first and the last segments of the links are bundled.
  • MIXED_MODE Mixed mode. This value can be used for the following: <ul> <li>Connection-point mode. When mixed mode is used as the argument of the methods ' ShortLinkLayout.setGlobalOriginPointMode()' or ' ShortLinkLayout.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 ' ShortLinkLayout.setOriginPointMode()' or ' ShortLinkLayout.setDestinationPointMode()'.</li> <li>Incremental link-reshape mode. When mixed mode is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()', each link can have a different incremental reshape mode. The mode for the incremental reshape of an individual link can be set by the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.</li> </ul>
  • MIXED_STYLE Mixed link shape. It can be used with the following meanings: <ul> <li>Link style mode. When used as the argument of the method ' ShortLinkLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by the method ' ShortLinkLayout.setLinkStyle()'.</li> <li>Connector style mode. When used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', each node can have a different connector style. The connector style of an individual node can be set by the method ' ShortLinkLayout.setConnectorStyle()'.</li> </ul>
  • NO_BUNDLE No link bundles. When used as the argument of the method ' ShortLinkLayout.setLinkBundlesMode()', no link bundles are computed.
  • NO_RESHAPE_STYLE No reshape link style. This can be used for individual links if the global link style is ' ShortLinkLayout.MIXED_STYLE'. To specify the style of an individual link, use this style as the argument of the method ' ShortLinkLayout.setLinkStyle()'.
  • ORTHOGONAL_STYLE Orthogonal link style. When used as the argument of the method ' ShortLinkLayout.setGlobalLinkStyle()', all links get an orthogonal shape (alternating horizontal and vertical segments). To specify the style of an individual link, use this style as the argument of the method ' ShortLinkLayout.setLinkStyle()'.
  • THREE_BENDS_ORTHOGONAL_STYLE Three-bends orthogonal self-link. When used as the argument of the method ' ShortLinkLayout.setGlobalSelfLinkStyle()', a three-bend shape is given to the self-links, that is, links with the same origin and destination node.
  • TWO_BENDS_ORTHOGONAL_STYLE Two-bends orthogonal self-link. When used as the argument of the method ' ShortLinkLayout.setGlobalSelfLinkStyle()', a two-bend shape is given to the self-links, that is, links with the same origin and destination node.

Method Summary

  • afterLayoutOfSubgraph(subgraph) Performs postprocessing operations after the layout of each subgraph or connected component.
  • attach(graphModel) Sets the graph model to be laid out.
  • beforeLayout() Performs preprocessing operations before the layout of the entire graph.
  • beforeLayoutOfSubgraph(subgraph) Performs preprocessing operations before the layout of each subgraph or connected component.
  • callLayoutStepPerformedIfNeeded() Calls 'onLayoutStepPerformed' when necessary.
  • cleanGraphModel(graphModel) Cleans a graph model.
  • cleanLink(graphModel, link) Cleans a link.
  • cleanNode(graphModel, node) Cleans a node.
  • connectAllLinksToCenter() Connects all links to the enter of their end nodes.
  • connectLinkToCenter(link, atFromSide, atToSide) Connects the link to the node center at both end nodes by using the link connection box interface.
  • constructor(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.
  • getAllowedNumberOfIterations() returns int Returns the maximum number of allowed optimization iterations.
  • getAllowedTime() returns Number Returns the currently allowed time for the layout algorithm in milliseconds.
  • getAuxiliaryLongLinkLayout() returns ibm_ilog.graphlayout.longlink.LongLinkLayout Returns the instance of ' ibm_ilog.graphlayout.longlink.LongLinkLayout' that is used for avoiding overlaps between links and nodes when ' ShortLinkLayout.isLinkOverlapNodesForbidden()' returns 'true'.
  • getBalanceSplineCurveThreshold() returns Number Returns the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • getBypassDistance() returns Number Returns the minimum distance between the origin and destination node for which a link shape going directly from one node to another is allowed.
  • getCalcLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region parameter.
  • getConnectorStyle(node) Returns the connector style of an individual node.
  • getDestinationPointMode(link) Returns the destination-point mode of an individual link.
  • getEvenlySpacedPinsMarginRatio() returns Number Returns the margin ratio for the evenly spaced connector style.
  • getGlobalConnectorStyle() returns int Returns the global style of the connectors.
  • getGlobalDestinationPointMode() returns int Returns the global mode for the connection points of the links on the destination nodes.
  • getGlobalIncrementalModifiedLinkReshapeMode() returns int Returns the reshape mode used during the incremental layout of modified links.
  • getGlobalIncrementalUnmodifiedLinkReshapeMode() returns int Returns the reshape mode used during the incremental layout of unmodified links.
  • getGlobalLinkStyle() returns int Returns the current choice for the style of the shape of the links.
  • getGlobalOriginPointMode() returns int Returns the global mode for the connection points of the links on the origin nodes.
  • getGlobalSelfLinkStyle() returns int Returns the current choice for the style of the shape of the self-links.
  • getGraphModel() returns ibm_ilog.graphlayout.AbstractGraphLayoutModel Returns the graph model to lay out if a graph model is attached.
  • getIncrementalModifiedLinkReshapeMode(link) Returns the reshape mode of an individual link used during the incremental layout of modified links.
  • getIncrementalUnmodifiedLinkReshapeMode(link) Returns the reshape mode of an individual link used during the incremental layout of unmodified links.
  • 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.
  • getLinkBundlesMode() returns int Returns the current choice for the link bundles mode.
  • getLinkConnectionBoxInterface() returns ibm_ilog.graphlayout.ILinkConnectionBoxProvider Returns the link connection box interface used to calculate the connection points of links during layout.
  • getLinkOffset() returns Number Returns the offset between links connected on the same side of the node.
  • getLinkStyle(link) Returns the style of the shape of an individual link.
  • getLinkToLinkCrossingPenalty() returns Number Returns the link-to-link crossing penalty factor.
  • getLinkToNodeCrossingPenalty() returns Number Returns the link-to-node crossing penalty factor.
  • 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.
  • getMinFinalSegmentLength() returns Number Returns the minimum length of the final segment of the links.
  • getMinSplineCurveSize() returns Number Returns the minimum curve size used when optimized spline control points routing is enabled.
  • getNodeBoxInterface() returns ibm_ilog.graphlayout.INodeBoxProvider Returns the node box interface used during the layout.
  • getNodeSideFilter() returns ibm_ilog.graphlayout.INodeSideFilter Returns the node-side filter used during layout.
  • 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.
  • 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.
  • getSpecLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region, as specified using the method ' ibm_ilog.graphlayout.GraphLayout.layoutRegion'.
  • getSplineLinkFilter() returns ibm_ilog.graphlayout.SplineLinkFilter Returns the filter that detects which links are suitable for optimized spline routing.
  • getViewMatrix() Returns the matrix that is applied to the first view attached to this layout.
  • increasePercentageComplete(newPercentage) Increases the percentage of completion that is stored in the layout report to the input value.
  • init() Initializes instance variables.
  • isCombinedInterGraphLinksMode() returns Boolean Returns 'true' if the routing of normal links in addition to intergraph links is enabled; returns 'false' otherwise.
  • isFitToViewEnabled() returns Boolean Returns 'true' if the graph drawing must fit (exactly or approximately) an area of a specific view.
  • isFixed(nodeOrLink) returns Boolean Returns whether the node or link is specified as fixed.
  • isGeometryUpToDate() returns Boolean Returns whether the geometry of the graph is up to date.
  • isIncrementalMode() returns Boolean Returns 'true' if the incremental mode is enabled.
  • isInputCheckEnabled() returns Boolean Returns 'true' if the checks for the nodes and/or links are enabled.
  • isInterGraphLinksMode() returns Boolean Returns 'true' if the routing of intergraph links is enabled; returns 'false' otherwise.
  • 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.
  • isLinkOverlapNodesForbidden() returns Boolean Returns 'true' if the overlap of links with nodes is forbidden; returns 'false' otherwise.
  • isLocalRecursiveLayoutNeeded(layoutProvider, recLayout, rootModel, traverse) returns Boolean Checks whether layout is needed when layout is performed recursively on a hierarchy of nested subgraphs.
  • isParametersUpToDate() returns Boolean Returns whether the layout parameters are up to date.
  • isPreserveFixedLinks() returns Boolean Returns 'true' if the layout is not allowed to reshape the links indicated as fixed by the user.
  • isPreserveFixedNodes() returns Boolean Returns 'true' if the layout is not allowed to move the nodes indicated as fixed by the user.
  • isSameShapeForMultipleLinks() returns Boolean Returns 'true' if the algorithm that makes sure that multiple links are reshaped in the same manner is enabled, and 'false' otherwise.
  • isSplineRoutingEnabled() returns Boolean Tests whether the calculation of optimized spline control points is enabled.
  • isStoppedImmediately() returns Boolean Returns 'true' if the method ' ibm_ilog.graphlayout.GraphLayout.stopImmediately()' was called.
  • isStructureUpToDate() returns Boolean Returns whether the structure of the graph is up to date.
  • isUseSeedValueForRandomGenerator() returns Boolean Returns 'true' if the user-defined seed value is used for the random generator and 'false' otherwise.
  • layout() Computes the layout using the Short Link Layout algorithm.
  • performLayout(force, traverse) returns int Starts the layout algorithm using the currently attached graph model and the current settings for the layout parameters.
  • performSublayout(subgraph, layout, force) Starts the input layout algorithm.
  • setAllowedNumberOfIterations(iterations) Sets the maximum number of iterations of the layout algorithm.
  • setAllowedTime(time) Sets the upper limit for the duration of the layout algorithm.
  • setBalanceSplineCurveThreshold(threshold) Sets the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • setBypassDistance(dist) Sets the minimum distance between the origin and destination node for which a link shape going directly from one node to another is allowed.
  • setCombinedInterGraphLinksMode(enable) Sets the routing of normal links in addition to intergraph links.
  • setConnectorStyle(node, style) Sets the connector style of an individual node.
  • setDestinationPointMode(link, mode) Sets the mode for the connection point of an individual link on the destination node.
  • setEvenlySpacedPinsMarginRatio(ratio) Sets the margin ratio for the evenly spaced connector style.
  • setFixed(nodeOrLink, fixed) Sets the specified node or link as fixed.
  • setGeometryUpToDate(uptodate) Sets whether the geometry of the graph is up to date.
  • setGlobalConnectorStyle(style) Sets the global style of connectors.
  • setGlobalDestinationPointMode(mode) Sets the global mode for the connection point of the links on the destination nodes.
  • setGlobalIncrementalModifiedLinkReshapeMode(mode) Sets the reshape mode used during the incremental layout of modified links, that is, links that have already been laid out in the previous layout execution and for which either the bounding box (see ' ShortLinkLayout.getNodeBoxInterface()' or the "link connection box" (see ' ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()') of their origin and destination nodes has been modified.
  • setGlobalIncrementalUnmodifiedLinkReshapeMode(mode) Sets the reshape mode used during the incremental layout of unmodified links, that is, links that have already been laid out in the previous layout execution and for which neither the bounding box (see ' ShortLinkLayout.getNodeBoxInterface()' nor the "link connection box" (see ' ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()') of their origin and destination nodes have been modified.
  • setGlobalLinkStyle(style) Sets the global style of the shape of the links.
  • setGlobalOriginPointMode(mode) Sets the global mode for the connection point of the links on the origin nodes.
  • setGlobalSelfLinkStyle(style) Sets the global style of the shape of the self-links.
  • setGraphModel(graphModel) Sets the graph model to be laid out.
  • setIncrementalMode(enable) Sets the incremental layout mode.
  • setIncrementalModifiedLinkReshapeMode(link, mode) Sets the reshape mode of an individual link used during the incremental layout of modified links, that is, links that have already been laid out in the previous layout execution and for which either the bounding box (see ' ShortLinkLayout.getNodeBoxInterface()' or the "link connection box" (see ' ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()') of their origin and destination nodes has been modified.
  • setIncrementalUnmodifiedLinkReshapeMode(link, mode) Sets the reshape mode of an individual link used during the incremental layout of unmodified links, that is, links that have already been laid out in the previous layout execution and for which neither the bounding box (see ' ShortLinkLayout.getNodeBoxInterface()' nor the "link connection box" (see ' ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()') of their origin and destination nodes have been modified.
  • 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.
  • setInterGraphLinksMode(enable) Sets the routing of intergraph links.
  • 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.
  • setLinkBundlesMode(mode) Sets the link bundles mode.
  • setLinkClipping(value) Sets whether links should be clipped at the shape of the end nodes.
  • setLinkConnectionBoxInterface(connectionBoxInterface) Sets the link connection box interface for the connection points of links.
  • setLinkOffset(offset) Sets the offset between links connected on the same side of the node.
  • setLinkOverlapNodesForbidden(s) Sets whether it is forbidden for the layout to reshape links such that they overlap nodes.
  • setLinkStyle(link, style) Sets the style of the shape of an individual link.
  • setLinkToLinkCrossingPenalty(penalty) Sets the link-to-link crossing penalty factor.
  • setLinkToNodeCrossingPenalty(penalty) Sets the link-to-node crossing penalty factor.
  • setMaxSplineCurveSize(size) Sets the maximum curve size used when optimized spline control point routing is enabled.
  • setMinBusyTime(time) Sets the minimal time that the layout algorithm can be busy.
  • setMinFinalSegmentLength(length) Sets the minimum length of the final (first and last) segment of the links.
  • setMinSplineCurveSize(size) Sets the minimum curve size used when optimized spline control point routing is enabled.
  • setNodeBoxInterface(nodeBoxInterface) Sets an object that provides the rectangle defining the position and size of each node.
  • setNodeSideFilter(filter) Sets the node-side filter, that is, an object that allows or prohibits the connection of the links on a given side of the nodes.
  • 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.
  • 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.
  • setPreserveFixedLinks(option) Sets whether the layout avoids movement of fixed links.
  • setPreserveFixedNodes(option) Sets whether the layout avoids movement of fixed nodes.
  • setSameShapeForMultipleLinks(option) Sets whether the layout algorithm must make sure that all multiple links have the same type of shape, that is, a shape with the same number of bends and with parallel segments.
  • setSeedValueForRandomGenerator(seed) Sets the seed value for the random generator.
  • 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.
  • setUseSeedValueForRandomGenerator(option) Sets whether the user-defined seed value should be used for the random generator.
  • stopImmediately() returns Boolean Overridden version of the base class method.
  • supportsAllowedTime() returns Boolean Indicates that this layout class can stop the layout computation in the proper manner when the user-defined allowed time is exceeded.
  • supportsLayoutOfConnectedComponents() returns Boolean Indicates whether the layout class can cut the attached graph into connected components, apply itself on each connected component separately, and then use the layout instance returned by the method ' ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents()' to position the connected components.
  • 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 a link.
  • supportsPercentageComplete() returns Boolean Indicates whether the layout class can estimate the percentage of completion during the run of layout.
  • supportsPreserveFixedLinks() returns Boolean Indicates that this layout class allows the user to specify fixed links.
  • supportsPreserveFixedNodes() returns Boolean Indicates whether the layout class allows the user to specify fixed nodes.
  • supportsRandomGenerator() returns Boolean Indicates whether the layout class uses randomly generated numbers (or randomly chosen parameters) for which it can accept a user-defined seed value.
  • supportsSplineRouting() returns Boolean Tests if this class supports the generic optimization of spline control points.
  • supportsStopImmediately() returns Boolean Indicates that this layout class can interrupt the current run of the layout immediately in a controlled way.
  • toString() returns String Returns a printable string representing this layout instance.
  • unfixAllLinks() Removes the fixed attribute from all links in the graph model.
  • unfixAllNodes() Removes the fixed attribute from all nodes in the graph model.

Event Summary

Properties

AUTOMATIC_PINS
Automatic pin style. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', the connector style of all nodes is automatically selected as follows. The connection points are dispatched using the style ' ShortLinkLayout.FIXED_OFFSET_PINS' if in so doing no connection point goes outside the border to which the link is attached. Otherwise, the connection points are dispatched using the style ' ShortLinkLayout.EVENLY_SPACED_PINS'. To specify automatic pins for an individual node, use automatic pin style as the argument of the method ' ShortLinkLayout.setConnectorStyle()'.
DIRECT_STYLE
Direct link style. When used as the argument of the method ' ShortLinkLayout.setGlobalLinkStyle()', all links get a (semi)direct shape. To specify the style of an individual link, use this style as the argument of the method ' ShortLinkLayout.setLinkStyle()'.
EVENLY_SPACED_PINS
Evenly spaced pin style. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', the connection points of all the links are evenly spaced along the node border to which the link is attached. To specify evenly spaced pins for an individual node, use evenly spaced pin style as the argument of the method ' ShortLinkLayout.setConnectorStyle()'.
FIRST_LAST_SEGMENT
Simple link bundles. When used as the argument of the method ' ShortLinkLayout.setLinkBundlesMode()', only first and last segments of the links are bundled.
FIXED_CONNECTION_POINTS_MODE
Fixed connection-points mode. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or the ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout preserves the connection points of the links. To specify the mode for the incremental reshape of an individual link, use fixed connection-points mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.
FIXED_MODE
Fixed mode. This value can be used for the following: <ul> <li>Connection-point mode. When fixed mode is used as the argument of the method ' ShortLinkLayout.setGlobalOriginPointMode()' or ' ShortLinkLayout.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 fixed mode as the argument of the method ' ShortLinkLayout.setOriginPointMode()' or ' ShortLinkLayout.setDestinationPointMode()'. </li> <li>Incremental link-reshape mode. When fixed mode is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout is not allowed to reshape the links in any way. To specify the mode for the incremental reshape of an individual link, use fixed mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.</li> </ul>
FIXED_NODE_SIDES_MODE
Fixed node-side mode. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or the ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout preserves the node sides to which the links are connected. To specify the mode for the incremental reshape of an individual link, use fixed node-side mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.
FIXED_OFFSET_PINS
Fixed-offset pin style. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', the connection points of all the links are placed at a fixed distance, given by the method ' ShortLinkLayout.getLinkOffset()'. To specify fixed-offset pina for an individual node, use fixed-offset pin style as the argument of the method ' ShortLinkLayout.setConnectorStyle()'.
FIXED_SHAPE_TYPE_MODE
Fixed shape-type mode. When this value is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or the ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout preserves the shape type of the link. This means that both the number of bends and the node sides to which the links are connected are preserved. To specify the mode for the incremental reshape of an individual link, use fixed shape-type mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.
FREE_MODE
Free mode. This value can be used for the following: <ul> <li>Connection-point mode. When free mode is used as the argument of the method ' ShortLinkLayout.setGlobalOriginPointMode()' or ' ShortLinkLayout.setGlobalDestinationPointMode()', the layout is free to choose the appropriate position for 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 free mode as the argument of the method ' ShortLinkLayout.setOriginPointMode()' or ' ShortLinkLayout.setDestinationPointMode()'.</li> <li>Incremental link-reshape mode. When free mode is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setGlobalIncrementalModifiedLinkReshapeMode()' in incremental mode, the layout is allowed to reshape the links freely. Any settings done using ' ibm_ilog.graphlayout.GraphLayout.isFixed()', ' ShortLinkLayout.getGlobalOriginPointMode()' and ' ShortLinkLayout.getGlobalDestinationPointMode()' are still obeyed. To specify the mode for the incremental reshape of an individual link, use free mode as the argument of the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.</li> </ul>
IMPROVED_FIRST_LAST_SEGMENT
Improved link bundles. When used as the argument of the method ' ShortLinkLayout.setLinkBundlesMode()', the first and the last segments of the links are bundled.
MIXED_MODE
Mixed mode. This value can be used for the following: <ul> <li>Connection-point mode. When mixed mode is used as the argument of the methods ' ShortLinkLayout.setGlobalOriginPointMode()' or ' ShortLinkLayout.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 ' ShortLinkLayout.setOriginPointMode()' or ' ShortLinkLayout.setDestinationPointMode()'.</li> <li>Incremental link-reshape mode. When mixed mode is used as the argument of the method ' ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()', each link can have a different incremental reshape mode. The mode for the incremental reshape of an individual link can be set by the method ' ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode()' or ' ShortLinkLayout.setIncrementalModifiedLinkReshapeMode()'.</li> </ul>
MIXED_STYLE
Mixed link shape. It can be used with the following meanings: <ul> <li>Link style mode. When used as the argument of the method ' ShortLinkLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by the method ' ShortLinkLayout.setLinkStyle()'.</li> <li>Connector style mode. When used as the argument of the method ' ShortLinkLayout.setGlobalConnectorStyle()', each node can have a different connector style. The connector style of an individual node can be set by the method ' ShortLinkLayout.setConnectorStyle()'.</li> </ul>
NO_BUNDLE
No link bundles. When used as the argument of the method ' ShortLinkLayout.setLinkBundlesMode()', no link bundles are computed.
NO_RESHAPE_STYLE
No reshape link style. This can be used for individual links if the global link style is ' ShortLinkLayout.MIXED_STYLE'. To specify the style of an individual link, use this style as the argument of the method ' ShortLinkLayout.setLinkStyle()'.
ORTHOGONAL_STYLE
Orthogonal link style. When used as the argument of the method ' ShortLinkLayout.setGlobalLinkStyle()', all links get an orthogonal shape (alternating horizontal and vertical segments). To specify the style of an individual link, use this style as the argument of the method ' ShortLinkLayout.setLinkStyle()'.
THREE_BENDS_ORTHOGONAL_STYLE
Three-bends orthogonal self-link. When used as the argument of the method ' ShortLinkLayout.setGlobalSelfLinkStyle()', a three-bend shape is given to the self-links, that is, links with the same origin and destination node.
TWO_BENDS_ORTHOGONAL_STYLE
Two-bends orthogonal self-link. When used as the argument of the method ' ShortLinkLayout.setGlobalSelfLinkStyle()', a two-bend shape is given to the self-links, that is, links with the same origin and destination node.

Methods

afterLayoutOfSubgraph

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

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

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

Sets the graph model to be laid out.

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

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

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

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

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

beforeLayoutOfSubgraph

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

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

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

Calls onLayoutStepPerformed when necessary.

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

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

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

cleanGraphModel

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

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

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

Cleans a link. This method removes any data that has been stored by the layout algorithm on a regular link or on an intergraph link.

The method is automatically called by ibm_ilog.graphlayout.GraphLayout.contentsChanged() whenever a GraphLayoutModelEvent of type GraphLayoutModelEvent.LINK_REMOVED is received.

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

Notice that the method may be called multiple times for the same link. At the time this method is called, the link may already be removed; therefore, overridden versions of this method should be implemented so that they work even if the object is no longer a link of graphModel.

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.

The method is automatically called by ibm_ilog.graphlayout.GraphLayout.contentsChanged() whenever a GraphLayoutModelEvent of type GraphLayoutModelEvent.NODE_REMOVED is received.

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

Notice that the method may be called multiple times for the same node. At the time this method is called, the node may already be removed; therefore, overridden versions of this method should be implemented so that they work even if the object is no longer a node of graphModel.

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 on 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. The other parameters, including the customization interfaces, are also 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. The other parameters, including the customization interfaces, are also copied.

If a method of the type supportsXXX is associated with a parameter, the parameter is copied only if the corresponding method returns true.

ParameterTypeDescription
source
createLayoutReport
Returns ibm_ilog.graphlayout.GraphLayoutReport: A new instance of the layout report.

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

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

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

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

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

detach

Detaches the graph model from the layout instance. When you attach a new graph model to the layout instance, you do not need to detach the old graph model because this is done automatically when you call ibm_ilog.graphlayout.GraphLayout.attach().

The method performs cleaning operations on the graph model. In addition to the cleaning operations in the base class, the Short Link Layout removes the link style specifications of individual links.

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

getAllowedNumberOfIterations
Returns int
Returns the maximum number of allowed optimization iterations.
getAllowedTime
Returns Number

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

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

getAuxiliaryLongLinkLayout
Returns ibm_ilog.graphlayout.longlink.LongLinkLayout: The instance of ' ibm_ilog.graphlayout.longlink.LongLinkLayout' that is used for avoiding overlaps between links and nodes when ' ShortLinkLayout.isLinkOverlapNodesForbidden()' returns 'true'.

Returns the instance of ibm_ilog.graphlayout.longlink.LongLinkLayout that is used for avoiding overlaps between links and nodes when ShortLinkLayout.isLinkOverlapNodesForbidden() returns true.

This method allows you to get this auxiliary layout instance and to customize its parameters if needed. In particular, you can reduce or increase the grid size (see ibm_ilog.graphlayout.longlink.LongLinkLayout.setHorizontalGridOffset() and ibm_ilog.graphlayout.longlink.LongLinkLayout.setVerticalGridOffset()).

You should not modify the origin and destination point mode, nor disable the preservation of fixed links. An ibm_ilog.graphlayout.AbstractGraphLayoutModel instance is attached to the ibm_ilog.graphlayout.longlink.LongLinkLayout instance only if needed, therefore

getAuxiliaryLongLinkLayout().getGraphModel()
may return null.

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.
getBypassDistance
Returns Number
Returns the minimum distance between the origin and destination node for which a link shape going directly from one node to another is allowed.
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).

getConnectorStyle
The connector style of an individual node.
Returns the connector style of an individual node.
ParameterTypeDescription
nodeObjectThe node.
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.
getEvenlySpacedPinsMarginRatio
Returns Number
Returns the margin ratio for the evenly spaced connector style.
getGlobalConnectorStyle
Returns int
Returns the global style of the connectors.
getGlobalDestinationPointMode
Returns int
Returns the global mode for the connection points of the links on the destination nodes.
getGlobalIncrementalModifiedLinkReshapeMode
Returns int
Returns the reshape mode used during the incremental layout of modified links.
getGlobalIncrementalUnmodifiedLinkReshapeMode
Returns int
Returns the reshape mode used during the incremental layout of unmodified links.
getGlobalLinkStyle
Returns int
Returns the current choice for the style of the shape of the links.
getGlobalOriginPointMode
Returns int
Returns the global mode for the connection points of the links on the origin nodes.
getGlobalSelfLinkStyle
Returns int
Returns the current choice for the style of the shape of the self-links.
getGraphModel
Returns ibm_ilog.graphlayout.AbstractGraphLayoutModel: The graph model to lay out if one is attached.

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

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

getIncrementalModifiedLinkReshapeMode
The reshape mode of an individual link used during the incremental layout of modified links, that is, links that have already been laid out in the previous layout execution and for which either the bounding box (see ' ShortLinkLayout.getNodeBoxInterface()' or the "link connection box" (see ' ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()') of their origin and destination nodes has been modified.
Returns the reshape mode of an individual link used during the incremental layout of modified links.
ParameterTypeDescription
linkObjectThe link.
getIncrementalUnmodifiedLinkReshapeMode
The reshape mode of an individual link used during the incremental layout of unmodified links, that is, links that have already been laid out in the previous layout execution and for which neither the bounding box (see ' ShortLinkLayout.getNodeBoxInterface()' nor the "link connection box" (see ' ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()') of their origin and destination nodes have been modified.
Returns the reshape mode of an individual link used during the incremental layout of unmodified links.
ParameterTypeDescription
linkObjectThe link.
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.
getLinkBundlesMode
Returns int
Returns the current choice for the link bundles mode.
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.

getLinkOffset
Returns Number
Returns the offset between links connected on the same side of the node.
getLinkStyle
The style of the shape of an individual link. Possible values are: ' ShortLinkLayout.ORTHOGONAL_STYLE', ' ShortLinkLayout.DIRECT_STYLE' or ' ShortLinkLayout.NO_RESHAPE_STYLE'.
Returns the style of the shape of an individual link.
ParameterTypeDescription
linkObjectThe link instance.
getLinkToLinkCrossingPenalty
Returns Number

Returns the link-to-link crossing penalty factor. When choosing the optimal shape for the links, the algorithm computes a penalty function expressed in the following manner:

Link_to_Link_Penalty * #Link_to_Link_Crossings + Link_to_Node_Penalty * #Link_to_Node_Crossings

The default value is 1.

getLinkToNodeCrossingPenalty
Returns Number

Returns the link-to-node crossing penalty factor. When choosing the optimal shape for the links, the algorithm computes a penalty function expressed in the following manner:

Link_to_Link_Penalty * #Link_to_Link_Crossings + Link_to_Node_Penalty * #Link_to_Node_Crossings

The default value is 1.

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.
getMinFinalSegmentLength
Returns Number
Returns the minimum length of the final segment of the 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.
getNodeBoxInterface
Returns ibm_ilog.graphlayout.INodeBoxProvider

Returns the node box interface used during the layout. Returns null if none is specified.

getNodeSideFilter
Returns ibm_ilog.graphlayout.INodeSideFilter

Returns the node-side filter used during layout. Returns null if none is specified.

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.

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.

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

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.
getViewMatrix
Returns the matrix that is applied to the first view attached to this layout.
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.

isCombinedInterGraphLinksMode
Returns Boolean
Returns 'true' if the routing of normal links in addition to intergraph links is enabled; returns 'false' otherwise.
isFitToViewEnabled
Returns Boolean: 'true' if the graph drawing must fit (exactly or approximately) an area of the diagram view.

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

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

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

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

Returns true if no changes occurred.

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

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

isIncrementalMode
Returns Boolean

Returns true if the incremental mode is enabled. It returns false otherwise.

isInputCheckEnabled
Returns Boolean

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

isInterGraphLinksMode
Returns Boolean
Returns 'true' if the routing of intergraph links is enabled; returns 'false' otherwise.
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.
isLinkOverlapNodesForbidden
Returns Boolean
Returns 'true' if the overlap of links with nodes is forbidden; returns 'false' otherwise.
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()'.
isParametersUpToDate
Returns Boolean

Returns whether the layout parameters are up to date.

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

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

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

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

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

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

isPreserveFixedLinks
Returns Boolean

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

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

isPreserveFixedNodes
Returns Boolean

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

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

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

isSameShapeForMultipleLinks
Returns Boolean
Returns 'true' if the algorithm that makes sure that multiple links are reshaped in the same manner is enabled, and 'false' otherwise.
isSplineRoutingEnabled
Returns Boolean: If the calculation of optimized spline control points is enabled, 'true' is returned.
Tests whether the calculation of optimized spline control points is enabled.
isStoppedImmediately
Returns Boolean: 'true' if the method 'stopImmediately' was called.

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

isStructureUpToDate
Returns Boolean

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

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

Returns true if no changes occurred.

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

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

isUseSeedValueForRandomGenerator
Returns Boolean

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

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

layout

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

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

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

You should not call this method directly.

ParameterTypeDescription
subgraph
layout
force
setAllowedNumberOfIterations

Sets the maximum number of iterations of the layout algorithm.

The default value is 3.

ParameterTypeDescription
iterations
setAllowedTime

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

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

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

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

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

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

ParameterTypeDescription
timeNumberThe allowed time in milliseconds.
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.
setBypassDistance

Sets the minimum distance between the origin and destination node for which a link shape going directly from one node to another is allowed. The algorithm tries to avoid link shapes that directly connect the sides of end nodes that are closer than the bypass value.

If the specified value is strictly negative, the value of the parameter ShortLinkLayout.getMinFinalSegmentLength() is used as the bypass distance. This allows the automatic adjustment of the bypass distance according to the current value of ShortLinkLayout.getMinFinalSegmentLength(). This behavior is suitable in most cases. However, you can specify a non-negative value in order to override the default behavior.

The default value is a negative value.

ParameterTypeDescription
distNumberThe minimum distance for a direct connection.
setCombinedInterGraphLinksMode

Sets the routing of normal links in addition to intergraph links. If intergraph link routing is disabled, the mode has no effect. If intergraph link routing is enabled and the argument is true, both normal links and intergraph links are routed in the same pass. Otherwise, only the intergraph links are routed.

The default value is true.

ParameterTypeDescription
enable
setConnectorStyle

Sets the connector style of an individual node. This connector style is used only if the global connector style is set to ShortLinkLayout.MIXED_STYLE. Otherwise, all nodes have the connector style that is specified as the global connector style.

Valid values are:

  • ShortLinkLayout.FIXED_OFFSET_PINS - The link connection points are spaced along the node border at a distance equal to the link offset (see ShortLinkLayout.getLinkOffset()).
  • ShortLinkLayout.EVENLY_SPACED_PINS - The link connection points are evenly spaced along the node border, preserving a margin which is determined by ShortLinkLayout.getEvenlySpacedPinsMarginRatio().
  • ShortLinkLayout.AUTOMATIC_PINS - Uses the connector style ShortLinkLayout.FIXED_OFFSET_PINS except if this pushes a connection point outside the border the link is attached to, in which case it uses the connector style ShortLinkLayout.EVENLY_SPACED_PINS.

The default value is ShortLinkLayout.AUTOMATIC_PINS.

ParameterTypeDescription
nodeObjectThe node.
styleintThe connector style.
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 ShortLinkLayout.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:

  • ShortLinkLayout.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()).
  • ShortLinkLayout.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.

    Note that, in this mode, the layout algorithm has less freedom for the choice of a link shape. Hence, this mode usually produces more crossings and overlaps than the mode ShortLinkLayout.FREE_MODE.

The default value is ShortLinkLayout.FREE_MODE.

ParameterTypeDescription
linkObjectThe link.
modeintThe mode to set.
setEvenlySpacedPinsMarginRatio

Sets the margin ratio for the evenly spaced connector style. This option has no effect if the connector style ShortLinkLayout.FIXED_OFFSET_PINS is used.

In evenly spaced connector style (see ShortLinkLayout.setGlobalConnectorStyle()), the connection points of the links are evenly spaced along the node border, preserving a margin at each extremity of the node border. The size of this margin is controlled by the margin ratio, and is computed by multiplying the offset between the links by the ratio.

The input value must be a positive or zero value. A ratio of 0 means no margin; a ratio of 1 means a margin equal to the offset between the links; a ratio of 0.5 means a margin equal to half the offset between the links; a ratio of 2 means a margin equal to twice the offset between the links and so on. There is no upper bound for the ratio; however, the margin which is obtained has an upper bound equal to (node-side-dimension - total-width-of-links) / 2.

The default value for the ratio is 0.5.

ParameterTypeDescription
ratioNumberThe margin ratio for the evenly spaced pins connector style.
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.
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
setGlobalConnectorStyle

Sets the global style of connectors. Valid values are the following:

  • ShortLinkLayout.FIXED_OFFSET_PINS - The link connection points are spaced along the node border at a distance equal to the link offset (see ShortLinkLayout.getLinkOffset()).
  • ShortLinkLayout.EVENLY_SPACED_PINS - The link connection points are evenly spaced along the node border, preserving a margin which is determined by ShortLinkLayout.getEvenlySpacedPinsMarginRatio().
  • ShortLinkLayout.AUTOMATIC_PINS - Uses the connector style ShortLinkLayout.FIXED_OFFSET_PINS except if this pushes a connection point outside the border to which the link is attached, in which case it uses the connector style ShortLinkLayout.EVENLY_SPACED_PINS.
  • ShortLinkLayout.MIXED_STYLE: each node can have a different connector style. The style of each individual node can be set by the method ShortLinkLayout.setConnectorStyle() so that different connector styles can occur in the same graph.

Unless the global connector style is ShortLinkLayout.MIXED_STYLE, all links have the same connector style.

The default value is ShortLinkLayout.AUTOMATIC_PINS.

The connector style is used to place the connection points of links that have the free origin-point or destination-point mode and no specified port index. Links with fixed-point mode do not change their connection point at the origin node. The placement of connection points also depends on the connection box interface in the following way:

  1. First, the bounding box of an end node is obtained. If a link connection box interface was set by using 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 ) is used.
  2. Next, the connection point of the link is placed at this bounding box in the manner specified by the connector style.

ParameterTypeDescription
styleintThe connector style.
setGlobalDestinationPointMode

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

  • ShortLinkLayout.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()).
  • ShortLinkLayout.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.

    Note that, in this mode, the layout algorithm has less freedom for the choice of a link shape. Hence, this mode usually produces more crossings and overlaps than the mode ShortLinkLayout.FREE_MODE.

  • ShortLinkLayout.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 ShortLinkLayout.setDestinationPointMode().

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

The default value is ShortLinkLayout.FREE_MODE.

ParameterTypeDescription
modeintThe global mode to set.
setGlobalIncrementalModifiedLinkReshapeMode

Sets the reshape mode used during the incremental layout of modified links, that is, links that have already been laid out in the previous layout execution and for which either the bounding box (see ShortLinkLayout.getNodeBoxInterface() or the "link connection box" (see ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()) of their origin and destination nodes has been modified.

This mode has no effect if incremental layout is disabled.

Valid values are:

  • ShortLinkLayout.FIXED_SHAPE_TYPE_MODE - Incremental layout preserves the shape type of the link. This means that both the number of bends and the node sides to which the link is connected are preserved.
  • ShortLinkLayout.FIXED_NODE_SIDES_MODE - Incremental layout preserves the node sides to which the links are connected.
  • ShortLinkLayout.FIXED_CONNECTION_POINTS_MODE - Incremental layout preserves the connection points of the links.
  • ShortLinkLayout.FIXED_MODE - The links are not reshaped at all during incremental layout. Only newly added links are rerouted.
  • ShortLinkLayout.FREE_MODE - Incremental layout is allowed to freely reshape the links. This is equivalent to nonincremental behavior for all the links, hence it is recommended to disable incremental layout ({link ShortLinkLayout.setIncrementalMode()) instead of setting ShortLinkLayout.FREE_MODE as the global incremental reshape mode. Any settings done using ibm_ilog.graphlayout.GraphLayout.isFixed(), ShortLinkLayout.getGlobalOriginPointMode(), and ShortLinkLayout.getGlobalDestinationPointMode() are still obeyed.
  • ShortLinkLayout.MIXED_MODE - Each link can have a different mode. The mode of each individual link can be set by the method ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode().

Unless the global mode is ShortLinkLayout.MIXED_MODE, all links are reshaped according to the same mode.

The default mode is ShortLinkLayout.FREE_MODE.

ParameterTypeDescription
modeintThe link reshape mode to set.
setGlobalIncrementalUnmodifiedLinkReshapeMode

Sets the reshape mode used during the incremental layout of unmodified links, that is, links that have already been laid out in the previous layout execution and for which neither the bounding box (see ShortLinkLayout.getNodeBoxInterface() nor the "link connection box" (see ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()) of their origin and destination nodes have been modified.

This mode has no effect if the incremental mode is disabled.

Valid values are:

  • ShortLinkLayout.FIXED_SHAPE_TYPE_MODE - The incremental layout preserves preserves the shape type of the link. This means that both the number of bends and the node sides to which the link is connected are preserved.
  • ShortLinkLayout.FIXED_NODE_SIDES_MODE - The incremental layout preserves the node sides to which the links are connected.
  • ShortLinkLayout.FIXED_CONNECTION_POINTS_MODE - The incremental layout preserves the connection points of the links.
  • ShortLinkLayout.FIXED_MODE - The links are not reshaped at all during incremental layout. Only newly added links are rerouted.
  • ShortLinkLayout.FREE_MODE - The incremental layout is allowed to freely reshape the links. This is equivalent to a non-incremental behavior for all the links, hence it is recommended to disable the incremental mode ( ShortLinkLayout.setIncrementalMode()) instead of setting ShortLinkLayout.FREE_MODE as global incremental reshape mode. (Of course, settings that may have been done using ibm_ilog.graphlayout.GraphLayout.isFixed(), ShortLinkLayout.getGlobalOriginPointMode() and ShortLinkLayout.getGlobalDestinationPointMode() are still obeyed.)
  • ShortLinkLayout.MIXED_MODE - Each link can have a different mode. The mode of each individual link can be set by the method ShortLinkLayout.setIncrementalUnmodifiedLinkReshapeMode().

Unless the global mode is ShortLinkLayout.MIXED_MODE, all links are reshaped according to the same mode.

The default mode is ShortLinkLayout.FIXED_SHAPE_TYPE_MODE.

ParameterTypeDescription
modeintThe link reshape mode to set.
setGlobalLinkStyle

Sets the global style of the shape of the links. Valid values are the following:

  • ShortLinkLayout.DIRECT_STYLE: the shape of the links is a polyline composed of a straight-line segment between the end nodes with two horizontal or vertical segments at its extremities (their length is controlled by ShortLinkLayout.setMinFinalSegmentLength() and may be 0).
  • ShortLinkLayout.ORTHOGONAL_STYLE: the shape of the links is a polyline composed of alternating horizontal and vertical segments.
  • ShortLinkLayout.MIXED_STYLE: each link can have a different link style. The style of each individual link can be set by the method ShortLinkLayout.setLinkStyle() so that different link shapes can occur in the same graph.

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

The default value is ShortLinkLayout.ORTHOGONAL_STYLE.

ParameterTypeDescription
style
setGlobalOriginPointMode

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

  • ShortLinkLayout.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()).
  • ShortLinkLayout.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.

    Note that, in this mode, the layout algorithm has less freedom for the choice of a link shape. Hence, this mode usually produces more crossings and overlaps than the mode ShortLinkLayout.FREE_MODE.

  • ShortLinkLayout.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 ShortLinkLayout.setOriginPointMode().

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

The default value is ShortLinkLayout.FREE_MODE.

ParameterTypeDescription
modeintThe global mode to set.
setGlobalSelfLinkStyle

Sets the global style of the shape of the self-links. Self-links are links that have the same origin and destination node.

Valid values are the following:

  • ShortLinkLayout.TWO_BENDS_ORTHOGONAL_STYLE: the shape of the links is a polyline composed of three alternating horizontal and vertical segments, connected to the same side of the node.
  • ShortLinkLayout.THREE_BENDS_ORTHOGONAL_STYLE: the shape of the links is a polyline composed of four alternating horizontal and vertical segments, connected to two adjacent sides of the node.

The default value is ShortLinkLayout.TWO_BENDS_ORTHOGONAL_STYLE.

ParameterTypeDescription
style
setGraphModel

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

ParameterTypeDescription
graphModel
setIncrementalMode

Sets the incremental layout mode. If the argument is true, the algorithm tries to create a layout with similar shapes for the links that were already laid out in the last layout execution, in order to preserve the "mental map" of the user as much as possible.

The exact incremental behavior is controlled by the "incremental link reshape" mode. For details, see ShortLinkLayout.setGlobalIncrementalUnmodifiedLinkReshapeMode() and ShortLinkLayout.setGlobalIncrementalModifiedLinkReshapeMode().

Incremental layout works only if the intergraph links mode is disabled or if there are no intergraph links. Also, incremental layout has no effect if the layout parameters have been changed since the previous layout.

Incremental layout is disabled by default.

ParameterTypeDescription
enableBooleanSet to 'true' to enable incremental layout, or 'false' to disable it.
setIncrementalModifiedLinkReshapeMode

Sets the reshape mode of an individual link used during the incremental layout of modified links, that is, links that have already been laid out in the previous layout execution and for which either the bounding box (see ShortLinkLayout.getNodeBoxInterface() or the "link connection box" (see ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()) of their origin and destination nodes has been modified.

This link reshape mode is used only if incremental layout is enabled and the global link reshape mode is set to ShortLinkLayout.MIXED_MODE. If the global mode is not ShortLinkLayout.MIXED_MODE, all links have the mode that is specified as the global link-reshape mode.

Valid values are:

  • ShortLinkLayout.FIXED_SHAPE_TYPE_MODE - Incremental layout preserves the shape type of the link. This means that both the number of bends and the node sides to which the link is connected are preserved.
  • ShortLinkLayout.FIXED_NODE_SIDES_MODE - Incremental layout preserves the node sides to which the links are connected.
  • ShortLinkLayout.FIXED_CONNECTION_POINTS_MODE - Incremental layout preserves the connection points of the links.
  • ShortLinkLayout.FIXED_MODE - The links are not reshaped at all during incremental layout. Only newly added links are rerouted.
  • ShortLinkLayout.FREE_MODE - Incremental layout is allowed to freely reshape the links. This is equivalent to nonincremental behavior for the link argument. Any settings done using ibm_ilog.graphlayout.GraphLayout.isFixed(), ShortLinkLayout.getGlobalOriginPointMode(), and ShortLinkLayout.getGlobalDestinationPointMode() are still obeyed.

The default mode is ShortLinkLayout.FREE_MODE.

ParameterTypeDescription
linkObjectThe link.
modeintThe link reshape mode to set.
setIncrementalUnmodifiedLinkReshapeMode

Sets the reshape mode of an individual link used during the incremental layout of unmodified links, that is, links that have already been laid out in the previous layout execution and for which neither the bounding box (see ShortLinkLayout.getNodeBoxInterface() nor the "link connection box" (see ibm_ilog.graphlayout.GraphLayout.getLinkConnectionBoxInterface()) of their origin and destination nodes have been modified.

This reshape mode is used only if incremental layout is enabled and the global link-reshape mode is set to ShortLinkLayout.MIXED_MODE. If the global mode is not ShortLinkLayout.MIXED_MODE, all links have the mode that is specified as the global link reshape mode.

Valid values are:

  • ShortLinkLayout.FIXED_SHAPE_TYPE_MODE - Incremental layout preserves the shape type of the link. This means that both the number of bends and the node sides to which the link is connected are preserved.
  • ShortLinkLayout.FIXED_NODE_SIDES_MODE - Incremental layout preserves the node sides to which the links are connected.
  • ShortLinkLayout.FIXED_CONNECTION_POINTS_MODE - Incremental layout preserves the connection points of the links.
  • ShortLinkLayout.FIXED_MODE - The links are not reshaped at all during incremental layout. Only newly added links are rerouted.
  • ShortLinkLayout.FREE_MODE - Incremental layout is allowed to reshape the links freely. This is equivalent to nonincremental behavior for the link argument. Any settings done using ibm_ilog.graphlayout.GraphLayout.isFixed(), ShortLinkLayout.getGlobalOriginPointMode() and ShortLinkLayout.getGlobalDestinationPointMode() are still obeyed.

The default mode is ShortLinkLayout.FIXED_SHAPE_TYPE_MODE.

ParameterTypeDescription
linkObjectThe link.
modeintThe link reshape 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
setInterGraphLinksMode

Sets the routing of intergraph links. If the argument is true, the intergraph links are routed; otherwise, only the normal links are routed. An intergraph link is a link stored in one graph that has an origin or destination not stored in the same graph. If the combined intergraph link routing is enabled in addition, this means that normal links and intergraph links are routed together; otherwise only the intergraph links are routed.

The default value is true.

If the intergraph link mode is enabled and the graph does contain some intergraph links, there are some restrictions:

  • Layout animation is not possible.
  • Incremental layout has no effect.
  • If layout is performed on a nested ibm_ilog.diagram.Graph (or ibm_ilog.graphlayout.AbstractGraphLayoutModel), the top-level grapher must have a manager view attached because of the coordinate transformations of the subgraphers. If you create your own subclass of ibm_ilog.graphlayout.AbstractGraphLayoutModel instead of ibm_ilog.graphlayout.AbstractGraphLayoutModel to route intergraph links, you must make sure that all graph models of all subgraphers use the same coordinate system through appropriate coordinate transformations.

ParameterTypeDescription
enable
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.
setLinkBundlesMode

Sets the link bundles mode. The valid modes are the following:

  • ShortLinkLayout.NO_BUNDLE: Several links connected to the same side of a node share the same connection point, that is, the middle of the node side. The final segments of the links overlap. No bundles are created and the link offset parameter is ignored.
  • ShortLinkLayout.FIRST_LAST_SEGMENT: The connection points of several links connected to the same side of a node are distributed according to the link offset value. With the orthogonal link style, the algorithm additionally ensures that the first and last segments of the links are always orthogonal to the side of the node to which they are connected.
  • ShortLinkLayout.IMPROVED_FIRST_LAST_SEGMENT: The algorithm additionally tries to avoid overlapping the second segment and the segment next to the last. Note that with the direct link style, this mode is equivalent to ShortLinkLayout.FIRST_LAST_SEGMENT.

The default value is ShortLinkLayout.IMPROVED_FIRST_LAST_SEGMENT.

ParameterTypeDescription
mode
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 ibm_ilog.graphlayout.ILinkConnectionBoxProvider.getBox()).

By default, the links are connected symmetrically to the middle of the box, and it is possible to "shift" the links tangentially by using the method ibm_ilog.graphlayout.ILinkConnectionBoxProvider.getTangentialOffset() from the interface ibm_ilog.graphlayout.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.
This method must return 0 if no offset is necessary on a certain node and/or side.

If you do not call this method , the layout algorithm places the connection points on the node box that has been customized using the method ShortLinkLayout.setNodeBoxInterface(). If this method has not been used, the bounding box of the node in the graph model (see ) is used.

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

ParameterTypeDescription
connectionBoxInterface
setLinkOffset

Sets the offset between links connected on the same side of the node.

The default value is 2.

ParameterTypeDescription
offset
setLinkOverlapNodesForbidden

Sets whether it is forbidden for the layout to reshape links such that they overlap nodes.

The default value of this parameter is false.

If overlaps are not forbidden, the algorithm tries to avoid overlaps anyway. However, it may create overlaps if, for example, it needs to prevent a link from crossing other links.

If overlaps are forbidden, the algorithm uses the auxiliary long link layout (see ShortLinkLayout.getAuxiliaryLongLinkLayout() to lay out links that would otherwise overlap nodes in an orthogonal shape.

The auxiliary long link layout works on a grid and the default grid size may need to be reduced to allow this algorithm to avoid overlaps (see ibm_ilog.graphlayout.longlink.LongLinkLayout.setHorizontalGridOffset() and ibm_ilog.graphlayout.longlink.LongLinkLayout.setVerticalGridOffset()).

Forbidding overlaps can slow down the layout and can produce additional link bends and link crossings.

ParameterTypeDescription
s
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 ShortLinkLayout.MIXED_STYLE. Otherwise, all links have the style that is specified as the global link style.

Valid values are:

  • ShortLinkLayout.ORTHOGONAL_STYLE - the link gets an orthogonal shape, that is, a shape consisting of a sequence of orthogonal line segments.
  • ShortLinkLayout.DIRECT_STYLE - the link gets a straight-line shape.
  • ShortLinkLayout.NO_RESHAPE_STYLE - the link is not reshaped.

The default value is ShortLinkLayout.ORTHOGONAL_STYLE.

ParameterTypeDescription
linkObjectThe link instance.
styleintThe style of the shape of an individual link.
setLinkToLinkCrossingPenalty
Sets the link-to-link crossing penalty factor.
ParameterTypeDescription
penalty
setLinkToNodeCrossingPenalty
Sets the link-to-node crossing penalty factor.
ParameterTypeDescription
penalty
setMaxSplineCurveSize

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

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

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

The default value is 30.

ParameterTypeDescription
sizeNumberThe maximum spline curve size
setMinBusyTime

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

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

The default value is 50 (milliseconds).

ParameterTypeDescription
time
setMinFinalSegmentLength

Sets the minimum length of the final (first and last) segment of the links.

The default value is 10.

ParameterTypeDescription
length
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
setNodeBoxInterface

Sets an object that provides the rectangle defining the position and size of each node.

If you do not call this method , the layout algorithm uses the bounding box of the node (see ).

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

ParameterTypeDescription
nodeBoxInterface
setNodeSideFilter

Sets the node-side filter, that is, an object that allows or prohibits the connection of the links on a given side of the nodes.

If a node-side filter is not installed, and the connection points of the links are not fixed (see ShortLinkLayout.setOriginPointMode(), ShortLinkLayout.setDestinationPointMode()), the layout algorithm is free to choose any side of the nodes, except for "pinned" connection points (see ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()).

When a filter is installed, the layout algorithm asks the filter at which side of its end node each link is allowed to attach to.

Note the following points:

  • A filter should always allow a link to connect to at least one side of a node; otherwise the link cannot be routed.
  • If the connection point on the origin or destination node is specified as fixed (see ShortLinkLayout.setGlobalOriginPointMode(), ShortLinkLayout.setGlobalDestinationPointMode(), ShortLinkLayout.setOriginPointMode(), ShortLinkLayout.setDestinationPointMode()), the filter is not used for the origin or the destination node, respectively.
  • When side constraints are added using the filter, the layout algorithm has less freedom for the choice of a link shape. Hence, laying out with a side filter usually produces more crossings and overlaps than laying out without side filter.
You can call this method with a null argument to return to the default behavior.

ParameterTypeDescription
filteribm_ilog.graphlayout.INodeSideFilterThe node-side filter.
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 ShortLinkLayout.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:

  • ShortLinkLayout.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()).
  • ShortLinkLayout.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.

    Note that, in this mode, the layout algorithm has less freedom for the choice of a link shape. Hence, this mode usually produces more crossings and overlaps than the mode ShortLinkLayout.FREE_MODE.

The default value is ShortLinkLayout.FREE_MODE.

ParameterTypeDescription
linkObjectThe link.
modeintThe mode to set.
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
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
setSameShapeForMultipleLinks

Sets whether the layout algorithm must make sure that all multiple links have the same type of shape, that is, a shape with the same number of bends and with parallel segments.

Multiple links are links that have the same origin and destination nodes.

If the argument is true, additional work is done to make sure that multiple links are reshaped in the same manner.

The default value is false.

For some categories of links, it cannot be guaranteed that they will be given the same type of shape as the other links with the same origin and destination nodes:

  • Newly inserted links in incremental mode (see ShortLinkLayout.setIncrementalMode().
  • Fixed links (see ibm_ilog.graphlayout.GraphLayout.setFixed().
  • Links with at least one of their connection points fixed (see ShortLinkLayout.setGlobalOriginPointMode(), ShortLinkLayout.setGlobalDestinationPointMode(), ShortLinkLayout.setOriginPointMode(), ShortLinkLayout.setDestinationPointMode()).

ParameterTypeDescription
optionBooleanSet to 'true' to enable the same shape option, or 'false' to disable it.
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
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
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
stopImmediately
Returns Boolean: 'true' if it was possible to indicate to this layout to stop its execution, 'false' if this layout does not support this feature or if it cannot be stopped.

Overridden version of the base class method.

supportsAllowedTime
Returns Boolean

Indicates that this layout class can stop the layout computation in the proper manner when the user-defined allowed time is exceeded.

The result code in the layout report is ibm_ilog.graphlayout.GraphLayoutReport.STOPPED_AND_INVALID in this case.

supportsLayoutOfConnectedComponents
Returns Boolean

Indicates whether the layout class can cut the attached graph into connected components, apply itself on each connected component separately, and then use the layout instance returned by the method ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents() to position the connected components.

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.

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

The link connection box is used instead of the bounding box of each node (see ) during the routing of links.

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 whether the layout class allows the user to specify fixed nodes. Fixed nodes are not moved during the layout.

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.

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

supportsRandomGenerator
Returns Boolean

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

The default implementation always returns false.

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

supportsSplineRouting
Returns Boolean

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

supportsStopImmediately
Returns Boolean

Indicates that this layout class can interrupt the current run of the layout immediately in a controlled way. The result code in the layout report is ibm_ilog.graphlayout.GraphLayoutReport.STOPPED_AND_INVALID in this case.

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

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

unfixAllLinks

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

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

unfixAllNodes

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

Events

onLayoutStepPerformed

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

ParameterTypeDescription
layoutStarted
layoutFinished
onObjectParameterChanged

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

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

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

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

Called when a global layout parameter has changed.

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

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

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