|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.CanonicMultiStageLayouter y.layout.organic.SmartOrganicLayouter
public class SmartOrganicLayouter
This layout algorithm arranges graphs in an organic fashion.
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
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.
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
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object EDGE_DIRECTEDNESS_DPKEY
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)
.
DataProvider
is registered with this key, the algorithm assumes that all edges are undirected.public static final java.lang.Object Z_COORDINATE_DPKEY
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.
DataProvider
is registered with this key, the z-coordinate information of the nodes is dropped.set3DEnabled(boolean)
public static final java.lang.Object NODE_INERTIA_DPKEY
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]
.
1.0
: The node will not move.
0.5
: The node will only move half as far as it would with an inertia of 0.0
.
0.0
: The node will move as fast as possible.
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
).scope
is
set to SCOPE_ALL
. Furthermore, the specified inertia is not considered for nodes of sub-structures.NODE_STRESS_DPKEY
,
setScope(byte)
public static final java.lang.Object NODE_STRESS_DPKEY
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]
.
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
).scope
is
set to SCOPE_ALL
. Furthermore, the specified stress is not considered for nodes of sub-structures.NODE_INERTIA_DPKEY
,
setScope(byte)
public static final byte CHAIN_SUBSTRUCTURE_STYLE_NONE
public static final byte CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR
Produces the same layout style as CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR_NESTED
, but chains
are never nested.
public static final byte CHAIN_SUBSTRUCTURE_STYLE_RECTANGULAR_NESTED
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.
public static final byte CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE
Produces the same layout style as CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE_NESTED
, but chains
are never nested.
public static final byte CHAIN_SUBSTRUCTURE_STYLE_STRAIGHT_LINE_NESTED
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.
public static final byte STAR_SUBSTRUCTURE_STYLE_NONE
public static final byte STAR_SUBSTRUCTURE_STYLE_RADIAL
Produces the same layout style as STAR_SUBSTRUCTURE_STYLE_RADIAL_NESTED
, but stars are never nested.
public static final byte STAR_SUBSTRUCTURE_STYLE_RADIAL_NESTED
Produces the same layout style as STAR_SUBSTRUCTURE_STYLE_RADIAL
, but stars may additionally
be nested inside chain and parallel substructures.
public static final byte STAR_SUBSTRUCTURE_STYLE_SEPARATED_RADIAL
PortConstraintKeys.SOURCE_GROUPID_KEY
and
PortConstraintKeys.TARGET_GROUPID_KEY
), the algorithm uses a grouped routing style.setStarSubstructureStyle(byte)
,
Constant Field ValuesA radial layout style of the star (marked nodes) where the root is placed outside | A radial layout style with edges grouped at the root |
public static final byte STAR_SUBSTRUCTURE_STYLE_CIRCULAR
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.
public static final byte STAR_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED
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.
public static final byte PARALLEL_SUBSTRUCTURE_STYLE_NONE
public static final byte PARALLEL_SUBSTRUCTURE_STYLE_RECTANGULAR
PortConstraintKeys.SOURCE_GROUPID_KEY
and
PortConstraintKeys.TARGET_GROUPID_KEY
), the algorithm uses a grouped routing style.setParallelSubstructureStyle(byte)
,
Constant Field ValuesA (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 |
public static final byte PARALLEL_SUBSTRUCTURE_STYLE_RADIAL
PortConstraintKeys.SOURCE_GROUPID_KEY
and
PortConstraintKeys.TARGET_GROUPID_KEY
), the algorithm uses a grouped routing style.setParallelSubstructureStyle(byte)
,
Constant Field ValuesA radial layout style of the inner (marked) nodes of the parallel structure | A radial layout style with edges grouped at the outer nodes |
public static final byte PARALLEL_SUBSTRUCTURE_STYLE_STRAIGHT_LINE
PortConstraintKeys.SOURCE_GROUPID_KEY
and
PortConstraintKeys.TARGET_GROUPID_KEY
), the algorithm uses a grouped routing style.setParallelSubstructureStyle(byte)
,
Constant Field ValuesThe inner (marked) nodes of the parallel structure are placed on a straight-line | The edges are grouped at the outer nodes |
public static final byte CYCLE_SUBSTRUCTURE_STYLE_NONE
public static final byte CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR
Produces the same layout style as CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED
, but cycles may not
be nested.
public static final byte CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR_NESTED
Produces the same layout style as CYCLE_SUBSTRUCTURE_STYLE_CIRCULAR
, but cycles may additionally
be nested inside chains, star and parallel substructures.
public static final byte SCOPE_ALL
public static final byte SCOPE_SUBSET
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.
public static final byte SCOPE_MAINLY_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
.
public static final byte SCOPE_MAINLY_SUBSET_GEOMETRIC
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
.
setScope(byte)
,
NODE_SUBSET_DATA
,
Constant Field ValuesInitial graph | The subset and geometrically close nodes were placed |
public static final byte CLUSTERING_POLICY_NONE
setClusteringPolicy(byte)
,
Constant Field Valuespublic static final byte CLUSTERING_POLICY_LOUVAIN_MODULARITY
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.
clustering quality
has no effect on this policy.setClusteringPolicy(byte)
,
Groups.louvainModularity(Graph, NodeMap)
,
Constant Field Valuespublic static final byte CLUSTERING_POLICY_EDGE_BETWEENNESS
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.
setClusteringPolicy(byte)
,
setAutoClusteringQuality(double)
,
Groups.edgeBetweennessClustering(Graph, NodeMap, double, int, int, boolean)
,
Constant Field Valuespublic static final byte CLUSTERING_POLICY_LABEL_PROPAGATION
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.
clustering quality
has no effect on this policy.setClusteringPolicy(byte)
,
Groups.labelPropagation(Graph, NodeMap)
,
Constant Field Valuespublic static final java.lang.Object NODE_SUBSET_DATA
DataProvider
key for marking the nodes that are part of the relevant subset
SCOPE_SUBSET
or
SCOPE_MAINLY_SUBSET
.setScope(byte)
public static final java.lang.Object GROUP_NODE_MODE_DATA
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.
public static final java.lang.Object GROUP_NODE_MODE_NORMAL
GROUP_NODE_MODE_DATA
public static final java.lang.Object GROUP_NODE_MODE_FIX_BOUNDS
setConsiderNodeLabelsEnabled(boolean)
is enabled,
property setNodeOverlapsAllowed(boolean)
is disabled or if there are NodeHalo
s, the bounds
restriction may be violated because the algorithm has to adjust the graph elements such that there are no overlaps.GROUP_NODE_MODE_DATA
public static final java.lang.Object GROUP_NODE_MODE_FIX_CONTENTS
setConsiderNodeLabelsEnabled(boolean)
is enabled,
property setNodeOverlapsAllowed(boolean)
is disabled or if there are NodeHalo
s, the bounds
restriction may be violated because the algorithm has to adjust the graph elements such that there are no overlaps.GROUP_NODE_MODE_DATA
public static final java.lang.Object PREFERRED_EDGE_LENGTH_DATA
DataProvider
key for defining an individual preferred length for each edge
Constructor Detail |
---|
public SmartOrganicLayouter()
SmartOrganicLayouter
instance with default settings.
Method Detail |
---|
public boolean is3DEnabled()
In order to retrieve the z-coordinates, a DataAcceptor
with key Z_COORDINATE_DPKEY
must be
registered with the input graph.
true
if the layout algorithm creates a 3D result, false
otherwiseset3DEnabled(boolean)
,
Z_COORDINATE_DPKEY
public void set3DEnabled(boolean enabled)
In order to retrieve the z-coordinates, a DataAcceptor
with key Z_COORDINATE_DPKEY
must be
registered with the input graph.
enabled
- true
if the layout algorithm should create a 3D result, false
otherwiseZ_COORDINATE_DPKEY
public boolean isMultiThreadingAllowed()
true
if multi-threading is used, false
otherwisesetMultiThreadingAllowed(boolean)
public void setMultiThreadingAllowed(boolean multiThreadingAllowed)
multiThreadingAllowed
- true
if multi-threading should be used, false
otherwisepublic double getGroupNodeCompactness()
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]
.
PartitionGrid
structure.setGroupNodeCompactness(double)
,
setAutomaticGroupNodeCompactionEnabled(boolean)
public void setGroupNodeCompactness(double groupNodeCompactness)
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]
.
PartitionGrid
structure.groupNodeCompactness
- the compactness value for group nodes
java.lang.IllegalArgumentException
- if specified compactness value is outside the interval [0,1]
setAutomaticGroupNodeCompactionEnabled(boolean)
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 |
public boolean isAutomaticGroupNodeCompactionEnabled()
When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness
specified by option setCompactness(double)
.
setGroupNodeCompactness(double)
is
ignored.true
if automatic group node compaction is enabled, false
otherwisesetAutomaticGroupNodeCompactionEnabled(boolean)
,
setGroupNodeCompactness(double)
,
setCompactness(double)
public void setAutomaticGroupNodeCompactionEnabled(boolean enabled)
When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness
specified by option setCompactness(double)
.
setGroupNodeCompactness(double)
is
ignored.enabled
- true
if automatic group node compaction should be enabled, false
otherwisesetGroupNodeCompactness(double)
,
setCompactness(double)
public boolean isAutoClusteringEnabled()
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.
true
if a clustering algorithm is used, false
otherwisesetAutoClusteringEnabled(boolean)
public void setAutoClusteringEnabled(boolean autoClusteringEnabled)
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.
autoClusteringEnabled
- true
if a clustering algorithm should be used, false
otherwisepublic double getAutoClusteringQuality()
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.
CLUSTERING_POLICY_EDGE_BETWEENNESS
is specified.[0,1]
setAutoClusteringQuality(double)
,
CLUSTERING_POLICY_EDGE_BETWEENNESS
,
setMaximumDuration(long)
public void setAutoClusteringQuality(double autoClusteringQuality)
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.
CLUSTERING_POLICY_EDGE_BETWEENNESS
is specified.autoClusteringQuality
- a value from the interval [0,1]
java.lang.IllegalArgumentException
- if the specified quality measure is outside the interval [0,1]
CLUSTERING_POLICY_EDGE_BETWEENNESS
,
setMaximumDuration(long)
public byte getClusteringPolicy()
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:
2
) are removed.
CLUSTERING_POLICY_LOUVAIN_MODULARITY
is the recommended policy for many cases. It offers
a good trade-off between performance and quality.setClusteringPolicy(byte)
public void setClusteringPolicy(byte clusteringPolicy)
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:
2
) are removed.
CLUSTERING_POLICY_LOUVAIN_MODULARITY
is the recommended policy for many cases. It offers
a good trade-off between performance and quality.clustering quality
setting has an influence
only if the edge betweenness policy
is specified.CLUSTERING_POLICY_NONE
. Automatic clustering is disabled.clusteringPolicy
- one of the predefined clustering policies
java.lang.IllegalArgumentException
- if an unknown clustering policy is givenpublic boolean isConsiderNodeLabelsEnabled()
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.setNodeSizeAware(boolean)
, i.e.
node sizes are always considered.true
if the labels of nodes are taken into account, false
otherwisesetConsiderNodeLabelsEnabled(boolean)
public void setConsiderNodeLabelsEnabled(boolean considerNodeLabelsEnabled)
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.setNodeSizeAware(boolean)
, i.e.
node sizes are always considered.considerNodeLabelsEnabled
- true
if the labels of nodes should be taken into account,
false
otherwisefalse | true |
public GroupBoundsCalculator getGroupBoundsCalculator()
GroupBoundsCalculator
instance used for calculating the size of group
nodes.
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
.GroupBoundsCalculator
instancesetGroupBoundsCalculator(GroupBoundsCalculator)
public boolean isSmartComponentLayoutEnabled()
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.
SCOPE_SUBSET
or SCOPE_MAINLY_SUBSET
is used.true
if ComponentLayouter
should be configured for subsets, false
otherwiseCanonicMultiStageLayouter.setComponentLayouterEnabled(boolean)
,
CanonicMultiStageLayouter.getComponentLayouter()
,
getScope()
public void setSmartComponentLayoutEnabled(boolean smartComponentLayoutEnabled)
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.
SCOPE_SUBSET
or SCOPE_MAINLY_SUBSET
is used.smartComponentLayoutEnabled
- true
if ComponentLayouter
should be configured for subsets,
false
otherwiseCanonicMultiStageLayouter.getComponentLayouter()
,
getScope()
public void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
GroupBoundsCalculator
instance used for calculating the size of group
nodes.
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
.MinimumSizeGroupBoundsCalculator
groupBoundsCalculator
- the GroupBoundsCalculator
instance
java.lang.IllegalArgumentException
- if the specified GroupBoundsCalculator
is null
public boolean isNodeEdgeOverlapAvoided()
setNodeOverlapsAllowed(boolean)
is disabled.true
if the layout algorithm tries to avoid node/edge overlaps, false
otherwisesetNodeEdgeOverlapAvoided(boolean)
,
setNodeOverlapsAllowed(boolean)
public void setNodeEdgeOverlapAvoided(boolean nodeEdgeOverlapAvoided)
setNodeOverlapsAllowed(boolean)
is disabled.nodeEdgeOverlapAvoided
- true
if the layout algorithm should try to avoid node/edge overlaps,
false
otherwisesetNodeOverlapsAllowed(boolean)
public void setOrientationLayouterEnabled(boolean enabled)
LayoutStage
that modifies the orientation of the layout is activated.
setOrientationLayouterEnabled
in class CanonicMultiStageLayouter
LayoutOrientation.TOP_TO_BOTTOM
, the orientation of
the layout will not be modified.OrientationLayouter
has no significant
effect.LayoutStage
is activated.enabled
- true
if the stage that modifies the orientation is activated,
false
otherwiseCanonicMultiStageLayouter.isOrientationLayouterEnabled()
,
CanonicMultiStageLayouter.setOrientationLayouter(y.layout.LayoutStage)
,
CanonicMultiStageLayouter.setLayoutOrientation(byte)
,
OrientationLayouter
protected void configureComponentLayouter(LayoutGraph graph, ComponentLayouter layouter)
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
.
ComponentLayouter
needs to be removed in
unconfigureComponentLayouter(LayoutGraph, ComponentLayouter)
.graph
- the input graphlayouter
- the ComponentLayouter
instance to reconfiguresetSmartComponentLayoutEnabled(boolean)
public void doLayout(LayoutGraph graph)
In contrast to doLayoutCore(LayoutGraph)
, graph and layouter are prepared for an independent layout run.
doLayout
in interface Layouter
doLayout
in class CanonicMultiStageLayouter
graph
- the input graphCanonicMultiStageLayouter.appendStage(LayoutStage)
,
CanonicMultiStageLayouter.prependStage(LayoutStage)
,
CanonicMultiStageLayouter.doLayoutCore(LayoutGraph)
protected void unconfigureComponentLayouter(LayoutGraph graph, ComponentLayouter layouter)
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)
.
ComponentLayouter
in
configureComponentLayouter(LayoutGraph, ComponentLayouter)
needs to be removed here.graph
- the input graphlayouter
- the ComponentLayouter
to resetsetSmartComponentLayoutEnabled(boolean)
protected boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graph
true
for all general graphs, false
if the given graph is null
protected void doLayoutCore(LayoutGraph 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
.
doLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graphpublic double getQualityTimeRatio()
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]
.
0.0
(low quality, fast) and 1.0
(high quality, slow)setQualityTimeRatio(double)
public void setQualityTimeRatio(double qualityTimeRatio)
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]
.
qualityTimeRatio
- a value between 0.0
(low quality, fast) and 1.0
(high quality, slow)
java.lang.IllegalArgumentException
- if the specified ratio is outside the interval [0,1]
public long getMaximumDuration()
The duration needs to be non-negative.
setMaximumDuration(long)
public void setMaximumDuration(long maximumDurationMillis)
The duration needs to be non-negative.
maximumDurationMillis
- a non-negative duration in milliseconds
java.lang.IllegalArgumentException
- if the specified duration has a negative valuepublic byte getScope()
DataProvider
registered with key NODE_SUBSET_DATA
.
If this DataProvider
is missing, all nodes will be arranged.setScope(byte)
,
NODE_SUBSET_DATA
public void setScope(byte scope)
DataProvider
registered with key NODE_SUBSET_DATA
.
If this DataProvider
is missing, all nodes will be arranged.SCOPE_ALL
scope
- one of the predefined scopes
java.lang.IllegalArgumentException
- if the given scope is unknownNODE_SUBSET_DATA
public byte getChainSubstructureStyle()
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.
DataProvider
is registered with key EDGE_DIRECTEDNESS_DPKEY
, all
edges of the chain must have the same direction.considers a subset
of nodes,
only these nodes may be contained in a substructure.setChainSubstructureStyle(byte)
,
setChainSubstructureSize(int)
,
setScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
public void setChainSubstructureStyle(byte chainSubstructureStyle)
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.
DataProvider
is registered with key EDGE_DIRECTEDNESS_DPKEY
, all
edges of the chain must have the same direction.considers a subset
of nodes,
only these nodes may be contained in a substructure.CHAIN_SUBSTRUCTURE_STYLE_NONE
chainSubstructureStyle
- one of the predefined styles for chain substructures
java.lang.IllegalArgumentException
- if the given style is unknownsetScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
,
setChainSubstructureSize(int)
public byte getCycleSubstructureStyle()
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.
DataProvider
is registered with key EDGE_DIRECTEDNESS_DPKEY
, all
edges of the cycle must have the same direction.considers a subset
of nodes,
only these nodes may be contained in a substructure.setCycleSubstructureStyle(byte)
,
setCycleSubstructureSize(int)
,
setScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
public void setCycleSubstructureStyle(byte cycleSubstructureStyle)
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.
DataProvider
is registered with key EDGE_DIRECTEDNESS_DPKEY
, all
edges of the cycle must have the same direction.considers a subset
of nodes,
only these nodes may be contained in a substructure.CYCLE_SUBSTRUCTURE_STYLE_NONE
cycleSubstructureStyle
- one of the predefined styles for cycle substructures
java.lang.IllegalArgumentException
- if the given style is unknownsetCycleSubstructureSize(int)
,
setScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
public byte getParallelSubstructureStyle()
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.
DataProvider
is registered with key EDGE_DIRECTEDNESS_DPKEY
, all
edges of the parallel structure must have the same direction.considers a subset
of nodes,
only these nodes may be contained in a substructure.setParallelSubstructureStyle(byte)
,
setParallelSubstructureSize(int)
,
setScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
public void setParallelSubstructureStyle(byte parallelSubstructureStyle)
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.
DataProvider
is registered with key EDGE_DIRECTEDNESS_DPKEY
, all
edges of the parallel structure must have the same direction.considers a subset
of nodes,
only these nodes may be contained in a substructure.PARALLEL_SUBSTRUCTURE_STYLE_NONE
parallelSubstructureStyle
- one of the predefined styles for parallel substructures
java.lang.IllegalArgumentException
- if the given style is unknownsetParallelSubstructureSize(int)
,
setScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
public boolean isParallelSubstructureTypeSeparationEnabled()
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
).
node types
are specified and if the
parallel substructure style is not PARALLEL_SUBSTRUCTURE_STYLE_NONE
.true
if parallel substructures are separated by node type, false
if they may contain nodes of different typessetParallelSubstructureTypeSeparationEnabled(boolean)
,
setParallelSubstructureStyle(byte)
,
Layouter.NODE_TYPE_DPKEY
public void setParallelSubstructureTypeSeparationEnabled(boolean parallelSubstructureTypeSeparation)
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
).
node types
are specified and if the
parallel substructure style is not PARALLEL_SUBSTRUCTURE_STYLE_NONE
.parallelSubstructureTypeSeparation
- true
if parallel substructures should be separated by
node type, false
if they may contain nodes of different typessetParallelSubstructureStyle(byte)
,
Layouter.NODE_TYPE_DPKEY
Type separation is enabled, yielding three substructures | Type separation is disabled, yielding a single substructure containing nodes of different types |
public boolean isStarSubstructureTypeSeparationEnabled()
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).
node types
are specified and if the
star substructure style is not set to STAR_SUBSTRUCTURE_STYLE_NONE
.true
if star substructures are separated by node type, false
if they may contain nodes of different typessetStarSubstructureTypeSeparationEnabled(boolean)
,
setStarSubstructureStyle(byte)
,
Layouter.NODE_TYPE_DPKEY
public void setStarSubstructureTypeSeparationEnabled(boolean starSubstructureTypeSeparation)
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).
node types
are specified and if the
star substructure style is not set to STAR_SUBSTRUCTURE_STYLE_NONE
.starSubstructureTypeSeparation
- true
if star substructures should be separated by
node type, false
if they may contain nodes of different typessetStarSubstructureStyle(byte)
,
Layouter.NODE_TYPE_DPKEY
Type separation is enabled, yielding three star structures | Type separation is disabled, yielding a single star structure containing nodes of different types |
public byte getStarSubstructureStyle()
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.
DataProvider
is registered with key EDGE_DIRECTEDNESS_DPKEY
, all
edges of the star must have the same direction.considers a subset
of nodes,
only these nodes may be contained in a substructure.setStarSubstructureStyle(byte)
,
setStarSubstructureSize(int)
,
setStarSubstructureTypeSeparationEnabled(boolean)
,
setScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
public void setStarSubstructureStyle(byte starSubstructureStyle)
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.
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.considers a subset
of nodes,
only these nodes may be contained in a substructure.STAR_SUBSTRUCTURE_STYLE_NONE
starSubstructureStyle
- one of the predefined styles for star substructures
java.lang.IllegalArgumentException
- if the given style is unknownsetStarSubstructureSize(int)
,
setStarSubstructureTypeSeparationEnabled(boolean)
,
setScope(byte)
,
EDGE_DIRECTEDNESS_DPKEY
public int getCycleSubstructureSize()
CYCLE_SUBSTRUCTURE_STYLE_NONE
is specified.setCycleSubstructureSize(int)
,
setCycleSubstructureStyle(byte)
public void setCycleSubstructureSize(int cycleSubstructureSize)
CYCLE_SUBSTRUCTURE_STYLE_NONE
is specified.cycleSubstructureSize
- the minimum number of nodes a cycle needs to contain to be detected as a substructure
java.lang.IllegalArgumentException
- if the given minimum size is less than 3
setCycleSubstructureStyle(byte)
public int getChainSubstructureSize()
CHAIN_SUBSTRUCTURE_STYLE_NONE
is specified.setChainSubstructureSize(int)
,
setChainSubstructureStyle(byte)
public void setChainSubstructureSize(int chainSubstructureSize)
CHAIN_SUBSTRUCTURE_STYLE_NONE
is specified.chainSubstructureSize
- the minimum number of nodes a chain needs to contain to be detected as a substructure
java.lang.IllegalArgumentException
- if the given minimum size is less than 2
setChainSubstructureStyle(byte)
public int getParallelSubstructureSize()
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.
PARALLEL_SUBSTRUCTURE_STYLE_NONE
is specified.setParallelSubstructureSize(int)
,
setParallelSubstructureStyle(byte)
public void setParallelSubstructureSize(int parallelSubstructureSize)
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.
PARALLEL_SUBSTRUCTURE_STYLE_NONE
is specified.parallelSubstructureSize
- the minimum number of nodes a parallel structure needs to contain to be
detected as a substructure
java.lang.IllegalArgumentException
- if the given minimum size is less than 2
setParallelSubstructureStyle(byte)
public int getStarSubstructureSize()
STAR_SUBSTRUCTURE_STYLE_NONE
is specified.setStarSubstructureStyle(byte)
,
setStarSubstructureSize(int)
public void setStarSubstructureSize(int starSubstructureSize)
STAR_SUBSTRUCTURE_STYLE_NONE
is specified.starSubstructureSize
- the minimum number of nodes, including the root, a star structure needs to contain
to be detected as a substructure
java.lang.IllegalArgumentException
- if the given minimum size is less than 3
setStarSubstructureStyle(byte)
public double getCompactness()
Smaller values result in less compact drawings, greater values result in more compact drawings.
The compactness value needs to lie in [0,1]
.
[0,1]
setCompactness(double)
public void setCompactness(double compactness)
Smaller values result in less compact drawings, greater values result in more compact drawings.
The compactness value needs to lie in [0,1]
.
public double getPreferredEdgeLength()
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.
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.setPreferredEdgeLength(double)
,
PREFERRED_EDGE_LENGTH_DATA
public void setPreferredEdgeLength(double preferredEdgeLength)
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.
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.preferredEdgeLength
- a non-negative edge length
java.lang.IllegalArgumentException
- if the specified edge length is negativePREFERRED_EDGE_LENGTH_DATA
Preferred edge length 40 | Preferred edge length 100 |
public double getPreferredMinimalNodeDistance()
The minimum preferred distance needs to be non-negative.
node-edge overlaps
are not allowed.setPreferredMinimalNodeDistance(double)
public void setPreferredMinimalNodeDistance(double preferredMinimumNodeToEdgeDistance)
The minimum preferred distance needs to be non-negative.
node-edge overlaps
are not allowed.preferredMinimumNodeToEdgeDistance
- a non-negative minimum distance
java.lang.IllegalArgumentException
- if the specified distance is negativepublic boolean isNodeSizeAware()
If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead.
setChainSubstructureStyle(byte)
).
Otherwise, the layout quality with substructure may be worse.true
if the sizes of nodes are considered, false
otherwisesetNodeSizeAware(boolean)
public void setNodeSizeAware(boolean nodeSizeAware)
If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead.
setChainSubstructureStyle(byte)
).
Otherwise, the layout quality with substructure may be worse.nodeSizeAware
- true
if the sizes of nodes should be considered, false
otherwisefalse | true |
public boolean isDeterministic()
In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are given as input.
true
if this algorithm works deterministically, false
otherwisesetDeterministic(boolean)
public void setDeterministic(boolean deterministic)
In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are given as input.
deterministic
- true
if this algorithm should work deterministically, false
otherwisepublic double getMinimalNodeDistance()
node overlaps
are allowed, the specified minimum node
distance will be ignored.setMinimalNodeDistance(double)
,
setNodeOverlapsAllowed(boolean)
public void setMinimalNodeDistance(double minimalNodeDistance)
The minimum node distance needs to be non-negative.
node overlaps
are allowed, the specified minimum node
distance will be ignored.minimalNodeDistance
- a non-negative minimum distance between nodes
java.lang.IllegalArgumentException
- if the specified minimum node distance is negativesetNodeOverlapsAllowed(boolean)
Preferred minimum node distance 40 | Preferred minimum node distance 100 |
public boolean isNodeOverlapsAllowed()
minimum node distance
.
This procedure may affect other options like output restrictions
and edge distances
.true
if node overlaps are allowed, false
otherwisesetNodeOverlapsAllowed(boolean)
,
setMinimalNodeDistance(double)
,
setScope(byte)
public void setNodeOverlapsAllowed(boolean nodeOverlapsAllowed)
minimum node distance
.
This procedure may affect other options like output restrictions
and edge distances
.nodeOverlapsAllowed
- true
if node overlaps are allowed, false
otherwisesetMinimalNodeDistance(double)
,
setScope(byte)
false | true |
public void setOutputRestriction(OutputRestriction restriction)
setNodeOverlapsAllowed(boolean)
is disabled, the restriction area might be violated when node
overlaps get resolved in a post-processing step.OutputRestriction.NONE
restriction
- the OutputRestriction
instance
java.lang.IllegalArgumentException
- if the given restriction is null
getOutputRestriction()
No restriction | Circular restriction | Elliptical restriction | Rectangular restriction |
public OutputRestriction getOutputRestriction()
setNodeOverlapsAllowed(boolean)
is disabled, the restriction area might be violated when node
overlaps get resolved in a post-processing step.OutputRestriction
setOutputRestriction(OutputRestriction)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |