public class IlvTopologicalMeshLayout
extends ilog.views.graphlayout.basic.IlvBasicLinkStyleLayout
The Topological Mesh Layout algorithm can be used to lay out cyclic
graphs, both planar and nonplanar. Most of the time, if the graph is
topologically symmetric, TML produces a symmetric drawing. The layout
algorithm places the nodes of a cycle of the graph on a circle and the
remaining nodes inside this circle. The size of the enclosing circle
depends on the layout region settings (see #setLayoutRegion
).
For an optimal layout quality, the layout region needs to be large
enough to have enough place for the nodes.
Sample drawings produced by the Topological Mesh Layout algorithm:
See the corresponding chapter of the User's Manual for details on the algorithm, the types of graphs for which this algorithm can be used, the features and limitations, code samples, parameters, and so on.
Note that the initial position of the nodes (at the moment you start
the layout) does not affect the resulting layout. However, nodes
specified as fixed are not moved if you call the method #setPreserveFixedNodes
with a true
argument.
CSS example:
SDM {
GraphLayout : true;
}
GraphLayout {
graphLayout : @#layout;
// optional settings for the graph layout renderer
}
Subobject#layout {
class : "ilog.views.graphlayout.topologicalmesh.IlvTopologicalMeshLayout";
allowedNodesPlacementTime : "3";
allowedNumberOfNodesPlacementIterations : "2";
allowedNumberOfOptimizationIterations : "2";
allowedOptimizationTime : "3";
coordinatesMode : "MANAGER_COORDINATES";
layoutOfConnectedComponentsEnabled : "false";
minBusyTime : "3";
nodesMoveThreshold : "3.0";
nodesPlacementAlgorithm : "SLOW_GOOD";
}
CSS specification of per-node and per-link layout parameters:
The following table lists the per-object rendering properties of the GraphLayout
renderer:
Property | Type | Default | Description |
---|---|---|---|
GraphLayout | IlvGraphLayout | null | Lets you define a different graph layout algorithm for each subgraph. If one is not specified, the same algorithm is applied recursively to all subgraphs. |
LayoutFixed | String | false | Deprecated, replaced by Fixed. |
Fixed | String | false | Lets you specify that the node or link must not be moved or reshaped by the layout algorithm. |
LayoutGroup | String | null | Lets you apply the algorithm to different groups of objects, one group after the other. |
LayoutIgnored | boolean | false | If true , the object is ignored by the layout. |
The per-node and per-link layout parameters are specified in the style sheet through the CSS rules for nodes and links, not through the CSS rule for graph layout. For instance:
link.tag {
LinkStyle : "ORTHOGONAL_STYLE";
}
Note that the names of the node and link layout parameters use an initial capital, unlike the regular properties. See also the documentation of the class IlvGraphLayoutRenderer.
Modifier and Type | Property and Description |
---|---|
long |
allowedNodesPlacementTime
Sets the allowed maximum time (in milliseconds) for the topological optimization step of the layout. |
int |
allowedNumberOfNodesPlacementIterations
Sets the maximum number of iterations of the drawing algorithm. |
int |
allowedNumberOfOptimizationIterations
Sets the maximum number of iterations of the topological optimization algorithm. |
long |
allowedOptimizationTime
Sets the allowed maximum time (in milliseconds) for the topological optimization step of the layout. |
java.lang.String |
class
Default constructor. |
int |
coordinatesMode
Sets the coordinates mode to be used during layout. |
boolean |
layoutOfConnectedComponentsEnabled
Sets whether the generic connected component layout mechanism is enabled. |
long |
minBusyTime
Sets the minimal time that the layout algorithm can be busy. |
double |
nodesMoveThreshold
Sets the convergence criteria of the node placement algorithm (the second step of the layout algorithm). |
int |
nodesPlacementAlgorithm
Sets the choice of the node placement algorithm (the second step of the layout algorithm). |
connectLinksToNodeCenters, linkStyle, multiLinkMaxSpread, multiLinkMode, multiLinkOffset, multiSelfLinkDistribution, multiSelfLinkMaxSpread, multiSelfLinkOffset, selfLinkAbsoluteAttachPosition, selfLinkAllowedCorners, selfLinkConnectToNodeCenter, selfLinkMode, selfLinkOrientation, selfLinkRelativeAttachPosition, selfLinkSpacing
public java.lang.String class
class : "ilog.views.graphlayout.topologicalmesh.IlvTopologicalMeshLayout";
public long allowedNodesPlacementTime
allowedNodesPlacementTime : "3";
public int allowedNumberOfNodesPlacementIterations
allowedNumberOfNodesPlacementIterations : "2";
public int allowedNumberOfOptimizationIterations
allowedNumberOfOptimizationIterations : "2";
public long allowedOptimizationTime
allowedOptimizationTime : "3";
public int coordinatesMode
Valid values are:
ilog.views.graphlayout.IlvGraphLayout#MANAGER_COORDINATES
- The
geometry of the graph is computed using the coordinate space of the
manager (that is, the attached IlvGrapher
) without applying
any transformation.
This mode should be used if you visualize the graph at zoom level 1, or you do not visualize it at all, or the graph contains only fully zoomable objects. In all these cases there is no need to take the transformer into account during the layout.
Note that in this mode the dimensional parameters of the layout algorithms are considered as being specified in manager coordinates.
ilog.views.graphlayout.IlvGraphLayout#VIEW_COORDINATES
-
The geometry of the graph is computed in the coordinate space of the
manager view. More exactly, all the coordinates are transformed using
the current reference transformer.
This mode should be used if you want the dimensional parameters of the layout algorithms to be considered as being specified in manager view coordinates.
ilog.views.graphlayout.IlvGraphLayout#INVERSE_VIEW_COORDINATES
- The
geometry of the graph is computed using the coordinate space of the
manager view and then applying the inverse transformation. This mode
is equivalent to the "manager coordinates" mode if the geometry of
the graphic objects strictly obeys the transformer. (A small
difference may exist because of the limited precision of the
computations.)
On the contrary, if some graphic objects are either nonzoomable (see
IlvGraphic#zoomable
) or semizoomable (for example, links with
a maximum line width), this mode gives different results than the
manager coordinates mode. These results are optimal if the graph is
visualized using the same transformer as the one taken into account
during the layout.
Note that in this mode the dimensional parameters of the layout algorithms are considered as being specified in manager coordinates.
The default value is IlvGraphLayout#INVERSE_VIEW_COORDINATES
.
This option is useful only if the attached graph model is an IlvGrapherAdapter
(or a subclass). Otherwise, it has no effect.
Note: the coordinates mode of the layout is used only while this
layout is running. If layout is not running, operations on the
grapher adapter use the coordinates mode that was set on the grapher
adapter directly (see IlvGrapherAdapter#setCoordinatesMode
).
coordinatesMode : "MANAGER_COORDINATES";
Allowed values: |
MANAGER_COORDINATES |
VIEW_COORDINATES |
INVERSE_VIEW_COORDINATES |
public boolean layoutOfConnectedComponentsEnabled
#supportsLayoutOfConnectedComponents()
), the method
#performLayout(boolean, boolean, boolean)
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 #getLayoutOfConnectedComponents()
.
Notice that the connected component layout is not used if the graph is connected.
A RuntimeException
is thrown if the layout does not
support this mechanism.
The default value is the value returned by the method #isLayoutOfConnectedComponentsEnabledByDefault()
.
CSS example:
layoutOfConnectedComponentsEnabled : "false";
public long minBusyTime
#layoutStepPerformed()
when the
method #callLayoutStepPerformedIfNeeded()
is used.
The objective is to avoid the overhead of #layoutStepPerformed()
becoming too high if the method is called too
often. Internal routines of layout algorithms usually call #callLayoutStepPerformedIfNeeded()
, which calls #layoutStepPerformed()
if the time since the last call was at least
the minimal busy time.
The default value is 50 (milliseconds).
minBusyTime : "3";
public double nodesMoveThreshold
threshold
.
The default value is 1
.
The value of the argument is in the same coordinate space as the
nodes and links of the graph. When laying out an IlvGrapher
,
the value is in manager coordinates (without transformation into view
coordinates). If it is necessary to provide a given value in the
coordinate space of a particular IlvManagerView
, the value in
manager coordinates can be computed using the following code:
IlvTransformer t = view.getTransformer(); double zoomFactor = transformer != null ? transformer.zoomFactor() : 1; double managerValue = viewValue / zoomFactor;CSS example:
nodesMoveThreshold : "3.0";
public int nodesPlacementAlgorithm
#SLOW_GOOD
The first node placement algorithm (the default), which provides more
uniformity of the node distribution inside the exterior cycle, but is
slightly slower. #QUICK_BAD
The second node placement
algorithm, which provides less uniformity of the node distribution
inside the exterior cycle, but is slightly quicker.
nodesPlacementAlgorithm : "SLOW_GOOD";
Allowed values: | ||
SLOW_GOOD |
Slow | |
QUICK_BAD |
Quick |
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.