|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.graphlayout.IlvGraphLayout
ilog.views.graphlayout.circular.IlvCircularLayout
public class IlvCircularLayout
The main class for the Circular Layout algorithm.
The Circular Layout algorithm displays graphs representing interconnected ring and/or star network topologies. The algorithm takes into account the size of the nodes and tries to avoid overlapping nodes.
Here are sample drawings produced by the Circular Layout algorithm:


For the layout algorithm to work, you must provide information about the topology of the network, that is about how the network should be divided into interconnected clusters.
The layout algorithm provides two clustering modes: clustering by
cluster identifiers explicitly provided for each node and clustering
by subgraphs (see setClusteringMode(int)):
For each node of the graph, you must specify the cluster (that is,
either the ring or the star) to which it belongs.
Note that a node can belong to more than one cluster. To do this, you
can use the methods
setClusterId(Object, IlvClusterId) and
addClusterId(Object, IlvClusterId).
The class IlvClusterId is the abstract base class that is used
as the identifier for the clusters. You can use one of its subclasses
provided in ILOG JViews (IlvClusterName and IlvClusterNumber)
or write your own subclass.
In addition, for each cluster (ring or star), you can specify the order
of the nodes along the cluster (with the exception of the central node for
star clusters). To do this, you must use the methods
setClusterId(Object, IlvClusterId, int) and
addClusterId(Object, IlvClusterId, int), where the last
argument is an integer index value associated with the node and the cluster.
If the index values are provided, the layout algorithm places the nodes
on the cluster in the order specified by the indexes.
Note that in this mode 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
IlvGraphLayout.setPreserveFixedNodes(boolean) with a true argument.
In this mode, the algorithm handles a nested graph including intergraph links. It arranges the nodes of each subgraph on a circle, so that the number of link crossings is small. It respects the intergraph links and rotates the cluster so that the number of link crossings is small.
It assumes that all nodes are nearly square, all nodes are in subgraphs, but the subgraph nesting is only 1. Nodes that are inside subgraphs of subgraphs are not anymore handles.
Note that in this mode each subgraph keeps its initial position. The subgraphs can be placed either by a different layout algorithm, or interactively.
The following figure illustrates the dimensional parameters of the layout algorithm (clustering by cluster identifiers).

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.
| Field Summary | |
|---|---|
static int |
BY_CLUSTER_IDS
Clustering by cluster IDs mode. |
static int |
BY_SUBGRAPHS
Clustering by subgraphs mode. |
static int |
NO_INDEX
This value is returned by the method getIndex when a node
has no index value with respect to a given cluster. |
static int |
NO_RESHAPE_STYLE
No links reshape option. |
static int |
STRAIGHT_LINE_STYLE
Straight-line links shape option. |
| Fields inherited from class ilog.views.graphlayout.IlvGraphLayout |
|---|
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES |
| Constructor Summary | |
|---|---|
IlvCircularLayout()
Creates a new instance of the Circular Layout algorithm. |
|
IlvCircularLayout(IlvCircularLayout source)
Creates a new layout instance by copying an existing one. |
|
| Method Summary | |
|---|---|
void |
addClusterId(Object node,
IlvClusterId id)
Allows you to add a cluster identifier id to the list
of cluster identifiers to which node belongs. |
void |
addClusterId(Object node,
IlvClusterId id,
int index)
Allows you to add a cluster identifier id to the list
of cluster identifiers to which node belongs. |
int |
checkAppropriateLink(Object link)
Checks whether the input link is appropriate for this layout. |
protected boolean |
clusterize()
Clusters the graph. |
IlvGraphLayout |
copy()
Copies the layout instance. |
void |
copyParameters(IlvGraphLayout source)
Copies the parameters from a given layout instance. |
protected IlvGraphLayoutGrapherProperty |
createLayoutGrapherProperty(String name,
boolean withDefaults)
Returns a new instance of IlvCircularLayoutGrapherProperty
that stores the parameter settings of this layout class. |
protected IlvGraphLayoutNodeProperty |
createLayoutNodeProperty(String name,
IlvGraphic node,
boolean withDefaults)
Returns a new instance of IlvCircularLayoutNodeProperty
that stores the parameter settings of this layout class for nodes. |
void |
detach()
Detaches the graph model from the layout instance. |
IlvPoint |
getClusterCenter(int clusterIndex)
Returns the center of the cluster of index clusterIndex. |
Vector |
getClusterIds()
Returns the identifiers of all clusters (rings and/or stars) that are detected in the graph. |
Enumeration |
getClusterIds(Object node)
Returns an enumeration of the cluster identifiers for the clusters to which node belongs. |
int |
getClusterIdsCount(Object node)
Returns the number of cluster identifiers to which node
belongs. |
int |
getClusteringMode()
Returns the current clustering mode. |
Vector |
getClusterNodes(int clusterIndex)
Returns the nodes that are contained in the cluster of index clusterIndex. |
float |
getClusterRadius(int clusterIndex)
Returns the radius of the cluster of index clusterIndex. |
float |
getDisconnectedGraphOffset()
Returns the offset between disconnected groups of clusters (rings and/or stars). |
int |
getIndex(Object node,
IlvClusterId clusterId)
Returns the index of node with respect to its order on
the cluster that is identified by clusterId. |
float |
getLevelOffset()
Returns the level offset value. |
int |
getLinkStyle()
Returns the current option for the style of the shape of the links. |
int |
getMaxNumberOfPermutations()
Returns the maximal number of permutations tested for a cluster of more than 7 nodes. |
IlvGraphicVector |
getMovingNodes()
Returns the vector of nodes being moved by the graph layout algorithm. |
float |
getOffset()
Returns the offset value. |
IlvClusterId[] |
getRootClusterIds()
Returns the cluster identifiers (instances of IlvClusterId) of the root clusters, as specified using
the method setRootClusterId. |
protected void |
init()
Initializes instance variables. |
boolean |
isAreaMinimizationEnabled()
Returns the option for total area minimization. |
boolean |
isStarCenter(Object node)
Returns true if node is the central node of a
star cluster, and false otherwise. |
protected void |
layout(boolean redraw)
Computes the layout using the Circular Layout algorithm. |
void |
removeAllClusterIds(Object node)
Removes node from all clusters to which it belongs. |
void |
removeAllRootClusterIds()
Allows you to reset all the root cluster settings. |
void |
removeClusterId(Object node,
IlvClusterId id)
Removes node from the cluster id. |
void |
removeRootClusterId(IlvClusterId clusterId)
Allows you to specify that a cluster is no longer the root of the connected component of the graph of clusters to which it belongs. |
void |
setAreaMinimizationEnabled(boolean option)
Enables or disables the total area minimization option. |
void |
setClusterId(Object node,
IlvClusterId id)
Allows you to specify that node belongs to a unique cluster
of a given identifier id. |
void |
setClusterId(Object node,
IlvClusterId id,
int index)
Allows you to specify that node belongs to a unique cluster
of a given identifier id and is associated with the
integer value index. |
void |
setClusteringMode(int mode)
Sets the clustering mode. |
void |
setDisconnectedGraphOffset(float offset)
Sets the offset between disconnected groups of clusters (rings and/or stars). |
void |
setLevelOffset(float offset)
Sets the offset between two concentric levels. |
void |
setLinkStyle(int style)
Sets the style of the shape of the links. |
void |
setMaxNumberOfPermutations(int n)
Sets the maximal number of permutations tested for a cluster of more than 7 nodes. |
void |
setOffset(float offset)
Sets the offset value. |
void |
setRootClusterId(IlvClusterId clusterId)
Allows you to specify a root cluster for the connected component of the graph of clusters to which it belongs. |
void |
setRootClusterIds(IlvClusterId[] clusterIds)
Allows you to specify the root cluster for each connected component of the graph of clusters. |
void |
setStarCenter(Object node,
boolean starCenter)
Allows you to specify whether node is the central node of
a star cluster. |
void |
setStructureUpToDate(boolean uptodate)
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. |
boolean |
supportsLayoutOfConnectedComponents()
Indicates that this layout class can cut the attached graph into connected components, apply itself to each connected component separately, and use the layout instance returned by the method IlvGraphLayout.getLayoutOfConnectedComponents() to position the connected
components. |
boolean |
supportsLayoutRegion()
Indicates that this layout class takes into account a user-defined region (a rectangle) or a user-defined manager view to compute the dimensions of the drawing. |
boolean |
supportsLinkClipping()
Indicates that this layout class can use a link clip interface to clip the end points of a link. |
boolean |
supportsLinkConnectionBox()
Indicates that this layout class can use a link connection box interface to calculate the end points of a link. |
boolean |
supportsPreserveFixedNodes()
Indicates that this layout class allows the user to specify fixed nodes. |
boolean |
supportsSaveParametersToNamedProperties()
Indicates that this layout class can transfer the layout parameters to named properties. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STRAIGHT_LINE_STYLE
setLinkStyle(int), the links are given a straight-line shape.
public static final int NO_RESHAPE_STYLE
setLinkStyle(int), the links are not reshaped.
public static final int NO_INDEX
getIndex when a node
has no index value with respect to a given cluster.
getIndex(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
Constant Field Valuespublic static final int BY_CLUSTER_IDS
setClusteringMode(int),
the graph is divided into clusters on the basis of the IlvClusterId
objects provided for each node.
addClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
setClusteringMode(int),
Constant Field Valuespublic static final int BY_SUBGRAPHS
When used as the argument of the method setClusteringMode(int),
the graph is divided into clusters on the basis of the structure of
the nested graph. (For details, see setClusteringMode(int).)
setClusteringMode(int),
Constant Field Values| Constructor Detail |
|---|
public IlvCircularLayout()
attach(IlvGrapher).
attach(IlvGraphModel).
performLayout.
IlvGraphLayout.attach(ilog.views.IlvGrapher),
IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel),
IlvGraphLayout.performLayout(),
IlvGrapherAdapter.addLayer(ilog.views.IlvManagerLayer),
IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)public IlvCircularLayout(IlvCircularLayout source)
copy() method.
Any subclass should provide a copy constructor.
The parameters of the source layout are copied using
the method copyParameters(ilog.views.graphlayout.IlvGraphLayout).
source - The layout instance that is copied.copy(),
copyParameters(ilog.views.graphlayout.IlvGraphLayout)| Method Detail |
|---|
public void copyParameters(IlvGraphLayout source)
Note that the parameters which are specific to a node or a link are not copied. The other parameters, including the link clip and link connection box 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.
copyParameters in class IlvGraphLayoutsource - The layout instance from which the parameters are copied.protected void init()
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.
init in class IlvGraphLayoutpublic IlvGraphLayout copy()
This method copies the layout instance by calling the copy constructor.
When performing a recursive layout of a nested graph,
IlvLayoutProvider uses this method to
"clone" the layout instance of a parent graph.
Note that the parameters specific to a node or link are not copied. The other parameters, including the layout region specification and he link clip and link connection box interfaces, are also copied.
If a method of the type supportsXXX is associated with a
parameter, the parameter is copied only if the corresponding method
returns true.
copy in class IlvGraphLayoutpublic void detach()
IlvGraphLayout.attach(ilog.views.IlvGrapher).
The detach method performs cleaning operations on the
graph model.
In addition to the cleaning operations in the base class, the
Circular Layout algorithm removes the cluster ID and the star center
attribute from the nodes.
Note that you must call this method when you no longer need the layout instance. Otherwise, some objects may not be garbage collected.
detach in class IlvGraphLayoutIlvGraphLayout.attach(ilog.views.IlvGrapher),
setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId)
protected void layout(boolean redraw)
throws IlvGraphLayoutException
IlvGraphLayout.performLayout().
Note that if the attached graph model is an IlvGrapherAdapter
and clustering information was not provided (using the method
setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId) or addClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
clustering information eventually stored in IlvClusterInfoProperty)
is automatically read.
layout in class IlvGraphLayoutredraw - If true, the attached graph model will be asked
to redraw the graph after layout.
When the layout algorithm moves the nodes and reshapes the links, it is
required to pass the value of the redraw argument to the
methods IlvGraphModel.moveNode(java.lang.Object, float, float, boolean) and
IlvGraphModel.reshapeLink(java.lang.Object, ilog.views.IlvPoint, ilog.views.IlvPoint[], int, int, ilog.views.IlvPoint, boolean).
IlvGraphLayoutException - when no cluster (ring or star) was
found, that is, if cluster information is not available.
Also, the subclass IlvInappropriateLinkException
can be thrown when laying out an IlvGrapher containing
links that cannot be reshaped to a straight line.IlvGraphLayout.performLayout(),
IlvGraphLayout.getCalcLayoutRegion()public void setRootClusterId(IlvClusterId clusterId)
If a root cluster is not specified for a connected component of the graph of clusters, an arbitrary cluster is used.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
clusterId - The cluster identifier of the root cluster.getRootClusterIds(),
removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId),
removeAllRootClusterIds()public void removeRootClusterId(IlvClusterId clusterId)
If a root cluster is not specified for a connected component of the graph of clusters, an arbitrary cluster is used.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
clusterId - The cluster identifier.setRootClusterId(ilog.views.graphlayout.circular.IlvClusterId),
getRootClusterIds(),
removeAllRootClusterIds()public void removeAllRootClusterIds()
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
getRootClusterIds(),
removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId),
setRootClusterId(ilog.views.graphlayout.circular.IlvClusterId)public void setRootClusterIds(IlvClusterId[] clusterIds)
If a root cluster is not specified for a connected component of the graph of clusters, an arbitrary cluster is used.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
clusterIds - The cluster identifiers of the root clusters.getRootClusterIds(),
removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId),
removeAllRootClusterIds()public IlvClusterId[] getRootClusterIds()
IlvClusterId) of the root clusters, as specified using
the method setRootClusterId.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
This method returns null if no root clusters have been
specified. In this case, arbitrary root clusters will be used for each
connected component of the graph of clusters.
setRootClusterId(ilog.views.graphlayout.circular.IlvClusterId),
removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId),
removeAllRootClusterIds()public void setStructureUpToDate(boolean uptodate)
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.
setStructureUpToDate in class IlvGraphLayoutIlvGraphLayout.isStructureUpToDate(),
IlvGraphLayout.isLayoutNeeded()protected boolean clusterize()
setClusterId and addClusterId.
false if no clusters were detected,
true otherwise.setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
addClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId)
public final void setStarCenter(Object node,
boolean starCenter)
node is the central node of
a star cluster.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
setStarCenter(IlvGraphic, boolean).isStarCenter(java.lang.Object)public boolean isStarCenter(Object node)
true if node is the central node of a
star cluster, and false otherwise.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.isStarCenter(IlvGraphic).setStarCenter(java.lang.Object, boolean)
public final void setClusterId(Object node,
IlvClusterId id)
node belongs to a unique cluster
of a given identifier id.
IlvClusterId for each node.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.id - The cluster ID.
IllegalArgumentException - if node is not (or is no
longer) a node of the attached grapher.setClusterId(IlvGraphic, IlvClusterId).getClusterIds()
public final void setClusterId(Object node,
IlvClusterId id,
int index)
node belongs to a unique cluster
of a given identifier id and is associated with the
integer value index. (The index is used by the layout
algorithm to determine the ordering of the nodes on the cluster.)
Note that index must not be negative. The values of the
indexes for consecutive nodes in a cluster are not necessarily consecutive.
Only the order of the values is important.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.id - The cluster ID.index - The index.
IllegalArgumentException - if node is not (or is no
longer) a node of the attached grapher.setClusterId(IlvGraphic, IlvClusterId, int).getClusterIds()
public final void addClusterId(Object node,
IlvClusterId id)
id to the list
of cluster identifiers to which node belongs.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.id - The cluster ID.
IllegalArgumentException - if node is not (or is no
longer) a node of the attached grapher.addClusterId(IlvGraphic, IlvClusterId).getClusterIds()
public final void addClusterId(Object node,
IlvClusterId id,
int index)
id to the list
of cluster identifiers to which node belongs. It also adds the
associated integer value index (to be used by the layout
algorithm to determine the order of the nodes on the cluster).
Note that index must not be negative. The values of the
indexes for consecutive nodes in a cluster are not necessarily consecutive.
Only the order of the values is important.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.id - The cluster ID.index - The index.
IllegalArgumentException - if node is not (or is no
longer) a node of the attached grapher.addClusterId(IlvGraphic, IlvClusterId, int).getClusterIds()
public final void removeClusterId(Object node,
IlvClusterId id)
node from the cluster id.
IlvClusterId as you used when you called
setClusterId or addClusterId.
You can use another instance if the instances are equal with respect to the
method IlvClusterId.equals.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.id - The cluster ID.removeClusterId(IlvGraphic, IlvClusterId).getClusterIds()public final void removeAllClusterIds(Object node)
node from all clusters to which it belongs.
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.removeAllClusterIds(IlvGraphic).getClusterIds()public Vector getClusterIds()
IlvClusterId or subclasses.
It returns null if there are no cluster identifiers.
This method should be used only if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
public float getClusterRadius(int clusterIndex)
clusterIndex.
The index corresponds to the index of elements in the vector returned
by the method getClusterIds. Therefore, valid values of
clusterIndex range from
zero to the number of clusters minus one (that is, the size of the vector
returned by the method getClusterIds() minus one).
Note that the returned value may not be correct if the nodes of the cluster have been moved since the layout was performed.
This method should be used only if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
clusterIndex - The cluster index.getClusterIds()public IlvPoint getClusterCenter(int clusterIndex)
clusterIndex.
The index corresponds to the index of elements in the vector returned
by the method getClusterIds. Therefore, valid values of
clusterIndex range from
zero to the number of clusters minus one (that is, the size of the vector
returned by the method getClusterIds() minus one).
Note that the returned value will not be correct if the nodes of the cluster have been moved since the layout was performed.
This method should be used only if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
getClusterIds()public Vector getClusterNodes(int clusterIndex)
clusterIndex.
This index corresponds to the index of elements in the vector returned
by the method getClusterIds. Therefore, valid values of
clusterIndex range from
zero to the number of clusters minus one (that is, the size of the vector
returned by the method getClusterIds() minus one).
This method should be used only if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
clusterIndex - The cluster index.getClusterIds()public Enumeration getClusterIds(Object node)
node belongs. The elements of the enumeration are instances
of IlvClusterId or subclasses.
This method should be used only if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.getClusterIds(IlvGraphic).setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
addClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
removeClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId)public int getClusterIdsCount(Object node)
node
belongs.
This method should be used only if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.getClusterIdsCount(IlvGraphic).getClusterIds(java.lang.Object)
public int getIndex(Object node,
IlvClusterId clusterId)
node with respect to its order on
the cluster that is identified by clusterId.
It returns NO_INDEX if node has no index
on the cluster.
This method should be used only if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
node - The node.clusterId - The cluster ID.
IllegalArgumentException - if node is not contained
in the cluster identified by clusterId.getIndex(IlvGraphic, IlvClusterId).setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
addClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId),
removeClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId)public final void setClusteringMode(int mode)
BY_CLUSTER_IDS -
The information needed for dividing the graph into clusters is
provided using IlvClusterId objects.
For each node of the graph, you must specify the cluster (that is,
either the ring or the star) to which it belongs.
Note that a node can belong to more than one cluster. To do this, you
can use the methods
setClusterId(Object, IlvClusterId) and
addClusterId(Object, IlvClusterId).
The class IlvClusterId is the abstract base class that is used
as the identifier for the clusters. You can use one of its subclasses
provided in ILOG JViews (IlvClusterName and IlvClusterNumber)
or write your own subclass.
In addition, for each cluster (ring or star), you can specify the order
of the nodes along the cluster (with the exception of the central node for
star clusters). To do this, you must use the methods
setClusterId(Object, IlvClusterId, int) and
addClusterId(Object, IlvClusterId, int), where the last
argument is an integer index value associated with the node and the cluster.
If the index values are provided, the layout algorithm places the nodes
on the cluster in the order specified by the indexes.
The position of the clusters is computed using a radial tree-like algorithm.
Note that in this mode 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
IlvGraphLayout.setPreserveFixedNodes(boolean) with a true argument.
BY_SUBGRAPHS -
The information needed for dividing the graph into clusters is
provided by placing the nodes and links into subgraphs.
In this mode, the algorithm handles a nested graph including intergraph links. It arranges the nodes of each subgraph on a circle, so that the number of link crossings is small. It respects the intergraph links and rotates the cluster so that the number of link crossings is small.
It assumes that all nodes are nearly square, all nodes are in subgraphs, but the subgraph nesting is only 1. Nodes that are inside subgraphs of subgraphs are not anymore handles.
Note that in this mode each subgraph keeps its initial position. The subgraphs can be placed either by a different layout algorithm, or interactively.
The default value is BY_CLUSTER_IDS.
getClusteringMode()public final int getClusteringMode()
setClusteringMode(int)public final void setMaxNumberOfPermutations(int n)
This parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_SUBGRAPHS.
The algorithm generates permutations of node orderings along the cluster circle and chooses the one with the best crossing and rotation behavior according to some quality criteria. Since the number of permutations is exponential, it is feasible to test all permutations only if there are no more than 7 nodes. Otherwise, the algorithm randomly generates some permutations and chooses the best one. The more permutations are chosen, the better the layout result.
getMaxNumberOfPermutations()public final int getMaxNumberOfPermutations()
This parameter is used only if the clustering mode
(see setClusteringMode(int)) is BY_SUBGRAPHS.
setMaxNumberOfPermutations(int)public final boolean supportsPreserveFixedNodes()
setPreserveFixedNodes(boolean) is called with a
true argument.
Note that, with clustering mode BY_CLUSTER_IDS, fixed nodes are
ignored by the Circular layout, which may lead to node overlaps.
The effect is very similar to the effect when the node is filtered during
layout.
supportsPreserveFixedNodes in class IlvGraphLayouttrue.IlvGraphLayout.setPreserveFixedNodes(boolean),
IlvGraphLayout.isPreserveFixedNodes()public boolean supportsLayoutOfConnectedComponents()
IlvGraphLayout.getLayoutOfConnectedComponents() to position the connected
components. By default, this layout is an instance of
IlvGridLayout
that can be customized as needed.
supportsLayoutOfConnectedComponents in class IlvGraphLayouttrue.IlvGraphLayout.getLayoutOfConnectedComponents(),
IlvGraphLayout.isLayoutOfConnectedComponentsEnabled(),
IlvGraphLayout.performLayout(boolean, boolean)public final boolean supportsLayoutRegion()
However, it is not possible to allow the user to control the size of the layout by specifying a bounding box for the drawing. The layout algorithm determines the size so that it has enough space to avoid overlapping nodes and clusters.
The layout region setting (which is either your own or the default setting) is used only to determine the position of the center of the drawing. That means that only the center of the layout region is taken into consideration when performing the layout.
Note that this parameter is only used if the clustering mode
(see setClusteringMode(int)) is BY_CLUSTER_IDS.
supportsLayoutRegion in class IlvGraphLayouttrue.IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView),
IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView, ilog.views.IlvRect),
IlvGraphLayout.setLayoutRegion(ilog.views.IlvRect),
IlvGraphLayout.getSpecLayoutRegion(),
IlvGraphLayout.getCalcLayoutRegion()public final boolean supportsLinkConnectionBox()
The connection box interface is used only if link clipping is enabled
by setting a link clip interface, and if the link style is straight
line. In this case, the layout algorithm calculates the virtual center
of the end nodes of each link by the link connection box interface and
obtains the final connection points by clipping with the link clip
interface.
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).
If no link clipping is performed, the layout algorithm does not actively place the end points of links. It relies on the link connectors that are attached to the nodes to find appropriate connection points for the links.
supportsLinkConnectionBox in class IlvGraphLayouttrue.IlvGraphLayout.setLinkConnectionBoxInterface(ilog.views.graphlayout.IlvLinkConnectionBoxInterface),
IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface),
IlvLinkConnector,
setLinkStyle(int),
supportsLinkClipping()public final boolean supportsLinkClipping()
Link clipping is performed only if the link style is straight line. If no link clip interface is given, the layout algorithm does not actively place the end points of links. It relies on the link connectors that are attached to the nodes to find appropriate connection points for the links.
supportsLinkClipping in class IlvGraphLayouttrue.IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface),
IlvLinkConnector,
setLinkStyle(int),
supportsLinkConnectionBox()public final boolean supportsSaveParametersToNamedProperties()
.ivl file.