|
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.circular.CircularLayouter
public class CircularLayouter
This layout algorithm arranges graphs in a circular fashion.
The nodes are arranged in circles and stars which emphasize group and tree structures inside a graph. Circular layout algorithms find applications in many areas such as social networking, network management, WWW visualization, eCommerce, telecommunications.
Circular layout with default settings
Circular layout with SINGLE_CYCLE
layout style
Circular layout with SINGLE_CYCLE
layout style and exterior edge routing
The layout algorithm performs three steps when calculating a circular arrangement for a graph:
layout style
. Considering each partition as a node, the resulting graph has a tree-like
structure.
partition style
.
getSingleCycleLayouter()
or getBalloonLayouter()
.
The partitions are moved to their final location.
The layout algorithm places the nodes in circles that represent a partition. There are several ways to find
partitions in the input graph. Which one is applied is defined using setLayoutStyle(byte)
.
The nodes in a partition can either lie on or in the interior of a circle. The placement of the nodes affects the compactness of
the layout and can be specified using setPartitionLayoutStyle(byte)
.
Since edges are routed as straight lines, they may overlap with nodes or node labels. To resolve these overlaps,
an edge routing algorithm (e.g. EdgeRouter
or OrganicEdgeRouter
) can
be appended.
Edges that belong to the same circle partition can be routed around the exterior of the circle.
The edge routing policy
determines which edges are exterior and
routing details of these edges can be configured via getExteriorEdgeLayoutDescriptor()
. Exterior edge
routes consist of smooth arcs. Edges that are routed externally can significantly improve the readability of the
circular layout by reducing the edge clutter in the interior of the circle. This holds true especially for graph
with a large number of edges. On the other hand, it significantly increases the amount of required space and,
thus, is not recommended when maximally compact layouts are desired.
This layout algorithm supports edge bundling
. In order to bundle the edges,
the nodes of the graph are clustered in groups. Edge bundling is supported only if
partition layout style
is set to PARTITION_LAYOUTSTYLE_CYCLIC
and
layout style
is other than BCC_ISOLATED
.
Field Summary | |
---|---|
static byte |
BCC_COMPACT
The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as separate partitions. |
static byte |
BCC_ISOLATED
The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as separate partitions. |
static java.lang.Object |
CIRCLE_ID_HOLDER_DPKEY
A DataAcceptor key for publishing the final circle information
For each node, the ID of the circle on which it was placed will be stored. |
static byte |
CIRCULAR_CUSTOM_GROUPS
The specifier for a layout style where the user can specify groups that will form separate partitions. |
static java.lang.Object |
CIRCULAR_CUSTOM_GROUPS_DPKEY
A DataProvider key for defining custom node partitions
The DataProvider needs to provide a mapping from Node s to unique Object IDs for each
group of nodes. |
static byte |
EDGE_ROUTING_POLICY_AUTOMATIC
An edge routing policy specifying that the algorithm automatically determines which edges to route internally and which externally. |
static byte |
EDGE_ROUTING_POLICY_EXTERIOR
An edge routing policy specifying that all edges are routed around the exterior of the circle, except the ones that connect two neighboring nodes. |
static byte |
EDGE_ROUTING_POLICY_INTERIOR
An edge routing policy specifying that there all edges are routed inside the circle and on its border as simple straight lines. |
static byte |
EDGE_ROUTING_POLICY_MARKED_EXTERIOR
An exterior edge routing policy specifying that exterior edges are explicitly marked by the user and the remaining edges are routed on the interior. |
static java.lang.Object |
EXTERIOR_EDGES_DPKEY
A DataProvider key for marking edges that should be routed externally, around the circle instead of inside
The DataProvider registered with the input with this key allows to individually select the edges that are
routed around the exterior of the circle when EDGE_ROUTING_POLICY_MARKED_EXTERIOR is specified
as edge routing policy . |
static byte |
PARTITION_LAYOUTSTYLE_CYCLIC
Specifier for a partition layout style where all nodes of a partition are placed on the boundary of a circle. |
static byte |
PARTITION_LAYOUTSTYLE_DISK
Specifier for a partition style with a semi-compact layout for each partition. |
static byte |
PARTITION_LAYOUTSTYLE_ORGANIC
Specifier for a partition style with a compact layout for each partition. |
static byte |
SINGLE_CYCLE
The specifier for a layout style where all nodes of the input graph will be placed on or in the interior of a single cycle. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
CircularLayouter()
Creates a new CircularLayouter instance with the default settings. |
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
Accepts general graphs without exception. |
void |
doLayout(LayoutGraph graph)
Calculates a circular layout for the given graph. |
void |
doLayoutCore(LayoutGraph graph)
Arranges the given graph in a circular fashion. |
BalloonLayouter |
getBalloonLayouter()
Returns the BalloonLayouter instance used for arranging multiple partitions. |
EdgeBundling |
getEdgeBundling()
Returns the EdgeBundling instance that defines the settings of the edge bundling feature. |
byte |
getEdgeRoutingPolicy()
Returns the edge routing policy that determines whether edges are routed internally or externally with respect to a single partition circle. |
ExteriorEdgeLayoutDescriptor |
getExteriorEdgeLayoutDescriptor()
Returns the descriptor that defines settings for the exterior edges. |
byte |
getLayoutStyle()
Returns the global layout style for this layout algorithm. |
int |
getMaximalDeviationAngle()
Returns the maximum deviation angle allowed for an edge. |
byte |
getPartitionLayoutStyle()
Returns the style for the arrangement of each partition. |
SingleCycleLayouter |
getSingleCycleLayouter()
Returns the SingleCycleLayouter instance used for laying out nodes on a single cycle. |
boolean |
isConsiderNodeLabelsEnabled()
Specifies whether or not the layout algorithm reserves space for node labels preventing possible overlaps. |
boolean |
isFromSketchModeEnabled()
Returns whether or not to take the coordinates of the input diagram into account when arranging the nodes of the partitions and the partitions themselves. |
boolean |
isPlaceChildrenOnCommonRadiusEnabled()
Returns whether or not, in the underlying tree, the children of a tree node are placed on a common radius. |
void |
setComponentLayouterEnabled(boolean enabled)
Specifies whether or not the LayoutStage used for arranging the components of the graph is activated. |
void |
setConsiderNodeLabelsEnabled(boolean handleNodeLabels)
Specifies whether or not the layout algorithm reserves space for node labels preventing possible overlaps. |
void |
setEdgeRoutingPolicy(byte edgeRoutingPolicy)
Specifies the edge routing policy that determines whether edges are routed internally or externally with respect to a single partition circle. |
void |
setFromSketchModeEnabled(boolean fromSketchModeEnabled)
Specifies whether or not to take the coordinates of the input diagram into account when arranging the nodes of the partitions and the partitions themselves. |
void |
setGroupNodeHidingEnabled(boolean groupNodeHidingEnabled)
Specifies whether or not the LayoutStage used for hiding group nodes is activated. |
void |
setLayoutStyle(byte style)
Specifies the global layout style for this layout algorithm. |
void |
setMaximalDeviationAngle(int deviationAngle)
Specifies the maximum deviation angle allowed for an edge. |
void |
setOrientationLayouterEnabled(boolean enabled)
Specifies whether or not the LayoutStage that modifies the orientation of the layout is activated. |
void |
setPartitionLayoutStyle(byte partitionStyle)
Sets the style for the arrangement of each partition. |
void |
setPlaceChildrenOnCommonRadiusEnabled(boolean placeChildrenOnCommonRadiusEnabled)
Specifies whether or not, in the underlying tree, the children of a tree node are placed on a common radius. |
void |
setSelfLoopLayouterEnabled(boolean enabled)
Specifies whether or not the LayoutStage used for routing self-loops is activated. |
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 CIRCLE_ID_HOLDER_DPKEY
DataAcceptor
key for publishing the final circle information
For each node, the ID of the circle on which it was placed will be stored.
DataAcceptor
also a DataProvider
storing values of type
IntValueSettable
can be registered. Then the IntValueSettable
instance gets filled with the
circle information of the corresponding nodes.DataProvider
is registered with this key, the circle information will be dropped.public static final byte BCC_COMPACT
If a node belongs to more than one biconnected component, it will be assigned to the one that seems to be more suitable.
setLayoutStyle(byte)
,
Constant Field ValuesLayout style BCC_COMPACT |
public static final byte BCC_ISOLATED
If a node belongs to more than one biconnected component, it will form an isolated partition and will be laid out in between of all its biconnected component cycles.
setLayoutStyle(byte)
,
Constant Field ValuesLayout style BCC_ISOLATED |
public static final byte CIRCULAR_CUSTOM_GROUPS
DataProvider
with key
CIRCULAR_CUSTOM_GROUPS_DPKEY
must be registered.
setLayoutStyle(byte)
,
Constant Field ValuesLayout style CIRCULAR_CUSTOM_GROUPS |
public static final byte SINGLE_CYCLE
setLayoutStyle(byte)
,
Constant Field ValuesLayout style SINGLE_CYCLE |
public static final java.lang.Object CIRCULAR_CUSTOM_GROUPS_DPKEY
DataProvider
key for defining custom node partitions
The DataProvider
needs to provide a mapping from Node
s to unique Object
IDs for each
group of nodes. These groups will form the circles in the layout.
CIRCULAR_CUSTOM_GROUPS
public static final byte PARTITION_LAYOUTSTYLE_CYCLIC
setPartitionLayoutStyle(byte)
,
Constant Field ValuesPartition style PARTITION_LAYOUTSTYLE_CYCLIC |
public static final byte PARTITION_LAYOUTSTYLE_DISK
This style places nodes in the interior and on the border of a circle and arranges them in an organic manner, leading to a more compact layout. Only nodes with connections to other partitions are guaranteed to lie on the boundary of the resulting disk.
setPartitionLayoutStyle(byte)
,
Constant Field ValuesPartition style PARTITION_LAYOUTSTYLE_DISK |
public static final byte PARTITION_LAYOUTSTYLE_ORGANIC
This style creates an organic circular layout for each partition. Even nodes that connect to different partitions may be placed in the interior of the resulting disk.
setPartitionLayoutStyle(byte)
,
Constant Field ValuesPartition style PARTITION_LAYOUTSTYLE_ORGANIC |
public static final java.lang.Object EXTERIOR_EDGES_DPKEY
DataProvider
key for marking edges that should be routed externally, around the circle instead of inside
The DataProvider
registered with the input with this key allows to individually select the edges that are
routed around the exterior of the circle when EDGE_ROUTING_POLICY_MARKED_EXTERIOR
is specified
as edge routing policy
.
EDGE_ROUTING_POLICY_MARKED_EXTERIOR
.setEdgeRoutingPolicy(byte)
,
EDGE_ROUTING_POLICY_MARKED_EXTERIOR
public static final byte EDGE_ROUTING_POLICY_INTERIOR
This is the default routing policy for the circular layout. No edges are routed on the exterior of the circle.
setEdgeRoutingPolicy(byte)
,
Constant Field ValuesRouting policy EDGE_ROUTING_POLICY_INTERIOR |
public static final byte EDGE_ROUTING_POLICY_AUTOMATIC
Interior edges are simple straight lines, whereas exterior edges get an arc-like, curved path.
The applied algorithm tries to optimize the readability of the final circular layout by extracting edges to the exterior such that the number of edge crossings is reduced. Furthermore, crossings between exterior edges are avoided.
bundled
is selected for exterior routing,
the bundling feature is ignored for that edge.setEdgeRoutingPolicy(byte)
,
Constant Field ValuesRouting policy EDGE_ROUTING_POLICY_AUTOMATIC - two edges are routed externally, thus,
avoiding the intersection with the two internal edges. |
public static final byte EDGE_ROUTING_POLICY_EXTERIOR
Exterior edges get an arc-like, curved edge path.
setEdgeRoutingPolicy(byte)
,
Constant Field ValuesEdge routing policy EDGE_ROUTING_POLICY_EXTERIOR . |
public static final byte EDGE_ROUTING_POLICY_MARKED_EXTERIOR
Edges marked in the DataProvider
registered with the graph with key EXTERIOR_EDGES_DPKEY
are routed around the exterior of the circle. All other edges remain internal.
bundled
is selected for exterior routing,
the bundling feature is ignored for that edge.setEdgeRoutingPolicy(byte)
,
EXTERIOR_EDGES_DPKEY
,
Constant Field ValuesConstructor Detail |
---|
public CircularLayouter()
CircularLayouter
instance with the default settings.
Method Detail |
---|
public boolean isConsiderNodeLabelsEnabled()
Nodes get temporarily enlarged such that they contain their labels.
This might result in layouts that need much space.
layout orientation
is set to LayoutOrientation.TOP_TO_BOTTOM
(which is the default).
Changing the layout orientation for an undirected layout algorithm like the
CircularLayouter
doesn't make sense.true
if labels are considered, false
otherwise.setConsiderNodeLabelsEnabled(boolean)
public void setConsiderNodeLabelsEnabled(boolean handleNodeLabels)
Nodes get temporarily enlarged such that they contain their labels.
This might result in layouts that need much space.
layout orientation
is set to LayoutOrientation.TOP_TO_BOTTOM
(which is the default).
Changing the layout orientation for an undirected layout algorithm like the
CircularLayouter
doesn't make sense.handleNodeLabels
- true
if labels should be considered, false
otherwise.isConsiderNodeLabelsEnabled()
Node labels are ignored | Node labels are considered |
public boolean isPlaceChildrenOnCommonRadiusEnabled()
Disabling this feature may produce more compact layout results.
true
if a common radius is used, false
otherwisesetPlaceChildrenOnCommonRadiusEnabled(boolean)
public void setPlaceChildrenOnCommonRadiusEnabled(boolean placeChildrenOnCommonRadiusEnabled)
Disabling this feature may produce more compact layout results.
public boolean isFromSketchModeEnabled()
If enabled:
BCC_COMPACT
as layout style, since otherwise the
underlying tree structure is not well defined.
true
if the initial coordinates of the nodes are used, false
otherwisesetFromSketchModeEnabled(boolean)
public void setFromSketchModeEnabled(boolean fromSketchModeEnabled)
If enabled:
BCC_COMPACT
as layout style, since otherwise the
underlying tree structure is not well defined.
fromSketchModeEnabled
- true
if the initial coordinates of the nodes should be used,
false
otherwiseisFromSketchModeEnabled()
Order of nodes when From Sketch mode is disabled | Initial graph with changed node order | Order of nodes when From Sketch mode is enabled |
public void setMaximalDeviationAngle(int deviationAngle)
The deviation angle for an edge is the difference between its optimal angle away from the parent cycle and its actual angle.
preferred child wedge
is set on the used
balloon layout algorithm
.deviationAngle
- the deviation angle given in degreesMaximum deviation angle is 20 degrees. | Maximum deviation angle is 90 degrees. |
public int getMaximalDeviationAngle()
The deviation angle for an edge is the difference between its optimal angle away from the parent cycle and its actual angle.
preferred child wedge
is set on the used
balloon layout algorithm
.setMaximalDeviationAngle(int)
public void setLayoutStyle(byte style)
BCC_COMPACT
style
- one of the predefined layout styles
java.lang.IllegalArgumentException
- if an unknown layout style is setgetLayoutStyle()
public byte getLayoutStyle()
setLayoutStyle(byte)
public SingleCycleLayouter getSingleCycleLayouter()
SingleCycleLayouter
instance used for laying out nodes on a single cycle.
Configuring this layout algorithm only affects layouts with only one partition.
SingleCycleLayouter
instance that handles layouts with only one partitionsetLayoutStyle(byte)
public BalloonLayouter getBalloonLayouter()
BalloonLayouter
instance used for arranging multiple partitions.
Configuring this layout algorithm affects the arrangement of the partitions within the overall layout.
BalloonLayouter
instance that arranges the partitionssetLayoutStyle(byte)
public byte getPartitionLayoutStyle()
public void setPartitionLayoutStyle(byte partitionStyle)
PARTITION_LAYOUTSTYLE_CYCLIC
partitionStyle
- one of the predefined partition styles
java.lang.IllegalArgumentException
- if an unknown style is givenpublic ExteriorEdgeLayoutDescriptor getExteriorEdgeLayoutDescriptor()
Exterior edges are routed around the exterior of a circle partition. Only edges connecting nodes
of the same partition can be exterior. The edge routing policy
determines
which edges are exterior (if any).
EDGE_ROUTING_POLICY_INTERIOR
,
which is the default policy.setEdgeRoutingPolicy(byte)
public byte getEdgeRoutingPolicy()
There are two types of supported edges, interior and exterior ones.
public void setEdgeRoutingPolicy(byte edgeRoutingPolicy)
There are two types of supported edges, interior and exterior ones.
EDGE_ROUTING_POLICY_INTERIOR
. Edges are routed as simple straight lines on the interior.edgeRoutingPolicy
- one of the predefined edge routing policies
java.lang.IllegalArgumentException
- if the given edge routing policy is unknownpublic void setComponentLayouterEnabled(boolean enabled)
LayoutStage
used for arranging the components of the graph is activated.
setComponentLayouterEnabled
in class CanonicMultiStageLayouter
CircularLayouter
can only handle single components. Disabling ComponentLayouter
will
lead to errors during execution.enabled
- true
if the stage that arranges the graph components is activated,
false
otherwiseCanonicMultiStageLayouter.isComponentLayouterEnabled()
,
CanonicMultiStageLayouter.setComponentLayouter(LayoutStage)
,
ComponentLayouter
public void setGroupNodeHidingEnabled(boolean groupNodeHidingEnabled)
LayoutStage
used for hiding group nodes is activated.
setGroupNodeHidingEnabled
in class CanonicMultiStageLayouter
CircularLayouter
cannot handle group nodes. Disabling GroupNodeHider
will lead to errors
during execution.groupNodeHidingEnabled
- true
if the stage used for hiding group nodes is activated,
false
otherwiseCanonicMultiStageLayouter.isGroupNodeHidingEnabled()
,
CanonicMultiStageLayouter.setGroupNodeHider(LayoutStage)
,
GroupNodeHider
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(LayoutStage)
,
CanonicMultiStageLayouter.setLayoutOrientation(byte)
,
OrientationLayouter
public void setSelfLoopLayouterEnabled(boolean enabled)
LayoutStage
used for routing self-loops is activated.
setSelfLoopLayouterEnabled
in class CanonicMultiStageLayouter
CircularLayouter
cannot handle self-loops. Disabling SelfLoopLayouter
will lead to errors
during execution.enabled
- true
if the stage responsible for routing self-loops is activated, false
otherwiseCanonicMultiStageLayouter.isSelfLoopLayouterEnabled()
,
CanonicMultiStageLayouter.setSelfLoopLayouter(LayoutStage)
,
SelfLoopLayouter
public EdgeBundling getEdgeBundling()
EdgeBundling
instance that defines the settings of the edge bundling feature.
The specified EdgeBundling
defines global bundling properties. Settings for individual
edges can be defined by assigning an EdgeBundleDescriptor
to an edge using a DataProvider
registered with key EdgeBundling.EDGE_BUNDLE_DESCRIPTOR_DPKEY
.
default
bundle descriptor
which has bundling
enabled.CIRCULAR_CUSTOM_GROUPS
, edge bundles between different groups might in
some cases intersect with other groups.partition layout style
is
set to PARTITION_LAYOUTSTYLE_CYCLIC
and layout style
is
other than BCC_ISOLATED
.EdgeBundling
instance defining the edge bundling setuppublic boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
graph
- the graph.
true
for all general graphspublic void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graphpublic void doLayout(LayoutGraph graph)
The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.
This method is not side effect free in the sense that the order of edges or nodes in the input graph may change during the layout process.
doLayout
in interface Layouter
doLayout
in class CanonicMultiStageLayouter
graph
- the input graphCanonicMultiStageLayouter.appendStage(LayoutStage)
,
CanonicMultiStageLayouter.prependStage(LayoutStage)
,
CanonicMultiStageLayouter.doLayoutCore(LayoutGraph)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |