|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty.layout.CanonicMultiStageLayouter
y.layout.circular.CompactDiskLayouter
public class CompactDiskLayouter
This layout algorithm arranges a graph on a disk packing the nodes as dense as possible.
The nodes are arranged on a disk such that the disk's radius is minimized. The layout mostly optimizes the dense placement of the nodes, while edges play a minor role. Hence, the compact disk layout is mostly suitable for graphs with small components whose loosely connected nodes should be grouped and packed in a small area.
The CompactDiskLayouter
arranges the nodes on a disk from the inside out packing them as dense as possible. During this iterative process
it avoids node overlaps and label overlaps (if activated; see setIntegratedNodeLabelingEnabled(boolean)
and setConsiderNodeLabelsEnabled(boolean)
). In particular,
to keep the layout compact the CompactDiskLayouter
may decide to place a single node or multiple nodes in the center of the disk.
CompactDiskLayouter
takes the connected components for the placement of the nodes into account. In that case
the nodes of the same component are placed sequentially in the iterative placement process ensuring that they form a visual component.
node types
are defined, the CompactDiskLayouter
takes these into account instead of
the connected components. In particular, nodes of the same type are placed closely together forming a visual component.
setFromSketchModeEnabled(boolean)
to take the coordinates of the input diagram
into account when arranging the nodes on the disk.
CompactDiskLayouter
allows for integrated node labeling
.
Node labels are placed automatically without generating overlaps with other labels or graph elements. There are
different ways
to place node labels.
Field Summary |
---|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
CompactDiskLayouter()
Creates a new CompactDiskLayouter instance with the default settings. |
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
Checks whether or not the core layout algorithm can layout the input graph. |
void |
doLayoutCore(LayoutGraph graph)
Invokes the core layout algorithm. |
double |
getMinimumNodeDistance()
Returns the minimum node distance that this algorithm should enforce between all pairs of nodes. |
byte |
getNodeLabelingPolicy()
Returns the policy defining how node labels are placed by the integrated node labeling mechanism (for example, the desired label orientation). |
double |
getNodeLabelSpacing()
Returns the spacing used for node labels when integrated node labeling is enabled. |
boolean |
isConsiderNodeLabelsEnabled()
Returns whether or not to reserve space for node labels during layout calculation. |
boolean |
isFromSketchModeEnabled()
Returns whether or not to take the coordinates of the input diagram into account when arranging the nodes on the disk. |
boolean |
isIntegratedNodeLabelingEnabled()
Returns whether or not the layout algorithm automatically places node labels. |
void |
setConsiderNodeLabelsEnabled(boolean considerNodeLabelsEnabled)
Specifies whether or not to reserve space for node labels during layout calculation. |
void |
setFromSketchModeEnabled(boolean fromSketchModeEnabled)
Specifies whether or not to take the coordinates of the input diagram into account when arranging the nodes on the disk. |
void |
setIntegratedNodeLabelingEnabled(boolean integratedNodeLabelingEnabled)
Specifies whether or not the layout algorithm automatically places node labels. |
void |
setMinimumNodeDistance(double minimumNodeDistance)
Specifies the minimum node distance this algorithm should enforce between all pairs of nodes. |
void |
setNodeLabelingPolicy(byte nodeLabelingPolicy)
Specifies the policy defining how node labels are placed by the integrated node labeling mechanism (for example, the desired label orientation). |
void |
setNodeLabelSpacing(double nodeLabelSpacing)
Specifies the spacing used for node labels when integrated node labeling is enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompactDiskLayouter()
CompactDiskLayouter
instance with the default settings.
Method Detail |
---|
public void setNodeLabelSpacing(double nodeLabelSpacing)
This spacing specifies the distance between labels associated with the same node (if there are multiple labels).
In addition, for ray-like labels of outermost nodes, the spacing also defines the distance between
the labels and the node they belong to (e.g. for ray-like label placement
).
The spacing must have a non-negative value.
integrated node labeling
is enabled.nodeLabelSpacing
- the non-negative node label spacing
java.lang.IllegalArgumentException
- if the given spacing value is negativesetIntegratedNodeLabelingEnabled(boolean)
![]() Node label spacing set to 5.0 | ![]() Node label spacing set to 25.0 |
public double getNodeLabelSpacing()
This spacing specifies the distance between labels associated with the same node (if there are multiple labels).
In addition, for ray-like labels of outermost nodes, the spacing also defines the distance between
the labels and the node they belong to (e.g. for ray-like label placement
).
The spacing must have a non-negative value.
integrated node labeling
is enabled.setIntegratedNodeLabelingEnabled(boolean)
,
setNodeLabelSpacing(double)
public boolean isConsiderNodeLabelsEnabled()
true
if the labels of nodes are taken into account, false
otherwisesetConsiderNodeLabelsEnabled(boolean)
public void setConsiderNodeLabelsEnabled(boolean considerNodeLabelsEnabled)
public boolean isIntegratedNodeLabelingEnabled()
If enabled, this layout algorithm will calculate the positions for the node labels assuring that no overlaps occur.
Different labeling strategies may be selected using setNodeLabelingPolicy(byte)
.
FreeNodeLabelModel
as the NodeLabelModel
for the nodes.consideration mechanism
has no more effect.true
if integrated node labeling is enabled,
false
otherwise.setIntegratedNodeLabelingEnabled(boolean)
,
setNodeLabelingPolicy(byte)
public void setIntegratedNodeLabelingEnabled(boolean integratedNodeLabelingEnabled)
If enabled, this layout algorithm will calculate the positions for the node labels assuring that no overlaps occur.
Different labeling strategies may be selected using setNodeLabelingPolicy(byte)
.
FreeNodeLabelModel
as the NodeLabelModel
for the nodes.consideration mechanism
has no more effect.integratedNodeLabelingEnabled
- true
if integrated node labeling should be enabled,
false
otherwise.setNodeLabelingPolicy(byte)
public byte getNodeLabelingPolicy()
integrated
node labeling
is enabled.setNodeLabelingPolicy(byte)
,
setIntegratedNodeLabelingEnabled(boolean)
public void setNodeLabelingPolicy(byte nodeLabelingPolicy)
integrated
node labeling
is enabled.NodeLabelingPolicy.NODE_LABELING_MIXED
nodeLabelingPolicy
- one of the predefined node labeling policies
java.lang.IllegalArgumentException
- if an unknown labeling policy is givensetIntegratedNodeLabelingEnabled(boolean)
![]() NodeLabelingPolicy.NODE_LABELING_MIXED | ![]() NodeLabelingPolicy.NODE_LABELING_HORIZONTAL | ![]() NodeLabelingPolicy.NODE_LABELING_RAYLIKE |
public void setFromSketchModeEnabled(boolean fromSketchModeEnabled)
If enabled: The layout algorithm tries to find a placement of the nodes on concentric circles such that it reflects the radial ordering as well as the distances of the nodes to the center of the input layout as good as possible.
fromSketchModeEnabled
- true
if the initial coordinates of the nodes should be used,
false
otherwise![]() Input graph where are roughly placed on circles. | ![]() Compact disk layout taking the coordinates of the input diagram into account. |
public boolean isFromSketchModeEnabled()
If enabled: The layout algorithm tries to find a placement of the nodes on concentric circles such that it reflects the radial ordering as well as the distances of the nodes to the center of the input layout as good as possible.
true
if the initial coordinates of the nodes are used, false
otherwisesetFromSketchModeEnabled(boolean)
public double getMinimumNodeDistance()
setMinimumNodeDistance(double)
public void setMinimumNodeDistance(double minimumNodeDistance)
The minimum node distance needs to be non-negative.
public boolean canLayoutCore(LayoutGraph graph)
CanonicMultiStageLayouter
This method should be implemented by subclasses such that it determines whether or not the core layout algorithm accepts the input graph.
canLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graph
true
if the core layout algorithm can handle the input graph, false
otherwisepublic void doLayoutCore(LayoutGraph graph)
CanonicMultiStageLayouter
This method should be implemented by subclasses in order to perform the layout routine of the layout algorithm.
doLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graph
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |