Search this API

y.layout.organic
Class SmartOrganicLayouter

java.lang.Object
  extended by y.layout.CanonicMultiStageLayouter
      extended by y.layout.organic.SmartOrganicLayouter
All Implemented Interfaces:
Layouter

public class SmartOrganicLayouter
extends CanonicMultiStageLayouter

This layout algorithm arranges graphs in an organic fashion.

Layout Style

The organic layout style is characterized by a natural distribution of nodes that exhibits clusters and symmetric properties of the graph. Nodes are placed space-saving, close to their adjacent nodes. Edges maintain uniform lengths and are routed with straight-line segments without bends.

Organic diagrams are commonly used for visualizing relations in large networks for example in bioinformatics, enterprise networking, visualizing social networks, mesh visualization or system management.


Organic Layout obtained with default settings


Organic Layout exhibiting symmetric properties

Concept

SmartOrganicLayouter uses a force-directed approach to place the nodes of the input graph. According to this approach, the graph is modeled as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged particles with mutually repulsive forces. Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the system reaches a (local) minimum of the sum of the forces.

Features

The ratio between the layout quality and the running time is conveniently adjustable. Another way to decrease the running time is to execute the layout algorithm multi-threaded.

This layout algorithm is able to consider a PartitionGrid structure. However, for common nodes (i.e. non-group nodes) it only considers single partition cells. Furthermore, the layout algorithm will throw a WrongGraphStructure if there is a partition grid and the descendants of a group node are assigned to different partition grid cells or if there are group nodes that are associated with a group node mode other than GROUP_NODE_MODE_NORMAL.

Although overlaps between edges and nodes are avoided, this layout algorithm doesn't guarantee that they won't appear in the resulting layout. To avoid overlaps, it is possible to route the edges afterwards using an edge routing algorithm, e.g., OrganicEdgeRouter.

SmartOrganicLayouter allows restricting the maximum duration which may be a suitable option to reduce the runtime required for large graphs. Note that restricting the maximum duration may result in a lower layout quality. Furthermore, the actual runtime may exceed the maximum duration since the layout algorithm still has to find a valid solution.

The algorithm is also able to detect certain types of substructures in a graph (i.e., chains, stars, cycles and parallel structures) and arrange these structures with special-purpose layout styles. Using substructure styles ensures that the corresponding structures are easily recognized in the graph. For the detection of substructures, it is optionally possible to consider node types, such that only nodes of the same user-defined type can form a substructure.


Organic Layout without applying specific layout styles to substructures


Organic Layout of the same graph applying specific layout styles to the detected substructures

 
Your browser does not support SVG content.

Field Summary
static byte CHAIN_SUBSTRUCTURE_STYLE_NONE
          Substructure style specifier for chains that indicates that the algorithm does not handle such structures in a special way.
static byte CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR
          Substructure style specifier for chains that leads to a compact (rotated) rectangular layout style for chains.
static byte CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR_NESTED
          Substructure style specifier for chains that leads to a compact (rotated) rectangular layout style for chains and where chains may be nested inside parallel substructures.
static byte CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE
          Substructure style specifier for chains that leads to a straight-line layout style for chains.
static byte CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE_NESTED
          Substructure style specifier for chains that leads to a straight-line layout style for chains and where chains may be nested inside parallel substructures.
static byte CLUSTERING_POLICY_EDGE_BETWEENNESS
          A clustering policy that clusters the nodes using edge betweenness centrality.
static byte CLUSTERING_POLICY_LABEL_PROPAGATION
          A clustering policy that clusters the nodes using the label propagation algorithm.
static byte CLUSTERING_POLICY_LOUVAIN_MODULARITY
          A clustering policy that clusters the nodes using the louvain modularity method.
static byte CLUSTERING_POLICY_NONE
          A policy that indicates that no automatic clustering is applied to the input graph.
static byte CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR
          Substructure style specifier for cycle structures that leads to a circular layout style.
static byte CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED
          Substructure style specifier for cycle structures that leads to a circular layout style and where cycles are allowed to be nested inside other substructures.
static byte CYCLE_SUBSTRUCTURE_STYLE_NONE
          Substructure style specifier for cycle structures that indicates that the algorithm does not handle such structures in a special way.
static java.lang.Object EDGE_DIRECTEDNESS_DPKEY
          A DataProvider key for specifying the directedness of edges.
static java.lang.Object GROUP_NODE_MODE_DATA
          A DataProvider key for assigning individual modes for all group nodes The modes specify how a group's content is handled and if it is resized during layout calculation.
static java.lang.Object GROUP_NODE_MODE_FIX_BOUNDS
          A mode constant for placing the group nodes and their content with respect to the original bounds of the group node.
static java.lang.Object GROUP_NODE_MODE_FIX_CONTENTS
          A mode constant for placing group nodes with fixed content.
static java.lang.Object GROUP_NODE_MODE_NORMAL
          A mode constant for placing and resizing the group nodes and their content by the layout algorithm.
static java.lang.Object NODE_INERTIA_DPKEY
          A DataProvider key for specifying the inertia of nodes.
static java.lang.Object NODE_STRESS_DPKEY
          A DataProvider key for specifying the stress of nodes.
static java.lang.Object NODE_SUBSET_DATA
          A DataProvider key for marking the nodes that are part of the relevant subset
static byte PARALLEL_SUBSTRUCTURE_STYLE_NONE
          Substructure style specifier for parallel structures that indicates that the algorithm does not handle such structures in a special way.
static byte PARALLEL_SUBSTRUCTURE_STYLE_RADIAL
          Substructure style specifier for parallel structures that leads to a radial layout style for the inner nodes.
static byte PARALLEL_SUBSTRUCTURE_STYLE_RECTANGULAR
          Substructure style specifier for parallel structures that leads to a (rotated) rectangular layout style for the inner nodes.
static byte PARALLEL_SUBSTRUCTURE_STYLE_STRAIGHT_LINE
          Substructure style specifier for parallel structures that places the inner nodes on a straight-line.
static java.lang.Object PREFERRED_EDGE_LENGTH_DATA
          A DataProvider key for defining an individual preferred length for each edge
static byte SCOPE_ALL
          Scope mode indicating that the algorithm should place all nodes of the graph.
static byte SCOPE_MAINLY_SUBSET
          Scope mode indicating that the algorithm should place a subset of nodes but may to a certain degree also move nodes that are structurally close to a node from the subset.
static byte SCOPE_MAINLY_SUBSET_GEOMETRIC
          Scope mode indicating that the algorithm should place a subset of nodes but may to a certain degree also move nodes that are geometrically close to a node from the subset.
static byte SCOPE_SUBSET
          Scope mode indicating that the algorithm should only place a subset of nodes.
static byte STAR_SUBSTRUCTURE_STYLE_CIRCULAR
          Substructure style specifier for stars that leads to a circular layout style for stars where the root is placed in the middle.
static byte STAR_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED
          Substructure style specifier for stars that leads to a circular layout style for stars where the root is placed in the middle and stars may be nested inside other substructures.
static byte STAR_SUBSTRUCTURE_STYLE_NONE
          Substructure style specifier for stars that indicates that the algorithm does not handle such structures in a special way.
static byte STAR_SUBSTRUCTURE_STYLE_RADIAL
          Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed in the middle.
static byte STAR_SUBSTRUCTURE_STYLE_RADIAL_NESTED
          Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed in the middle and the stars may be nested inside other substructures.
static byte STAR_SUBSTRUCTURE_STYLE_SEPARATED_RADIAL
          Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed on the outside (separated from the nodes with degree one).
static java.lang.Object Z_COORDINATE_DPKEY
          A DataAcceptor key for publishing the z-coordinate for all non-group nodes in the graph.
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SmartOrganicLayouter()
          Creates a new SmartOrganicLayouter instance with default settings.
 
Method Summary
protected  boolean canLayoutCore(LayoutGraph graph)
          Accepts general graphs without exception.
protected  void configureComponentLayouter(LayoutGraph graph, ComponentLayouter layouter)
          Configures the given ComponentLayouter to take fixed nodes in components into account.
 void doLayout(LayoutGraph graph)
          Calculates an organic arrangement of the graph.
protected  void doLayoutCore(LayoutGraph graph)
          Calculates an organic arrangement of the graph.
 double getAutoClusteringQuality()
          Returns the quality measure of the edge betweenness clustering algorithm if it is chosen as clustering policy.
 int getChainSubstructureSize()
          Returns the minimum size (number of nodes) a chain needs to have to be detected and handled as a chain substructure.
 byte getChainSubstructureStyle()
          Returns the style specifier for chain substructures.
 byte getClusteringPolicy()
          Returns the clustering policy that is applied to the input graph and before executing the arrangement algorithm.
 double getCompactness()
          Returns the compactness factor for the layout algorithm.
 int getCycleSubstructureSize()
          Returns the minimum size (number of nodes) a cycle needs to have to be detected and handled as a cycle substructure.
 byte getCycleSubstructureStyle()
          Returns the style specifier for cycle substructures.
 GroupBoundsCalculator getGroupBoundsCalculator()
          Returns the GroupBoundsCalculator instance used for calculating the size of group nodes.
 double getGroupNodeCompactness()
          Specifies the compactness of group nodes.
 long getMaximumDuration()
          Returns the maximum duration in milliseconds that this layout algorithm is allowed to run.
 double getMinimalNodeDistance()
          Returns the minimum node distance that this algorithm should enforce between all pairs of nodes.
 OutputRestriction getOutputRestriction()
          Returns the area restriction for the result of the layout algorithm.
 int getParallelSubstructureSize()
          Returns the minimum size (number of nodes) a parallel structure needs to have to be detected and handled as a parallel substructure.
 byte getParallelSubstructureStyle()
          Returns the style specifier for parallel substructures.
 double getPreferredEdgeLength()
          Returns the default preferred edge length.
 double getPreferredMinimalNodeDistance()
          Returns the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed.
 double getQualityTimeRatio()
          Returns the ratio of layout quality versus running time.
 byte getScope()
          Returns the scope that determines which nodes are placed by this algorithm.
 int getStarSubstructureSize()
          Returns the minimum size (number of nodes including the root) a star needs to have to be detected and handled as a star substructure.
 byte getStarSubstructureStyle()
          Returns the style specifier for star substructures.
 boolean is3DEnabled()
          Returns whether or not the layout algorithm should create a 3D result.
 boolean isAutoClusteringEnabled()
          Deprecated. Use the clustering policy property instead to enable and disable automatic clustering. See the documentation for details.
 boolean isAutomaticGroupNodeCompactionEnabled()
          Specifies whether or not group nodes are compacted automatically.
 boolean isConsiderNodeLabelsEnabled()
          Returns whether or not to reserve space for node labels during layout calculation.
 boolean isDeterministic()
          Returns whether or not the deterministic mode of this algorithm is enabled.
 boolean isMultiThreadingAllowed()
          Returns whether or not the layout algorithm may use multi-threading to reduce the running time.
 boolean isNodeEdgeOverlapAvoided()
          Returns whether or not the layout algorithm tries to avoid node/edge overlaps.
 boolean isNodeOverlapsAllowed()
          Returns whether or not overlaps between nodes are allowed.
 boolean isNodeSizeAware()
          Returns whether or not to consider node sizes during layout calculation.
 boolean isParallelSubstructureTypeSeparationEnabled()
          Returns whether parallel substructures should be separated by the node type.
 boolean isSmartComponentLayoutEnabled()
          Returns whether or not this instance should configure the ComponentLayouter to respect subsets of nodes.
 boolean isStarSubstructureTypeSeparationEnabled()
          Returns whether star substructures should be separated by the node type.
 void set3DEnabled(boolean enabled)
          Specifies whether or not the layout algorithm should create a 3D result.
 void setAutoClusteringEnabled(boolean autoClusteringEnabled)
          Deprecated. Use the clustering policy property instead to enable and disable automatic clustering. See the documentation for details.
 void setAutoClusteringQuality(double autoClusteringQuality)
          Specifies the quality measure of the edge betweenness clustering algorithm if it is chosen as clustering policy.
 void setAutomaticGroupNodeCompactionEnabled(boolean enabled)
          Specifies whether or not group nodes are compacted automatically.
 void setChainSubstructureSize(int chainSubstructureSize)
          Specifies the minimum size (number of nodes) a chain needs to have to be detected and handled as a chain substructure.
 void setChainSubstructureStyle(byte chainSubstructureStyle)
          Sets the style specifier for chain substructures.
 void setClusteringPolicy(byte clusteringPolicy)
          Specifies the clustering policy that is applied to the input graph and before executing the arrangement algorithm.
 void setCompactness(double compactness)
          Specifies the compactness factor for the layout algorithm.
 void setConsiderNodeLabelsEnabled(boolean considerNodeLabelsEnabled)
          Specifies whether or not to reserve space for node labels during layout calculation.
 void setCycleSubstructureSize(int cycleSubstructureSize)
          Specifies the minimum size (number of nodes) a cycle needs to have to be detected and handled as a cycle substructure.
 void setCycleSubstructureStyle(byte cycleSubstructureStyle)
          Sets the style specifier for cycle substructures.
 void setDeterministic(boolean deterministic)
          Specifies whether or not the deterministic mode of this algorithm is enabled.
 void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
          Specifies the GroupBoundsCalculator instance used for calculating the size of group nodes.
 void setGroupNodeCompactness(double groupNodeCompactness)
          Specifies the compactness of group nodes.
 void setMaximumDuration(long maximumDurationMillis)
          Specifies the maximum duration in milliseconds that this layout algorithm is allowed to run.
 void setMinimalNodeDistance(double minimalNodeDistance)
          Specifies the minimum node distance this algorithm should enforce between all pairs of nodes.
 void setMultiThreadingAllowed(boolean multiThreadingAllowed)
          Specifies whether or not the layout algorithm may use multi-threading to reduce the running time.
 void setNodeEdgeOverlapAvoided(boolean nodeEdgeOverlapAvoided)
          Specifies whether or not the layout algorithm tries to avoid node/edge overlaps.
 void setNodeOverlapsAllowed(boolean nodeOverlapsAllowed)
          Specifies whether or not overlaps between nodes are allowed.
 void setNodeSizeAware(boolean nodeSizeAware)
          Specifies whether or not to consider node sizes during layout calculation.
 void setOrientationLayouterEnabled(boolean enabled)
          Specifies whether or not the LayoutStage that modifies the orientation of the layout is activated.
 void setOutputRestriction(OutputRestriction restriction)
          Specifies the area restriction for the result of the layout algorithm.
 void setParallelSubstructureSize(int parallelSubstructureSize)
          Specifies the minimum size (number of nodes) a parallel structure needs to have to be detected and handled as a parallel substructure.
 void setParallelSubstructureStyle(byte parallelSubstructureStyle)
          Sets the style specifier for parallel substructures.
 void setParallelSubstructureTypeSeparationEnabled(boolean parallelSubstructureTypeSeparation)
          Specifies whether parallel substructures should be separated by the node type.
 void setPreferredEdgeLength(double preferredEdgeLength)
          Specifies the default preferred edge length.
 void setPreferredMinimalNodeDistance(double preferredMinimumNodeToEdgeDistance)
          Specifies the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed.
 void setQualityTimeRatio(double qualityTimeRatio)
          Specifies the ratio of layout quality versus running time.
 void setScope(byte scope)
          Sets the scope that determines which nodes are placed by this algorithm.
 void setSmartComponentLayoutEnabled(boolean smartComponentLayoutEnabled)
          Specifies whether or not this instance should configure the ComponentLayouter to respect subsets of nodes.
 void setStarSubstructureSize(int starSubstructureSize)
          Specifies the minimum size (number of nodes including the root) a star needs to have to be detected and handled as a star substructure.
 void setStarSubstructureStyle(byte starSubstructureStyle)
          Sets the style specifier for star substructures.
 void setStarSubstructureTypeSeparationEnabled(boolean starSubstructureTypeSeparation)
          Specifies whether star substructures should be separated by the node type.
protected  void unconfigureComponentLayouter(LayoutGraph graph, ComponentLayouter layouter)
          Disposes of the ComponentLayouter instance.
 
Methods inherited from class y.layout.CanonicMultiStageLayouter
appendStage, calcLayout, calcLayout, canLayout, checkGroupNodeSize, checkNodeSize, doLayout, enableOnlyCore, getComponentLayouter, getGroupNodeHider, getLabelLayouter, getLayoutOrientation, getOrientationLayouter, getParallelEdgeLayouter, getSelfLoopLayouter, getSubgraphLayouter, isComponentLayouterEnabled, isGroupNodeHidingEnabled, isLabelLayouterEnabled, isOrientationLayouterEnabled, isParallelEdgeLayouterEnabled, isSelfLoopLayouterEnabled, isSubgraphLayouterEnabled, prependStage, removeStage, setComponentLayouter, setComponentLayouterEnabled, setGroupNodeHider, setGroupNodeHidingEnabled, setLabelLayouter, setLabelLayouterEnabled, setLayoutOrientation, setOrientationLayouter, setParallelEdgeLayouter, setParallelEdgeLayouterEnabled, setSelfLoopLayouter, setSelfLoopLayouterEnabled, setSubgraphLayouter, setSubgraphLayouterEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDGE_DIRECTEDNESS_DPKEY

public static final java.lang.Object EDGE_DIRECTEDNESS_DPKEY
A DataProvider key for specifying the directedness of edges.

Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this DataProvider allows the user to specify hints on the directedness of edges. More precisely, a value of 1 indicates that the edge should be considered to be directed from source to target, a value of -1 that it is directed from target to source, and a value of 0 means that it is undirected.

Currently, the specified values are only considered during the detection of special substructures, see setChainSubstructureStyle(byte), setCycleSubstructureStyle(byte), setParallelSubstructureStyle(byte) and setStarSubstructureStyle(byte).

 
If no DataProvider is registered with this key, the algorithm assumes that all edges are undirected.

Z_COORDINATE_DPKEY

public static final java.lang.Object Z_COORDINATE_DPKEY
A DataAcceptor key for publishing the z-coordinate for all non-group nodes in the graph.

For each non-group node, the center z-coordinate will be stored in this DataAcceptor after the layout run. This coordinate is only required if property set3DEnabled(boolean) is enabled. Otherwise, the algorithm produces a 2D result.

 
If no DataProvider is registered with this key, the z-coordinate information of the nodes is dropped.
See Also:
set3DEnabled(boolean)

NODE_INERTIA_DPKEY

public static final java.lang.Object NODE_INERTIA_DPKEY
A DataProvider key for specifying the inertia of nodes.

The inertia can be specified for each non-group node if the scope is set to SCOPE_ALL. It is defined to be a value from the interval [0,1].

 
If this DataProvider is registered and there is at least one node with inertia value greater than 0.0, the algorithm considers the initial coordinates of the nodes (similar as for SCOPE_SUBSET).
 
The inertia values are only considered for non-group nodes and if the scope is set to SCOPE_ALL. Furthermore, the specified inertia is not considered for nodes of sub-structures.
See Also:
NODE_STRESS_DPKEY, setScope(byte)

NODE_STRESS_DPKEY

public static final java.lang.Object NODE_STRESS_DPKEY
A DataProvider key for specifying the stress of nodes.

The stress value indicates how far a node will possibly move. The higher the stress of a node is, the farther it may move.

The stress can be specified for each non-group node if the scope is set to SCOPE_ALL. It is defined to be a value from the interval [0,1].

 
If this DataProvider is registered and there is at least one node with stress value less than 1.0, the algorithm considers the initial coordinates of the nodes (similar as for SCOPE_SUBSET).
 
The stress values are only considered for non-group nodes and if the scope is set to SCOPE_ALL. Furthermore, the specified stress is not considered for nodes of sub-structures.
See Also:
NODE_INERTIA_DPKEY, setScope(byte)

CHAIN_SUBSTRUCTURE_STYLE_NONE

public static final byte CHAIN_SUBSTRUCTURE_STYLE_NONE
Substructure style specifier for chains that indicates that the algorithm does not handle such structures in a special way.

See Also:
setChainSubstructureStyle(byte), Constant Field Values
Sample Graph:

No special handling of the chain (marked nodes)

CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR

public static final byte CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR
Substructure style specifier for chains that leads to a compact (rotated) rectangular layout style for chains.

Produces the same layout style as CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR_NESTED, but chains are never nested.

See Also:
setChainSubstructureStyle(byte), Constant Field Values
Sample Graph:

A compact (rotated) rectangular layout style of the chain (marked nodes)

CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR_NESTED

public static final byte CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR_NESTED
Substructure style specifier for chains that leads to a compact (rotated) rectangular layout style for chains and where chains may be nested inside parallel substructures.

Produces the same layout style as CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR, but chains may additionally be nested inside parallel substructures. Nesting can emphasize how different substructures are related but often makes the results less compact.

See Also:
setChainSubstructureStyle(byte), Constant Field Values
Sample Graph:

A compact rectangular chain (marked nodes) nested inside a parallel substructure

CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE

public static final byte CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE
Substructure style specifier for chains that leads to a straight-line layout style for chains.

Produces the same layout style as CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE_NESTED, but chains are never nested.

See Also:
setChainSubstructureStyle(byte), Constant Field Values
Sample Graph:

A straight-line layout style of the chain (marked nodes)

CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE_NESTED

public static final byte CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE_NESTED
Substructure style specifier for chains that leads to a straight-line layout style for chains and where chains may be nested inside parallel substructures.

Produces the same layout style as CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE, but chains may additionally be nested inside parallel substructures. Nesting can emphasize how different substructures are related but often makes the results less compact.

See Also:
setChainSubstructureStyle(byte), Constant Field Values
Sample Graph:

A straight-line chain (marked nodes) nested inside a parallel substructure

STAR_SUBSTRUCTURE_STYLE_NONE

public static final byte STAR_SUBSTRUCTURE_STYLE_NONE
Substructure style specifier for stars that indicates that the algorithm does not handle such structures in a special way.

See Also:
setStarSubstructureStyle(byte), Constant Field Values
Sample Graph:

No special handling of the star (marked nodes)

STAR_SUBSTRUCTURE_STYLE_RADIAL

public static final byte STAR_SUBSTRUCTURE_STYLE_RADIAL
Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed in the middle.

Produces the same layout style as STAR_SUBSTRUCTURE_STYLE_RADIAL_NESTED, but stars are never nested.

See Also:
setStarSubstructureStyle(byte), Constant Field Values
Sample Graph:

A radial layout style of the star (marked nodes) where the root is placed in the middle

STAR_SUBSTRUCTURE_STYLE_RADIAL_NESTED

public static final byte STAR_SUBSTRUCTURE_STYLE_RADIAL_NESTED
Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed in the middle and the stars may be nested inside other substructures.

Produces the same layout style as STAR_SUBSTRUCTURE_STYLE_RADIAL, but stars may additionally be nested inside chain and parallel substructures.

See Also:
setStarSubstructureStyle(byte), Constant Field Values
Sample Graph:

A radial layout style of a star (marked nodes) that is nested inside a straight-line chain substructure

STAR_SUBSTRUCTURE_STYLE_SEPARATED_RADIAL

public static final byte STAR_SUBSTRUCTURE_STYLE_SEPARATED_RADIAL
Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed on the outside (separated from the nodes with degree one).

 
If the edges are grouped at the root node (see PortConstraintKeys.SOURCE_GROUPID_KEY and PortConstraintKeys.TARGET_GROUPID_KEY), the algorithm uses a grouped routing style.
See Also:
setStarSubstructureStyle(byte), Constant Field Values
Sample Graphs:

A radial layout style of the star (marked nodes) where the root is placed outside

A radial layout style with edges grouped at the root

STAR_SUBSTRUCTURE_STYLE_CIRCULAR

public static final byte STAR_SUBSTRUCTURE_STYLE_CIRCULAR
Substructure style specifier for stars that leads to a circular layout style for stars where the root is placed in the middle.

In contrast to the radial layout style, all nodes (except the root) are placed on a single cycle.

Produces the same layout style as STAR_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED, but stars may not be nested.

See Also:
setStarSubstructureStyle(byte), Constant Field Values
Sample Graph:

A circular layout style of the star (marked nodes) where the root is placed in the middle

STAR_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED

public static final byte STAR_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED
Substructure style specifier for stars that leads to a circular layout style for stars where the root is placed in the middle and stars may be nested inside other substructures.

In contrast to the radial layout style, all nodes (except the root) are placed on a single cycle.

Produces the same layout style as STAR_SUBSTRUCTURE_STYLE_CIRCULAR, but stars may additionally be nested inside chain and parallel substructures.

See Also:
setStarSubstructureStyle(byte), Constant Field Values
Sample Graph:

A circular layout style of the star (marked nodes) that is nested inside a straight-line chain substructure

PARALLEL_SUBSTRUCTURE_STYLE_NONE

public static final byte PARALLEL_SUBSTRUCTURE_STYLE_NONE
Substructure style specifier for parallel structures that indicates that the algorithm does not handle such structures in a special way.

See Also:
setParallelSubstructureStyle(byte), Constant Field Values
Sample Graph:

No special handling of the parallel structure

PARALLEL_SUBSTRUCTURE_STYLE_RECTANGULAR

public static final byte PARALLEL_SUBSTRUCTURE_STYLE_RECTANGULAR
Substructure style specifier for parallel structures that leads to a (rotated) rectangular layout style for the inner nodes.

 
If the edges are grouped at the outer nodes (see PortConstraintKeys.SOURCE_GROUPID_KEY and PortConstraintKeys.TARGET_GROUPID_KEY), the algorithm uses a grouped routing style.
See Also:
setParallelSubstructureStyle(byte), Constant Field Values
Sample Graphs:

A (rotated) rectangular layout style of the inner (marked) nodes of the parallel structure

A (rotated) rectangular layout style with edges grouped at the outer nodes

PARALLEL_SUBSTRUCTURE_STYLE_RADIAL

public static final byte PARALLEL_SUBSTRUCTURE_STYLE_RADIAL
Substructure style specifier for parallel structures that leads to a radial layout style for the inner nodes.

 
If the edges are grouped at the outer nodes (see PortConstraintKeys.SOURCE_GROUPID_KEY and PortConstraintKeys.TARGET_GROUPID_KEY), the algorithm uses a grouped routing style.
See Also:
setParallelSubstructureStyle(byte), Constant Field Values
Sample Graphs:

A radial layout style of the inner (marked) nodes of the parallel structure

A radial layout style with edges grouped at the outer nodes

PARALLEL_SUBSTRUCTURE_STYLE_STRAIGHT_LINE

public static final byte PARALLEL_SUBSTRUCTURE_STYLE_STRAIGHT_LINE
Substructure style specifier for parallel structures that places the inner nodes on a straight-line.

 
If the edges are grouped at the outer nodes (see PortConstraintKeys.SOURCE_GROUPID_KEY and PortConstraintKeys.TARGET_GROUPID_KEY), the algorithm uses a grouped routing style.
See Also:
setParallelSubstructureStyle(byte), Constant Field Values
Sample Graphs:

The inner (marked) nodes of the parallel structure are placed on a straight-line

The edges are grouped at the outer nodes

CYCLE_SUBSTRUCTURE_STYLE_NONE

public static final byte CYCLE_SUBSTRUCTURE_STYLE_NONE
Substructure style specifier for cycle structures that indicates that the algorithm does not handle such structures in a special way.

See Also:
setCycleSubstructureStyle(byte), Constant Field Values
Sample Graph:

No special handling of the cycle (marked nodes)

CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR

public static final byte CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR
Substructure style specifier for cycle structures that leads to a circular layout style.

Produces the same layout style as CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED, but cycles may not be nested.

See Also:
setCycleSubstructureStyle(byte), Constant Field Values
Sample Graph:

A circular layout style of the nodes of the cycle (marked nodes)

CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED

public static final byte CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED
Substructure style specifier for cycle structures that leads to a circular layout style and where cycles are allowed to be nested inside other substructures.

Produces the same layout style as CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR, but cycles may additionally be nested inside chains, star and parallel substructures.

See Also:
setCycleSubstructureStyle(byte), Constant Field Values
Sample Graph:

A cycle (marked nodes) nested inside a radial parallel substructure

SCOPE_ALL

public static final byte SCOPE_ALL
Scope mode indicating that the algorithm should place all nodes of the graph.

See Also:
setScope(byte), Constant Field Values
Sample Graphs:

Initial graph

All nodes are placed

SCOPE_SUBSET

public static final byte SCOPE_SUBSET
Scope mode indicating that the algorithm should only place a subset of nodes.

The subset is determined by a boolean value returned by a DataProvider registered with key NODE_SUBSET_DATA. Nodes not being part of the subset will remain at their location.

See Also:
setScope(byte), NODE_SUBSET_DATA, Constant Field Values
Sample Graphs:

Initial graph

Only the selected subset was placed

SCOPE_MAINLY_SUBSET

public static final byte SCOPE_MAINLY_SUBSET
Scope mode indicating that the algorithm should place a subset of nodes but may to a certain degree also move nodes that are structurally close to a node from the subset.

Nodes that don't belong to the actual subset may be moved if they are structurally close to nodes from the subset, but they will keep their relative positions to the other nodes outside the subset.

The actual subset is determined by a boolean value returned by a DataProvider registered with key NODE_SUBSET_DATA.

See Also:
setScope(byte), NODE_SUBSET_DATA, Constant Field Values
Sample Graphs:

Initial graph

The subset and structurally close nodes were placed

SCOPE_MAINLY_SUBSET_GEOMETRIC

public static final byte SCOPE_MAINLY_SUBSET_GEOMETRIC
Scope mode indicating that the algorithm should place a subset of nodes but may to a certain degree also move nodes that are geometrically close to a node from the subset.

Nodes that don't belong to the actual subset may be moved if they are geometrically close to nodes from the subset. To measure the geometric distance, nodes in the subset are internally temporarily moved to a predicted position which is based on the location of their fixed neighbor nodes. Then, the euclidean distance between node\ bounds is calculated and if a node that is not in the subset has a distance smaller than some threshold, it may be moved. The threshold depends on the specified preferred edge length and minimum node distance of the algorithm. Larger values of these properties increase the threshold.

The actual subset is determined by a boolean value returned by a DataProvider registered with key NODE_SUBSET_DATA.

 
The given location of nodes in the subset is not relevant for determining geometric proximity. Nodes are internally moved with respect to their fix neighbor nodes, to a temporary, predicted position.
See Also:
setScope(byte), NODE_SUBSET_DATA, Constant Field Values
Sample Graphs:

Initial graph

The subset and geometrically close nodes were placed

CLUSTERING_POLICY_NONE

public static final byte CLUSTERING_POLICY_NONE
A policy that indicates that no automatic clustering is applied to the input graph.

See Also:
setClusteringPolicy(byte), Constant Field Values

CLUSTERING_POLICY_LOUVAIN_MODULARITY

public static final byte CLUSTERING_POLICY_LOUVAIN_MODULARITY
A clustering policy that clusters the nodes using the louvain modularity method.

The louvain algorithm starts by assigning each node to its own community. Then, it iteratively tries to construct clusters by moving nodes from their current community to another until the modularity is locally optimized.

As a clustering policy, louvain modularity offers a good trade-off between quality and performance.

 
The clustering quality has no effect on this policy.
See Also:
setClusteringPolicy(byte), Groups.louvainModularity(Graph, NodeMap), Constant Field Values

CLUSTERING_POLICY_EDGE_BETWEENNESS

public static final byte CLUSTERING_POLICY_EDGE_BETWEENNESS
A clustering policy that clusters the nodes using edge betweenness centrality.

This clustering can give very good results, but compared to the other policies it likely yields worse performance. To influence the quality and performance of it, the property setAutoClusteringQuality(double) can be adjusted.

See Also:
setClusteringPolicy(byte), setAutoClusteringQuality(double), Groups.edgeBetweennessClustering(Graph, NodeMap, double, int, int, boolean), Constant Field Values

CLUSTERING_POLICY_LABEL_PROPAGATION

public static final byte CLUSTERING_POLICY_LABEL_PROPAGATION
A clustering policy that clusters the nodes using the label propagation algorithm.

This algorithm iteratively assigns a so-called label to each node. The label of a node is set to the most frequent label among its neighbors. If there are multiple candidates the algorithm randomly chooses one of them. In the end, all nodes with the same label belong to the same community.

Compared to the other clustering policies, the label propagation often offers very good performance. However, the results are rather unstable, i.e., small changes in the input may lead to significantly different node clusters. If stable results are important, it is recommended to select another policy.

 
The clustering quality has no effect on this policy.
See Also:
setClusteringPolicy(byte), Groups.labelPropagation(Graph, NodeMap), Constant Field Values

NODE_SUBSET_DATA

public static final java.lang.Object NODE_SUBSET_DATA
A DataProvider key for marking the nodes that are part of the relevant subset

 
The specified subset is only considered if the scope is set to SCOPE_SUBSET or SCOPE_MAINLY_SUBSET.
See Also:
setScope(byte)

GROUP_NODE_MODE_DATA

public static final java.lang.Object GROUP_NODE_MODE_DATA
A DataProvider key for assigning individual modes for all group nodes

The modes specify how a group's content is handled and if it is resized during layout calculation.


GROUP_NODE_MODE_NORMAL

public static final java.lang.Object GROUP_NODE_MODE_NORMAL
A mode constant for placing and resizing the group nodes and their content by the layout algorithm. The size of the group is adjusted to the space that is needed by the placement of its contained nodes.

See Also:
GROUP_NODE_MODE_DATA

GROUP_NODE_MODE_FIX_BOUNDS

public static final java.lang.Object GROUP_NODE_MODE_FIX_BOUNDS
A mode constant for placing the group nodes and their content with respect to the original bounds of the group node. The bounds of the group nodes are treated as fixed and cannot be exceeded by the content of the group nodes.

 
The substructure detection is not applied to the content of groups with fixed bounds.
 
If property setConsiderNodeLabelsEnabled(boolean) is enabled, property setNodeOverlapsAllowed(boolean) is disabled or if there are NodeHalos, the bounds restriction may be violated because the algorithm has to adjust the graph elements such that there are no overlaps.
See Also:
GROUP_NODE_MODE_DATA

GROUP_NODE_MODE_FIX_CONTENTS

public static final java.lang.Object GROUP_NODE_MODE_FIX_CONTENTS
A mode constant for placing group nodes with fixed content. Although these particular group nodes can move like all other ordinary group nodes, their content remains fixed relative to the position of the group node.

 
This implicitly fixes all descendants of the group node.
 
If property setConsiderNodeLabelsEnabled(boolean) is enabled, property setNodeOverlapsAllowed(boolean) is disabled or if there are NodeHalos, the bounds restriction may be violated because the algorithm has to adjust the graph elements such that there are no overlaps.
See Also:
GROUP_NODE_MODE_DATA

PREFERRED_EDGE_LENGTH_DATA

public static final java.lang.Object PREFERRED_EDGE_LENGTH_DATA
A DataProvider key for defining an individual preferred length for each edge

Constructor Detail

SmartOrganicLayouter

public SmartOrganicLayouter()
Creates a new SmartOrganicLayouter instance with default settings.

Method Detail

is3DEnabled

public boolean is3DEnabled()
Returns whether or not the layout algorithm should create a 3D result.

In order to retrieve the z-coordinates, a DataAcceptor with key Z_COORDINATE_DPKEY must be registered with the input graph.

 
For graphs drawn on a plane, disabling this option produces better results.
Returns:
true if the layout algorithm creates a 3D result, false otherwise
See Also:
set3DEnabled(boolean), Z_COORDINATE_DPKEY

set3DEnabled

public void set3DEnabled(boolean enabled)
Specifies whether or not the layout algorithm should create a 3D result.

In order to retrieve the z-coordinates, a DataAcceptor with key Z_COORDINATE_DPKEY must be registered with the input graph.

 
For graphs drawn on a plane, disabling this option produces better results.
Default Value:
The default value is false. The layout algorithm doesn't produce a 3D result.
Parameters:
enabled - true if the layout algorithm should create a 3D result, false otherwise
See Also:
Z_COORDINATE_DPKEY

isMultiThreadingAllowed

public boolean isMultiThreadingAllowed()
Returns whether or not the layout algorithm may use multi-threading to reduce the running time.

Returns:
true if multi-threading is used, false otherwise
See Also:
setMultiThreadingAllowed(boolean)

setMultiThreadingAllowed

public void setMultiThreadingAllowed(boolean multiThreadingAllowed)
Specifies whether or not the layout algorithm may use multi-threading to reduce the running time.

Default Value:
The default value is false. Multi-threading is disabled.
Parameters:
multiThreadingAllowed - true if multi-threading should be used, false otherwise

getGroupNodeCompactness

public double getGroupNodeCompactness()
Specifies the compactness of group nodes.

The compactness ranges from 0 to 1 where 0 results in group nodes not affecting the overall layout too much while 1 forces nodes in the same group to be clustered tightly.

The values need to lie in [0,1].

 
The specified value is only considered if automatic group node compaction is disabled and if there is no PartitionGrid structure.
Returns:
groupNodeCompactness the compactness value for group nodes
See Also:
setGroupNodeCompactness(double), setAutomaticGroupNodeCompactionEnabled(boolean)

setGroupNodeCompactness

public void setGroupNodeCompactness(double groupNodeCompactness)
Specifies the compactness of group nodes.

The compactness ranges from 0 to 1 where 0 results in group nodes not affecting the overall layout too much while 1 forces nodes in the same group to be clustered tightly.

The values need to lie in [0,1].

 
The specified value is only considered if automatic group node compaction is disabled and if there is no PartitionGrid structure.
Default Value:
The default value is 0.4.
Parameters:
groupNodeCompactness - the compactness value for group nodes
Throws:
java.lang.IllegalArgumentException - if specified compactness value is outside the interval [0,1]
See Also:
setAutomaticGroupNodeCompactionEnabled(boolean)
Sample Graphs:

Compactness of group nodes is set to 0.4

Compactness of group nodes is set to 0

Compactness of group nodes is set to 1

isAutomaticGroupNodeCompactionEnabled

public boolean isAutomaticGroupNodeCompactionEnabled()
Specifies whether or not group nodes are compacted automatically.

When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness specified by option setCompactness(double).

 
If this option is enabled, the value specified by option setGroupNodeCompactness(double) is ignored.
Returns:
true if automatic group node compaction is enabled, false otherwise
See Also:
setAutomaticGroupNodeCompactionEnabled(boolean), setGroupNodeCompactness(double), setCompactness(double)

setAutomaticGroupNodeCompactionEnabled

public void setAutomaticGroupNodeCompactionEnabled(boolean enabled)
Specifies whether or not group nodes are compacted automatically.

When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness specified by option setCompactness(double).

 
If this option is enabled, the value specified by option setGroupNodeCompactness(double) is ignored.
Default Value:
The default value is true. Automatic group node compaction is enabled.
Parameters:
enabled - true if automatic group node compaction should be enabled, false otherwise
See Also:
setGroupNodeCompactness(double), setCompactness(double)

isAutoClusteringEnabled

public boolean isAutoClusteringEnabled()
Deprecated. Use the clustering policy property instead to enable and disable automatic clustering. See the documentation for details.

Returns whether or not a clustering algorithm is applied to the input graph.

This property is deprecated! It is replaced by property setClusteringPolicy(byte). To disable the clustering, specify CLUSTERING_POLICY_NONE. To enable it choose one of the available other policies. On enabling, this property will specify CLUSTERING_POLICY_EDGE_BETWEENNESS as the clustering policy. On disabling, CLUSTERING_POLICY_NONE is set.

Returns:
true if a clustering algorithm is used, false otherwise
See Also:
setAutoClusteringEnabled(boolean)

setAutoClusteringEnabled

public void setAutoClusteringEnabled(boolean autoClusteringEnabled)
Deprecated. Use the clustering policy property instead to enable and disable automatic clustering. See the documentation for details.

Specifies whether or not a clustering algorithm is applied to the input graph.

This property is deprecated! It is replaced by property setClusteringPolicy(byte). To disable the clustering, specify CLUSTERING_POLICY_NONE. To enable it choose one of the available other policies. On enabling, this property will specify CLUSTERING_POLICY_EDGE_BETWEENNESS as the clustering policy. On disabling, CLUSTERING_POLICY_NONE is set.

Default Value:
The default value is false. Automatic clustering is disabled.
Parameters:
autoClusteringEnabled - true if a clustering algorithm should be used, false otherwise

getAutoClusteringQuality

public double getAutoClusteringQuality()
Returns the quality measure of the edge betweenness clustering algorithm if it is chosen as clustering policy.

The higher the value, the higher the clustering quality.

The value needs to lie in [0,1].

 

The expected running time of the clustering algorithm increases with the quality measure. The running time does not depend on the specified maximum duration.

 
The clustering quality only has an effect if clustering policy CLUSTERING_POLICY_EDGE_BETWEENNESS is specified.
Returns:
a value from interval [0,1]
See Also:
setAutoClusteringQuality(double), CLUSTERING_POLICY_EDGE_BETWEENNESS, setMaximumDuration(long)

setAutoClusteringQuality

public void setAutoClusteringQuality(double autoClusteringQuality)
Specifies the quality measure of the edge betweenness clustering algorithm if it is chosen as clustering policy.

The higher the value, the higher the clustering quality.

The value needs to lie in [0,1].

 

The expected running time of the clustering algorithm increases with the quality measure. The running time does not depend on the specified maximum duration.

 
The clustering quality only has an effect if clustering policy CLUSTERING_POLICY_EDGE_BETWEENNESS is specified.
Default Value:
The default value is 1.
Parameters:
autoClusteringQuality - a value from the interval [0,1]
Throws:
java.lang.IllegalArgumentException - if the specified quality measure is outside the interval [0,1]
See Also:
CLUSTERING_POLICY_EDGE_BETWEENNESS, setMaximumDuration(long)

getClusteringPolicy

public byte getClusteringPolicy()
Returns the clustering policy that is applied to the input graph and before executing the arrangement algorithm.

By default, no clustering is applied, that is, CLUSTERING_POLICY_NONE is set.

When a policy other than CLUSTERING_POLICY_NONE is specified, the following steps are performed during the layout:

  1. A clustering algorithm is applied to the input graph.
  2. All nodes of the same cluster are put into a newly created group node.
  3. The layout is applied to the modified graph.
  4. Group nodes denoting clusters (inserted during step 2) are removed.
The user can also specify customized clusters by defining appropriate groups.

 
The CLUSTERING_POLICY_LOUVAIN_MODULARITY is the recommended policy for many cases. It offers a good trade-off between performance and quality.
Returns:
one of the predefined clustering policies
See Also:
setClusteringPolicy(byte)

setClusteringPolicy

public void setClusteringPolicy(byte clusteringPolicy)
Specifies the clustering policy that is applied to the input graph and before executing the arrangement algorithm.

By default, no clustering is applied, that is, CLUSTERING_POLICY_NONE is set.

When a policy other than CLUSTERING_POLICY_NONE is specified, the following steps are performed during the layout:

  1. A clustering algorithm is applied to the input graph.
  2. All nodes of the same cluster are put into a newly created group node.
  3. The layout is applied to the modified graph.
  4. Group nodes denoting clusters (inserted during step 2) are removed.
The user can also specify customized clusters by defining appropriate groups.

 
The CLUSTERING_POLICY_LOUVAIN_MODULARITY is the recommended policy for many cases. It offers a good trade-off between performance and quality.
 
The clustering quality setting has an influence only if the edge betweenness policy is specified.
Default Value:
The default value is CLUSTERING_POLICY_NONE. Automatic clustering is disabled.
Parameters:
clusteringPolicy - one of the predefined clustering policies
Throws:
java.lang.IllegalArgumentException - if an unknown clustering policy is given

isConsiderNodeLabelsEnabled

public boolean isConsiderNodeLabelsEnabled()
Returns whether or not to reserve space for node labels during layout calculation.

 
Note that this option only works correctly if the layout orientation is set to LayoutOrientation.TOP_TO_BOTTOM (which is the default). Changing the layout orientation for an undirected layout algorithm like the SmartOrganicLayouter doesn't make sense.
 
Enabling this setting overrides the value of setNodeSizeAware(boolean), i.e. node sizes are always considered.
Returns:
true if the labels of nodes are taken into account, false otherwise
See Also:
setConsiderNodeLabelsEnabled(boolean)

setConsiderNodeLabelsEnabled

public void setConsiderNodeLabelsEnabled(boolean considerNodeLabelsEnabled)
Specifies whether or not to reserve space for node labels during layout calculation.

 
Note that this option only works correctly if the layout orientation is set to LayoutOrientation.TOP_TO_BOTTOM (which is the default). Changing the layout orientation for an undirected layout algorithm like the SmartOrganicLayouter doesn't make sense.
 
Enabling this setting overrides the value of setNodeSizeAware(boolean), i.e. node sizes are always considered.
Default Value:
The default value is false. Node labels are not considered.
Parameters:
considerNodeLabelsEnabled - true if the labels of nodes should be taken into account, false otherwise
Sample Graphs:

false

true

getGroupBoundsCalculator

public GroupBoundsCalculator getGroupBoundsCalculator()
Returns the GroupBoundsCalculator instance used for calculating the size of group nodes.

 
The specified GroupBoundsCalculator is not applied to empty group nodes (i.e. group nodes without children). Such group nodes will not be resized by the algorithm even if that leads to a violation of the minimum group node size specified by GroupingKeys.MINIMUM_NODE_SIZE_DPKEY.
Returns:
the GroupBoundsCalculator instance
See Also:
setGroupBoundsCalculator(GroupBoundsCalculator)

isSmartComponentLayoutEnabled

public boolean isSmartComponentLayoutEnabled()
Returns whether or not this instance should configure the ComponentLayouter to respect subsets of nodes.

When only a subset of nodes is placed by the layout algorithm, the fixed nodes will keep their locations even if they reside in different components.

 
This option is only considered if SCOPE_SUBSET or SCOPE_MAINLY_SUBSET is used.
Returns:
true if ComponentLayouter should be configured for subsets, false otherwise
See Also:
CanonicMultiStageLayouter.setComponentLayouterEnabled(boolean), CanonicMultiStageLayouter.getComponentLayouter(), getScope()

setSmartComponentLayoutEnabled

public void setSmartComponentLayoutEnabled(boolean smartComponentLayoutEnabled)
Specifies whether or not this instance should configure the ComponentLayouter to respect subsets of nodes.

When only a subset of nodes is placed by the layout algorithm, the fixed nodes will keep their locations even if they reside in different components.

 
This option is only considered if SCOPE_SUBSET or SCOPE_MAINLY_SUBSET is used.
Default Value:
The default value is false. Smart component layout is disabled.
Parameters:
smartComponentLayoutEnabled - true if ComponentLayouter should be configured for subsets, false otherwise
See Also:
CanonicMultiStageLayouter.getComponentLayouter(), getScope()

setGroupBoundsCalculator

public void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
Specifies the GroupBoundsCalculator instance used for calculating the size of group nodes.

 
The specified GroupBoundsCalculator is not applied to empty group nodes (i.e. group nodes without children). Such group nodes will not be resized by the algorithm even if that leads to a violation of the minimum group node size specified by GroupingKeys.MINIMUM_NODE_SIZE_DPKEY.
Default Value:
The default value is MinimumSizeGroupBoundsCalculator
Parameters:
groupBoundsCalculator - the GroupBoundsCalculator instance
Throws:
java.lang.IllegalArgumentException - if the specified GroupBoundsCalculator is null

isNodeEdgeOverlapAvoided

public boolean isNodeEdgeOverlapAvoided()
Returns whether or not the layout algorithm tries to avoid node/edge overlaps.

 
The current implementation does not guarantee the non-existence of overlaps but tries to avoid them. Furthermore, the post-processing step that removes node overlaps ignores node/edge overlaps, i.e., the number of node/edge overlaps may increase if option setNodeOverlapsAllowed(boolean) is disabled.
Returns:
true if the layout algorithm tries to avoid node/edge overlaps, false otherwise
See Also:
setNodeEdgeOverlapAvoided(boolean), setNodeOverlapsAllowed(boolean)

setNodeEdgeOverlapAvoided

public void setNodeEdgeOverlapAvoided(boolean nodeEdgeOverlapAvoided)
Specifies whether or not the layout algorithm tries to avoid node/edge overlaps.

 
The current implementation does not guarantee the non-existence of overlaps but tries to avoid them. Furthermore, the post-processing step that removes node overlaps ignores node/edge overlaps, i.e., the number of node/edge overlaps may increase if option setNodeOverlapsAllowed(boolean) is disabled.
Default Value:
The default value is false. Overlaps between nodes and edges are not avoided.
Parameters:
nodeEdgeOverlapAvoided - true if the layout algorithm should try to avoid node/edge overlaps, false otherwise
See Also:
setNodeOverlapsAllowed(boolean)

setOrientationLayouterEnabled

public void setOrientationLayouterEnabled(boolean enabled)
Specifies whether or not the LayoutStage that modifies the orientation of the layout is activated.

Overrides:
setOrientationLayouterEnabled in class CanonicMultiStageLayouter
 
If the current layout orientation is LayoutOrientation.TOP_TO_BOTTOM, the orientation of the layout will not be modified.
 
Based on the undirected layout style, disabling OrientationLayouter has no significant effect.
Default Value:
The default value is true. The orientation LayoutStage is activated.
Parameters:
enabled - true if the stage that modifies the orientation is activated, false otherwise
See Also:
CanonicMultiStageLayouter.isOrientationLayouterEnabled(), CanonicMultiStageLayouter.setOrientationLayouter(y.layout.LayoutStage), CanonicMultiStageLayouter.setLayoutOrientation(byte), OrientationLayouter

configureComponentLayouter

protected void configureComponentLayouter(LayoutGraph graph,
                                          ComponentLayouter layouter)
Configures the given ComponentLayouter to take fixed nodes in components into account.

Components that contain fixed nodes will not be rearranged.

This method is called by doLayout(LayoutGraph) before the actual layout is calculated. It may be overridden in order to manually configure the ComponentLayouter.

 
Everything that is added to the graph or the ComponentLayouter needs to be removed in unconfigureComponentLayouter(LayoutGraph, ComponentLayouter).
Parameters:
graph - the input graph
layouter - the ComponentLayouter instance to reconfigure
See Also:
setSmartComponentLayoutEnabled(boolean)

doLayout

public void doLayout(LayoutGraph graph)
Calculates an organic arrangement of the graph.

In contrast to doLayoutCore(LayoutGraph), graph and layouter are prepared for an independent layout run.

Specified by:
doLayout in interface Layouter
Overrides:
doLayout in class CanonicMultiStageLayouter
 
The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.
Parameters:
graph - the input graph
See Also:
CanonicMultiStageLayouter.appendStage(LayoutStage), CanonicMultiStageLayouter.prependStage(LayoutStage), CanonicMultiStageLayouter.doLayoutCore(LayoutGraph)

unconfigureComponentLayouter

protected void unconfigureComponentLayouter(LayoutGraph graph,
                                            ComponentLayouter layouter)
Disposes of the ComponentLayouter instance.

This method is called by doLayout(LayoutGraph) after the actual layout is calculated. It may be overridden in order to revert a custom configuration made in configureComponentLayouter(LayoutGraph, ComponentLayouter).

 
Everything that was added to the graph or to the ComponentLayouter in configureComponentLayouter(LayoutGraph, ComponentLayouter) needs to be removed here.
Parameters:
graph - the input graph
layouter - the ComponentLayouter to reset
See Also:
setSmartComponentLayoutEnabled(boolean)

canLayoutCore

protected boolean canLayoutCore(LayoutGraph graph)
Accepts general graphs without exception.

Specified by:
canLayoutCore in class CanonicMultiStageLayouter
Parameters:
graph - the input graph
Returns:
true for all general graphs, false if the given graph is null

doLayoutCore

protected void doLayoutCore(LayoutGraph graph)
Calculates an organic arrangement of the graph.

In contrast to doLayout(LayoutGraph), graph and algorithm are not prepared specifically. This method should only be called directly when using SmartOrganicLayouter as a LayoutStage.

Specified by:
doLayoutCore in class CanonicMultiStageLayouter
 
The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.
Parameters:
graph - the input graph

getQualityTimeRatio

public double getQualityTimeRatio()
Returns the ratio of layout quality versus running time.

The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout calculation.

The value needs to lie within [0,1].

Returns:
a value between 0.0 (low quality, fast) and 1.0 (high quality, slow)
See Also:
setQualityTimeRatio(double)

setQualityTimeRatio

public void setQualityTimeRatio(double qualityTimeRatio)
Specifies the ratio of layout quality versus running time.

The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout calculation.

The value needs to lie within [0,1].

Default Value:
The default value is 0.6.
Parameters:
qualityTimeRatio - a value between 0.0 (low quality, fast) and 1.0 (high quality, slow)
Throws:
java.lang.IllegalArgumentException - if the specified ratio is outside the interval [0,1]

getMaximumDuration

public long getMaximumDuration()
Returns the maximum duration in milliseconds that this layout algorithm is allowed to run.

The duration needs to be non-negative.

 
Restricting the maximum duration may result in a lower layout quality. Furthermore, the real runtime may exceed the maximum duration since the layout algorithm still has to find a valid solution.
Returns:
a non-negative duration in milliseconds
See Also:
setMaximumDuration(long)

setMaximumDuration

public void setMaximumDuration(long maximumDurationMillis)
Specifies the maximum duration in milliseconds that this layout algorithm is allowed to run.

The duration needs to be non-negative.

 
Restricting the maximum duration may result in a lower layout quality. Furthermore, the real runtime may exceed the maximum duration since the layout algorithm still has to find a valid solution.
Default Value:
The default value is 30000.
Parameters:
maximumDurationMillis - a non-negative duration in milliseconds
Throws:
java.lang.IllegalArgumentException - if the specified duration has a negative value

getScope

public byte getScope()
Returns the scope that determines which nodes are placed by this algorithm.

 
When using scopes that consider only a subset of the nodes, this subset needs to be marked using a DataProvider registered with key NODE_SUBSET_DATA. If this DataProvider is missing, all nodes will be arranged.
Returns:
one of the predefined scopes
See Also:
setScope(byte), NODE_SUBSET_DATA

setScope

public void setScope(byte scope)
Sets the scope that determines which nodes are placed by this algorithm.

 
When using scopes that consider only a subset of the nodes, this subset needs to be marked using a DataProvider registered with key NODE_SUBSET_DATA. If this DataProvider is missing, all nodes will be arranged.
Default Value:
The default value is SCOPE_ALL
Parameters:
scope - one of the predefined scopes
Throws:
java.lang.IllegalArgumentException - if the given scope is unknown
See Also:
NODE_SUBSET_DATA

getChainSubstructureStyle

public byte getChainSubstructureStyle()
Returns the style specifier for chain substructures.

A chain is a simple edge path where the degree of the nodes is less than or equal to 2. Use property setChainSubstructureSize(int) to specify the minimum size a chain must have.

If there are user-defined node types, a chain substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY, all edges of the chain must have the same direction.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Returns:
one of the predefined styles for chain substructures
See Also:
setChainSubstructureStyle(byte), setChainSubstructureSize(int), setScope(byte), EDGE_DIRECTEDNESS_DPKEY

setChainSubstructureStyle

public void setChainSubstructureStyle(byte chainSubstructureStyle)
Sets the style specifier for chain substructures.

A chain is a simple edge path where the degree of the nodes is less than or equal to 2. Use property setChainSubstructureSize(int) to specify the minimum size a chain must have.

If there are user-defined node types, a chain substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY, all edges of the chain must have the same direction.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Default Value:
The default value is CHAIN_SUBSTRUCTURE_STYLE_NONE
Parameters:
chainSubstructureStyle - one of the predefined styles for chain substructures
Throws:
java.lang.IllegalArgumentException - if the given style is unknown
See Also:
setScope(byte), EDGE_DIRECTEDNESS_DPKEY, setChainSubstructureSize(int)

getCycleSubstructureStyle

public byte getCycleSubstructureStyle()
Returns the style specifier for cycle substructures.

A cycle is a simple edge path where the first and last node are identical. The algorithm only considers cycles where the number of edges connecting nodes of the cycle with the remaining nodes is less than or equal to 2. To define the minimum number of nodes a cycle must contain, use property setCycleSubstructureSize(int) (default is 4).

If there are user-defined node types, a cycle substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY, all edges of the cycle must have the same direction.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Returns:
one of the predefined styles for cycle substructures
See Also:
setCycleSubstructureStyle(byte), setCycleSubstructureSize(int), setScope(byte), EDGE_DIRECTEDNESS_DPKEY

setCycleSubstructureStyle

public void setCycleSubstructureStyle(byte cycleSubstructureStyle)
Sets the style specifier for cycle substructures.

A cycle is a simple edge path where the first and last node are identical. The algorithm only considers cycles where the number of edges connecting nodes of the cycle with the remaining nodes is less than or equal to 2. To define the minimum number of nodes a cycle must contain, use property setCycleSubstructureSize(int) (default is 4).

If there are user-defined node types, a cycle substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY, all edges of the cycle must have the same direction.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Default Value:
The default value is CYCLE_SUBSTRUCTURE_STYLE_NONE
Parameters:
cycleSubstructureStyle - one of the predefined styles for cycle substructures
Throws:
java.lang.IllegalArgumentException - if the given style is unknown
See Also:
setCycleSubstructureSize(int), setScope(byte), EDGE_DIRECTEDNESS_DPKEY

getParallelSubstructureStyle

public byte getParallelSubstructureStyle()
Returns the style specifier for parallel substructures.

A parallel structure consists of a set of nodes (called the inner nodes) such that all nodes have degree two and are connected to the same pair of neighbors (called the outer nodes).

Use property setParallelSubstructureSize(int) to specify the minimum number of inner nodes a structure must contain to be handled as a substructure.

If there are user-defined node types, a parallel substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY, all edges of the parallel structure must have the same direction.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Returns:
one of the predefined styles for parallel substructures
See Also:
setParallelSubstructureStyle(byte), setParallelSubstructureSize(int), setScope(byte), EDGE_DIRECTEDNESS_DPKEY

setParallelSubstructureStyle

public void setParallelSubstructureStyle(byte parallelSubstructureStyle)
Sets the style specifier for parallel substructures.

A parallel structure consists of a set of nodes (called the inner nodes) such that all nodes have degree two and are connected to the same pair of neighbors (called the outer nodes).

Use property setParallelSubstructureSize(int) to specify the minimum number of inner nodes a structure must contain to be handled as a substructure.

If there are user-defined node types, a parallel substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY, all edges of the parallel structure must have the same direction.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Default Value:
The default value is PARALLEL_SUBSTRUCTURE_STYLE_NONE
Parameters:
parallelSubstructureStyle - one of the predefined styles for parallel substructures
Throws:
java.lang.IllegalArgumentException - if the given style is unknown
See Also:
setParallelSubstructureSize(int), setScope(byte), EDGE_DIRECTEDNESS_DPKEY

isParallelSubstructureTypeSeparationEnabled

public boolean isParallelSubstructureTypeSeparationEnabled()
Returns whether parallel substructures should be separated by the node type.

If this option is enabled and there are node types specified, all parallel substructures only contain nodes of the same type. Otherwise, if this option is disabled, a parallel substructure may contain nodes of different type. The algorithm still tries to highlight the different types by choosing a suitable layout for these components (e.g., placing nodes of the same type closer together or preferably on the same circle if the style is PARALLEL_SUBSTRUCTURE_STYLE_RADIAL).

 
This setting only has an effect if node types are specified and if the parallel substructure style is not PARALLEL_SUBSTRUCTURE_STYLE_NONE.
Returns:
true if parallel substructures are separated by node type, false if they may contain nodes of different types
See Also:
setParallelSubstructureTypeSeparationEnabled(boolean), setParallelSubstructureStyle(byte), Layouter.NODE_TYPE_DPKEY

setParallelSubstructureTypeSeparationEnabled

public void setParallelSubstructureTypeSeparationEnabled(boolean parallelSubstructureTypeSeparation)
Specifies whether parallel substructures should be separated by the node type.

If this option is enabled and there are node types specified, all parallel substructures only contain nodes of the same type. Otherwise, if this option is disabled, a parallel substructure may contain nodes of different type. The algorithm still tries to highlight the different types by choosing a suitable layout for these components (e.g., placing nodes of the same type closer together or preferably on the same circle if the style is PARALLEL_SUBSTRUCTURE_STYLE_RADIAL).

 
This setting only has an effect if node types are specified and if the parallel substructure style is not PARALLEL_SUBSTRUCTURE_STYLE_NONE.
Default Value:
The default value is true. Parallel substructures are strictly separated by node type.
Parameters:
parallelSubstructureTypeSeparation - true if parallel substructures should be separated by node type, false if they may contain nodes of different types
See Also:
setParallelSubstructureStyle(byte), Layouter.NODE_TYPE_DPKEY
Sample Graphs:

Type separation is enabled, yielding three substructures

Type separation is disabled, yielding a single substructure containing nodes of different types

isStarSubstructureTypeSeparationEnabled

public boolean isStarSubstructureTypeSeparationEnabled()
Returns whether star substructures should be separated by the node type.

If this option is enabled and there are node types specified, all star substructures only contain nodes of the same type. Otherwise, if this option is disabled, a star substructure may contain nodes of different type. The algorithm still tries to highlight the different types by choosing a suitable layout for these components (e.g., placing nodes of the same type closer together or on the same circle).

 
This setting only has an effect if node types are specified and if the star substructure style is not set to STAR_SUBSTRUCTURE_STYLE_NONE.
Returns:
true if star substructures are separated by node type, false if they may contain nodes of different types
See Also:
setStarSubstructureTypeSeparationEnabled(boolean), setStarSubstructureStyle(byte), Layouter.NODE_TYPE_DPKEY

setStarSubstructureTypeSeparationEnabled

public void setStarSubstructureTypeSeparationEnabled(boolean starSubstructureTypeSeparation)
Specifies whether star substructures should be separated by the node type.

If this option is enabled and there are node types specified, all star substructures only contain nodes of the same type. Otherwise, if this option is disabled, a star substructure may contain nodes of different type. The algorithm still tries to highlight the different types by choosing a suitable layout for these components (e.g., placing nodes of the same type closer together or on the same circle).

 
This setting only has an effect if node types are specified and if the star substructure style is not set to STAR_SUBSTRUCTURE_STYLE_NONE.
Default Value:
The default value is true. Star substructures are strictly separated by node type.
Parameters:
starSubstructureTypeSeparation - true if star substructures should be separated by node type, false if they may contain nodes of different types
See Also:
setStarSubstructureStyle(byte), Layouter.NODE_TYPE_DPKEY
Sample Graphs:

Type separation is enabled, yielding three star structures

Type separation is disabled, yielding a single star structure containing nodes of different types

getStarSubstructureStyle

public byte getStarSubstructureStyle()
Returns the style specifier for star substructures.

A star consists of a set of degree one nodes that are all connected to the same node (called the root of the star). Use property setStarSubstructureSize(int) to define the minimum number of nodes, including the root, a star must contain to be detected as a substructure.

If there are user-defined node types, by default, a star substructure only contains nodes of the same type or only nodes without a type (i.e. null as type), see setStarSubstructureTypeSeparationEnabled(boolean). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY, all edges of the star must have the same direction.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Returns:
one of the predefined styles for star substructures
See Also:
setStarSubstructureStyle(byte), setStarSubstructureSize(int), setStarSubstructureTypeSeparationEnabled(boolean), setScope(byte), EDGE_DIRECTEDNESS_DPKEY

setStarSubstructureStyle

public void setStarSubstructureStyle(byte starSubstructureStyle)
Sets the style specifier for star substructures.

A star consists of a set of degree one nodes that are all connected to the same node (called the root of the star). Use property setStarSubstructureSize(int) to define the minimum number of nodes, including the root, a star must contain to be detected as a substructure.

If there are user-defined node types, by default, a star substructure only contains nodes of the same type or only nodes without a type (i.e. null as type), see setStarSubstructureTypeSeparationEnabled(boolean). This way, node types can be used to control which elements are allowed to form a substructure.

 
If a DataProvider is registered with key EDGE_DIRECTEDNESS_DPKEY and the style is set to STAR_SUBSTRUCTURE_STYLE_SEPARATED_RADIAL, all edges of the star must have the same direction. Otherwise, the edge directedness is ignored.
 
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
Default Value:
The default value is STAR_SUBSTRUCTURE_STYLE_NONE
Parameters:
starSubstructureStyle - one of the predefined styles for star substructures
Throws:
java.lang.IllegalArgumentException - if the given style is unknown
See Also:
setStarSubstructureSize(int), setStarSubstructureTypeSeparationEnabled(boolean), setScope(byte), EDGE_DIRECTEDNESS_DPKEY

getCycleSubstructureSize

public int getCycleSubstructureSize()
Returns the minimum size (number of nodes) a cycle needs to have to be detected and handled as a cycle substructure.

 
This setting has no effect if style CYCLE_SUBSTRUCTURE_STYLE_NONE is specified.
Returns:
the minimum number of nodes a cycle needs to contain to be detected as a substructure
See Also:
setCycleSubstructureSize(int), setCycleSubstructureStyle(byte)

setCycleSubstructureSize

public void setCycleSubstructureSize(int cycleSubstructureSize)
Specifies the minimum size (number of nodes) a cycle needs to have to be detected and handled as a cycle substructure.

 
This setting has no effect if style CYCLE_SUBSTRUCTURE_STYLE_NONE is specified.
Default Value:
The default value is 4.
Parameters:
cycleSubstructureSize - the minimum number of nodes a cycle needs to contain to be detected as a substructure
Throws:
java.lang.IllegalArgumentException - if the given minimum size is less than 3
See Also:
setCycleSubstructureStyle(byte)

getChainSubstructureSize

public int getChainSubstructureSize()
Returns the minimum size (number of nodes) a chain needs to have to be detected and handled as a chain substructure.

 
This setting has no effect if style CHAIN_SUBSTRUCTURE_STYLE_NONE is specified.
Returns:
the minimum number of nodes a chain needs to contain to be detected as a substructure
See Also:
setChainSubstructureSize(int), setChainSubstructureStyle(byte)

setChainSubstructureSize

public void setChainSubstructureSize(int chainSubstructureSize)
Specifies the minimum size (number of nodes) a chain needs to have to be detected and handled as a chain substructure.

 
This setting has no effect if style CHAIN_SUBSTRUCTURE_STYLE_NONE is specified.
Default Value:
The default value is 4.
Parameters:
chainSubstructureSize - the minimum number of nodes a chain needs to contain to be detected as a substructure
Throws:
java.lang.IllegalArgumentException - if the given minimum size is less than 2
See Also:
setChainSubstructureStyle(byte)

getParallelSubstructureSize

public int getParallelSubstructureSize()
Returns the minimum size (number of nodes) a parallel structure needs to have to be detected and handled as a parallel substructure.

The size of a parallel structure is defined as the number of inner nodes, that is, the degree-two nodes sharing the same neighbor nodes.

 
This setting has no effect if style PARALLEL_SUBSTRUCTURE_STYLE_NONE is specified.
Returns:
the minimum number of nodes a parallel structure needs to contain to be detected as a substructure
See Also:
setParallelSubstructureSize(int), setParallelSubstructureStyle(byte)

setParallelSubstructureSize

public void setParallelSubstructureSize(int parallelSubstructureSize)
Specifies the minimum size (number of nodes) a parallel structure needs to have to be detected and handled as a parallel substructure.

The size of a parallel structure is defined as the number of inner nodes, that is, the degree-two nodes sharing the same neighbor nodes.

 
This setting has no effect if style PARALLEL_SUBSTRUCTURE_STYLE_NONE is specified.
Default Value:
The default value is 3.
Parameters:
parallelSubstructureSize - the minimum number of nodes a parallel structure needs to contain to be detected as a substructure
Throws:
java.lang.IllegalArgumentException - if the given minimum size is less than 2
See Also:
setParallelSubstructureStyle(byte)

getStarSubstructureSize

public int getStarSubstructureSize()
Returns the minimum size (number of nodes including the root) a star needs to have to be detected and handled as a star substructure.

 
This setting has no effect if style STAR_SUBSTRUCTURE_STYLE_NONE is specified.
Returns:
the minimum number of nodes, including the root, a star structure needs to contain to be detected as a substructure
See Also:
setStarSubstructureStyle(byte), setStarSubstructureSize(int)

setStarSubstructureSize

public void setStarSubstructureSize(int starSubstructureSize)
Specifies the minimum size (number of nodes including the root) a star needs to have to be detected and handled as a star substructure.

 
This setting has no effect if style STAR_SUBSTRUCTURE_STYLE_NONE is specified.
Default Value:
The default value is 4.
Parameters:
starSubstructureSize - the minimum number of nodes, including the root, a star structure needs to contain to be detected as a substructure
Throws:
java.lang.IllegalArgumentException - if the given minimum size is less than 3
See Also:
setStarSubstructureStyle(byte)

getCompactness

public double getCompactness()
Returns the compactness factor for the layout algorithm.

Smaller values result in less compact drawings, greater values result in more compact drawings.

The compactness value needs to lie in [0,1].

Returns:
the compactness value in [0,1]
See Also:
setCompactness(double)

setCompactness

public void setCompactness(double compactness)
Specifies the compactness factor for the layout algorithm.

Smaller values result in less compact drawings, greater values result in more compact drawings.

The compactness value needs to lie in [0,1].

Default Value:
The default value is 0.5.
Parameters:
compactness - the compactness value in [0,1]
Throws:
java.lang.IllegalArgumentException - if the specified value is outside the interval [0,1]
Sample Graphs:

Compactness is set to 0

Compactness is set to 1

getPreferredEdgeLength

public double getPreferredEdgeLength()
Returns the default preferred edge length.

If there is no specific preferred edge length assigned to an edge, this default preferred edge length is used.

The preferred edge length needs to be non-negative.

 
If the option setNodeOverlapsAllowed(boolean) is disabled, the preferred edge length may be violated because then the nodes are moved in a post-processing step to resolve overlaps.
Returns:
a non-negative edge length
See Also:
setPreferredEdgeLength(double), PREFERRED_EDGE_LENGTH_DATA

setPreferredEdgeLength

public void setPreferredEdgeLength(double preferredEdgeLength)
Specifies the default preferred edge length.

If there is no specific preferred edge length assigned to an edge, the default preferred edge length is used.

The preferred edge length needs to be non-negative.

 
If the option setNodeOverlapsAllowed(boolean) is disabled, the preferred edge length may be violated because then the nodes are moved in a post-processing step to resolve overlaps.
Default Value:
The default value is 40.
Parameters:
preferredEdgeLength - a non-negative edge length
Throws:
java.lang.IllegalArgumentException - if the specified edge length is negative
See Also:
PREFERRED_EDGE_LENGTH_DATA
Sample Graphs:

Preferred edge length 40

Preferred edge length 100

getPreferredMinimalNodeDistance

public double getPreferredMinimalNodeDistance()
Returns the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed.

The minimum preferred distance needs to be non-negative.

 
The algorithm doesn't guarantee that the specified minimum value is always maintained.
 
This value has an effect only if node-edge overlaps are not allowed.
Returns:
a non-negative minimum preferred distance
See Also:
setPreferredMinimalNodeDistance(double)

setPreferredMinimalNodeDistance

public void setPreferredMinimalNodeDistance(double preferredMinimumNodeToEdgeDistance)
Specifies the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed.

The minimum preferred distance needs to be non-negative.

 
The algorithm doesn't guarantee that the specified minimum value is always maintained.
 
This value has an effect only if node-edge overlaps are not allowed.
Default Value:
The default value is 40.
Parameters:
preferredMinimumNodeToEdgeDistance - a non-negative minimum distance
Throws:
java.lang.IllegalArgumentException - if the specified distance is negative

isNodeSizeAware

public boolean isNodeSizeAware()
Returns whether or not to consider node sizes during layout calculation.

If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead.

 
This option doesn't affect the minimum node distance property.
 
It is highly recommended to enable this property when using the substructure feature(s) for handling of chains, stars, cycles and parallel structures (see e.g. setChainSubstructureStyle(byte)). Otherwise, the layout quality with substructure may be worse.
Returns:
true if the sizes of nodes are considered, false otherwise
See Also:
setNodeSizeAware(boolean)

setNodeSizeAware

public void setNodeSizeAware(boolean nodeSizeAware)
Specifies whether or not to consider node sizes during layout calculation.

If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead.

 
This option doesn't affect the minimum node distance property.
 
It is highly recommended to enable this property when using the substructure feature(s) for handling of chains, stars, cycles and parallel structures (see e.g. setChainSubstructureStyle(byte)). Otherwise, the layout quality with substructure may be worse.
Default Value:
The default value is false. Points will be used for modeling the nodes.
Parameters:
nodeSizeAware - true if the sizes of nodes should be considered, false otherwise
Sample Graphs:

false

true

isDeterministic

public boolean isDeterministic()
Returns whether or not the deterministic mode of this algorithm is enabled.

In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are given as input.

Returns:
true if this algorithm works deterministically, false otherwise
See Also:
setDeterministic(boolean)

setDeterministic

public void setDeterministic(boolean deterministic)
Specifies whether or not the deterministic mode of this algorithm is enabled.

In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are given as input.

Default Value:
The default value is false. The layout algorithm is non-deterministic.
Parameters:
deterministic - true if this algorithm should work deterministically, false otherwise

getMinimalNodeDistance

public double getMinimalNodeDistance()
Returns the minimum node distance that this algorithm should enforce between all pairs of nodes.

 
If node overlaps are allowed, the specified minimum node distance will be ignored.
Returns:
a non-negative minimum distance between nodes
See Also:
setMinimalNodeDistance(double), setNodeOverlapsAllowed(boolean)

setMinimalNodeDistance

public void setMinimalNodeDistance(double minimalNodeDistance)
Specifies the minimum node distance this algorithm should enforce between all pairs of nodes.

The minimum node distance needs to be non-negative.

 
If node overlaps are allowed, the specified minimum node distance will be ignored.
Default Value:
The default value is 0.
Parameters:
minimalNodeDistance - a non-negative minimum distance between nodes
Throws:
java.lang.IllegalArgumentException - if the specified minimum node distance is negative
See Also:
setNodeOverlapsAllowed(boolean)
Sample Graphs:

Preferred minimum node distance 40

Preferred minimum node distance 100

isNodeOverlapsAllowed

public boolean isNodeOverlapsAllowed()
Returns whether or not overlaps between nodes are allowed.

 
When disabled, a post-processing step is added that resolves node overlaps considering the specified minimum node distance. This procedure may affect other options like output restrictions and edge distances.
 
If only a subset of nodes is considered in the layout algorithm, there might be some overlapping nodes even if this option is disabled.
Returns:
true if node overlaps are allowed, false otherwise
See Also:
setNodeOverlapsAllowed(boolean), setMinimalNodeDistance(double), setScope(byte)

setNodeOverlapsAllowed

public void setNodeOverlapsAllowed(boolean nodeOverlapsAllowed)
Specifies whether or not overlaps between nodes are allowed.

 
When disabled, a post-processing step is added that resolves node overlaps considering the specified minimum node distance. This procedure may affect other options like output restrictions and edge distances.
 
If only a subset of nodes is considered in the layout algorithm, there might be some overlapping nodes even if this option is disabled.
Default Value:
The default value is false. Node overlaps are not allowed.
Parameters:
nodeOverlapsAllowed - true if node overlaps are allowed, false otherwise
See Also:
setMinimalNodeDistance(double), setScope(byte)
Sample Graphs:

false

true

setOutputRestriction

public void setOutputRestriction(OutputRestriction restriction)
Specifies the area restriction for the result of the layout algorithm.

 
If option setNodeOverlapsAllowed(boolean) is disabled, the restriction area might be violated when node overlaps get resolved in a post-processing step.
Default Value:
The default value is OutputRestriction.NONE
Parameters:
restriction - the OutputRestriction instance
Throws:
java.lang.IllegalArgumentException - if the given restriction is null
See Also:
getOutputRestriction()
Sample Graphs:

No restriction

Circular restriction

Elliptical restriction

Rectangular restriction

getOutputRestriction

public OutputRestriction getOutputRestriction()
Returns the area restriction for the result of the layout algorithm.

 
If option setNodeOverlapsAllowed(boolean) is disabled, the restriction area might be violated when node overlaps get resolved in a post-processing step.
Returns:
the OutputRestriction
See Also:
setOutputRestriction(OutputRestriction)

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.