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

ibm_ilog.graphlayout.MultipleLayout

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

The main class for the Multiple Layout algorithm.

This is not a layout algorithm but rather a facility to compose multiple layout algorithms and treat them as one algorithm object. This is more convenient if a sequence of layout algorithms must be applied to subgraphs. For instance, assume that you want to apply to each subgraph a Tree layout, then a Link layout for the nontree links. It would be unfortunate to call ibm_ilog.graphlayout.GraphLayout.performLayout() multiple times to achieve this, because the tree layout of the parent graph would be finished before the link layout of its subgraph has started; hence the link layout of the subgraph invalidates the tree layout of the parent graph again. To avoid this effect, the Tree layout, Link layout, and Label layout of the subgraph should be finished before any layout of the parent graph has started. The following sample shows how to achieve this by using the Multiple Layout class:

GraphLayout layout = new MultipleLayout(
new TreeLayout(),
new LinkLayout(),
new AnnealingLabelLayout());
layout.attach(grapher);
layout.performLayout(true, true, true);
If more than two graph layouts and one label layout are necessary, you can construct an MultipleLayout from another MultipleLayout, as follows:
GraphLayout layout = new MultipleLayout(
new MultipleLayout(layout1, layout2, null),
new MultipleLayout(layout3, layout4, null),
labelLayout);
The multiple layout offers only a few layout parameters that are global to all three sublayouts (such as the allowed time), but you can specify the other layout parameters individually for each sublayout by accessing MultipleLayout.getFirstGraphLayout(), MultipleLayout.getSecondGraphLayout() , and MultipleLayout.getLabelLayout() directly.

If complex combinations of graph layouts and label layouts are needed in a nested graph, you should use the Recursive Multiple Layout (see ibm_ilog.graphlayout.RecursiveMultipleLayout) that utilizes the Multiple Layout inside a Recursive Layout.

Method Summary

  • afterLayoutOfSubgraph(subgraph) Performs postprocessing operations after the layout of each subgraph or connected component.
  • attach(graphModel) Allows you to specify the graph model you want to lay out.
  • beforeLayout() Performs preprocessing operations before the layout of the entire graph.
  • beforeLayoutOfSubgraph(subgraph) Performs preprocessing operations before the layout of each subgraph or connected component.
  • callLayoutStepPerformedIfNeeded() Calls 'onLayoutStepPerformed' when necessary.
  • cleanGraphModel(graphModel) Cleans a graph model.
  • cleanLink(graphModel, link) Cleans a link.
  • cleanNode(graphModel, node) Cleans a node.
  • connectAllLinksToCenter() Connects all links to the enter of their end nodes.
  • connectLinkToCenter(link, atFromSide, atToSide) Connects the link to the node center at both end nodes by using the link connection box interface.
  • constructor(a0, a1)
  • contentsChanged(event) Called when the structure or the geometry of the graph changes.
  • copy() returns ibm_ilog.graphlayout.GraphLayout Copies the layout instance.
  • copyParameters(source) Copies the parameters from a given layout instance.
  • createLayoutReport() returns ibm_ilog.graphlayout.GraphLayoutReport Returns a new instance of the layout report.
  • detach() Detaches the graph model from the layout instance.
  • getAllowedTime() returns Number Returns the currently allowed time for the layout algorithm in milliseconds.
  • getBalanceSplineCurveThreshold() returns Number Returns the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • getCalcLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region parameter.
  • getFirstGraphLayout() returns ibm_ilog.graphlayout.GraphLayout Returns the layout that is applied first.
  • getGraphModel() returns ibm_ilog.graphlayout.AbstractGraphLayoutModel Returns the graph model to lay out if a graph model is attached.
  • getInstanceId() returns int A utility method that returns a unique integer value for each layout instance.
  • getLayout(subgraph) returns ibm_ilog.graphlayout.GraphLayout Returns the layout instance for a subgraph of the nested graph encapsulated by the graph model of this layout instance.
  • 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.
  • getMaxSplineCurveSize() returns Number Returns the maximum curve size used when spline control point optimization routing is enabled.
  • getMinBusyTime() returns Number Returns the minimal time that the layout algorithm can be busy between two calls of ' ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed()' when the method ' ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded()' is used.
  • getMinSplineCurveSize() returns Number Returns the minimum curve size used when optimized spline control points routing is enabled.
  • getMultipleLayout(layout) returns ibm_ilog.graphlayout.MultipleLayout
  • getObjectParameter(graphModel, nodeOrLink, key) returns Object Returns the value of a parameter of the layout instance.
  • 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.
  • getSecondGraphLayout() returns ibm_ilog.graphlayout.GraphLayout Returns the layout that is applied second.
  • getSeedValueForRandomGenerator() returns Number Returns the user-defined seed value for the random generator.
  • getSpecLayoutRegion() returns Rectangle Returns a copy of the rectangle that defines the layout region, as specified using the method ' ibm_ilog.graphlayout.GraphLayout.layoutRegion'.
  • getSplineLinkFilter() returns ibm_ilog.graphlayout.SplineLinkFilter Returns the filter that detects which links are suitable for optimized spline routing.
  • getViewMatrix() Returns the matrix that is applied to the first view attached to this layout.
  • increasePercentageComplete(newPercentage) Increases the percentage of completion that is stored in the layout report to the input value.
  • init() Initializes instance variables.
  • isFirstGraphLayoutActive() returns Boolean Returns whether the first graph layout is active.
  • 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 'false' if at least one node, link, label, or obstacle was moved or reshaped 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.
  • isInputCheckEnabled() returns Boolean Returns 'true' if the checks for the nodes and/or links are 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.
  • isLocalRecursiveLayoutNeeded(layoutProvider, recLayout, rootModel, traverse) returns Boolean Checks whether layout is needed when layout is performed recursively on a hierarchy of nested subgraphs.
  • isParametersUpToDate() returns Boolean Returns '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.
  • 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.
  • isSecondGraphLayoutActive() returns Boolean Returns whether the second graph layout is active.
  • isSplineRoutingEnabled() returns Boolean Tests whether the calculation of optimized spline control points is enabled.
  • isStoppedImmediately() returns Boolean Returns 'true' if the method ' ibm_ilog.graphlayout.GraphLayout.stopImmediately()' was called.
  • isStructureUpToDate() returns Boolean Returns 'false' if at least one modification occurred in the structure of the graph 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.
  • 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 Multiple Layout algorithm.
  • mayContinue() returns Boolean
  • performFirstGraphLayout(redraw) Called in order to perform the first graph layout.
  • performLayout(force, traverse) returns int Starts the layout algorithm using the currently attached graph model and the current settings for the layout parameters.
  • performSecondGraphLayout(redraw) Called in order to perform the second graph layout.
  • performSublayout(subgraph, layout, force) Starts the input layout algorithm.
  • setAllowedTime(time) Sets the upper limit for the duration of the layout algorithm.
  • setBalanceSplineCurveThreshold(threshold) Sets the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
  • setFirstGraphLayout(layout) Sets the first layout to be applied.
  • setFirstGraphLayoutActive(active) Sets whether the first graph layout is active.
  • setFixed(nodeOrLink, fixed) Sets the specified node or link as fixed.
  • setGeometryUpToDate(uptodate) Sets whether the geometry of the graph is up to date.
  • setGraphModel(graphModel) Sets the graph model to be laid out.
  • setInputCheckEnabled(enable) Sets whether the checks for the nodes, links, and/or labels provided as arguments for the different methods of this layout algorithm and its sublayout algorithms are enabled.
  • 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(linkConnectionBoxInterface) Sets the link connection box interface for the connection points of links.
  • setMaxSplineCurveSize(size) Sets the maximum curve size used when optimized spline control point routing is enabled.
  • setMinBusyTime(time) Sets the minimal time 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.
  • setMinSplineCurveSize(size) Sets the minimum curve size used when optimized spline control point routing is enabled.
  • setMultipleLayoutProperty(layout, mlayout)
  • setObjectParameter(graphModel, nodeOrLink, key, value) returns Object Sets the value of a parameter for a node or a link, using a given graph model.
  • setParameter(key, value) returns Object Sets the value of a property for the layout instance.
  • setParametersUpToDate(uptodate) Sets whether the parameters of the 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.
  • setSecondGraphLayout(layout) Sets the second layout to be applied.
  • setSecondGraphLayoutActive(active) Sets whether the second graph layout is active.
  • setSeedValueForRandomGenerator(seed) Sets the seed value for the random generator.
  • setSilentAttach(flag) This method is used internally.
  • setSplineLinkFilter(filter) Sets the filter that detects which links are suitable for optimized spline routing.
  • setSplineRoutingEnabled(flag) Sets whether the calculation of optimized spline control points is enabled.
  • setStructureUpToDate(uptodate) Sets whether the structure of the graph is up to date.
  • setUseSeedValueForRandomGenerator(option) Sets whether the user-defined seed value should be used for the random generator.
  • stopImmediately() returns Boolean Stops the running layout algorithm as soon as possible.
  • supportsAllowedTime() returns Boolean Indicates whether the layout class can stop the layout computation when a 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 whether the layout class can use a link connection box interface to calculate the end points of a link.
  • supportsPercentageComplete() returns Boolean Indicates whether the layout class can estimate the percentage of completion during the run of the layout.
  • supportsPreserveFixedLinks() returns Boolean Indicates whether the layout class allows the user to specify fixed links.
  • supportsPreserveFixedNodes() returns Boolean Indicates whether the layout class allows the user to specify fixed nodes.
  • supportsRandomGenerator() returns Boolean Indicates whether the layout class uses randomly generated numbers (or randomly chosen parameters) for which it can accept a user-defined seed value.
  • supportsSplineRouting() returns Boolean Indicates whether the layout class supports the generic optimization of spline control points.
  • supportsStopImmediately() returns Boolean Indicates whether the layout class can immediately interrupt the current run of the layout 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.
  • updateLayoutStepData(event)

Event Summary

Methods

afterLayoutOfSubgraph

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

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

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

Allows you to specify the graph model you want to lay out.

In addition to the functionality in the base class, the Multiple Layout attaches its sublayouts.

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model.
beforeLayout

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

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

beforeLayoutOfSubgraph

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

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

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

Calls onLayoutStepPerformed when necessary.

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

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

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

cleanGraphModel

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

redraw: Boolean Whether the links need to be redrawn.

connectLinkToCenter

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

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

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

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

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

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

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

Copies the layout instance.

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

When performing a recursive layout on a nested graph, this method is used by ibm_ilog.graphlayout.ILayoutProvider to "clone" the layout instance of a parent graph. Note that the parameters which are specific to a node or a link are not copied. The persistence flags are copied. The sublayout instances and their global layout parameters are copied. The labeling model is not copied.

copyParameters

Copies the parameters from a given layout instance.

Note that the parameters which are specific to a node or a link are not copied. The activation and persistence flags are copied. The sublayout instances and their global layout parameters are copied. The labeling model is not copied.

ParameterTypeDescription
source
createLayoutReport
Returns ibm_ilog.graphlayout.GraphLayoutReport: A new instance of the layout report. The current implementation creates an instance of ' MultipleLayoutReport'.

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 MultipleLayout.attach(). The detach method performs cleaning operations on the graph model. In addition to the cleaning operations in the base class, the Multiple Layout detaches its sublayouts.

Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected. If you explicitly set a labeling model, this labeling model will be disposed inside detach.

getAllowedTime
Returns Number

Returns the currently allowed time for the layout algorithm in milliseconds. The allowed time is additionally limited by the allowed time parameter on the sublayouts. The effective allowed time is the minimum of the sum of allowed times for for the sublayouts and the value returned as allowed time for this Multiple layout.

Note that the method performLayout does not automatically stop the layout when the allowed time is exceeded. It only delegates the stop to the sublayouts, and it is entirely the responsibility of the implementation of the method MultipleLayout.layout() on the sublayouts to do this.

getBalanceSplineCurveThreshold
Returns Number: The threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
Returns the threshold for spline curves at bends which the optimized spline control point routing uses to balance the curve.
getCalcLayoutRegion
Returns Rectangle: A copy of the rectangle that defines the layout region parameter.

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

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

getFirstGraphLayout
Returns ibm_ilog.graphlayout.GraphLayout
Returns the layout that is applied first.
getGraphModel
Returns ibm_ilog.graphlayout.AbstractGraphLayoutModel: The graph model to lay out if one is attached.

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

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

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

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

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

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

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

ParameterTypeDescription
subgraphObjectThe subgraph object. This must not be the root graph.
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.

getMaxSplineCurveSize
Returns Number: The maximum curve size used when spline control point optimization routing is enabled.
Returns the maximum curve size used when spline control point optimization routing is enabled.
getMinBusyTime
Returns Number
Returns the minimal time that the layout algorithm can be busy between two calls of ' ibm_ilog.graphlayout.GraphLayout.onLayoutStepPerformed()' when the method ' ibm_ilog.graphlayout.GraphLayout.callLayoutStepPerformedIfNeeded()' is used.
getMinSplineCurveSize
Returns Number: The minimum curve size used when optimized spline control points routing is enabled.
Returns the minimum curve size used when optimized spline control points routing is enabled.
getMultipleLayout
Returns ibm_ilog.graphlayout.MultipleLayout
ParameterTypeDescription
layout
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.
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.

getSecondGraphLayout
Returns ibm_ilog.graphlayout.GraphLayout

Returns the layout that is applied second. It returns null if no second layout is necessary.

getSeedValueForRandomGenerator
Returns Number

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

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

getSpecLayoutRegion
Returns Rectangle: Returns a copy of the rectangle that defines the layout region.

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

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

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

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

getSplineLinkFilter
Returns ibm_ilog.graphlayout.SplineLinkFilter: The filter that detects which links are suitable for optimized spline routing.
Returns the filter that detects which links are suitable for optimized spline routing.
getViewMatrix
Returns the matrix that is applied to the first view attached to this layout.
increasePercentageComplete

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

ParameterTypeDescription
newPercentageintNew percentage of completion
init

Initializes instance variables.

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

isFirstGraphLayoutActive
Returns Boolean
Returns whether the first graph layout is active.
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 false if at least one node, link, label, or obstacle was moved or reshaped 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 changes occurred.

The method returns false if the geometry of one of the sublayouts is out-of-date.

isInputCheckEnabled
Returns Boolean

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

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

Verifies that it is necessary to perform the layout.

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

isLayoutOfConnectedComponentsEnabled
Returns Boolean

Indicates whether the connected component layout mechanism is enabled.

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

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

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

The default implementation always returns false.

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

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

Indicates whether this layout algorithm is running or not.

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

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

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

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

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

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

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

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

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

Returns 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 changes occurred.

The method returns false if the parameters of one of the sublayouts is out-of-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.

isSecondGraphLayoutActive
Returns Boolean
Returns whether the second graph layout is active.
isSplineRoutingEnabled
Returns Boolean: If the calculation of optimized spline control points is enabled, 'true' is returned.
Tests whether the calculation of optimized spline control points is enabled.
isStoppedImmediately
Returns Boolean: 'true' if the method 'stopImmediately' was called.

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

isStructureUpToDate
Returns Boolean

Returns false if at least one modification occurred in the structure of the graph 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 changes occurred.

The method returns false if the structure of one of the sublayouts is out-of-date.

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 Multiple Layout algorithm. To start the layout, call the method ibm_ilog.graphlayout.GraphLayout.performLayout().

mayContinue
Returns Boolean
performFirstGraphLayout
The graph layout report of the first graph layout.

Called in order to perform the first graph layout. The default implementation simply calls ibm_ilog.graphlayout.GraphLayout.performLayout() on the first graph layout. This method can be overridden if it is necessary to perform some additional preparations before applying the first graph layout.

ParameterTypeDescription
redrawBooleanWhether to redraw the graph during layout.
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.
performSecondGraphLayout
The graph layout report of the second graph layout.

Called in order to perform the second graph layout. The default implementation simply calls ibm_ilog.graphlayout.GraphLayout.performLayout() on the second graph layout. This method can be overridden if it is necessary to perform some additional preparations before applying the second graph layout.

ParameterTypeDescription
redrawBooleanWhether to redraw the graph during layout.
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
setAllowedTime

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

The default value for Multiple layout is 1000000000 (1000000 seconds). The allowed time is additionally limited by the allowed time parameter on the sublayouts.

ParameterTypeDescription
timeNumberThe allowed time in milliseconds.
setBalanceSplineCurveThreshold

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

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

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

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

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

The default value is 10.

ParameterTypeDescription
thresholdNumberThe balance spline curve threshold.
setFirstGraphLayout

Sets the first layout to be applied. You should set the layout before attaching the graph model.

ParameterTypeDescription
layoutibm_ilog.graphlayout.GraphLayoutThe first layout.
setFirstGraphLayoutActive

Sets whether the first graph layout is active.

This allows you to temporarily disable the first graph layout. The first graph layout is active by default. However, if you want to perform a layout using only the second graph layout or the label layout, you can set the first layout inactive. The first layout remains attached when inactive, but it is not performed when calling ibm_ilog.graphlayout.GraphLayout.performLayout() on the Multiple layout instance.

ParameterTypeDescription
activeBoolean'true' if the first graph layout is active, or 'false' otherwise.
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.

Normally called with a false argument if the geometry of the graph changed.

This method is automatically called with a true argument each time the layout is successfully performed. In this case, it calls setGeometryUpToDate with a true argument for the sublayouts as well.

ParameterTypeDescription
uptodate
setGraphModel

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

ParameterTypeDescription
graphModelibm_ilog.graphlayout.AbstractGraphLayoutModelThe graph model to be laid out.
setInputCheckEnabled

Sets whether the checks for the nodes, links, and/or labels provided as arguments for the different methods of this layout algorithm and its sublayout algorithms are enabled.

It is enabled by default.

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. This method is part of IBM ILOG Dojo Diagrammer internals. You should not use it.

ParameterTypeDescription
runningBooleanWhether layout is running or not.
fromParentsBooleanWhether this notification is 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 and the tangential shift offset at each side for the connection points.

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

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

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

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

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

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

The default value is 50 (milliseconds).

ParameterTypeDescription
time
setMinSplineCurveSize

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

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

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

The default value is 5.

ParameterTypeDescription
sizeNumberThe minimum spline curve size
setMultipleLayoutProperty
ParameterTypeDescription
layout
mlayout
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.
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 layout are up to date.

Automatically called with a false argument each time the value of a parameter is changed.

This method is automatically called with a true argument each time the layout is successfully performed. In this case, it calls setParametersUpToDate with a true argument for the sublayouts as well.

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
setSecondGraphLayout

Sets the second layout to be applied. You should set the layout before attaching the graph model.

ParameterTypeDescription
layoutibm_ilog.graphlayout.GraphLayoutThe second graph layout.
setSecondGraphLayoutActive

Sets whether the second graph layout is active.

This allows you to temporarily disable the second graph layout. The second graph layout is active by default. However, if you want to perform a layout using only the first graph layout or the label layout, you can set the second layout inactive. The second layout remains attached when inactive, but it is not performed when calling ibm_ilog.graphlayout.GraphLayout.performLayout() on the Multiple layout instance.

ParameterTypeDescription
activeBoolean'true' if the second graph layout is active, or 'false' otherwise.
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
setSilentAttach

This method is used internally. You should not call this method.

ParameterTypeDescription
flag
setSplineLinkFilter

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

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

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

ParameterTypeDescription
filter
setSplineRoutingEnabled

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

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

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

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

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

Normally called with a false argument if the structure of the graph changed.

It is automatically called with a true argument each time the layout is successfully performed. In this case, it calls setStructureUpToDate with a true argument for the sublayouts as well.

ParameterTypeDescription
uptodate
setUseSeedValueForRandomGenerator

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

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

ParameterTypeDescription
option
stopImmediately
Returns Boolean: 'true' if the algorithm can be stopped at this time.

Stops the running layout algorithm as soon as possible.

This method can be used if multiple threads are used for layout and GUI control. The GUI control thread calls this method to notify the layout thread that the layout run must be stopped. The layout algorithm will perform some final cleanup operations before terminating. Therefore, the layout thread will continue until the cleanup operations are finished. The GUI thread, however, returns immediately from this method.

If the layout algorithm is stopped before completion, the result code of the layout report is ibm_ilog.graphlayout.GraphLayoutReport.STOPPED_AND_INVALID.

supportsAllowedTime
Returns Boolean: 'true' if the first graph layout , the second graph layout and the label layout support this feature.

Indicates whether the layout class can stop the layout computation when a user-defined allowed time is exceeded.

If the first graph layout, the second graph layout, and the label layout support this feature, then it returns true.

supportsLayoutOfConnectedComponents
Returns Boolean: 'true' if the first graph layout and the second graph layout support this feature.

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.

If the first graph layout and the second graph layout support this feature, then it returns true.

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 whether the layout class can use a link connection box interface to calculate the end points of a link. The link connection box interface is an object that provides the rectangle to which the links are connected for each node and the tangential shift offset at each side for the connection points.

If the layout class supports this feature and a connection box interface object is set using the method ibm_ilog.graphlayout.GraphLayout.setLinkConnectionBoxInterface(), the layout algorithm uses this object to calculate the connection points for links.

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.

supportsPercentageComplete
Returns Boolean

Indicates whether the layout class can estimate the percentage of completion during the run of the layout. If the sublayouts support this feature, the percentage value is calculated from the sublayouts. If the sublayouts do not support this feature, the Multiple Layout algorithm can indicate by discrete percentage values (typically 33% and 66% and 100%) whether the first graph layout, the second graph layout, or the label layout are already finished.

The calculated percentage values are not very precise.

supportsPreserveFixedLinks
Returns Boolean

Indicates whether the layout class allows the user to specify fixed links. Fixed links are not reshaped 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.

supportsPreserveFixedNodes
Returns Boolean

Indicates whether the layout class allows the user to specify fixed nodes. Fixed nodes are not moved during the layout.

The default implementation always returns false. Subclasses can override this method in order to return true, that is, to indicate that this option is supported.

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

supportsRandomGenerator
Returns Boolean

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

The default implementation always returns false.

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

supportsSplineRouting
Returns Boolean

Indicates whether the layout class supports the generic optimization of spline control points.

Subclasses can override this method in order to return true, that is, to indicate that this option is supported. Subclasses that do not route the links and always use straight links cannot benefit from the generic mechanism.

supportsStopImmediately
Returns Boolean: 'true' if the first graph layout , the second graph layout, and the label layout support this feature.

Indicates whether the layout class can immediately interrupt the current run of the layout in a controlled way.

If the first graph layout, the second graph layout, and the label layout support this feature, then it returns true.

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.

updateLayoutStepData
ParameterTypeDescription
event

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
onSubGraphLayoutStepPerformed
ParameterTypeDescription
layout