public class CircularLayout extends MultiStageLayout
LayoutStyle.SINGLE_CYCLE layout style
layout style. Considering each partition as a node, the resulting graph has a tree-like
structure.
partition style.SingleCycleLayout or
BalloonLayout. 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 LayoutStyle.
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 PartitionStyle.
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.
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 PartitionStyle.CYCLE and layout style is other than
LayoutStyle.BCC_ISOLATED.
| Modifier and Type | Field and Description |
|---|---|
static NodeDpKey<Integer> |
CIRCLE_ID_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 NodeDpKey<Object> |
CUSTOM_GROUPS_DPKEY
A
DataProvider key for defining custom node partitions
The IDataProvider needs to provide a mapping from Nodes to unique Object IDs for each group of
nodes. |
| Constructor and Description |
|---|
CircularLayout()
Creates a new
CircularLayout instance with the default settings. |
| Modifier and Type | Method and Description |
|---|---|
void |
applyLayout(LayoutGraph graph)
Calculates a circular layout for the given graph.
|
void |
applyLayoutCore(LayoutGraph graph)
Arranges the given graph in a circular fashion.
|
BalloonLayout |
getBalloonLayout()
Gets the
BalloonLayout instance used for arranging multiple partitions. |
EdgeBundling |
getEdgeBundling()
Gets the
EdgeBundling instance that defines the settings of the edge bundling feature. |
LayoutStyle |
getLayoutStyle()
Gets the global layout style for this layout algorithm.
|
int |
getMaximumDeviationAngle()
Gets the maximum deviation angle allowed for an edge.
|
PartitionStyle |
getPartitionStyle()
Gets the style for the arrangement of each partition.
|
SingleCycleLayout |
getSingleCycleLayout()
Gets the
SingleCycleLayout instance used for laying out nodes on a single cycle. |
boolean |
isFromSketchModeEnabled()
Gets 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 |
isNodeLabelConsiderationEnabled()
Gets whether or not the layout algorithm reserves space for node labels preventing possible overlaps.
|
boolean |
isPlacingChildrenOnCommonRadiusEnabled()
Gets whether or not, in the underlying tree, the children of a tree node are placed on a common radius.
|
void |
setComponentLayoutEnabled(boolean value)
Sets whether or not the
ILayoutStage used for arranging the components of the graph is activated. |
void |
setFromSketchModeEnabled(boolean value)
Sets 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 |
setHideGroupsStageEnabled(boolean value)
Sets whether or not the
ILayoutStage used for hiding group nodes is activated. |
void |
setLayoutStyle(LayoutStyle value)
Sets the global layout style for this layout algorithm.
|
void |
setMaximumDeviationAngle(int value)
Sets the maximum deviation angle allowed for an edge.
|
void |
setNodeLabelConsiderationEnabled(boolean value)
Sets whether or not the layout algorithm reserves space for node labels preventing possible overlaps.
|
void |
setOrientationLayoutEnabled(boolean value)
Sets whether or not the
ILayoutStage that modifies the orientation of the layout is activated. |
void |
setPartitionStyle(PartitionStyle value)
Sets the style for the arrangement of each partition.
|
void |
setPlacingChildrenOnCommonRadiusEnabled(boolean value)
Sets whether or not, in the underlying tree, the children of a tree node are placed on a common radius.
|
void |
setSelfLoopRouterEnabled(boolean value)
Sets whether or not the
ILayoutStage used for routing self-loops is activated. |
appendStage, checkNodeSize, disableAllStages, getComponentLayout, getHideGroupsStage, getLabeling, getLayoutOrientation, getOrientationLayout, getParallelEdgeRouter, getSelfLoopRouter, getSubgraphLayout, isComponentLayoutEnabled, isHideGroupsStageEnabled, isLabelingEnabled, isOrientationLayoutEnabled, isParallelEdgeRouterEnabled, isSelfLoopRouterEnabled, isSubgraphLayoutEnabled, prependStage, removeStage, setComponentLayout, setHideGroupsStage, setLabeling, setLabelingEnabled, setLayoutOrientation, setOrientationLayout, setParallelEdgeRouter, setParallelEdgeRouterEnabled, setSelfLoopRouter, setSubgraphLayout, setSubgraphLayoutEnabledpublic static final NodeDpKey<Integer> CIRCLE_ID_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.
IDataProvider is registered with this key, the circle information will be dropped.public static final NodeDpKey<Object> CUSTOM_GROUPS_DPKEY
DataProvider key for defining custom node partitions
The IDataProvider needs to provide a mapping from Nodes to unique Object IDs for each group of
nodes. These groups will form the circles in the layout.
LayoutStyle.CUSTOM_GROUPSpublic CircularLayout()
CircularLayout instance with the default settings.public void applyLayout(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.
applyLayout in interface ILayoutAlgorithmapplyLayout in class MultiStageLayoutgraph - the input graphMultiStageLayout.appendStage(ILayoutStage),
MultiStageLayout.prependStage(ILayoutStage),
MultiStageLayout.applyLayoutCore(LayoutGraph)public void applyLayoutCore(LayoutGraph graph)
applyLayoutCore in class MultiStageLayoutgraph - the input graphpublic BalloonLayout getBalloonLayout()
BalloonLayout instance used for arranging multiple partitions.
Configuring this layout algorithm affects the arrangement of the partitions within the overall layout.
BalloonLayout instance that arranges the partitionssetLayoutStyle(LayoutStyle)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 IDataProvider registered with key
EdgeBundling.EDGE_BUNDLE_DESCRIPTOR_DPKEY.
default bundle descriptor
which has bundling enabled.LayoutStyle.CUSTOM_GROUPS, edge bundles between different groups might in some cases intersect with other
groups.partition layout style is set to PartitionStyle.CYCLE
and layout style is other than LayoutStyle.BCC_ISOLATED.EdgeBundling instance defining the edge bundling setuppublic LayoutStyle getLayoutStyle()
IllegalArgumentException - if an unknown layout style is setLayoutStyle.BCC_COMPACTsetLayoutStyle(LayoutStyle)public int getMaximumDeviationAngle()
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.setMaximumDeviationAngle(int)public PartitionStyle getPartitionStyle()
IllegalArgumentException - if an unknown style is givenPartitionStyle.CYCLEsetPartitionStyle(PartitionStyle)public SingleCycleLayout getSingleCycleLayout()
SingleCycleLayout instance used for laying out nodes on a single cycle.
Configuring this layout algorithm only affects layouts with only one partition.
SingleCycleLayout instance that handles layouts with only one partitionsetLayoutStyle(LayoutStyle)public boolean isFromSketchModeEnabled()
If enabled:
LayoutStyle.BCC_COMPACT as layout style, since otherwise the
underlying tree structure is not well defined.
false. The layout algorithm does not consider the initial coordinates of the nodes.true if the initial coordinates of the nodes are used, false otherwisesetFromSketchModeEnabled(boolean)public boolean isNodeLabelConsiderationEnabled()
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 CircularLayout doesn't make sense.false. Node labels are not taken into account.true if labels are considered, false otherwise.setNodeLabelConsiderationEnabled(boolean)public boolean isPlacingChildrenOnCommonRadiusEnabled()
Disabling this feature may produce more compact layout results.
true. Children are placed on a common radius.true if a common radius is used, false otherwisesetPlacingChildrenOnCommonRadiusEnabled(boolean)public void setComponentLayoutEnabled(boolean value)
ILayoutStage used for arranging the components of the graph is activated.setComponentLayoutEnabled in class MultiStageLayoutCircularLayout can only handle single components. Disabling ComponentLayout will lead to errors during
execution.true. The stage that arranges connected graph components is activated.value - true if the stage that arranges the graph components is activated, false otherwiseMultiStageLayout.isComponentLayoutEnabled(),
MultiStageLayout.setComponentLayout(ILayoutStage),
ComponentLayoutpublic void setFromSketchModeEnabled(boolean value)
If enabled:
LayoutStyle.BCC_COMPACT as layout style, since otherwise the
underlying tree structure is not well defined.
false. The layout algorithm does not consider the initial coordinates of the nodes.value - true if the initial coordinates of the nodes are used, false otherwiseisFromSketchModeEnabled()public void setHideGroupsStageEnabled(boolean value)
ILayoutStage used for hiding group nodes is activated.setHideGroupsStageEnabled in class MultiStageLayoutCircularLayout cannot handle group nodes. Disabling HideGroupsStage will lead to errors during
execution.true. The stage responsible for hiding group nodes is activated.value - true if the stage used for hiding group nodes is activated, false otherwiseMultiStageLayout.isHideGroupsStageEnabled(),
MultiStageLayout.setHideGroupsStage(ILayoutStage),
HideGroupsStagepublic void setLayoutStyle(LayoutStyle value)
IllegalArgumentException - if an unknown layout style is setLayoutStyle.BCC_COMPACTvalue - one of the predefined layout stylesgetLayoutStyle()public void setMaximumDeviationAngle(int value)
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.value - the maximum deviation angle given in degreesgetMaximumDeviationAngle()public void setNodeLabelConsiderationEnabled(boolean value)
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 CircularLayout doesn't make sense.false. Node labels are not taken into account.value - true if labels are considered, false otherwise.isNodeLabelConsiderationEnabled()public void setOrientationLayoutEnabled(boolean value)
ILayoutStage that modifies the orientation of the layout is activated.setOrientationLayoutEnabled in class MultiStageLayoutLayoutOrientation.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(ILayoutStage),
MultiStageLayout.setLayoutOrientation(com.yworks.yfiles.layout.LayoutOrientation),
OrientationLayoutpublic void setPartitionStyle(PartitionStyle value)
IllegalArgumentException - if an unknown style is givenPartitionStyle.CYCLEvalue - one of the predefined partition stylesgetPartitionStyle()public void setPlacingChildrenOnCommonRadiusEnabled(boolean value)
Disabling this feature may produce more compact layout results.
true. Children are placed on a common radius.value - true if a common radius is used, false otherwiseisPlacingChildrenOnCommonRadiusEnabled()public void setSelfLoopRouterEnabled(boolean value)
ILayoutStage used for routing self-loops is activated.setSelfLoopRouterEnabled in class MultiStageLayoutCircularLayout cannot handle self-loops. Disabling SelfLoopRouter will lead to errors during execution.true. The stage that routes self-loops is activated.value - true if the stage responsible for routing self-loops is activated, false otherwiseMultiStageLayout.isSelfLoopRouterEnabled(),
MultiStageLayout.setSelfLoopRouter(ILayoutStage),
SelfLoopRouter