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

Object » ibm_ilog.graphlayout.GraphLayout » ibm_ilog.graphlayout.longlink.LongLinkLayout
dojo.require("ibm_ilog.graphlayout.longlink.LongLinkLayout");

The main class for the Long Link Layout algorithm.

The Long Link Layout algorithm reshapes the links of a graph without moving the nodes. It is specialized to route long orthogonal links on a grid without overlapping nodes. It uses a classical path search mechanism and an additional crossing reduction phase. It can be used to find an orthogonal route without overlaps in a labyrinth of node obstacles.

Optionally, direct links can be computed, which, however, may overlap nodes. See the method LongLinkLayout.setGlobalLinkStyle().

This layout algorithm is recommended if any of the following conditions apply:

  • Many links are long, and it is important that long orthogonal links do not overlap obstacles.
  • Routing on a grid is preferred because it guarantees a minimum distance between link segments.
  • An increasing number of bends is acceptable if this avoids any overlaps.
Otherwise, the ibm_ilog.graphlayout.shortlink.ShortLinkLayout may be more suitable.

Here are sample drawings produced by the Long Link Layout: Sample drawing produced with the Long Link Layout

The long link mode can be used to find a route through a labyrinth:

Sample drawing produced with the Long Link Layout

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, all links are routed. In incremental mode, only those links are routed that overlap nodes or whose end nodes have changed. The incremental mode cannot be used for intergraph links.
  • The algorithm supports self-links and multiple links between the same pair of nodes.

Property Summary

  • DIRECT_STYLE Direct link style option. When used as the argument of the method ' LongLinkLayout.setGlobalLinkStyle()', all links get a (semi)direct shape. This link shape may cause overlaps between links and nodes. To specify the style of an individual link, use this option as the argument of the method ' LongLinkLayout.setLinkStyle()'.
  • FIXED_MODE Fixed connection point mode. When used as the argument of the method ' LongLinkLayout.setGlobalOriginPointMode()' or ' LongLinkLayout.setGlobalDestinationPointMode()', the layout must keep the current position of the connection point. To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' LongLinkLayout.setOriginPointMode()' or ' LongLinkLayout.setDestinationPointMode()'.
  • FREE_MODE Free connection point mode. When used as the argument of the method ' LongLinkLayout.setGlobalOriginPointMode()' or ' LongLinkLayout.setGlobalDestinationPointMode()', the layout is free to choose the appropriate position of the connection points, except for "pinned" connection points (see ' ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()'). To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' LongLinkLayout.setOriginPointMode()' or ' LongLinkLayout.setDestinationPointMode()'.
  • MIXED_MODE Mixed connection point mode. When used as the argument of the method ' LongLinkLayout.setGlobalOriginPointMode()' or ' LongLinkLayout.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 ' LongLinkLayout.setOriginPointMode()' or ' LongLinkLayout.setDestinationPointMode()'.
  • MIXED_STYLE Mixed link shape option. When used as the argument of the method ' LongLinkLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by the method ' LongLinkLayout.setLinkStyle()'.
  • NO_RESHAPE_STYLE No reshape link style option. This can be used for individual links if the global link style is ' LongLinkLayout.MIXED_STYLE'. To specify the style of an individual link, use this option as the argument of the method ' LongLinkLayout.setLinkStyle()'.
  • ORTHOGONAL_STYLE Orthogonal link shape option. When used as the argument of the method ' LongLinkLayout.setGlobalLinkStyle()', all links get an orthogonal shape (alternating horizontal and vertical segments). To specify the shape of an individual link, use this option as the argument of the method ' LongLinkLayout.setLinkStyle()'.

Method Summary

  • addLineObstacle(p1, p2) Adds a line segment obstacle for link routing.
  • addLineRectObstacle(obstacleBoundingBox) Adds a line segment obstacle for the routing.
  • addRectObstacle(obstacleBoundingBox) Adds a rectangular obstacle for the routing.
  • afterLayoutOfSubgraph(subgraph) Performs postprocessing operations after the layout of each subgraph or connected component.
  • attach(graphModel) Sets the graph model to be laid out.
  • beforeLayout() Performs preprocessing operations before the layout of the entire graph.
  • beforeLayoutOfSubgraph(subgraph) Performs preprocessing operations before the layout of each subgraph or connected component.
  • callLayoutStepPerformedIfNeeded() Calls 'onLayoutStepPerformed' when necessary.
  • cleanGraphModel(graphModel) Cleans a graph model.
  • cleanLink(graphModel, link) Cleans a link.
  • cleanNode(graphModel, node) Cleans a node.
  • connectAllLinksToCenter() Connects all links to the enter of their end nodes.
  • connectLinkToCenter(link, atFromSide, atToSide) Connects the link to the node center at both end nodes by using the link connection box interface.
  • constructor(source)
  • contentsChanged(event) Called when the structure or the geometry of the graph changes.
  • copy() returns ibm_ilog.graphlayout.GraphLayout Copies the layout instance.
  • copyParameters(source) Copies the parameters from a given layout instance.
  • createLayoutReport() returns ibm_ilog.graphlayout.GraphLayoutReport Creates the graph layout report instance.
  • detach() Detaches the graph model from the layout instance.
  • getAllowedTime() returns Number Returns the currently allowed time for the layout algorithm in milliseconds.
  • getAllowedTimePerLink() returns Number Returns the upper limit for the time allowed to find a route for a long link in milliseconds.
  • getBalanceSplineCurveThreshold() returns Number Returns the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • getCalcFallbackLinks() returns ibm_ilog.graphlayout.IIterator Returns the links that could not be routed on the grid without obstacle overlaps by the previous layout call.
  • getCalcLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region parameter.
  • getDestinationPointMode(link) Returns the destination-point mode of an individual link.
  • getGlobalDestinationPointMode() returns int Returns the global mode for the connection points of the links on the destination nodes.
  • getGlobalLinkStyle() returns int Returns the global style of the shapes of links.
  • getGlobalOriginPointMode() returns int Returns the global mode for the connection points of the links on the origin nodes.
  • getGraphModel() returns ibm_ilog.graphlayout.AbstractGraphLayoutModel Returns the graph model to lay out if a graph model is attached.
  • getHorizontalGridBase() returns Number Returns the horizontal base coordinate of the grid.
  • getHorizontalGridOffset() returns Number Returns the horizontal offset between the grid lines.
  • getHorizontalMinOffset() returns Number Returns the minimum horizontal offset between the node border and a link segment that is (vertically) parallel to the node border.
  • getInstanceId() returns int A utility method that returns a unique integer value for each layout instance.
  • getInterGraphLinksRoutingModel() returns ibm_ilog.graphlayout.internalutil.SubgraphData Return the intergraph link routing model.
  • 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.
  • getLinkConnectionBoxInterface() returns ibm_ilog.graphlayout.ILinkConnectionBoxProvider Returns the link connection box interface used to calculate the connection points of links during layout.
  • getLinkStyle(link) Returns the style for the shape of an individual link.
  • getMaxBacktrack() returns int Returns the maximum number of backtrack steps to find a route for a long link.
  • getMaxSplineCurveSize() returns Number Returns the maximum curve size used when spline control point optimization routing is enabled.
  • getMinBusyTime() returns Number Returns the minimal time that the layout algorithm can be busy between two calls of ' ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed()' when the method ' ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded()' is used.
  • getMinEndSegmentLength() returns Number Returns the minimum length of the last segment of each link.
  • getMinNodeCornerOffset() returns Number Returns the minimum offset between a node corner and a link starting at this node.
  • getMinSplineCurveSize() returns Number Returns the minimum curve size used when optimized spline control points routing is enabled.
  • getMinStartSegmentLength() returns Number Returns the minimum length of the first segment of each link.
  • getNodeBoxInterface() returns ibm_ilog.graphlayout.INodeBoxProvider Returns the node box interface used for the obstacle area during the layout.
  • getNodeSideFilter() returns ibm_ilog.graphlayout.INodeSideFilter Returns the node-side filter used during layout.
  • getNumberCrossingReductionIterations() returns int Returns the maximum number of iterations performed during crossing reduction.
  • 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.
  • getTerminationPointFilter() returns ibm_ilog.graphlayout.longlink.ILongLinkTerminationPointFilter Returns the termination point filter used during layout.
  • getVerticalGridBase() returns Number Returns the vertical base coordinate of the grid.
  • getVerticalGridOffset() returns Number Returns the vertical offset between the grid lines.
  • getVerticalMinOffset() returns Number Returns the minimum vertical offset between the node border and a link segment that is (horizontally) parallel to the node border.
  • 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.
  • isCrossingReductionEnabled() returns Boolean Returns 'true' if crossing reduction is enabled.
  • isExhaustiveSearching() returns Boolean Returns 'true' if routing uses exhaustive searching.
  • isFallbackRouteEnabled() returns Boolean Returns 'true' if the fallback routing algorithm is enabled.
  • isFitToViewEnabled() returns Boolean Returns 'true' if the graph drawing must fit (exactly or approximately) an area of a specific view.
  • isFixed(nodeOrLink) returns Boolean Returns whether the node or link is specified as fixed.
  • isGeometryUpToDate() returns Boolean Returns whether the geometry of the graph is up to date.
  • isIncrementalConnectionPreserving() returns Boolean Returns 'true' if the incremental mode preserves the side and relative order of the link connection points.
  • 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.
  • 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.
  • isLinkObstacleEnabled() returns Boolean Returns 'true' if links should be line obstacles for the link routes.
  • isLocalRecursiveLayoutNeeded(layoutProvider, recLayout, rootModel, traverse) returns Boolean Checks whether layout is needed when layout is performed recursively on a hierarchy of nested subgraphs.
  • isNodeObstacleEnabled() returns Boolean Returns 'true' if nodes should be obstacles for the link routes.
  • 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.
  • 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.
  • isStraightRouteEnabled() returns Boolean Returns 'true' if straight routing is enabled.
  • 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 Long Link Layout algorithm.
  • layoutStepPerformed() Can be called by the layout classes when a step of the layout algorithm has been performed.
  • markForIncremental(link) Marks the input link to be rerouted with the next call of ' ibm_ilog.graphlayout.GraphLayout.performLayout()', if incremental mode is enabled.
  • performLayout(force, traverse) returns int Starts the layout algorithm using the currently attached graph model and the current settings for the layout parameters.
  • performSublayout(subgraph, layout, force) Starts the input layout algorithm.
  • removeAllLineObstacles() Removes all additional line obstacles.
  • removeAllRectObstacles() Removes all additional rectangular obstacles.
  • setAllowedTime(time) Sets the upper limit for the duration of the layout algorithm.
  • setAllowedTimePerLink(time) Sets the upper limit for the time allowed to find a route for a long link.
  • setBalanceSplineCurveThreshold(threshold) Sets the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • setCombinedInterGraphLinksMode(enable) Sets the routing of normal links in addition to intergraph links.
  • setCrossingReductionEnabled(flag) Sets the crossing reduction.
  • setDestinationPointMode(link, mode) Sets the mode for the connection point of an individual link on the destination node.
  • setExhaustiveSearching(flag) Sets the exhaustive searching of routes for links.
  • setFallbackRouteEnabled(flag) Sets whether the fallback routing algorithm is enabled.
  • setFixed(nodeOrLink, fixed) Sets the specified node or link as fixed.
  • setGeometryUpToDate(uptodate) Sets whether the geometry of the graph is up to date.
  • setGlobalDestinationPointMode(mode) Sets the global mode for the connection point of the links on the destination nodes.
  • setGlobalLinkStyle(style) Sets the global style of the shapes of links.
  • setGlobalOriginPointMode(mode) Sets the global mode for the connection point of the links on the origin nodes.
  • setGraphModel(graphModel) Sets the graph model to be laid out.
  • setHorizontalGridBase(coordinate) Sets the horizontal base coordinate of the grid.
  • setHorizontalGridOffset(offset) Sets the horizontal offset between the grid lines.
  • setHorizontalMinOffset(minOffset) Sets the minimum horizontal offset between the node border and a link segment that is (vertically) parallel to the node border.
  • setIncrementalConnectionPreserving(flag) Sets whether the incremental layout mode preserves the side and relative order of the link connection points.
  • setIncrementalMode(enable) Sets the incremental layout mode.
  • setInputCheckEnabled(enable) Sets whether the checks for the nodes and/or links provided as arguments for the different methods of the layout algorithms are enabled.
  • 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.
  • 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.
  • setLinkObstacleEnabled(flag) Sets whether links should be line obstacles for the link routes.
  • setLinkStyle(link, style) Sets the style for the shape of an individual link.
  • setMaxBacktrack(numberOfSteps) Sets the maximum number of backtrack steps to find a route for a long link.
  • 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.
  • setMinEndSegmentLength(length) Sets the minimum length of the last segment of each link, that is, the segment incident to the "to" node.
  • setMinNodeCornerOffset(offset) Sets the minimum offset between a node corner and a link starting at this node.
  • setMinSplineCurveSize(size) Sets the minimum curve size used when optimized spline control point routing is enabled.
  • setMinStartSegmentLength(length) Sets the minimum length of the first segment of each link, that is, the segment incident to the "from" node.
  • setNodeBoxInterface(nodeBoxInterface) Sets the node box interface for the obstacle area.
  • setNodeObstacleEnabled(flag) Sets whether nodes should be obstacles for the link routes.
  • 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.
  • setNumberCrossingReductionIterations(iterations) Sets the maximum number of iterations performed during crossing reduction.
  • 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.
  • 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.
  • setStraightRouteEnabled(flag) Sets the straight routing.
  • setStructureUpToDate(uptodate) Sets whether the structure of the graph is up to date.
  • setTerminationPointFilter(filter) Sets the termination point filter, that is, an object that allows filtering the termination points that are proposed by the layout algorithm.
  • setUseSeedValueForRandomGenerator(option) Sets whether the user-defined seed value should be used for the random generator.
  • setVerticalGridBase(coordinate) Sets the vertical base coordinate of the grid.
  • setVerticalGridOffset(offset) Sets the vertical offset between the grid lines.
  • setVerticalMinOffset(minOffset) Sets the minimum vertical offset between the node border and a link segment that is (horizontally) parallel to the node border.
  • stopImmediately() returns Boolean Stops the running of the layout algorithm as soon as possible.
  • supportsAllowedTime() returns Boolean Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded.
  • supportsLayoutOfConnectedComponents() returns Boolean Indicates 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 that this 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.
  • supportsSaveParametersToNamedProperties() returns Boolean Indicates that this layout class can transfer the layout parameters to named properties.
  • supportsSplineRouting() returns Boolean Tests if this class supports the generic optimization of spline control points.
  • supportsStopImmediately() returns Boolean Indicates that this layout class can interrupt the current run of the layout immediately in a controlled way.
  • toString() returns String Returns a printable string representing this layout instance.
  • unfixAllLinks() Removes the fixed attribute from all links in the graph model.
  • unfixAllNodes() Removes the fixed attribute from all nodes in the graph model.

Event Summary

Attached Objects

Properties

DIRECT_STYLE
Direct link style option. When used as the argument of the method ' LongLinkLayout.setGlobalLinkStyle()', all links get a (semi)direct shape. This link shape may cause overlaps between links and nodes. To specify the style of an individual link, use this option as the argument of the method ' LongLinkLayout.setLinkStyle()'.
FIXED_MODE
Fixed connection point mode. When used as the argument of the method ' LongLinkLayout.setGlobalOriginPointMode()' or ' LongLinkLayout.setGlobalDestinationPointMode()', the layout must keep the current position of the connection point. To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' LongLinkLayout.setOriginPointMode()' or ' LongLinkLayout.setDestinationPointMode()'.
FREE_MODE
Free connection point mode. When used as the argument of the method ' LongLinkLayout.setGlobalOriginPointMode()' or ' LongLinkLayout.setGlobalDestinationPointMode()', the layout is free to choose the appropriate position of the connection points, except for "pinned" connection points (see ' ibm_ilog.graphlayout.AbstractGraphLayoutModel.hasPinnedConnectionPoint()'). To specify the mode for the connection points of an individual link, use this mode as the argument of the method ' LongLinkLayout.setOriginPointMode()' or ' LongLinkLayout.setDestinationPointMode()'.
MIXED_MODE
Mixed connection point mode. When used as the argument of the method ' LongLinkLayout.setGlobalOriginPointMode()' or ' LongLinkLayout.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 ' LongLinkLayout.setOriginPointMode()' or ' LongLinkLayout.setDestinationPointMode()'.
MIXED_STYLE
Mixed link shape option. When used as the argument of the method ' LongLinkLayout.setGlobalLinkStyle()', each link can have a different shape. The shape of an individual link can be set by the method ' LongLinkLayout.setLinkStyle()'.
NO_RESHAPE_STYLE
No reshape link style option. This can be used for individual links if the global link style is ' LongLinkLayout.MIXED_STYLE'. To specify the style of an individual link, use this option as the argument of the method ' LongLinkLayout.setLinkStyle()'.
ORTHOGONAL_STYLE
Orthogonal link shape option. When used as the argument of the method ' LongLinkLayout.setGlobalLinkStyle()', all links get an orthogonal shape (alternating horizontal and vertical segments). To specify the shape of an individual link, use this option as the argument of the method ' LongLinkLayout.setLinkStyle()'.

Methods

addLineObstacle

Adds a line segment obstacle for link routing.

A line segment obstacle does not need to be strictly horizontal or vertical. Orthogonally routed link segments are considered line segment obstacles by default for the routing of another link. The algorithm tries to find link routing that allows crossing line obstacles in the orthogonal direction but avoids overlaps with line obstacles in the parallel direction. If graphical objects that are not links should also be considered as obstacles, you can add them by this method.

ParameterTypeDescription
p1PointThe start point of the line segment obstacle.
p2PointThe end point of the line segment obstacle.
addLineRectObstacle

Adds a line segment obstacle for the routing.

This must be either a horizontal line segment or a vertical line segment; hence, the input bounding box must either have zero width or zero height. Orthogonally routed link segments are considered line segment obstacles by default for the routing of another link. The algorithm tries to find a link routing that allows crossing line obstacles in the orthogonal direction but avoids overlaps with line obstacles in the parallel direction. If graphic objects that are not links should also be considered as obstacles, you can add them by this method.

ParameterTypeDescription
obstacleBoundingBoxRectangleA line segment obstacle for the routing.
addRectObstacle

Adds a rectangular obstacle for the routing.

All nodes are considered rectangular obstacles by default for the routing of a link. The algorithm tries to find a link routing that avoids overlaps with rectangular obstacles. If graphic objects that are not nodes should also be considered as obstacles, you can add them by this method.

ParameterTypeDescription
obstacleBoundingBoxRectangleA rectangular obstacle for the routing.
afterLayoutOfSubgraph

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

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

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

Sets the graph model to be laid out.

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

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

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

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

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

beforeLayoutOfSubgraph

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

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

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

Calls onLayoutStepPerformed when necessary.

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

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

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

cleanGraphModel

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

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

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

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

The method is automatically called by ibm_ilog.graphlayout.GraphLayout.contentsChanged() whenever a ibm_ilog.graphlayout.GraphLayoutModelEvent of type ibm_ilog.graphlayout.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 ibm_ilog.graphlayout.GraphLayoutModelEvent of type ibm_ilog.graphlayout.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
source
contentsChanged

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

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

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

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

Copies the layout instance.

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

When performing a recursive layout on a nested graph, ibm_ilog.graphlayout.ILayoutProvider uses this method to "clone" the layout instance of a parent graph. Note that the parameters which are specific to a node or a link are not copied. Only the global parameters are copied. The customization interfaces (node side filter, node box interface, termination point filter) 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. Only the global parameters are copied. The customization interfaces (node side filter, node box interface, termination point filter) are also copied.

ParameterTypeDescription
sourceibm_ilog.graphlayout.GraphLayoutThe layout instance from which the parameters are copied.
createLayoutReport
Returns ibm_ilog.graphlayout.GraphLayoutReport: A new instance of layout report. The current implementation creates an instance of ' LongLinkLayoutReport'.

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

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.

getAllowedTimePerLink
Returns Number
Returns the upper limit for the time allowed to find a route for a long link in milliseconds.
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.
getCalcFallbackLinks
Returns ibm_ilog.graphlayout.IIterator: The links that could not be routed on the grid without obstacle overlaps by the previous layout call.

Returns the links that could not be routed on the grid without obstacle overlaps by the previous layout call. A link may not be routed without overlaps if the allowed time to find a route for this single link elapsed (see LongLinkLayout.getAllowedTimePerLink()), or if the route would have to bypass too many obstacles (see LongLinkLayout.getMaxBacktrack()), or if there is no path on the grid from the start node to the end node that bypasses all obstacles.

Such links must be routed by some fallback mechanism. If the fallback routing option was set to true by using LongLinkLayout.setFallbackRouteEnabled(), these links are routed by a simple fallback routing algorithm inside ibm_ilog.graphlayout.GraphLayout.performLayout(). If the fallback routing option was set to false, such links are not routed. In this case, the user is supposed to implement a fallback mechanism to route such links after ibm_ilog.graphlayout.GraphLayout.performLayout() terminates successfully.

Note that there will be no calculated fallback links if the previous layout did not terminate successfully, for example, if the global layout time elapsed or if the algorithm was stopped immediately during the previous run of ibm_ilog.graphlayout.GraphLayout.performLayout().

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

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.
getGlobalDestinationPointMode
Returns int
Returns the global mode for the connection points of the links on the destination nodes.
getGlobalLinkStyle
Returns int
Returns the global style of the shapes of links.
getGlobalOriginPointMode
Returns int
Returns the global mode for the connection points of the links on the origin nodes.
getGraphModel
Returns ibm_ilog.graphlayout.AbstractGraphLayoutModel: The graph model to lay out if one is attached.

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

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

getHorizontalGridBase
Returns Number
Returns the horizontal base coordinate of the grid.
getHorizontalGridOffset
Returns Number
Returns the horizontal offset between the grid lines.
getHorizontalMinOffset
Returns Number
Returns the minimum horizontal offset between the node border and a link segment that is (vertically) parallel to the node border.
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.

getInterGraphLinksRoutingModel
Returns ibm_ilog.graphlayout.internalutil.SubgraphData
Return the intergraph link routing model.
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.
getLinkConnectionBoxInterface
Returns ibm_ilog.graphlayout.ILinkConnectionBoxProvider

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

Returns null if none is specified.

getLinkStyle
The style for the shape of an individual link. Possible values are: ' LongLinkLayout.ORTHOGONAL_STYLE', ' LongLinkLayout.DIRECT_STYLE', ' LongLinkLayout.NO_RESHAPE_STYLE'.
Returns the style for the shape of an individual link.
ParameterTypeDescription
linkObjectThe link instance.
getMaxBacktrack
Returns int
Returns the maximum number of backtrack steps to find a route for a long link.
getMaxSplineCurveSize
Returns Number: The maximum curve size used when spline control point optimization routing is enabled.
Returns the maximum curve size used when spline control point optimization routing is enabled.
getMinBusyTime
Returns Number
Returns the minimal time that the layout algorithm can be busy between two calls of ' ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed()' when the method ' ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded()' is used.
getMinEndSegmentLength
Returns Number
Returns the minimum length of the last segment of each link.
getMinNodeCornerOffset
Returns Number
Returns the minimum offset between a node corner and a link starting at this node.
getMinSplineCurveSize
Returns Number: The minimum curve size used when optimized spline control points routing is enabled.
Returns the minimum curve size used when optimized spline control points routing is enabled.
getMinStartSegmentLength
Returns Number
Returns the minimum length of the first segment of each link.
getNodeBoxInterface
Returns ibm_ilog.graphlayout.INodeBoxProvider

Returns the node box interface used for the obstacle area 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.

getNumberCrossingReductionIterations
Returns int
Returns the maximum number of iterations performed during crossing reduction.
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.
getTerminationPointFilter
Returns ibm_ilog.graphlayout.longlink.ILongLinkTerminationPointFilter

Returns the termination point filter used during layout. Returns null if none is specified.

getVerticalGridBase
Returns Number
Returns the vertical base coordinate of the grid.
getVerticalGridOffset
Returns Number
Returns the vertical offset between the grid lines.
getVerticalMinOffset
Returns Number
Returns the minimum vertical offset between the node border and a link segment that is (horizontally) parallel to the node border.
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.

isCrossingReductionEnabled
Returns Boolean
Returns 'true' if crossing reduction is enabled.
isExhaustiveSearching
Returns Boolean
Returns 'true' if routing uses exhaustive searching.
isFallbackRouteEnabled
Returns Boolean
Returns 'true' if the fallback routing algorithm is enabled.
isFitToViewEnabled
Returns Boolean: 'true' if the graph drawing must fit (exactly or approximately) an area of the diagram view.

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

isFixed
Returns Boolean: 'true' if the node or link is specified as fixed.
Returns whether the node or link is specified as fixed.
ParameterTypeDescription
nodeOrLinkObjectNode or link instance present in the graph model attached to this layout.
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.

isIncrementalConnectionPreserving
Returns Boolean
Returns 'true' if the incremental mode preserves the side and relative order of the link connection points.
isIncrementalMode
Returns Boolean
Returns 'true' if the incremental mode is enabled.
isInputCheckEnabled
Returns Boolean

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

isInterGraphLinksMode
Returns Boolean

Returns true if the routing of intergraph links is enabled. It 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.
isLinkObstacleEnabled
Returns Boolean
Returns 'true' if links should be line obstacles for the link routes.
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()'.
isNodeObstacleEnabled
Returns Boolean
Returns 'true' if nodes should be obstacles for the link routes.
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.

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.

isStraightRouteEnabled
Returns Boolean
Returns 'true' if straight routing is enabled.
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 Long Link Layout algorithm. To start the layout, call the method ibm_ilog.graphlayout.GraphLayout.performLayout() .

layoutStepPerformed

Can be called by the layout classes when a step of the layout algorithm has been performed. The method notifies the listeners of the layout events (if any). In addition to the base functionality, this method updates the percentage of completion value.

markForIncremental

Marks the input link to be rerouted with the next call of ibm_ilog.graphlayout.GraphLayout.performLayout(), if incremental mode is enabled. Normally the incremental layout reroutes only those links that have changed since the last layout. By setting a mark on the link, this link will be rerouted even if it has not changed.

ParameterTypeDescription
linkObjectThe link instance.
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
removeAllLineObstacles
Removes all additional line obstacles.
removeAllRectObstacles
Removes all additional rectangular obstacles.
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.
setAllowedTimePerLink

Sets the upper limit for the time allowed to find a route for a long link. The algorithm tries to find a short route for the link. It uses a backtrack mechanism to find a route that bypasses obstacles. The runtime of the backtrack can be large if the size of the drawing area is large and the grid offset is small. The algorithm stops the backtrack when the specified time is elapsed and gives up without result.

The default value is 2000 (2 seconds).

Note that the specified time is valid for each single link, that is, the maximum time to find routes for all links is approximately the specified time per link multiplied by the number of links. However, this happens only extremely seldom. The algorithm will most likely find a route for the majority of the links before the time elapses; therefore, the average time to find routes for all links is much smaller.

If the specified time elapsed for a link and the fallback routing is enabled, the link is quickly routed by the fallback mechanism instead.

ParameterTypeDescription
time
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.
setCombinedInterGraphLinksMode

Sets the routing of normal links in addition to intergraph links. If intergraph link routing is disabled, the option 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
setCrossingReductionEnabled

Sets the crossing reduction. If this option is enabled, the algorithm tries to reduce the crossings between orthogonal links that are routed.

Crossing reduction is enabled by default.

ParameterTypeDescription
flag
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 LongLinkLayout.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:

  • LongLinkLayout.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()).
  • LongLinkLayout.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.
    In this mode, the first segment of a link is not placed on the grid. Therefore, the first segment may be closer than the specified minimum offset to neighbor links, or may even overlap them if they start at the same fixed point.

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

The default value is LongLinkLayout.FREE_MODE.

ParameterTypeDescription
linkObjectThe link.
modeintThe mode to set.
setExhaustiveSearching

Sets the exhaustive searching of routes for links. If this option is enabled, the algorithm examines the complete grid exhaustively to find a route for an orthogonal link. This may result in fewer bends, but it takes a huge amount of runtime for large graphs.

Exhaustive searching is disabled by default.

ParameterTypeDescription
flag
setFallbackRouteEnabled

Sets whether the fallback routing algorithm is enabled.

This routing algorithm is used for those links that cannot be routed on the grid without overlapping other obstacles (nodes or links). If it is disabled, then these fallback links remain unrouted.

The default is true.

ParameterTypeDescription
flag
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
setGlobalDestinationPointMode

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

  • LongLinkLayout.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()).
  • LongLinkLayout.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 first segment of a link is not placed on the grid. Therefore, the first segment may be closer than the specified minimum offset to neighbor links, or may even overlap them if they start at the same fixed point.

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

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

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

The default value is LongLinkLayout.FREE_MODE.

ParameterTypeDescription
modeintThe global mode to set.
setGlobalLinkStyle

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

  • LongLinkLayout.ORTHOGONAL_STYLE - all links get an orthogonal shape, that is, a shape consisting of a sequence of alternating horizontal and vertical line segments.
  • LongLinkLayout.DIRECT_STYLE - all links get a nearly straight-line shape. The shape of the links is a polyline composed of a straight-line segment between the end nodes with two short horizontal or vertical segments at its ends (their length is controlled by LongLinkLayout.setMinStartSegmentLength() and LongLinkLayout.setMinEndSegmentLength() and may be 0). In this link style, links may overlap nodes.
  • LongLinkLayout.MIXED_STYLE - each link can have a different link style. The style of each individual link can be set by the method LongLinkLayout.setLinkStyle() so that different link shapes can occur in the same graph.

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

The default value is LongLinkLayout.ORTHOGONAL_STYLE.

ParameterTypeDescription
style
setGlobalOriginPointMode

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

  • LongLinkLayout.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()).
  • LongLinkLayout.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 first segment of a link is not placed on the grid. Therefore, the first segment may be closer than the specified minimum offset to neighbor links, or may even overlap them if they start at the same fixed point.

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

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

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

The default value is LongLinkLayout.FREE_MODE.

ParameterTypeDescription
modeintThe global mode to set.
setGraphModel

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

ParameterTypeDescription
graphModel
setHorizontalGridBase

Sets the horizontal base coordinate of the grid. This is the x-coordinate of the first vertical grid line. Links are routed on an orthogonal grid.

The default value is 0.

ParameterTypeDescription
coordinate
setHorizontalGridOffset

Sets the horizontal offset between the grid lines. Links are routed on an orthogonal grid.

The default value is 5.

ParameterTypeDescription
offset
setHorizontalMinOffset

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

The default value is 3.

ParameterTypeDescription
minOffset
setIncrementalConnectionPreserving

Sets whether the incremental layout mode preserves the side and relative order of the link connection points. The default is false.

ParameterTypeDescription
flag
setIncrementalMode

Sets the incremental layout mode. If the argument is true, only those links that were affected by changes since the last layout are rerouted. A link is rerouted under the following conditions:

  • if the link is new,
  • if the link shape or link style has changed,
  • if the parameters controlling start and end segments have changed,
  • if the link now overlaps obstacles that were moved or resized,
  • if the link is no longer on the grid,
  • if the link is marked for incremental rerouting.
The links preserve the side and relative order of their connection points from the previous layout, if this mode is selected by LongLinkLayout.setIncrementalConnectionPreserving().

The incremental mode works only if the intergraph links mode is disabled or if there are no intergraph links. The incremental mode is disabled by default.

ParameterTypeDescription
enable
setInputCheckEnabled

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

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

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

ParameterTypeDescription
enable
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 a given graph that has an origin or destination not stored in this graph. If the combined intergraph link routing is enabled in additional, 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 actually contains some intergraph links, there are some restrictions:

  • Layout animation is not possible.
  • The incremental mode 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 ensure 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.
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.

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()). The tangential offsets provided by the link connection box interface are currently ignored.

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

Sets whether links should be line obstacles for the link routes.

The default is true. There are, however, situations where it may be suitable to consider a set of obstacles different from the links. In this case you can switch links as obstacles off and use the methods LongLinkLayout.addLineRectObstacle() and LongLinkLayout.addLineObstacle() to specify the obstacles that are needed.

ParameterTypeDescription
flag
setLinkStyle

Sets the style for the shape of an individual link. This link style is used only if the global link style is set to LongLinkLayout.MIXED_STYLE. Otherwise, all links have the style that is specified as the global link style.

Valid values are:

  • LongLinkLayout.ORTHOGONAL_STYLE - the link gets an orthogonal shape, that is, a shape consisting of a sequence of alternating horizontal and vertical line segments.
  • LongLinkLayout.DIRECT_STYLE - the link gets a nearly straight-line shape. The shape of the link is a polyline composed of a straight-line segment between the end nodes with two short horizontal or vertical segments at its ends (their length is controlled by LongLinkLayout.setMinStartSegmentLength() and LongLinkLayout.setMinEndSegmentLength() and may be 0). In this link style, links may overlap nodes.
  • LongLinkLayout.NO_RESHAPE_STYLE - the link is not reshaped.

The default value is LongLinkLayout.ORTHOGONAL_STYLE.

ParameterTypeDescription
linkObjectThe link instance.
styleintThe style for the shape of an individual link.
setMaxBacktrack

Sets the maximum number of backtrack steps to find a route for a long link. The algorithm tries to find a short route for the link. The backtrack number indicates that the algorithm tries to find a route that is so many grid points longer than the shortest possible route before it gives up the search.

Decreasing the value causes the algorithm to give up earlier without result. If the "from" point and "to" point are fixed, this speeds up the search. Otherwise, the time behavior is more complex, so it may speed up or slow down the search.

The default value is 30000.

If the maximum number of backtrack steps is exceeded and the fallback routing is enabled, the link is quickly routed by the fallback mechanism instead.

ParameterTypeDescription
numberOfSteps
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
setMinEndSegmentLength

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

The default value is 10.

ParameterTypeDescription
length
setMinNodeCornerOffset

Sets the minimum offset between a node corner and a link starting at this node. Setting this to 0 enables the layout to start a link exactly at a node corner.

The default value is 3.

ParameterTypeDescription
offset
setMinSplineCurveSize

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

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

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

The default value is 5.

ParameterTypeDescription
sizeNumberThe minimum spline curve size
setMinStartSegmentLength

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

The default value is 10.

ParameterTypeDescription
length
setNodeBoxInterface

Sets the node box interface for the obstacle area.

The node box interface is an object that provides the rectangle that determines the node box for each node. If none is given, the layout algorithm uses the bounding box of each node (see ) by default.

This node box specifies the obstacle area of the node, that is, the area that links should avoid so they do not overlap the node. This can be different from the node box used to find the connection points of the links.

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

ParameterTypeDescription
nodeBoxInterface
setNodeObstacleEnabled

Sets whether nodes should be obstacles for the link routes. The default is true. There are, however, situations where it may be suitable to consider a set of obstacles different from the nodes. In this case you can switch nodes as obstacles off and use the method LongLinkLayout.addRectObstacle() to specify the obstacles that are needed.

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

Note that the node-side filter serves the same purpose as the termination point filter; it is, however, easier to use. If a termination point filter is installed, the node-side filter is ignored. If neither a termination point filter nor a node-side filter is installed, the layout algorithm is free to choose any side of the nodes.

When a filter is specified, the layout algorithm asks the filter at which side of its end node each link is allowed to attach to. Note that a filter should always allow a link to connect to at least one side of a node; otherwise the link cannot be routed.

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

ParameterTypeDescription
filter
setNumberCrossingReductionIterations

Sets the maximum number of iterations performed during crossing reduction. This option has an effect only if crossing reduction is enabled. Reducing the value speeds up the algorithm, but the layout may contain more link crossings.

The default value is 2.

ParameterTypeDescription
iterations
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 LongLinkLayout.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:

  • LongLinkLayout.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()).
  • LongLinkLayout.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 first segment of a link is not placed on the grid. Therefore, the first segment may be closer than the specified minimum offset to neighbor links, or may even overlap them if they start at the same fixed point.

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

The default value is LongLinkLayout.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
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.
setStraightRouteEnabled

Sets the straight routing. If this option is enabled, the algorithm makes an additional attempt to find a route with zero or one bend before starting the normal backtrack mechanism. As result, the layout has fewer bends, but the distribution of links at the border may become uneven.

Straight routing is enabled by default.

ParameterTypeDescription
flag
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
setTerminationPointFilter

Sets the termination point filter, that is, an object that allows filtering the termination points that are proposed by the layout algorithm.

For each side, the layout algorithm proposes some termination points. It also proposes a penalty that indicates how "good" this termination point is. The default penalty indicates how far the termination point is away from the border. By installing a termination point filter, you can change this penalty.

Note that the termination point filter serves the same purpose as the node-side filter but allows a greater flexibility. If a termination point filter and a node-side filter are installed, the node-side filter is ignored. If neither a termination point filter nor a node-side filter is installed, the layout algorithm is free to choose any termination point.

When a filter is specified, the layout algorithm proposes a sequence of termination points on the grid for each link. It proposes termination points at all four sides of the corresponding end node. It asks the filter for the penalty of each termination point and then chooses the termination points with the lowest penalty that are feasible to route the link.

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

ParameterTypeDescription
filter
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
setVerticalGridBase

Sets the vertical base coordinate of the grid. This is the y-coordinate of the first horizontal grid line. Links are routed on an orthogonal grid.

The default value is 0.

ParameterTypeDescription
coordinate
setVerticalGridOffset

Sets the vertical offset between the grid lines. Links are routed on an orthogonal grid.

The default value is 5.

ParameterTypeDescription
offset
setVerticalMinOffset

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

The default value is 3.

ParameterTypeDescription
minOffset
stopImmediately
Returns Boolean: 'true' if the layout algorithm can be stopped.

Stops the running of the layout algorithm as soon as possible.

The Long Link Layout algorithm has several steps. In the first steps, the layout algorithm can be stopped and the method returns true. In the very last step, the layout algorithm cannot be stopped and the method returns false.

supportsAllowedTime
Returns Boolean

Indicates that this layout class can stop the layout computation in a proper manner when the user-defined allowed time is exceeded. If the allowed time elapses before termination of the Long Link Layout algorithm, the links are not reshaped and remain at the same position as before the start of the algorithm.

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

supportsLayoutOfConnectedComponents
Returns Boolean

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

The link connection box is used instead of the bounding box of each node (see ) during the routing of links. The tangential offsets provided by the link connection box interface are currently ignored.

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. The effect is very similar to the effect when the links are filtered during layout.

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.

supportsSaveParametersToNamedProperties
Returns Boolean

Indicates that this layout class can transfer the layout parameters to named properties. This mechanism can be used if layout parameters must be stored persistently in an .ivl file.

supportsSplineRouting
Returns Boolean: This implementation always returns 'true'.

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. If interrupted, the links are not reshaped and remain at the same position as before the start of the algorithm.

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

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

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

unfixAllLinks

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

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

unfixAllNodes

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

Events

onLayoutStepPerformed

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

ParameterTypeDescription
layoutStarted
layoutFinished
onObjectParameterChanged

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

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

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

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

Called when a global layout parameter has changed.

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

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

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