|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.grid.GenericPartitionGridStage
public class GenericPartitionGridStage
This LayoutStage
offers generic support for partition grid structures
.
The stage performs the following steps:
grid cell
. Nodes without associated grid cell are temporarily assigned to a
suitable cell.
core layout algorithm
to each sub-component and, afterwards, reassembles the global partition grid structure. Since the sub-components
do not contain nodes of different cells, the core layout algorithm
doesn't require support for partition grid on its own.
inter-edge router
. Note that such edges
are temporarily hidden during the core layout runs.
Disabling property setMultiCellComponentSplittingEnabled(boolean)
allows to switch to a mode where connected
components are not split into smaller sub-components. Hence, a component may contain nodes of different partition cells
and, thus, the specified core layout algorithm
has to support partition grid
structures by itself. In this case, this stage doesn't offer a generic partition grid support (since the core
layout algorithm already has to support such structures). Instead it may speed up the layout calculation since the
core layout algorithm is applied to different smaller graphs instead of a single, larger input graph.
PartitionGrid
Field Summary | |
---|---|
static java.lang.Object |
SPLIT_EDGES_DPKEY
A DataProvider key for explicitly marking (some) edges that should not be considered when calculating the
sub-components
This key is only considered if property setMultiCellComponentSplittingEnabled(boolean)
is disabled. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
GenericPartitionGridStage()
Creates a new instance without a specific core layout algorithm . |
|
GenericPartitionGridStage(Layouter coreLayouter)
Creates a new instance using the given core layout algorithm . |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Accepts all graphs that can be handled by the core layout algorithm . |
void |
doLayout(LayoutGraph graph)
Starts the layout. |
Layouter |
getInterEdgeRouter()
Returns the current edge routing algorithm for handling inter-edges. |
java.lang.Object |
getInterEdgesDpKey()
Returns the key for marking the inter-edges to be routed. |
boolean |
isLabelConsiderationEnabled()
Returns whether or not to take node and edge labels into account when calculating the bounding box of the partition cells. |
boolean |
isMultiCellComponentSplittingEnabled()
Returns whether or not the algorithm should split connected components that have nodes associated with different partition cells. |
void |
setInterEdgeRouter(Layouter interEdgeRouter)
Specifies the current edge routing algorithm for handling inter-edges. |
void |
setInterEdgesDpKey(java.lang.Object interEdgesDpKey)
Specifies the key for marking the inter-edges to be routed. |
void |
setLabelConsiderationEnabled(boolean enabled)
Specifies whether or not to take node and edge labels into account when calculating the bounding box of the partition cells. |
void |
setMultiCellComponentSplittingEnabled(boolean multiCellComponentSplittingEnabled)
Specifies whether or not the algorithm should split connected components that have nodes associated with different partition cells. |
Methods inherited from class y.layout.AbstractLayoutStage |
---|
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter |
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 SPLIT_EDGES_DPKEY
DataProvider
key for explicitly marking (some) edges that should not be considered when calculating the
sub-components
This key is only considered if property setMultiCellComponentSplittingEnabled(boolean)
is disabled. The marked edges, the so-called split-edges, are temporarily removed during the calculation of the
sub-components and, finally, routed with the specified inter-edge router
.
This allows to control how the graph is split into smaller graph components. Recall that with this setting
a component may contain nodes of different partition cells.
setInterEdgeRouter(Layouter)
,
setMultiCellComponentSplittingEnabled(boolean)
Constructor Detail |
---|
public GenericPartitionGridStage()
core layout algorithm
.
public GenericPartitionGridStage(Layouter coreLayouter)
core layout algorithm
.
coreLayouter
- the core layout algorithmMethod Detail |
---|
public void setLabelConsiderationEnabled(boolean enabled)
setMultiCellComponentSplittingEnabled(boolean)
is enabled.
Otherwise the proper calculation of the partition cell box is up to the
core layout algorithm
.enabled
- true
if node and edge labels should be taken into account, false
otherwisesetMultiCellComponentSplittingEnabled(boolean)
public boolean isLabelConsiderationEnabled()
setMultiCellComponentSplittingEnabled(boolean)
is enabled.
Otherwise the proper calculation of the partition cell box is up to the
core layout algorithm
.true
if node and edge labels are taken into account, false
otherwisesetLabelConsiderationEnabled(boolean)
,
setMultiCellComponentSplittingEnabled(boolean)
public Layouter getInterEdgeRouter()
If option setMultiCellComponentSplittingEnabled(boolean)
is enabled, components that contain nodes associated
with different partition cells
are split into sub-components.
Edges that connect nodes of different sub-components are called inter-edges and routed
with this edge routing algorithm.
It is required that a suitable selection key
is specified. The same
selection key must be used for setting the scope for the edge routing algorithm.
null
if edges are routed as straight linessetInterEdgeRouter(Layouter)
,
setInterEdgesDpKey(Object)
public void setInterEdgeRouter(Layouter interEdgeRouter)
If option setMultiCellComponentSplittingEnabled(boolean)
is enabled, components that contain nodes associated
with different partition cells
are split into sub-components.
Edges that connect nodes of different sub-components are called inter-edges and routed
with this edge routing algorithm.
It is required that a suitable selection key
is specified. The same
selection key must be used for setting the scope for the edge routing algorithm.
interEdgeRouter
- the edge routing algorithm for inter-edges or null
if edges should be routed
as straight linessetInterEdgesDpKey(Object)
public java.lang.Object getInterEdgesDpKey()
The key should be used by the specified inter-edge routing algorithm
to obtain
the edges that must be routed. This stage automatically
marks these edges and registers the DataProvider
using the specified key.
DataAcceptor
registered with this key, this stage uses it to mark the
edges instead of adding a new DataProvider
.getInterEdgeRouter()
,
setInterEdgesDpKey(Object)
public void setInterEdgesDpKey(java.lang.Object interEdgesDpKey)
The key should be used by the specified inter-edge routing algorithm
to obtain
the edges that must be routed. This stage automatically
marks these edges and registers the DataProvider
using the specified key.
DataAcceptor
registered with this key, this stage uses it to mark the
edges instead of adding a new DataProvider
.Layouter.SELECTED_EDGES
interEdgesDpKey
- the inter-edge selection key
java.lang.IllegalArgumentException
- if the specified key is null
setInterEdgeRouter(Layouter)
public boolean isMultiCellComponentSplittingEnabled()
If this option is enabled, such components are split into sub-components that only include nodes associated
with the same grid cell
. Hence, the core layout algorithm
doesn't see the partition grid
at all. Edges that connect nodes of different sub-components are temporarily
hidden and routed afterwards by means of the inter-edge router
.
If this option is disabled, the layout algorithm determines independent components and calls the
core layout algorithm
for each of them. Note that two connected components
are only independent if there is no group node that contains a node of each of them and if
the two sub-partition grids induced by the connected components do no have a common ColumnDescriptor
or RowDescriptor
.
The core layout algorithm is called once for each independent component and, thus,
has to support partition grid structures.
core layout algorithm
has to
support partition grid structures by itself.true
if connected components with nodes of different partition cells are split,
false
otherwisesetMultiCellComponentSplittingEnabled(boolean)
public void setMultiCellComponentSplittingEnabled(boolean multiCellComponentSplittingEnabled)
If this option is enabled, such components are split into sub-components that only include nodes associated
with the same grid cell
. Hence, the core layout algorithm
doesn't see the partition grid
at all. Edges that connect nodes of different sub-components are temporarily
hidden and routed afterwards by means of the inter-edge router
.
If this option is disabled, the layout algorithm determines independent components and calls the
core layout algorithm
for each of them. Note that two connected components
are only independent if there is no group node that contains a node of each of them and if
the two sub-partition grids induced by the connected components do no have a common ColumnDescriptor
or RowDescriptor
.
The core layout algorithm is called once for each independent component and, thus,
has to support partition grid structures.
core layout algorithm
has to
support partition grid structures by itself.multiCellComponentSplittingEnabled
- true
if connected components with nodes of different
partition cells should be split, false
otherwisepublic boolean canLayout(LayoutGraph graph)
core layout algorithm
.
If there is no core layout algorithm
, all graphs are accepted.
graph
- the input graph
true
if there is no core layout algorithm or the core layout algorithm accepts the graph,
false
otherwiseLayouter.doLayout(LayoutGraph)
public void doLayout(LayoutGraph graph)
graph
- the input graphLayouter.canLayout(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 |