|
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.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 component Ids into a valid, temporary grouping structure
that is visible for the core layout algorithm
and is obeyed by it if it
supports grouped graphs. Importantly, it is not possible to realize a nested grouping structure using this stage.
If nested groups are required during layout, they need to be defined the usual way by using DataProvider
keys specified in GroupingKeys
.
This stage works as follows:
component Ids
. All nodes
with the same Id 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 component defined by this stage, use a DataProvider
registered
with the input graph with key COMPONENT_LAYOUT_ALGORITHM_DPKEY
. It is then
not necessary to use RecursiveGroupLayouter.GROUP_NODE_LAYOUTER_DPKEY
at all.COMPONENT_ID_DPKEY
,
COMPONENT_LAYOUT_ALGORITHM_DPKEY
Field Summary | |
---|---|
static java.lang.Object |
COMPONENT_ID_DPKEY
A DataProvider key for specifying components of the input graph
Nodes with the same component Id constitute a component and are assigned to the same, temporary, group node,
which is visible during the execution of the core layout algorithm
and again removed afterwards. |
static java.lang.Object |
COMPONENT_LAYOUT_ALGORITHM_DPKEY
A DataProvider key for specifying a layout algorithm for each component node
when used with the recursive group layout stage
If this stage is used in conjunction with RecursiveGroupLayouter , the layout algorithm
specified here is mapped to be responsible for the arrangement of the nodes forming a specified component. |
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 component Id
mapping, 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 COMPONENT_ID_DPKEY
DataProvider
key for specifying components of the input graph
Nodes with the same component Id constitute a component and are assigned to the same, temporary, group node,
which is visible during the execution of the core layout algorithm
and again removed afterwards.
GroupingKeys
.public static final java.lang.Object COMPONENT_LAYOUT_ALGORITHM_DPKEY
DataProvider
key for specifying a layout algorithm for each component node
when used with the recursive group layout stage
If this stage is used in conjunction with RecursiveGroupLayouter
, the layout algorithm
specified here is mapped to be responsible for the arrangement of the nodes forming a specified component.
The first found Layouter
instance bound to any node of a component is applied to that component.
Internally, the temporary group node that encloses the component nodes is automatically mapped
in a DataProvider
registered with key RecursiveGroupLayouter.GROUP_NODE_LAYOUTER_DPKEY
.
RecursiveGroupLayouter
.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)
component Id
mapping, executes the core layout algorithm, and, finally, removes the temporary group nodes.
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 |