ilog.views.graphlayout.circular
Class IlvCircularLayout

java.lang.Object
  extended by ilog.views.graphlayout.IlvGraphLayout
      extended by ilog.views.graphlayout.circular.IlvCircularLayout
All Implemented Interfaces:
GraphModelListener, Serializable, EventListener

public class IlvCircularLayout
extends IlvGraphLayout

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

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.

See Also:
Serialized Form

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 ilog.views.graphlayout.IlvGraphLayout
addGraphLayoutEventListener, addGraphLayoutParameterEventListener, afterLayoutOfSubgraph, attach, attach, beforeLayout, beforeLayoutOfSubgraph, callLayoutStepPerformedIfNeeded, checkAppropriateLinks, cleanGraphModel, cleanLink, cleanNode, clipAllLinks, clipLink, contentsChanged, createLayoutLinkProperty, createLayoutReport, getAllowedTime, getAutoLayoutHandler, getBalanceSplineCurveThreshold, getCalcLayoutRegion, getCoordinatesMode, getGrapher, getGraphModel, getInstanceId, getLayout, getLayoutOfConnectedComponents, getLayoutOfConnectedComponentsReport, getLayoutRegion, getLayoutReport, getLayouts, getLinkClipInterface, getLinkConnectionBoxInterface, getMaxSplineCurveSize, getMinBusyTime, getMinSplineCurveSize, getParentLayout, getProperty, getProperty, getRecursiveLayout, getRemainingAllowedTime, getSeedValueForRandomGenerator, getSpecLayoutRegion, getSplineLinkFilter, increasePercentageComplete, isAnimate, isAutoLayout, isFitToView, isFixed, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutOfConnectedComponentsEnabled, isLayoutOfConnectedComponentsEnabledByDefault, isLayoutRunning, isLayoutTimeElapsed, isMemorySavings, isParametersUpToDate, isPreserveFixedLinks, isPreserveFixedNodes, isSplineRoutingEnabled, isStoppedImmediately, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, performAutoLayout, performLayout, performLayout, performLayout, PerformLayout, performSublayout, removeGraphLayoutEventListener, removeGraphLayoutParameterEventListener, setAllowedTime, setAnimate, setAutoLayout, setAutoLayoutHandler, setBalanceSplineCurveThreshold, setCoordinatesMode, setFixed, setGeometryUpToDate, setGrapher, setGraphModel, setInputCheckEnabled, setLayoutOfConnectedComponents, setLayoutOfConnectedComponentsEnabled, setLayoutRegion, setLayoutRegion, setLayoutRegion, setLayoutReport, setLinkClipInterface, setLinkConnectionBoxInterface, setMaxSplineCurveSize, setMemorySavings, setMinBusyTime, setMinSplineCurveSize, setParametersUpToDate, setParentLayout, setPreserveFixedLinks, setPreserveFixedNodes, setProperty, setProperty, setSeedValueForRandomGenerator, setSplineLinkFilter, setSplineRoutingEnabled, setUseDefaultParameters, setUseSeedValueForRandomGenerator, stopImmediately, supportsAllowedTime, supportsAnimation, supportsMemorySavings, supportsPercentageComplete, supportsPreserveFixedLinks, supportsRandomGenerator, supportsSplineRouting, supportsStopImmediately, unfixAllLinks, unfixAllNodes, useAnimateRedraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRAIGHT_LINE_STYLE

public static final int STRAIGHT_LINE_STYLE
Straight-line links shape option. When used as an argument of the method setLinkStyle(int), the links are given a straight-line shape.

Since:
JViews 3.0
See Also:
Constant Field Values

NO_RESHAPE_STYLE

public static final int NO_RESHAPE_STYLE
No links reshape option. When used as an argument of the method setLinkStyle(int), the links are not reshaped.

Since:
JViews 3.0
See Also:
Constant Field Values

NO_INDEX

public static final int NO_INDEX
This value is returned by the method getIndex when a node has no index value with respect to a given cluster.

See Also:
getIndex(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId), Constant Field Values

BY_CLUSTER_IDS

public static final int BY_CLUSTER_IDS
Clustering by cluster IDs mode. When used as the argument of the method setClusteringMode(int), the graph is divided into clusters on the basis of the IlvClusterId objects provided for each node.

Since:
JViews 5.5
See Also:
addClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId), setClusteringMode(int), Constant Field Values

BY_SUBGRAPHS

public static final int BY_SUBGRAPHS
Clustering by subgraphs mode.

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

Since:
JViews 5.5
See Also:
setClusteringMode(int), Constant Field Values
Constructor Detail

IlvCircularLayout

public IlvCircularLayout()
Creates a new instance of the Circular Layout algorithm.
To indicate the grapher you want to lay out, use the method attach(IlvGrapher).
To indicate the graph model you want to lay out, use the method attach(IlvGraphModel).
To perform the layout, use the method performLayout.
To modify the layout parameters, use the different methods provided in this class and its superclass.

See Also:
IlvGraphLayout.attach(ilog.views.IlvGrapher), IlvGraphLayout.attach(ilog.views.graphlayout.IlvGraphModel), IlvGraphLayout.performLayout(), IlvGrapherAdapter.addLayer(ilog.views.IlvManagerLayer), IlvGrapherAdapter.setFilter(ilog.views.graphlayout.IlvLayoutGraphicFilter)

IlvCircularLayout

public IlvCircularLayout(IlvCircularLayout source)
Creates a new layout instance by copying an existing one. This constructor is used by the 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).

Parameters:
source - The layout instance that is copied.
Since:
JViews 5.0
See Also:
copy(), copyParameters(ilog.views.graphlayout.IlvGraphLayout)
Method Detail

copyParameters

public void copyParameters(IlvGraphLayout source)
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 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.

Overrides:
copyParameters in class IlvGraphLayout
Parameters:
source - The layout instance from which the parameters are copied.
Since:
JViews 5.0

init

protected void init()
Initializes instance variables.

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

Overrides:
init in class IlvGraphLayout
Since:
JViews 5.0

copy

public IlvGraphLayout copy()
Copies the layout instance.

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.

Specified by:
copy in class IlvGraphLayout
Returns:
A copy of the layout instance.
Since:
JViews 5.0

detach

public void detach()
Detaches the graph model from the layout instance. When you attach a new graph model to the layout instance, you do not need to detach the old graph model because this is done automatically when you call 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.

Overrides:
detach in class IlvGraphLayout
See Also:
IlvGraphLayout.attach(ilog.views.IlvGrapher), setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId)

layout

protected void layout(boolean redraw)
               throws IlvGraphLayoutException
Computes the layout using the Circular Layout algorithm. To start the layout, call the method 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.

Specified by:
layout in class IlvGraphLayout
Parameters:
redraw - 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).
Throws:
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.
See Also:
IlvGraphLayout.performLayout(), IlvGraphLayout.getCalcLayoutRegion()

setRootClusterId

public void setRootClusterId(IlvClusterId clusterId)
Allows you to specify a root cluster for the connected component of the graph of clusters to which it belongs.

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.

Parameters:
clusterId - The cluster identifier of the root cluster.
Since:
JViews 3.0
See Also:
getRootClusterIds(), removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId), removeAllRootClusterIds()

removeRootClusterId

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

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.

Parameters:
clusterId - The cluster identifier.
Since:
JViews 3.0
See Also:
setRootClusterId(ilog.views.graphlayout.circular.IlvClusterId), getRootClusterIds(), removeAllRootClusterIds()

removeAllRootClusterIds

public void removeAllRootClusterIds()
Allows you to reset all the root cluster settings. Arbitrary clusters are used as root clusters for each connected component of the graph of clusters.

This parameter is only used if the clustering mode (see setClusteringMode(int)) is BY_CLUSTER_IDS.

Since:
JViews 3.0
See Also:
getRootClusterIds(), removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId), setRootClusterId(ilog.views.graphlayout.circular.IlvClusterId)

setRootClusterIds

public void setRootClusterIds(IlvClusterId[] clusterIds)
Allows you to specify the root cluster for each connected component of the graph of clusters.

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.

Parameters:
clusterIds - The cluster identifiers of the root clusters.
Since:
JViews 6.0
See Also:
getRootClusterIds(), removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId), removeAllRootClusterIds()

getRootClusterIds

public IlvClusterId[] getRootClusterIds()
Returns the cluster identifiers (instances of 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.

Since:
JViews 6.0
See Also:
setRootClusterId(ilog.views.graphlayout.circular.IlvClusterId), removeRootClusterId(ilog.views.graphlayout.circular.IlvClusterId), removeAllRootClusterIds()

setStructureUpToDate

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

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.

Overrides:
setStructureUpToDate in class IlvGraphLayout
See Also:
IlvGraphLayout.isStructureUpToDate(), IlvGraphLayout.isLayoutNeeded()

clusterize

protected boolean clusterize()
Clusters the graph. This method is called by the Circular Layout algorithm to create the internal representation of the clustered graph. The method uses the clustering information provided by the methods setClusterId and addClusterId.

Returns:
false if no clusters were detected, true otherwise.
Since:
JViews 3.0
See Also:
setClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId), addClusterId(java.lang.Object, ilog.views.graphlayout.circular.IlvClusterId)

setStarCenter

public final void setStarCenter(Object node,
                                boolean starCenter)
Allows you to specify whether 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.

Since:
JViews 3.0 This method replaces setStarCenter(IlvGraphic, boolean).
See Also:
isStarCenter(java.lang.Object)

isStarCenter

public boolean isStarCenter(Object node)
Returns 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.

Parameters:
node - The node.
Since:
JViews 3.0 This method replaces isStarCenter(IlvGraphic).
See Also:
setStarCenter(java.lang.Object, boolean)

setClusterId

public final void setClusterId(Object node,
                               IlvClusterId id)
Allows you to specify that node belongs to a unique cluster of a given identifier id.
Note that you must specify a different instance of IlvClusterId for each node.

This parameter is only used if the clustering mode (see setClusteringMode(int)) is BY_CLUSTER_IDS.

Parameters:
node - The node.
id - The cluster ID.
Throws:
IllegalArgumentException - if node is not (or is no longer) a node of the attached grapher.
Since:
JViews 3.0 This method replaces setClusterId(IlvGraphic, IlvClusterId).
See Also:
getClusterIds()

setClusterId

public final 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. (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.

Parameters:
node - The node.
id - The cluster ID.
index - The index.
Throws:
IllegalArgumentException - if node is not (or is no longer) a node of the attached grapher.
Since:
JViews 3.0 This method replaces setClusterId(IlvGraphic, IlvClusterId, int).
See Also:
getClusterIds()

addClusterId

public final void addClusterId(Object node,
                               IlvClusterId id)
Allows you to add a cluster identifier 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.

Parameters:
node - The node.
id - The cluster ID.
Throws:
IllegalArgumentException - if node is not (or is no longer) a node of the attached grapher.
Since:
JViews 3.0 This method replaces addClusterId(IlvGraphic, IlvClusterId).
See Also:
getClusterIds()

addClusterId

public final 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. 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.

Parameters:
node - The node.
id - The cluster ID.
index - The index.
Throws:
IllegalArgumentException - if node is not (or is no longer) a node of the attached grapher.
Since:
JViews 3.0 This method replaces addClusterId(IlvGraphic, IlvClusterId, int).
See Also:
getClusterIds()

removeClusterId

public final void removeClusterId(Object node,
                                  IlvClusterId id)
Removes node from the cluster id.
Note that you do not need to use the same instance of 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.

Parameters:
node - The node.
id - The cluster ID.
Since:
JViews 3.0 This method replaces removeClusterId(IlvGraphic, IlvClusterId).
See Also:
getClusterIds()

removeAllClusterIds

public final void removeAllClusterIds(Object node)
Removes node from all clusters to which it belongs.

This parameter is only used if the clustering mode (see setClusteringMode(int)) is BY_CLUSTER_IDS.

Parameters:
node - The node.
Since:
JViews 3.0 This method replaces removeAllClusterIds(IlvGraphic).
See Also:
getClusterIds()

getClusterIds

public Vector getClusterIds()
Returns the identifiers of all clusters (rings and/or stars) that are detected in the graph. The returned vector contains instances of 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.


getClusterRadius

public float getClusterRadius(int clusterIndex)
Returns the radius of the cluster of index 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.

Parameters:
clusterIndex - The cluster index.
See Also:
getClusterIds()

getClusterCenter

public IlvPoint getClusterCenter(int clusterIndex)
Returns the center of the cluster of index 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.

See Also:
getClusterIds()

getClusterNodes

public Vector getClusterNodes(int clusterIndex)
Returns the nodes that are contained in the cluster of index 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.

Parameters:
clusterIndex - The cluster index.
See Also:
getClusterIds()

getClusterIds

public Enumeration getClusterIds(Object node)
Returns an enumeration of the cluster identifiers for the clusters to which 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.

Parameters:
node - The node.
Since:
JViews 3.0 This method replaces getClusterIds(IlvGraphic).
See Also:
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)

getClusterIdsCount

public int getClusterIdsCount(Object node)
Returns the number of cluster identifiers to which node belongs.

This method should be used only if the clustering mode (see setClusteringMode(int)) is BY_CLUSTER_IDS.

Parameters:
node - The node.
Since:
JViews 3.0 This method replaces getClusterIdsCount(IlvGraphic).
See Also:
getClusterIds(java.lang.Object)

getIndex

public int getIndex(Object node,
                    IlvClusterId clusterId)
Returns the index of 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.

Parameters:
node - The node.
clusterId - The cluster ID.
Throws:
IllegalArgumentException - if node is not contained in the cluster identified by clusterId.
Since:
JViews 3.0 This method replaces getIndex(IlvGraphic, IlvClusterId).
See Also:
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)

setClusteringMode

public final void setClusteringMode(int mode)
Sets the clustering mode. Valid value are:

The default value is BY_CLUSTER_IDS.

Since:
JViews 5.5
See Also:
getClusteringMode()

getClusteringMode

public final int getClusteringMode()
Returns the current clustering mode.

Since:
JViews 5.5
See Also:
setClusteringMode(int)

setMaxNumberOfPermutations

public final void setMaxNumberOfPermutations(int n)
Sets the maximal number of permutations tested for a cluster of more than 7 nodes. For smaller cluster, always all permutations are tested.

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.

Since:
JViews 5.5
See Also:
getMaxNumberOfPermutations()

getMaxNumberOfPermutations

public final int getMaxNumberOfPermutations()
Returns the maximal number of permutations tested for a cluster of more than 7 nodes.

This parameter is used only if the clustering mode (see setClusteringMode(int)) is BY_SUBGRAPHS.

Since:
JViews 5.5
See Also:
setMaxNumberOfPermutations(int)

supportsPreserveFixedNodes

public final boolean supportsPreserveFixedNodes()
Indicates that this layout class allows the user to specify fixed nodes. Fixed nodes are not moved during the layout if the method 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.

Overrides:
supportsPreserveFixedNodes in class IlvGraphLayout
Returns:
Always true.
See Also:
IlvGraphLayout.setPreserveFixedNodes(boolean), IlvGraphLayout.isPreserveFixedNodes()

supportsLayoutOfConnectedComponents

public 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. By default, this layout is an instance of IlvGridLayout that can be customized as needed.

Overrides:
supportsLayoutOfConnectedComponents in class IlvGraphLayout
Returns:
Always true.
Since:
JViews 3.5
See Also:
IlvGraphLayout.getLayoutOfConnectedComponents(), IlvGraphLayout.isLayoutOfConnectedComponentsEnabled(), IlvGraphLayout.performLayout(boolean, boolean)

supportsLayoutRegion

public final 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.

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.

Overrides:
supportsLayoutRegion in class IlvGraphLayout
Returns:
Always true.
See Also:
IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView), IlvGraphLayout.setLayoutRegion(ilog.views.IlvManagerView, ilog.views.IlvRect), IlvGraphLayout.setLayoutRegion(ilog.views.IlvRect), IlvGraphLayout.getSpecLayoutRegion(), IlvGraphLayout.getCalcLayoutRegion()

supportsLinkConnectionBox

public final boolean supportsLinkConnectionBox()
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 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.

Overrides:
supportsLinkConnectionBox in class IlvGraphLayout
Returns:
Always true.
Since:
JViews 5.0
See Also:
IlvGraphLayout.setLinkConnectionBoxInterface(ilog.views.graphlayout.IlvLinkConnectionBoxInterface), IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface), IlvLinkConnector, setLinkStyle(int), supportsLinkClipping()

supportsLinkClipping

public final boolean supportsLinkClipping()
Indicates that this layout class can use a link clip interface to clip the end points of a link. The link clip interface is an object that provides the connection for a link clipped at the border of the shape of the end node. This is useful if the nodes have a nonrectangular shape such as a triangle, rhombus, or circle.

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.

Overrides:
supportsLinkClipping in class IlvGraphLayout
Returns:
Always true.
Since:
JViews 5.0
See Also:
IlvGraphLayout.setLinkClipInterface(ilog.views.graphlayout.IlvLinkClipInterface), IlvLinkConnector, setLinkStyle(int), supportsLinkConnectionBox()

supportsSaveParametersToNamedProperties

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

Overrides: