public class OrganicLayout extends MultiStageLayout
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
OrganicLayout
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 InvalidGraphStructureException
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 GroupNodeMode.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
.
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 corrsponding structures are easily
recognized in the graph.
Organic Layout without applying specific layout styles to substructures Organic Layout of the same graph applying specific layout styles to the detected substructures
Modifier and Type | Field and Description |
---|---|
static NodeDpKey<Boolean> |
AFFECTED_NODES_DPKEY
A
DataProvider key for marking the nodes that are part of the relevant subset
|
static EdgeDpKey<Double> |
EDGE_DIRECTEDNESS_DPKEY
A
DataProvider key for specifying the directedness of edges.
|
static NodeDpKey<GroupNodeMode> |
GROUP_NODE_MODE_DPKEY
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 EdgeDpKey<Double> |
PREFERRED_EDGE_LENGTH_DPKEY
A
DataProvider key for defining an individual preferred length for each edge
|
Constructor and Description |
---|
OrganicLayout()
Creates a new
OrganicLayout instance with default settings. |
Modifier and Type | Method and Description |
---|---|
void |
applyLayout(LayoutGraph graph)
Calculates an organic arrangement of the graph.
|
void |
applyLayoutCore(LayoutGraph graph)
Calculates an organic arrangement of the graph.
|
protected void |
configureComponentLayout(LayoutGraph graph,
ComponentLayout layouter)
Configures the given
ComponentLayout to take fixed nodes in components into account. |
protected void |
disposeComponentLayout(LayoutGraph graph,
ComponentLayout layouter)
Disposes of the
ComponentLayout instance. |
ChainSubstructureStyle |
getChainSubstructureStyle()
Gets the style specifier for chain substructures.
|
double |
getClusteringQuality()
Gets the quality measure of the clustering algorithm.
|
double |
getCompactnessFactor()
Gets the compactness factor for the layout algorithm.
|
CycleSubstructureStyle |
getCycleSubstructureStyle()
Gets the style specifier for cycle substructures.
|
IGroupBoundsCalculator |
getGroupBoundsCalculator()
Gets the
IGroupBoundsCalculator instance used for calculating the size of group nodes. |
double |
getGroupNodeCompactness()
Gets the compactness of group nodes.
|
long |
getMaximumDuration()
Gets the maximum duration in milliseconds that this layout algorithm is allowed to run.
|
double |
getMinimumNodeDistance()
Gets the minimum node distance that this algorithm should enforce between all pairs of nodes.
|
OutputRestriction |
getOutputRestriction()
Gets the area restriction for the result of the layout algorithm.
|
ParallelSubstructureStyle |
getParallelSubstructureStyle()
Gets the style specifier for parallel substructures.
|
double |
getPreferredEdgeLength()
Gets the default preferred edge length.
|
double |
getPreferredMinimumNodeToEdgeDistance()
Gets the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed.
|
double |
getQualityTimeRatio()
Gets the ratio of layout quality versus running time.
|
Scope |
getScope()
Gets the scope that determines which nodes are placed by this algorithm.
|
StarSubstructureStyle |
getStarSubstructureStyle()
Gets the style specifier for star substructures.
|
boolean |
isAutomaticGroupNodeCompaction()
Gets whether or not group nodes are compacted automatically.
|
boolean |
isAvoidingNodeEdgeOverlapsEnabled()
Gets whether or not the layout algorithm tries to avoid node/edge overlaps.
|
boolean |
isConsiderNodeSizes()
Gets whether or not to consider node sizes during layout calculation.
|
boolean |
isDeterministicModeEnabled()
Gets whether or not the deterministic mode of this algorithm is enabled.
|
boolean |
isMultiThreadingAllowed()
Gets whether or not the layout algorithm may use multi-threading to reduce the running time.
|
boolean |
isNodeClusteringEnabled()
Gets whether or not a clustering algorithm should be applied to the input graph.
|
boolean |
isNodeLabelConsiderationEnabled()
Gets whether or not to reserve space for node labels during layout calculation.
|
boolean |
isNodeOverlapsAllowed()
Gets whether or not overlaps between nodes are allowed.
|
boolean |
isSmartComponentLayoutEnabled()
Gets whether or not this instance should configure the
ComponentLayout to respect subsets of nodes. |
void |
setAutomaticGroupNodeCompaction(boolean value)
Sets whether or not group nodes are compacted automatically.
|
void |
setAvoidingNodeEdgeOverlapsEnabled(boolean value)
Sets whether or not the layout algorithm tries to avoid node/edge overlaps.
|
void |
setChainSubstructureStyle(ChainSubstructureStyle value)
Sets the style specifier for chain substructures.
|
void |
setClusteringQuality(double value)
Sets the quality measure of the clustering algorithm.
|
void |
setCompactnessFactor(double value)
Sets the compactness factor for the layout algorithm.
|
void |
setConsiderNodeSizes(boolean value)
Sets whether or not to consider node sizes during layout calculation.
|
void |
setCycleSubstructureStyle(CycleSubstructureStyle value)
Sets the style specifier for cycle substructures.
|
void |
setDeterministicModeEnabled(boolean value)
Sets whether or not the deterministic mode of this algorithm is enabled.
|
void |
setGroupBoundsCalculator(IGroupBoundsCalculator value)
Sets the
IGroupBoundsCalculator instance used for calculating the size of group nodes. |
void |
setGroupNodeCompactness(double value)
Sets the compactness of group nodes.
|
void |
setMaximumDuration(long value)
Sets the maximum duration in milliseconds that this layout algorithm is allowed to run.
|
void |
setMinimumNodeDistance(double value)
Sets the minimum node distance that this algorithm should enforce between all pairs of nodes.
|
void |
setMultiThreadingAllowed(boolean value)
Sets whether or not the layout algorithm may use multi-threading to reduce the running time.
|
void |
setNodeClusteringEnabled(boolean value)
Sets whether or not a clustering algorithm should be applied to the input graph.
|
void |
setNodeLabelConsiderationEnabled(boolean value)
Sets whether or not to reserve space for node labels during layout calculation.
|
void |
setNodeOverlapsAllowed(boolean value)
Sets whether or not overlaps between nodes are allowed.
|
void |
setOrientationLayoutEnabled(boolean value)
Sets whether or not the
ILayoutStage that modifies the orientation of the layout is
activated. |
void |
setOutputRestriction(OutputRestriction value)
Sets the area restriction for the result of the layout algorithm.
|
void |
setParallelSubstructureStyle(ParallelSubstructureStyle value)
Sets the style specifier for parallel substructures.
|
void |
setPreferredEdgeLength(double value)
Sets the default preferred edge length.
|
void |
setPreferredMinimumNodeToEdgeDistance(double value)
Sets the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed.
|
void |
setQualityTimeRatio(double value)
Sets the ratio of layout quality versus running time.
|
void |
setScope(Scope value)
Sets the scope that determines which nodes are placed by this algorithm.
|
void |
setSmartComponentLayoutEnabled(boolean value)
Sets whether or not this instance should configure the
ComponentLayout to respect subsets of nodes. |
void |
setStarSubstructureStyle(StarSubstructureStyle value)
Sets the style specifier for star substructures.
|
appendStage, checkNodeSize, disableAllStages, getComponentLayout, getHideGroupsStage, getLabeling, getLayoutOrientation, getOrientationLayout, getParallelEdgeRouter, getSelfLoopRouter, getSubgraphLayout, isComponentLayoutEnabled, isHideGroupsStageEnabled, isLabelingEnabled, isOrientationLayoutEnabled, isParallelEdgeRouterEnabled, isSelfLoopRouterEnabled, isSubgraphLayoutEnabled, prependStage, removeStage, setComponentLayout, setComponentLayoutEnabled, setHideGroupsStage, setHideGroupsStageEnabled, setLabeling, setLabelingEnabled, setLayoutOrientation, setOrientationLayout, setParallelEdgeRouter, setParallelEdgeRouterEnabled, setSelfLoopRouter, setSelfLoopRouterEnabled, setSubgraphLayout, setSubgraphLayoutEnabled
public static final NodeDpKey<Boolean> AFFECTED_NODES_DPKEY
DataProvider
key for marking the nodes that are part of the relevant subset
Scope.SUBSET
or Scope.MAINLY_SUBSET
.setScope(Scope)
public static final EdgeDpKey<Double> EDGE_DIRECTEDNESS_DPKEY
DataProvider
key for specifying the directedness of edges.
Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this IDataProvider
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
ChainSubstructureStyle
,
CycleSubstructureStyle
, ParallelSubstructureStyle
and StarSubstructureStyle
.
IDataProvider
is registered with this key, the algorithm assumes that all edges are undirected.public static final NodeDpKey<GroupNodeMode> GROUP_NODE_MODE_DPKEY
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 OrganicLayout()
OrganicLayout
instance with default settings.public void applyLayout(LayoutGraph graph)
In contrast to applyLayoutCore(LayoutGraph)
, graph and layouter are prepared for an independent layout run.
applyLayout
in interface ILayoutAlgorithm
applyLayout
in class MultiStageLayout
graph
- the input graphMultiStageLayout.appendStage(ILayoutStage)
,
MultiStageLayout.prependStage(ILayoutStage)
,
MultiStageLayout.applyLayoutCore(LayoutGraph)
public void applyLayoutCore(LayoutGraph graph)
In contrast to applyLayout(LayoutGraph)
, graph and algorithm are not prepared specifically. This method should
only be called directly when using OrganicLayout
as a ILayoutStage
.
applyLayoutCore
in class MultiStageLayout
graph
- the input graphprotected void configureComponentLayout(LayoutGraph graph, ComponentLayout layouter)
ComponentLayout
to take fixed nodes in components into account.
Components that contain fixed nodes will not be rearranged.
This method is called by applyLayout(LayoutGraph)
before the actual layout is calculated. It may be overridden
in order to manually configure the ComponentLayout
.
ComponentLayout
needs to be removed in
disposeComponentLayout(LayoutGraph, ComponentLayout)
.graph
- the input graphlayouter
- the ComponentLayout
instance to reconfiguresetSmartComponentLayoutEnabled(boolean)
protected void disposeComponentLayout(LayoutGraph graph, ComponentLayout layouter)
ComponentLayout
instance.
This method is called by applyLayout(LayoutGraph)
after the actual layout is calculated. It may be overridden
in order to revert a custom configuration made in configureComponentLayout(LayoutGraph, ComponentLayout)
.
ComponentLayout
in configureComponentLayout(LayoutGraph, ComponentLayout)
needs to be removed here.graph
- the input graphlayouter
- the ComponentLayout
to resetsetSmartComponentLayoutEnabled(boolean)
public ChainSubstructureStyle getChainSubstructureStyle()
A chain is a simple edge path where the degree of the nodes is less than or equal to 2
.
IllegalArgumentException
- if the given style is unknownIDataProvider
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.ChainSubstructureStyle.NONE
setScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
setChainSubstructureStyle(ChainSubstructureStyle)
public double getClusteringQuality()
The higher the value, the higher the clustering quality.
The value needs to lie in [0,1]
.
IllegalArgumentException
- if the specified quality measure is outside the interval [0,1]
[0,1]
setNodeClusteringEnabled(boolean)
,
setMaximumDuration(long)
,
setClusteringQuality(double)
public double getCompactnessFactor()
Smaller values result in less compact drawings, greater values result in more compact drawings.
The compactness value needs to lie in [0,1]
.
IllegalArgumentException
- if the specified value is outside the interval [0,1]
[0,1]
setCompactnessFactor(double)
public CycleSubstructureStyle 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
.
IllegalArgumentException
- if the given style is unknownIDataProvider
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.CycleSubstructureStyle.NONE
setScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
setCycleSubstructureStyle(CycleSubstructureStyle)
public IGroupBoundsCalculator getGroupBoundsCalculator()
IGroupBoundsCalculator
instance used for calculating the size of group nodes.IllegalArgumentException
- if the specified IGroupBoundsCalculator
is null
IGroupBoundsCalculator
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
IGroupBoundsCalculator
instancesetGroupBoundsCalculator(IGroupBoundsCalculator)
public 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]
.
IllegalArgumentException
- if specified compactness value is outside the interval [0,1]
PartitionGrid
structure.setAutomaticGroupNodeCompaction(boolean)
,
setGroupNodeCompactness(double)
public long getMaximumDuration()
The duration needs to be non-negative.
IllegalArgumentException
- if the specified duration has a negative valuesetMaximumDuration(long)
public double getMinimumNodeDistance()
The minimum node distance needs to be non-negative.
IllegalArgumentException
- if the specified minimum node distance is negativenode overlaps
are allowed, the specified minimum node distance will be
ignored.setNodeOverlapsAllowed(boolean)
,
setMinimumNodeDistance(double)
public OutputRestriction getOutputRestriction()
NodeOverlapsAllowed
is disabled, the restriction area might be
violated when node overlaps get resolved in a post-processing step.OutputRestriction.NONE
OutputRestriction
setOutputRestriction(OutputRestriction)
public ParallelSubstructureStyle 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).
IllegalArgumentException
- if the given style is unknownIDataProvider
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.ParallelSubstructureStyle.NONE
setScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
setParallelSubstructureStyle(ParallelSubstructureStyle)
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.
IllegalArgumentException
- if the specified edge length is negativeNodeOverlapsAllowed
is disabled, the preferred edge length may be
violated because then the nodes are moved in a post-processing step to resolve overlaps.PREFERRED_EDGE_LENGTH_DPKEY
,
setPreferredEdgeLength(double)
public double getPreferredMinimumNodeToEdgeDistance()
The minimum preferred distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is negativenode-edge overlaps
are not
allowed.setPreferredMinimumNodeToEdgeDistance(double)
public 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]
.
IllegalArgumentException
- if the specified ratio is outside the interval [0,1]
0.0
(low quality, fast) and 1.0
(high quality, slow)setQualityTimeRatio(double)
public Scope getScope()
IllegalArgumentException
- if the given scope is unknownIDataProvider
registered with key AFFECTED_NODES_DPKEY
. If this IDataProvider
is missing, all nodes will be
arranged.Scope.ALL
AFFECTED_NODES_DPKEY
,
setScope(Scope)
public StarSubstructureStyle 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).
IllegalArgumentException
- if the given style is unknownIDataProvider
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.StarSubstructureStyle.NONE
setScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
setStarSubstructureStyle(StarSubstructureStyle)
public boolean isAutomaticGroupNodeCompaction()
When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness
specified by option CompactnessFactor
.
GroupNodeCompactness
is ignored.true
. Automatic group node compaction is enabled.true
if automatic group node compaction is enabled, false
otherwisesetGroupNodeCompactness(double)
,
setCompactnessFactor(double)
,
setAutomaticGroupNodeCompaction(boolean)
public boolean isAvoidingNodeEdgeOverlapsEnabled()
NodeOverlapsAllowed
is disabled.false
. Overlaps between nodes and edges are not avoided.true
if the layout algorithm tries to avoid node/edge overlaps, false
otherwisesetNodeOverlapsAllowed(boolean)
,
setAvoidingNodeEdgeOverlapsEnabled(boolean)
public boolean isConsiderNodeSizes()
If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead.
false
. Points will be used for modeling the nodes.true
if the sizes of nodes are considered, false
otherwisesetConsiderNodeSizes(boolean)
public boolean isDeterministicModeEnabled()
In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are given as input.
false
. The layout algorithm works deterministically.true
if this algorithm works deterministically, false
otherwisesetDeterministicModeEnabled(boolean)
public boolean isMultiThreadingAllowed()
false
. Multi-threading is disabled.true
if multi-threading is used, false
otherwisesetMultiThreadingAllowed(boolean)
public boolean isNodeClusteringEnabled()
When this option is enabled, the following steps are performed during the layout:
2
) are removed.The user can also specify customized clusters by defining appropriate groups.
false
. Automatic clustering is disabled.true
if a clustering algorithm is used, false
otherwisesetMaximumDuration(long)
,
setNodeClusteringEnabled(boolean)
public boolean isNodeLabelConsiderationEnabled()
layout orientation
is set to LayoutOrientation.TOP_TO_BOTTOM
(which is the default). Changing the layout
orientation for an undirected layout algorithm like the OrganicLayout
doesn't make sense.ConsiderNodeSizes
, i.e. node sizes are always considered.false
. Node labels are not considered.true
if the labels of nodes are taken into account, false
otherwisesetNodeLabelConsiderationEnabled(boolean)
public boolean isNodeOverlapsAllowed()
minimum node distance
. This procedure may affect other options like output restrictions
and edge distances
.false
. Node overlaps are not allowed.true
if node overlaps are allowed, false
otherwisesetMinimumNodeDistance(double)
,
setScope(Scope)
,
setNodeOverlapsAllowed(boolean)
public boolean isSmartComponentLayoutEnabled()
ComponentLayout
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.false
. Smart component layout is disabled.true
if ComponentLayout
should be configured for subsets, false
otherwiseMultiStageLayout.setComponentLayoutEnabled(boolean)
,
MultiStageLayout.getComponentLayout()
,
getScope()
,
setSmartComponentLayoutEnabled(boolean)
public void setAutomaticGroupNodeCompaction(boolean value)
When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness
specified by option CompactnessFactor
.
GroupNodeCompactness
is ignored.true
. Automatic group node compaction is enabled.value
- true
if automatic group node compaction is enabled, false
otherwisesetGroupNodeCompactness(double)
,
setCompactnessFactor(double)
,
isAutomaticGroupNodeCompaction()
public void setAvoidingNodeEdgeOverlapsEnabled(boolean value)
NodeOverlapsAllowed
is disabled.false
. Overlaps between nodes and edges are not avoided.value
- true
if the layout algorithm tries to avoid node/edge overlaps, false
otherwisesetNodeOverlapsAllowed(boolean)
,
isAvoidingNodeEdgeOverlapsEnabled()
public void setChainSubstructureStyle(ChainSubstructureStyle value)
A chain is a simple edge path where the degree of the nodes is less than or equal to 2
.
IllegalArgumentException
- if the given style is unknownIDataProvider
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.ChainSubstructureStyle.NONE
value
- one of the predefined styles for chain substructuressetScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
getChainSubstructureStyle()
public void setClusteringQuality(double value)
The higher the value, the higher the clustering quality.
The value needs to lie in [0,1]
.
IllegalArgumentException
- if the specified quality measure is outside the interval [0,1]
value
- a value from interval [0,1]
setNodeClusteringEnabled(boolean)
,
setMaximumDuration(long)
,
getClusteringQuality()
public void setCompactnessFactor(double value)
Smaller values result in less compact drawings, greater values result in more compact drawings.
The compactness value needs to lie in [0,1]
.
IllegalArgumentException
- if the specified value is outside the interval [0,1]
value
- the compactness value in [0,1]
getCompactnessFactor()
public void setConsiderNodeSizes(boolean value)
If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead.
false
. Points will be used for modeling the nodes.value
- true
if the sizes of nodes are considered, false
otherwiseisConsiderNodeSizes()
public void setCycleSubstructureStyle(CycleSubstructureStyle value)
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
.
IllegalArgumentException
- if the given style is unknownIDataProvider
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.CycleSubstructureStyle.NONE
value
- one of the predefined styles for cycle substructuressetScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
getCycleSubstructureStyle()
public void setDeterministicModeEnabled(boolean value)
In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are given as input.
false
. The layout algorithm works deterministically.value
- true
if this algorithm works deterministically, false
otherwiseisDeterministicModeEnabled()
public void setGroupBoundsCalculator(IGroupBoundsCalculator value)
IGroupBoundsCalculator
instance used for calculating the size of group nodes.IllegalArgumentException
- if the specified IGroupBoundsCalculator
is null
IGroupBoundsCalculator
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
value
- the IGroupBoundsCalculator
instancegetGroupBoundsCalculator()
public void setGroupNodeCompactness(double value)
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]
.
IllegalArgumentException
- if specified compactness value is outside the interval [0,1]
PartitionGrid
structure.value
- groupNodeCompactness the compactness value for group nodessetAutomaticGroupNodeCompaction(boolean)
,
getGroupNodeCompactness()
public void setMaximumDuration(long value)
The duration needs to be non-negative.
IllegalArgumentException
- if the specified duration has a negative valuevalue
- a non-negative duration in millisecondsgetMaximumDuration()
public void setMinimumNodeDistance(double value)
The minimum node distance needs to be non-negative.
IllegalArgumentException
- if the specified minimum node distance is negativenode overlaps
are allowed, the specified minimum node distance will be
ignored.value
- a non-negative minimum distance between nodes that are not connected by an edgesetNodeOverlapsAllowed(boolean)
,
getMinimumNodeDistance()
public void setMultiThreadingAllowed(boolean value)
false
. Multi-threading is disabled.value
- true
if multi-threading is used, false
otherwiseisMultiThreadingAllowed()
public void setNodeClusteringEnabled(boolean value)
When this option is enabled, the following steps are performed during the layout:
2
) are removed.The user can also specify customized clusters by defining appropriate groups.
false
. Automatic clustering is disabled.value
- true
if a clustering algorithm is used, false
otherwisesetMaximumDuration(long)
,
isNodeClusteringEnabled()
public void setNodeLabelConsiderationEnabled(boolean value)
layout orientation
is set to LayoutOrientation.TOP_TO_BOTTOM
(which is the default). Changing the layout
orientation for an undirected layout algorithm like the OrganicLayout
doesn't make sense.ConsiderNodeSizes
, i.e. node sizes are always considered.false
. Node labels are not considered.value
- true
if the labels of nodes are taken into account, false
otherwiseisNodeLabelConsiderationEnabled()
public void setNodeOverlapsAllowed(boolean value)
minimum node distance
. This procedure may affect other options like output restrictions
and edge distances
.false
. Node overlaps are not allowed.value
- true
if node overlaps are allowed, false
otherwisesetMinimumNodeDistance(double)
,
setScope(Scope)
,
isNodeOverlapsAllowed()
public void setOrientationLayoutEnabled(boolean value)
ILayoutStage
that modifies the orientation of the layout is
activated.setOrientationLayoutEnabled
in class MultiStageLayout
LayoutOrientation.TOP_TO_BOTTOM
, the orientation of the layout will not be
modified.OrientationLayout
has no significant
effect.true
. The orientation ILayoutStage
is activated.value
- true
if the stage that modifies the orientation is activated, false
otherwiseMultiStageLayout.isOrientationLayoutEnabled()
,
MultiStageLayout.setOrientationLayout(com.yworks.yfiles.layout.ILayoutStage)
,
MultiStageLayout.setLayoutOrientation(com.yworks.yfiles.layout.LayoutOrientation)
,
OrientationLayout
public void setOutputRestriction(OutputRestriction value)
NodeOverlapsAllowed
is disabled, the restriction area might be
violated when node overlaps get resolved in a post-processing step.OutputRestriction.NONE
value
- the OutputRestriction
getOutputRestriction()
public void setParallelSubstructureStyle(ParallelSubstructureStyle value)
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).
IllegalArgumentException
- if the given style is unknownIDataProvider
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.ParallelSubstructureStyle.NONE
value
- one of the predefined styles for parallel substructuressetScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
getParallelSubstructureStyle()
public void setPreferredEdgeLength(double value)
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.
IllegalArgumentException
- if the specified edge length is negativeNodeOverlapsAllowed
is disabled, the preferred edge length may be
violated because then the nodes are moved in a post-processing step to resolve overlaps.value
- a non-negative edge lengthPREFERRED_EDGE_LENGTH_DPKEY
,
getPreferredEdgeLength()
public void setPreferredMinimumNodeToEdgeDistance(double value)
The minimum preferred distance needs to be non-negative.
IllegalArgumentException
- if the specified distance is negativenode-edge overlaps
are not
allowed.value
- a non-negative minimum preferred distancegetPreferredMinimumNodeToEdgeDistance()
public void setQualityTimeRatio(double value)
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]
.
IllegalArgumentException
- if the specified ratio is outside the interval [0,1]
value
- a value between 0.0
(low quality, fast) and 1.0
(high quality, slow)getQualityTimeRatio()
public void setScope(Scope value)
IllegalArgumentException
- if the given scope is unknownIDataProvider
registered with key AFFECTED_NODES_DPKEY
. If this IDataProvider
is missing, all nodes will be
arranged.Scope.ALL
value
- one of the predefined scopesAFFECTED_NODES_DPKEY
,
getScope()
public void setSmartComponentLayoutEnabled(boolean value)
ComponentLayout
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.false
. Smart component layout is disabled.value
- true
if ComponentLayout
should be configured for subsets, false
otherwiseMultiStageLayout.setComponentLayoutEnabled(boolean)
,
MultiStageLayout.getComponentLayout()
,
getScope()
,
isSmartComponentLayoutEnabled()
public void setStarSubstructureStyle(StarSubstructureStyle value)
A star consists of a set of degree one nodes that are all connected to the same node (called the root of the star).
IllegalArgumentException
- if the given style is unknownIDataProvider
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.StarSubstructureStyle.NONE
value
- one of the predefined styles for star substructuressetScope(Scope)
,
EDGE_DIRECTEDNESS_DPKEY
,
getStarSubstructureStyle()