|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty.layout.AbstractLayoutStage
y.layout.TemporaryGroupNodeInsertionStage
public class TemporaryGroupNodeInsertionStage
TemporaryGroupNodeInsertionStage
is useful if nodes should be treated by layout algorithms as if they
were actually grouped without the need to manually create a grouped graph for the layout process.
This stage converts given TemporaryGroupDescriptor
s into a valid, temporary grouping structure
that is visible for the core layout algorithm
and is obeyed by it if it
supports grouped graphs.
This stage works as follows:
temporar group descriptors
. All nodes
with the same descriptor
are assigned to a newly created group node that is inserted into the graph.
core layout algorithm
is executed. It works on the graph containing
the inserted group nodes.
core layout algorithm
sees both, the newly inserted groups and the
old, existing ones and does not distinguish among them.
RecursiveGroupLayouter
should be applied
but the graph is not grouped. This way a layout algorithm (or different ones) can be applied independently
for different sub-graphs without manually grouping the graph only for the layout process. To map a specific
Layouter
instance to a temporary group descriptor use
TemporaryGroupDescriptor.setRecursiveGroupLayoutAlgorithm(Layouter)
.
It is then not necessary to use RecursiveGroupLayouter.GROUP_NODE_LAYOUTER_DPKEY
.TEMPORARY_GROUP_DESCRIPTOR_DPKEY
,
TemporaryGroupDescriptor
,
INSERTED_GROUP_NODE_DPKEY
![]() |
![]() |
Field Summary | |
---|---|
static java.lang.Object |
INSERTED_GROUP_NODE_DPKEY
A DataProvider key that this stage uses for marking the inserted group nodes
The algorithm temporarily adds a DataProvider that is registered with this key and
marks inserted group nodes. |
static java.lang.Object |
TEMPORARY_GROUP_DESCRIPTOR_DPKEY
A DataProvider key for specifying temporary groups of the input graph
Nodes associated with the same TemporaryGroupDescriptor instance constitute a group and are assigned
to the same, temporarily inserted group node,
which is visible during the execution of the core layout algorithm
and removed afterwards. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
TemporaryGroupNodeInsertionStage()
Creates a new TemporaryGroupNodeInsertionStage with default settings. |
|
TemporaryGroupNodeInsertionStage(Layouter core)
Creates a new TemporaryGroupNodeInsertionStage with the given layout algorithm
as 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)
Creates temporary group nodes based on the sub-graphs define by the temporary group descriptors ,
executes the core layout algorithm, and, finally, removes the temporary group nodes. |
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 TEMPORARY_GROUP_DESCRIPTOR_DPKEY
DataProvider
key for specifying temporary groups of the input graph
Nodes associated with the same TemporaryGroupDescriptor
instance constitute a group and are assigned
to the same, temporarily inserted group node,
which is visible during the execution of the core layout algorithm
and removed afterwards.
INSERTED_GROUP_NODE_DPKEY
public static final java.lang.Object INSERTED_GROUP_NODE_DPKEY
DataProvider
key that this stage uses for marking the inserted group nodes
The algorithm temporarily adds a DataProvider
that is registered with this key and
marks inserted group nodes. More precisely, for each inserted group node
DataProvider.getBool(Object)
returns true
.
It is only available during the processing of this stage and automatically removed at the end.
Constructor Detail |
---|
public TemporaryGroupNodeInsertionStage()
TemporaryGroupNodeInsertionStage
with default settings.
public TemporaryGroupNodeInsertionStage(Layouter core)
TemporaryGroupNodeInsertionStage
with the given layout algorithm
as core layout algorithm
.
core
- the core layout algorithmMethod Detail |
---|
public 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)
temporary group descriptors
,
executes the core layout algorithm, and, finally, removes the temporary group nodes.
graph
- the input graphLayouter.canLayout(LayoutGraph)
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |