ibm_ilog.graphlayout.basic.BasicLinkStyleLayout
The Basic Link Style Layout is a common base class of all layouts algorithms that offer no complex link shapes. It offers only the link styles "straight links" and "no link reshape" for the regular links. It offers common options, for handling multiple links between the same pair of nodes, and for handling self-links that start and end at the same node.
While the main purpose of BasicLinkStyleLayout
is to
serve as a base class for some other layout algorithms, the Basic
Link Style Layout can also be used by itself. In this case, it does
not place any nodes, but it can route certain links. Links between
different node pairs can be routed as straight lines. Multiple links
between different node pairs can be routed as shifted bundle of
straight links, or as bundle with one bend point. Self-links that
start and end at the same node can be routed in a rectangular or
square style (or, if spline links are used, as approximation of a
circle).
Here are sample drawings produced with the Basic Link Style Layout algorithm:
See the corresponding chapter of the IBM ILOG Dojo Diagrammer User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features and limitations, code samples, parameters, and so on.
Method Summary
- afterLayoutOfSubgraph(subgraph) Performs postprocessing operations after the layout of each subgraph or connected component.
- attach(graphModel) Sets the graph model to be laid out.
- beforeLayout() Performs preprocessing operations before the layout of the entire graph.
- beforeLayoutOfSubgraph(subgraph) Performs preprocessing operations before the layout of each subgraph or connected component.
- callLayoutStepPerformedIfNeeded() Calls 'onLayoutStepPerformed' when necessary.
- cleanGraphModel(graphModel) Cleans a graph model.
- cleanLink(graphModel, link) Cleans a link.
- cleanNode(graphModel, node) Cleans a node.
- connectAllLinksToCenter() Connects all links to the enter of their end nodes.
- connectLinkToCenter(link, atFromSide, atToSide) Connects the link to the node center at both end nodes by using the link connection box interface.
- constructor(a0) Returns a new instance of ' BasicLinkStyleLayoutNodeProperty' that stores the parameter settings of this layout class for nodes.
- 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.
- 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.
- getLayoutCodeOnInterrupt() returns int Returns the layout code when the allowed time elapsed before completion of the layout.
- 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() returns int Returns the current option for the style of the shape of the links.
- 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.
- getMultiLinkMaxSpread() returns Number Returns the maximum spread width between multiple links between the same pair of nodes.
- getMultiLinkMode() returns int Returns the current option for the mode how multiple links between the same pair of nodes are laid out.
- getMultiLinkOffset() returns Number Returns the offset between multiple links between the same pair of nodes.
- getMultiLinksCount() returns int Returns the number of multilinks.
- getMultiSelfLinkDistribution() returns int Returns the current option for the distribution of bundles of multiple self-links (that is, multiple links that start and end at the same node).
- getMultiSelfLinkMaxSpread() returns Number Returns the maximum spread width between multiple self-links (that is, multiple links that start and end at the same node).
- getMultiSelfLinkOffset() returns Number Returns the offset between multiple self-links (that is, multiple links that start and end at the same node).
- 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.
- getPercentagesOfCompletion() returns Array Returns an array of 4 integer numbers, denoting the percentage of completion for each of the 4 steps.
- 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.
- getSelfLinkAbsoluteAttachPosition() returns Point Returns the absolute attach position at the node border for self-links (that is, links that start and end at the same node).
- getSelfLinkAllowedCorners() returns int Returns which corners are allowed to have self-links (that is, links that start and end at the same node).
- getSelfLinkMode() returns int Returns the current option for the mode how self-links (that is, links that start and end at the same node) are laid out.
- getSelfLinkOrientation() returns int Returns the current option for the orientation of self-links (that is, links that start and end at the same node).
- getSelfLinkRelativeAttachPosition() returns Point Returns the relative attach position at the node border for self-links (that is, links that start and end at the same node).
- getSelfLinkSpacing() returns Number Returns the minimal spacing between node border and the self-links (that is, links that start and end at the same node).
- getSelfLinksCount() returns int Returns the number of self-links.
- 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.
- internalLayout() Called from ' BasicLinkStyleLayout.layout()' to place the nodes.
- isConnectLinksToNodeCenters() returns Boolean Returns 'true' if the algorithm connects the links to the centers of the nodes.
- 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.
- isInputCheckEnabled() returns Boolean Returns 'true' if the checks for the nodes and/or links are enabled.
- isInterrupted() returns Boolean Returns 'true' if the layout is interrupted.
- 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 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.
- isSelfLinkConnectToNodeCenter() returns Boolean Returns whether self-links (that is, links that start and end at the same node) connect towards the node center.
- isSplineRoutingEnabled() returns Boolean Tests whether the calculation of optimized spline control points is enabled.
- isStoppedImmediately() returns Boolean Returns 'true' if the method ' ibm_ilog.graphlayout.GraphLayout.stopImmediately()' was called.
- isStructureUpToDate() returns Boolean Returns whether the structure of the graph is up to date.
- isUseSeedValueForRandomGenerator() returns Boolean Returns 'true' if the user-defined seed value is used for the random generator and 'false' otherwise.
- layout() Computes the layout using the Basic Link Style Layout algorithm.
- performLayout(force, traverse) returns int Starts the layout algorithm using the currently attached graph model and the current settings for the layout parameters.
- performSublayout(subgraph, layout, force) Starts the input layout algorithm.
- 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.
- setConnectLinksToNodeCenters(enable) Sets whether the algorithm connects the links to the centers of the nodes.
- 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 and/or links provided as arguments for the different methods of the layout 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.
- setLinkStyle(style) Sets the style of the shape of the links.
- setMaxSplineCurveSize(size) Sets the maximum curve size used when optimized spline control point routing is enabled.
- setMinBusyTime(time) Sets the minimal time that the layout algorithm can be busy.
- setMinSplineCurveSize(size) Sets the minimum curve size used when optimized spline control point routing is enabled.
- setMultiLinkMaxSpread(maxSpread) Sets the maximum spread width between multiple links between the same pair of nodes.
- setMultiLinkMode(mode) Sets the mode how multiple links between the same pair of nodes are laid out.
- setMultiLinkOffset(offset) Sets the offset between multiple links between the same pair of nodes.
- setMultiSelfLinkDistribution(distribution) Sets the distribution of bundles of multiple self-links (that is, multiple links that start and end at the same node).
- setMultiSelfLinkMaxSpread(maxSpread) Sets the maximum spread width between multiple self-links (that is, multiple links that start and end at the same node).
- setMultiSelfLinkOffset(offset) Sets the offset between multiple self-links (that is, multiple links that start and end at the same node).
- 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 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.
- setSelfLinkAbsoluteAttachPosition(position) Sets the absolute attach position at the node border for self-links (that is, links that start and end at the same node).
- setSelfLinkAllowedCorners(corners) Sets which corners are allowed to have self-links (that is, links that start and end at the same node).
- setSelfLinkConnectToNodeCenter(enable) Sets whether self-links (that is, links that start and end at the same node) connect towards the node center.
- setSelfLinkMode(mode) Sets the mode how self-links (that is, links that start and end at the same node) are laid out.
- setSelfLinkOrientation(orientation) Sets the orientation of self-links (that is, links that start and end at the same node).
- setSelfLinkRelativeAttachPosition(position) Sets the relative attach position at the node border for self-links (that is, links that start and end at the same node).
- setSelfLinkSpacing(spacing) Sets the minimal spacing between node border and self-links (that is, links that start and end at the same node).
- setSplineLinkFilter(filter) Sets the filter that detects which links are suitable for optimized spline routing.
- setSplineRoutingEnabled(flag) Sets whether the calculation of optimized spline control points is enabled.
- setStructureUpToDate(uptodate) Sets whether the structure of the graph is up to date.
- 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 that this layout class can stop the layout computation when the user-defined allowed time is exceeded.
- supportsLayoutOfConnectedComponents() returns Boolean Indicates that this layout class can cut the attached graph into connected components, apply itself to 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 layout run.
- supportsPreserveFixedLinks() returns Boolean Indicates that this layout class allows the user to specify fixed links.
- supportsPreserveFixedNodes() returns Boolean Indicates that this layout class allows the user to specify fixed nodes.
- supportsRandomGenerator() returns Boolean Indicates whether the layout class uses randomly generated numbers (or randomly chosen parameters) for which it can accept a user-defined seed value.
- supportsSplineRouting() returns Boolean Indicates whether the layout 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
- onAttached()
- onDetached()
- onLayoutStepPerformed(layoutStarted, layoutFinished) Notifies of the layout events (if any).
- onObjectParameterChanged(nodeOrLink, parameterName) Called when a layout parameter for a specific node or link has changed.
- onParameterChanged(parameterName) Called when a global layout parameter has changed.
- onParameterChangedImpl(nodeOrLink, parameterName)
Methods
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.
Parameter | Type | Description |
---|---|---|
subgraph | ibm_ilog.graphlayout.AbstractGraphLayoutModel | Subgraph or connected component where layout has just been performed. |
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.
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model to lay out. |
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.
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.
Parameter | Type | Description |
---|---|---|
subgraph | ibm_ilog.graphlayout.AbstractGraphLayoutModel | Subgraph where layout is about to be performed. |
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
).
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.
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model to be cleaned. |
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
.
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model to which the 'link' belongs. |
link | Object | The link to be cleaned. |
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
.
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model to which the 'node' belongs. |
node | Object | The node to be cleaned. |
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)
.
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)
.
Parameter | Type | Description |
---|---|---|
link | Object | The link to be connected. |
atFromSide | Boolean | 'true' if the link should be connected at its source node. |
atToSide | Boolean | 'true' if the link should be connected at its target node. redraw: Boolean Whether the link needs to be redrawn. |
Returns a new instance of
BasicLinkStyleLayoutNodeProperty
that stores the parameter
settings of this layout class for nodes.
The method is used by
ibm_ilog.graphlayout.AbstractGraphLayoutModel.saveParametersToNamedProperties()
to create a named property for a node that contains parameter
settings of this layout instance for the input node.
Parameter | Type | Description |
---|---|---|
a0 |
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()
.
Parameter | Type | Description |
---|---|---|
event | ibm_ilog.graphlayout.GraphLayoutModelEvent | The event indicating the change that has occurred in the graph model. |
Copies the layout instance.
This method copies the layout instance by calling the copy constructor.
When performing a recursive layout of a nested graph, this method is
used by ibm_ilog.graphlayout.ILayoutProvider
to
"clone" the layout instance of a parent graph.
Note that the parameters which are specific to a node or a link are not copied. The other parameters, including the customization interfaces, are also copied. A copy of the layout instance used for laying out the connected components is set on the new instance.
If a method of the type supportsXXX
is associated with
a parameter, the parameter is copied only if the corresponding
method returns true
.
Copies the parameters from a given layout instance.
Note that the parameters which are specific to a node or a link are not copied. The other parameters, including the customization interfaces, are also copied. A copy of the layout instance used for laying out the connected components is set on this layout instance.
If a method of the type supportsXXX
is associated with
a parameter, the parameter is copied only if the corresponding
method returns true
.
Parameter | Type | Description |
---|---|---|
source |
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 .
Detaches the graph model from the layout instance.
When a new graph model is attached to the layout instance, it is not
necessary to detach the previously attached graph model because this
is done automatically when the method
ibm_ilog.graphlayout.GraphLayout.attach()
is called.
This method performs cleaning operations on the graph model (for
example, properties added to the graph model objects and graph model
listeners are removed). The method
ibm_ilog.graphlayout.GraphLayout.cleanGraphModel()
is called
with the currently attached graph model as the argument. The methods
ibm_ilog.graphlayout.GraphLayout.cleanNode()
and
ibm_ilog.graphlayout.GraphLayout.cleanLink()
are
called for each node and link returned by the methods
AbstractGraphLayoutModel.getNodes()
,
AbstractGraphLayoutModel.getLinks()
and
AbstractGraphLayoutModel.getIntergraphLinks()
.
Subclasses can override this method to remove additional information stored in the layout instance.
After detaching the model, the method onDetached
is
called, passing this layout instance as an argument.
Note that you must call this method when you no longer need the layout instance; otherwise, some objects may not be garbage collected.
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.
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)
.
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()
.
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.
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.
Parameter | Type | Description |
---|---|---|
subgraph | Object | The subgraph object. This must not be the root graph. |
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.
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
.
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
.
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
.
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.
Parameter | Type | Description |
---|---|---|
preOrder | Boolean | If 'true', the layout instances are returned in preorder, otherwise in postorder. |
Returns the link connection box interface used to calculate the connection points of links during layout.
Returns null
if none is specified.
Returns the number of multilinks.
Can be used by subclasses inside
BasicLinkStyleLayout.internalLayout()
to test how many
multilinks have to be treated.
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.
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model used for storing the parameter. |
nodeOrLink | Object | The node or link for which the parameter is to be retrieved. |
key | String | The key string for the parameter. |
Returns the value of a parameter of the layout instance.
The method returns null
if the parameter does not
exist.
Parameter | Type | Description |
---|---|---|
key | String | The key string for the parameter. |
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.
Returns an array of 4 integer numbers, denoting the percentage of completion for each of the 4 steps. The steps are the following:
- After collecting multilinks and self-links.
- After calling
BasicLinkStyleLayout.internalLayout()
. - After treating all multilinks.
- After treating all self-links.
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.
- 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.
Returns the user-defined seed value for the random generator.
An Error
is thrown if the layout does not support this
mechanism.
Returns the absolute attach position at the node border for self-links (that is, links that start and end at the same node). The absolute attach position is expressed as absolute coordinate units.
- ' BasicLinkStyleLayout.TOP_LEFT': top left corner.
- ' BasicLinkStyleLayout.TOP_RIGHT': top right corner.
- ' BasicLinkStyleLayout.BOTTOM_RIGHT': bottom right corner.
- ' BasicLinkStyleLayout.BOTTOM_LEFT': bottom left corner.
Returns which corners are allowed to have self-links (that is, links that start and end at the same node). The default value is all the corners, that is, a combination of all the possible values.
Returns the relative attach position at the node border for self-links (that is, links that start and end at the same node). The relative attach position is expressed as a fraction of the width and height of the node bounding box. Self-links occur at a corner of the node, and the relative position is specified with respect to this corner.
Returns the number of self-links.
Can be used by subclasses inside
BasicLinkStyleLayout.internalLayout()
to test how many
self-links have to be treated.
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()
returnsfalse
). - 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).
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.
Parameter | Type | Description |
---|---|---|
newPercentage | int | New percentage of completion |
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.
Called from BasicLinkStyleLayout.layout()
to place the
nodes.
This layout does not place any nodes, but subclasses of this layout
may place nodes in this method.
Returns true
if the graph drawing must fit (exactly or
approximately) an area of a specific view.
Otherwise, the method returns false
.
Parameter | Type | Description |
---|---|---|
nodeOrLink | Object | Node or link instance present in the graph model attached to this layout. |
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.
Returns true
if the checks for the nodes and/or links
are enabled.
Returns 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
.
Indicates whether the connected component layout mechanism is enabled.
The default value is the value returned by the method
ibm_ilog.graphlayout.GraphLayout.isLayoutOfConnectedComponentsEnabledByDefault()
.
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.
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.
Parameter | Type | Description |
---|---|---|
checkParents | Boolean | Indicates that this method should also check whether any controlling parent layout is currently running. |
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()
.
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.
Parameter | Type | Description |
---|---|---|
layoutProvider | ibm_ilog.graphlayout.ILayoutProvider | The object that provides a layout instance to be used for laying out each subgraph. |
recLayout | ibm_ilog.graphlayout.GraphLayout | The recursive layout that started the recursive application of layouts. This can be 'null'. |
rootModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model that is the root of the nesting hierarchy of graph models. |
traverse | Boolean | If '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()'. |
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.
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.
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.
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.
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.
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.
Computes the layout using the Basic Link Style Layout algorithm.
To start the layout, call the method
ibm_ilog.graphlayout.GraphLayout.performLayout()
. Subclasses
should not override this method but should override
BasicLinkStyleLayout.internalLayout()
instead.
Parameter | Type | Description |
---|---|---|
force | Boolean | If 'true', the method isLayoutNeeded is not called. No check is made to determine if it is necessary to perform the layout. |
traverse | Boolean | If '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. |
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.
Parameter | Type | Description |
---|---|---|
subgraph | ||
layout | ||
force |
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.
Parameter | Type | Description |
---|---|---|
time | Number | The allowed time in milliseconds. |
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
.
Parameter | Type | Description |
---|---|---|
threshold | Number | The balance spline curve threshold. |
Sets whether the algorithm connects the links to the centers of the
nodes.
This option has only an effect if the link style is not
BasicLinkStyleLayout.NO_RESHAPE_STYLE
. If the argument is
true
, the links are connected to the center of the
nodes. 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)
.
The default value is true
.
Parameter | Type | Description |
---|---|---|
enable |
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.
Parameter | Type | Description |
---|---|---|
nodeOrLink | Object | Node or link instance which is part of the graph model. |
fixed | Boolean | Indicates whether the object should remain fixed or not. |
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.
Parameter | Type | Description |
---|---|---|
uptodate |
Sets the graph model to be laid out.
You should not call this method. Instead, use the method
ibm_ilog.graphlayout.GraphLayout.attach()
.
Parameter | Type | Description |
---|---|---|
graphModel |
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
.
Parameter | Type | Description |
---|---|---|
enable |
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.
Parameter | Type | Description |
---|---|---|
layout | ibm_ilog.graphlayout.GraphLayout | The layout instance to set, or 'null' to return to the default layout instance. |
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()
.
Parameter | Type | Description |
---|---|---|
enable | Boolean | Set to 'true' to enable the connected component layout mechanism, or 'false' to disable. |
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
.
Parameter | Type | Description |
---|---|---|
rect | Rectangle | The rectangle for the layout region, or 'null'. |
Parameter | Type | Description |
---|---|---|
value |
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.
Parameter | Type | Description |
---|---|---|
report | ibm_ilog.graphlayout.GraphLayoutReport | New layout report. |
Sets whether layout is running. The method is part of IBM ILOG Dojo Diagrammer internals. You should not use it.
Parameter | Type | Description |
---|---|---|
running | Boolean | Whether layout is running or not. |
fromParents | Boolean | Whether this is a notification from a parent layout or from this layout instance. |
Parameter | Type | Description |
---|---|---|
value |
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.
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.
Parameter | Type | Description |
---|---|---|
linkConnectionBoxInterface |
Sets the style of the shape of the links.
Valid values are
BasicLinkStyleLayout.STRAIGHT_LINE_STYLE
(the links are given
a straight-line shape) and
BasicLinkStyleLayout.NO_RESHAPE_STYLE
(no reshape is
performed on the links).
This feature can be useful if the graph contains links that have
intermediate points and are not straight-line links, for instance,
ilog.diagrammer.model.DiagrammerLink
links with
intermediate points.
The default value is
BasicLinkStyleLayout.STRAIGHT_LINE_STYLE
.
Parameter | Type | Description |
---|---|---|
style | int | The link style value. |
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
.
Parameter | Type | Description |
---|---|---|
size | Number | The maximum spline curve size |
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).
Parameter | Type | Description |
---|---|---|
time |
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
.
Parameter | Type | Description |
---|---|---|
size | Number | The minimum spline curve size |
Sets the maximum spread width between multiple links between the same pair of nodes.
If the multilink mode is
BasicLinkStyleLayout.STRAIGHT_LINE_BUNDLE
or
BasicLinkStyleLayout.NARROW_STRAIGHT_LINE_BUNDLE
, the
multiple straight line links are shifted relative to each other to
avoid overlaps. If the multilink mode is
BasicLinkStyleLayout.CONNECTED_ONE_BEND_BUNDLE
or
BasicLinkStyleLayout.FREE_ONE_BEND_BUNDLE
, bends are added to
the multiple links to avoid that those links overlap. The straight
links, or the multilink bends, respectively, are shifted relative to
each other by the multilink offset unless the number of links times
the offset exceeds the max spread value. In that case, the offset is
limited by the max spread value. If the multilink mode is
BasicLinkStyleLayout.NARROW_STRAIGHT_LINE_BUNDLE
, the offset
is further limited by the node size. If the multilink mode is
BasicLinkStyleLayout.NO_BUNDLE
, the maximum spread width has
no effect.
This maximum spread width affects only links that are no self-links.
See BasicLinkStyleLayout.setMultiSelfLinkMaxSpread()
for the same parameter at self-links.
The default maximum spread value is 50
.
Parameter | Type | Description |
---|---|---|
maxSpread | Number | The maximum spread value. |
Sets the mode how multiple links between the same pair of nodes are laid out. Valid values are:
-
BasicLinkStyleLayout.NO_BUNDLE
- no bundling. Multiple links between the same pair of nodes are not spread out and will overlap. -
BasicLinkStyleLayout.STRAIGHT_LINE_BUNDLE
- straight line bundling. Multiple links between the same pair of nodes are routed as straight lines but shifted relative to each other to avoid overlaps. Different to the narrow mode, the shift offset is not limited by the node size. -
BasicLinkStyleLayout.NARROW_STRAIGHT_LINE_BUNDLE
- narrow straight line bundling (the default). Multiple links between the same pair of nodes are routed as straight lines but shifted relative to each other to avoid overlaps. The bundle may appear more narrow since the shift offset is limited by the size of the end nodes. -
BasicLinkStyleLayout.CONNECTED_ONE_BEND_BUNDLE
- one bend polyline bundling with connection. Multiple links between the same pair of nodes are routed with one bend to avoid overlaps. All links of the bundle are connected to the node and start at the same point and end at the same point. -
BasicLinkStyleLayout.FREE_ONE_BEND_BUNDLE
- one bend polyline bundling without enforced connection. Multiple links between the same pair of nodes are routed with one bend to avoid overlaps. The link connection point is not enforced, that is, the node and link are free to decide themselves where to place the connection point. There is no guarantee that all links of the bundle start or end at a common point.
BasicLinkStyleLayout.NO_RESHAPE_STYLE
.
Parameter | Type | Description |
---|---|---|
mode | int | The multilink mode value. |
Sets the offset between multiple links between the same pair of
nodes.
If the multilink mode is
BasicLinkStyleLayout.STRAIGHT_LINE_BUNDLE
or
BasicLinkStyleLayout.NARROW_STRAIGHT_LINE_BUNDLE
, it is the
offset between the the multiple straight line links. If the
multilink mode is
BasicLinkStyleLayout.CONNECTED_ONE_BEND_BUNDLE
or
BasicLinkStyleLayout.FREE_ONE_BEND_BUNDLE
, it is the offset
between the bends that are added to the multiple links to avoid that
those links overlap. If the multilink mode is
BasicLinkStyleLayout.NO_BUNDLE
, the offset has no effect.
The straight links, or the multilink bends, respectively, are
shifted relative to each other by the multilink offset unless the
number of links times the offset exceeds the max spread value. In
that case, the offset is limited by the max spread value. If the
multilink mode is
BasicLinkStyleLayout.NARROW_STRAIGHT_LINE_BUNDLE
, the offset
is further limited by the node size.
This offset affects only links that are no self-links. See
BasicLinkStyleLayout.setMultiSelfLinkOffset()
for the same
parameter at self-links.
The default value is 10
.
Parameter | Type | Description |
---|---|---|
offset | Number | The offset value. |
Sets the distribution of bundles of multiple self-links (that is, multiple links that start and end at the same node). Self-link bundles form essentially nested rectangles or circles. There is a reference point at the node border and this reference point is either in the middle of the bundle, or at the outermost circle or at the innermost cicle. Valid values are:
-
BasicLinkStyleLayout.CENTERED
- centered (default). The middle of a bundle of multiple self-links is attached at the reference points for self-links. The nested circles are equally spread out towards the inner nesting and towards the outer nesting. -
BasicLinkStyleLayout.OUTER
- towards outer nestings. The innermost self-link of a bundle of multiple self-links is attached at the reference points for self-links and the remaining self-links are distributed towards the outer of the nestings. -
BasicLinkStyleLayout.INNER
- towards inner nestings. The outermost self-link of a bundle of multiple self-links is attached at the reference points for self-links and the remaining self-links are distributed towards the inner of the nestings.
BasicLinkStyleLayout.NO_RESHAPE_STYLE
and the
self-link mode is not BasicLinkStyleLayout.NO_BENDS
.
Parameter | Type | Description |
---|---|---|
distribution | int | The distribution mode for multiple self-links. |
Sets the maximum spread width between multiple self-links (that is, multiple links that start and end at the same node).
If the self-link mode is not
BasicLinkStyleLayout.NO_BENDS
, bends are added to self-links.
If there are multiple self-links at the same node, the bends are
shifted relative to each other by the multiple self-link offset
unless the number of self-links times the offset exceeds the max
spread value. In that case, the offset is limited by the max spread
value. If the self-link mode is
BasicLinkStyleLayout.NARROW_CONNECTED_RECTANGULAR
,
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
,
BasicLinkStyleLayout.NARROW_FREE_RECTANGULAR
, or
BasicLinkStyleLayout.NARROW_FREE_SQUARE
, the offset is
further limited by the node size. If the self-link mode is
BasicLinkStyleLayout.NO_BENDS
, the maximum spread width has
no effect.
This maximum spread width affects only self-links, no other
multilinks. See
BasicLinkStyleLayout.setMultiLinkMaxSpread()
for the same
parameter at other multilinks.
The default maximum spread value is 50
.
Parameter | Type | Description |
---|---|---|
maxSpread | Number | The maximum spread value. |
Sets the offset between multiple self-links (that is, multiple links that start and end at the same node).
If the self-link mode is not
BasicLinkStyleLayout.NO_BENDS
, bends are added to self-links.
If there are multiple self-links at the same node, the bends are
shifted relative to each other by the multiple self-link offset
unless the number of self-links times the offset exceeds the
multiple self-link max spread value. In that case, the offset is
limited by the max spread value. If the self-link mode is
BasicLinkStyleLayout.NARROW_CONNECTED_RECTANGULAR
,
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
,
BasicLinkStyleLayout.NARROW_FREE_RECTANGULAR
, or
BasicLinkStyleLayout.NARROW_FREE_SQUARE
, the offset is
further limited by the node size. If the self-link mode is
BasicLinkStyleLayout.NO_BENDS
, the offset has no effect.
This offset affects only self-links, no other multilinks. See
BasicLinkStyleLayout.setMultiLinkOffset()
for the same
parameter at other multilinks.
The default value is 10
.
Parameter | Type | Description |
---|---|---|
offset | Number | The offset value. |
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.
Parameter | Type | Description |
---|---|---|
graphModel | ibm_ilog.graphlayout.AbstractGraphLayoutModel | The graph model used for storing the parameter. |
nodeOrLink | Object | The node or link for which the parameter is to be set. |
key | String | The key string for the parameter. |
value | Object | The new value of the parameter. |
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
.
Parameter | Type | Description |
---|---|---|
key | String | The key string for the parameter. |
value | Object | The new value of the parameter. |
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.
Parameter | Type | Description |
---|---|---|
uptodate |
Sets the parent layout of this layout instance. You should not call this method directly.
Parameter | Type | Description |
---|---|---|
parent |
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.
Parameter | Type | Description |
---|---|---|
option |
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.
Parameter | Type | Description |
---|---|---|
option |
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.
Parameter | Type | Description |
---|---|---|
seed |
Sets the absolute attach position at the node border for self-links
(that is, links that start and end at the same node).
The x value of the position specifies a point at the top or bottom
border of the node, and the y value of the position specifies a
point at the left or right border of the node. The absolute attach
position is expressed as absolute coordinate units. Self-links occur
at a corner of the node, and the relative position is specified with
respect to this corner. For instance, if the self-link occurs at the
bottom right corner, the attach position (10, 20)
specifies that the self-link goes from 10 units away from the corner
at the bottom side (that is, x = node.x + node.width -
10
) to 20 units away from the corner at the right side (that
is, y = node.y + node.height - 20
).
If the self-link mode is
BasicLinkStyleLayout.CONNECTED_SQUARE
,
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
,
BasicLinkStyleLayout.FREE_SQUARE
, or
BasicLinkStyleLayout.NARROW_FREE_SQUARE
, then the attach
position is only respected at one side and calculate on the other
side to form a square.
The real attach position is the sum of the relative attach position
The real attach position is the sum of the relative attach position and the absolute attach position.
The default value of the absolute attach position is (0,
0)
.
Parameter | Type | Description |
---|---|---|
position | Point | The absolute attach position for self-links. |
Sets which corners are allowed to have self-links (that is, links
that start and end at the same node).
The default value is BasicLinkStyleLayout.ALL_CORNERS
,
that is, a combination of all the possible values:
-
BasicLinkStyleLayout.TOP_LEFT
: top left corner. -
BasicLinkStyleLayout.TOP_RIGHT
: top right corner. -
BasicLinkStyleLayout.BOTTOM_RIGHT
: bottom right corner. -
BasicLinkStyleLayout.BOTTOM_LEFT
: bottom left corner.
Parameter | Type | Description |
---|---|---|
corners | int | A bitwise-Or combination of the following values: BasicLinkStyleLayout.TOP_LEFT: top left corner; BasicLinkStyleLayout.TOP_RIGHT: top right corner; BasicLinkStyleLayout.BOTTOM_RIGHT: bottom right corner; BasicLinkStyleLayout.BOTTOM_LEFT: bottom left corner; or the value BasicLinkStyleLayout.ALL_CORNERS. |
Sets whether self-links (that is, links that start and end at the
same node) connect towards the node center.
This is disabled by default. It has only an effect for the self-link
modes BasicLinkStyleLayout.CONNECTED_RECTANGULAR
,
BasicLinkStyleLayout.NARROW_CONNECTED_RECTANGULAR
,
BasicLinkStyleLayout.CONNECTED_SQUARE
, or
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
. If disabled,
the self-link segments incident to the node border are orthogonal to
the node border. If enabled, the self-link segments are rotated to
point towards the node center.
Parameter | Type | Description |
---|---|---|
enable | Boolean | Whether the option is enabled. |
Sets the mode how self-links (that is, links that start and end at the same node) are laid out. Valid values are:
-
BasicLinkStyleLayout.NO_BENDS
- no reshape. Self-links are not reshaped with bends and may not be visible after layout. -
BasicLinkStyleLayout.CONNECTED_RECTANGULAR
- rectangular self-links with 3 bends and connection. Self-links are reshaped with 3 bends placed in orthogonal style so that the link segments approximately resemble three quarters of a rectangle (the fourth quarter being the node where the self-link is attached). The connection points are placed on the border of the node. -
BasicLinkStyleLayout.FREE_RECTANGULAR
- rectangular self-links with 3 bends without enforced connection. Self-links are reshaped with 3 bends placed at the same position likeBasicLinkStyleLayout.CONNECTED_RECTANGULAR
. However, the link connection points are not enforced, that is, the nodes and links are free to decide themselves where to place the connection point. Since the connection point is not enforced, the link segments in free rectangular mode may not be orthogonal. -
BasicLinkStyleLayout.CONNECTED_SQUARE
- square self-links with 3 bends and connection. Self-links are reshaped with 3 bends placed in orthogonal style so that the link segments approximately resemble three quarters of a square (the fourth quarter being the node where the self-link is attached). If the self-link is a spline link, the square shape might be more appropriate than a rectangular shape since the spline then may approximately resemble three quarters of a circle. The connection points are placed on the border of the node. -
BasicLinkStyleLayout.FREE_SQUARE
- square self-links with 3 bends without enforced connection. Self-links are reshaped with 3 bends placed at the same position likeBasicLinkStyleLayout.CONNECTED_SQUARE
. If the self-link is a spline link, the square shape might be more appropriate than a rectangular shape since the spline then may approximately resemble three quarters of a circle. However, the link connection points are not enforced, that is, the nodes and links are free to decide themselves where to place the connection point. Since the connection point is not enforced, the link segments in free rectangular mode may not be orthogonal. -
BasicLinkStyleLayout.NARROW_CONNECTED_RECTANGULAR
- narrow rectangular self-links with 3 bends and connection (default). Self-links are reshaped with 3 bends placed in orthogonal style so that the link segments approximately resemble three quarters of a rectangle (the fourth quarter being the node where the self-link is attached). The connection points are placed on the border of the node. For single self-links, this mode has the same effect likeBasicLinkStyleLayout.CONNECTED_RECTANGULAR
. If you have multiple self-links at the same node, the self-links are shifted by an offset to avoid overlaps. In this case, this mode differs fromBasicLinkStyleLayout.CONNECTED_RECTANGULAR
, as the self-link bundle may appear more narrow since the shift offset of the multiple self-links is limited by the size of the end node. -
BasicLinkStyleLayout.NARROW_FREE_RECTANGULAR
- narrow rectangular self-links with 3 bends without enforced connection. Self-links are reshaped with 3 bends placed at the same position likeBasicLinkStyleLayout.NARROW_CONNECTED_RECTANGULAR
. For single self-links, this mode has the same effect likeBasicLinkStyleLayout.FREE_RECTANGULAR
. If you have multiple self-links at the same node, the self-links are shifted by an offset to avoid overlaps. In this case, this mode differs fromBasicLinkStyleLayout.FREE_RECTANGULAR
, as the self-link bundle may appear more narrow since the shift offset of the multiple self-links is limited by the size of the end node. The link connection points are not enforced, that is, the nodes and links are free to decide themselves where to place the connection point. Since the connection point is not enforced, the link segments in free rectangular mode may not be orthogonal. -
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
- narrow square self-links with 3 bends and connection. Self-links are reshaped with 3 bends placed in orthogonal style so that the link segments approximately resemble three quarters of a square (the fourth quarter being the node where the self-link is attached). If the self-link is a spline link, the square shape might be more appropriate than a rectangular shape since the spline then may approximately resemble three quarters of a circle. The connection points are placed on the border of the node. For single self-links, this mode has the same effect likeBasicLinkStyleLayout.CONNECTED_SQUARE
. If you have multiple self-links at the same node, the self-links are shifted by an offset to avoid overlaps. In this case, this mode differs fromBasicLinkStyleLayout.CONNECTED_SQUARE
, as the self-link bundle may appear more narrow since the shift offset of the multiple self-links is limited by the size of the end node. -
BasicLinkStyleLayout.NARROW_FREE_SQUARE
- narrow square self-links with 3 bends without enforced connection. Self-links are reshaped with 3 bends placed at the same position likeBasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
. If the self-link is a spline link, the square shape might be more appropriate than a rectangular shape since the spline then may approximately resemble three quarters of a circle. For single self-links, this mode has the same effect likeBasicLinkStyleLayout.FREE_SQUARE
. If you have multiple self-links at the same node, the self-links are shifted by an offset to avoid overlaps. In this case, this mode differs fromBasicLinkStyleLayout.FREE_SQUARE
, as the self-link bundle may appear more narrow since the shift offset of the multiple self-links is limited by the size of the end node. The link connection points are not enforced, that is, the nodes and links are free to decide themselves where to place the connection point. Since the connection point is not enforced, the link segments in free square mode may not be orthogonal.
BasicLinkStyleLayout.NO_RESHAPE_STYLE
.
Parameter | Type | Description |
---|---|---|
mode | int | The mode for self-links. |
Sets the orientation of self-links (that is, links that start and end at the same node). Valid values are:
-
BasicLinkStyleLayout.CLOCK_WISE
- clockwise (default). -
BasicLinkStyleLayout.COUNTER_CLOCK_WISE
- counterclockwise. -
BasicLinkStyleLayout.HORIZONTAL_TO_VERTICAL
- horizontal to vertical. Self-links start at the left or right side of the node with a horizontal segment and end at the top or bottom side of the node with a vertical segment. -
BasicLinkStyleLayout.VERTICAL_TO_HORIZONTAL
- vertical to horizontal. Self-links start at the top or bottom side of the node with a vertical segment and end at the left or right side of the node with a horizontal segment.
BasicLinkStyleLayout.NO_RESHAPE_STYLE
and the self-link mode
is not BasicLinkStyleLayout.NO_BENDS
.
Parameter | Type | Description |
---|---|---|
orientation | int | The orientation mode for self-links. |
Sets the relative attach position at the node border for self-links
(that is, links that start and end at the same node).
The x value of the position specifies a point at the top or bottom
border of the node, and the y value of the position specifies a
point at the left or right border of the node. The relative attach
position is expressed as a fraction of the width and height of the
node bounding box. Self-links occur at a corner of the node, and the
relative position is specified with respect to this corner. For
instance, the attach position (0.5, 0.1)
specifies the
middle of the top or bottom side and a point that is one tenth of
the node height away from the corner of the self-link at the left or
right side. If the self-link occurs at the bottom right corner, it
goes from the middle of the bottom side, to a point at the right
side that is 10% away from that corner. The attach position
(0.0, 0.0)
specifies exactly the corresponding corner.
The attach position (1.0, 1.0)
specified the, in each
direction, opposite corners, that is, if the self-link occurs at the
bottom right corner, it goes from the bottom left corner to the top
right corner. Such extreme values are perhaps not useful; they are
mentioned only to illustrate the meaning of the relative position.
The coordinate range for useful values is approximately between 0.1
and 0.5 for the relative position.
If the self-link mode is
BasicLinkStyleLayout.CONNECTED_SQUARE
,
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
,
BasicLinkStyleLayout.FREE_SQUARE
, or
BasicLinkStyleLayout.NARROW_FREE_SQUARE
, then the attach
position is only respected at one side and calculate on the other
side to form a square.
The real attach position is the sum of the relative attach position and the absolute attach position.
The default value of the relative attach position is (0.5,
0.5)
.
Parameter | Type | Description |
---|---|---|
position | Point | The relative attach position for self-links. |
Sets the minimal spacing between node border and self-links (that
is, links that start and end at the same node).
If the self-link mode is
BasicLinkStyleLayout.NO_BENDS
, the offset has no effect.
If the spacing is negative, the spacing is calculated automatically.
This is in particular useful for the self-link modes
BasicLinkStyleLayout.CONNECTED_SQUARE
and
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
in combination
with spline links, to form approximate circle shapes for the
self-links.
The default value is 5
.
Parameter | Type | Description |
---|---|---|
spacing | Number | The spacing value. |
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.
Parameter | Type | Description |
---|---|---|
filter |
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.
Parameter | Type | Description |
---|---|---|
flag | Boolean | Set to 'true' to enable the optimization of spline control points. |
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.
Parameter | Type | Description |
---|---|---|
uptodate |
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.
Parameter | Type | Description |
---|---|---|
option |
Stops the running layout algorithm as soon as possible.
This method only sets the flag
ibm_ilog.graphlayout.GraphLayout.isStoppedImmediately()
to
true
; it is the responsibility of the implementation of
the method ibm_ilog.graphlayout.GraphLayout.layout()
to react in an appropriate way. Layout algorithms that support the
immediate stop feature should check the flag
ibm_ilog.graphlayout.GraphLayout.isStoppedImmediately()
from
time to time and react when this flag changes to true
.
Layout algorithms that are stopped in this way set the result code
of the layout report to
GraphLayoutReport.STOPPED_AND_VALID
or
GraphLayoutReport.STOPPED_AND_INVALID
.
Indicates that this layout class can stop the layout computation
when the user-defined allowed time is exceeded.
The result code in the layout report is
ibm_ilog.graphlayout.GraphLayoutReport.STOPPED_AND_INVALID
in
this case. Subclasses may return a different result code if the
method BasicLinkStyleLayout.getLayoutCodeOnInterrupt()
is overridden.
Indicates that this layout class can cut the attached graph into
connected components, apply itself to each connected component
separately, and then use the layout instance returned by the method
ibm_ilog.graphlayout.GraphLayout.getLayoutOfConnectedComponents()
to position the connected components.
By default, this layout is an instance of
ibm_ilog.graphlayout.grid.GridLayout
which can be customized
as needed.
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.
Indicates that this layout class can use a link connection box interface to calculate the end points of a link. The link connection box interface is an object that provides the rectangle to which the links are connected for each node and the tangential shift offset at each side for the connection points.
The connection box interface is only used if the link style is
straight line. It is used when the option
"connect links to node centers" (see
BasicLinkStyleLayout.isConnectLinksToNodeCenters()
) is
enabled. It is used for multilink bundles unless the multilink mode
is BasicLinkStyleLayout.NO_BUNDLE
or
BasicLinkStyleLayout.FREE_ONE_BEND_BUNDLE
. It is used for
self-links if the self-link mode is
BasicLinkStyleLayout.CONNECTED_RECTANGULAR
,
BasicLinkStyleLayout.NARROW_CONNECTED_RECTANGULAR
,
BasicLinkStyleLayout.CONNECTED_SQUARE
, or
BasicLinkStyleLayout.NARROW_CONNECTED_SQUARE
. In all other
cases, the layout algorithms does not actively place the end points
of links, hence it is not used.
When the connection box interface is used, the layout algorithm
calculates the virtual center of the end nodes of each link by the
link connection box interface and routes the links relative to those
centers. The virtual center is defined as the center of the
connection box shifted by the average of the tangential "top" and
"bottom" offsets in the horizontal direction, and by the average of
the tangential "left" and "right" offsets 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)
.
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.
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.
Indicates that this layout class allows the user to specify fixed
nodes.
Fixed nodes are not positioned during the layout if the method
ibm_ilog.graphlayout.GraphLayout.setPreserveFixedLinks()
is
called with a true
argument. The base class
BasicLinkStyleLayout
does not move any nodes anyway, hence
specifying nodes as fixed is not necessary. All subclasses of this
class however move nodes, and specifying nodes as fixed for a
subclass can be useful.
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.
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.
Indicates that this layout class can interrupt the current run of
the layout immediately in a controlled way.
The result code in the layout report is
ibm_ilog.graphlayout.GraphLayoutReport.STOPPED_AND_INVALID
in
this case. Subclasses may return a different result code if the
method BasicLinkStyleLayout.getLayoutCodeOnInterrupt()
is overridden.
Returns a printable string containing the fully qualified class name
and the identifier returned by the method getInstanceId()
.
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.
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
This method can be called by the layout classes when a step (or iteration) of the layout algorithm has been performed.
Parameter | Type | Description |
---|---|---|
layoutStarted | ||
layoutFinished |
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.
Parameter | Type | Description |
---|---|---|
nodeOrLink | Object | Node or link instance for which a parameter has been changed. |
parameterName | String | Name of the parameter whose value has been changed. |
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.
Parameter | Type | Description |
---|---|---|
parameterName | String | Name of the parameter whose value has been changed. |
Parameter | Type | Description |
---|---|---|
nodeOrLink | ||
parameterName |