|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.tree.TreeComponentLayouter
public class TreeComponentLayouter
The TreeComponentLayouter arranges tree-like subgraph structures in a mixed layout style.

The tree components are marked
![]() |
![]() |
| Field Summary | |
|---|---|
static java.lang.Object |
DUMMY_NODE_DPKEY
A DataProvider key for identifying dummy nodes during the layout calculation
This DataProvider is registered and also removed in
doLayoutUsingDummies(LayoutGraph, DataProvider). |
| Fields inherited from interface y.layout.Layouter |
|---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
| Constructor Summary | |
|---|---|
TreeComponentLayouter(Layouter treeCoreLayouter)
Creates a new TreeComponentLayouter instance using the specified layouter for arranging the subtrees. |
|
| Method Summary | |
|---|---|
boolean |
canLayout(LayoutGraph graph)
Accepts all graphs if there is a core layout algorithm and a
tree layout algorithm. |
void |
doLayout(LayoutGraph graph)
Finds the tree components inside the given graph and applies a tree layout
to them. |
protected void |
doLayoutUsingDummies(LayoutGraph graph,
DataProvider dummyDp)
Delegates the layout calculation to the core layout algorithm and handles the dummy
nodes. |
Layouter |
getCoreLayouter()
Returns the core layout algorithm. |
Layouter |
getTreeComponentCoreLayouter()
Returns the layout algorithm that is applied to tree components. |
boolean |
isOrientationOptimizationActive()
Returns whether or not tree component arrangement is improved by changing the orientation of components. |
boolean |
isUndirectedTreeConsiderationEnabled()
Returns whether or not undirected tree sub-graphs should be detected and handled. |
void |
setCoreLayouter(Layouter l)
Specifies the core layout algorithm. |
void |
setOrientationOptimizationActive(boolean orientationOptimizationActive)
Specifies whether or not tree component arrangement is improved by changing the orientation of components. |
void |
setTreeComponentCoreLayouter(Layouter treeComponentCoreLayouter)
Specifies the layout algorithm that is applied to tree components. |
void |
setUndirectedTreeConsiderationEnabled(boolean undirectedTreeConsiderationEnabled)
Specifies whether or not undirected tree sub-graphs should be detected and handled. |
| 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 DUMMY_NODE_DPKEY
DataProvider key for identifying dummy nodes during the layout calculation
This DataProvider is registered and also removed in
doLayoutUsingDummies(LayoutGraph, DataProvider).
doLayoutUsingDummies(LayoutGraph, DataProvider)| Constructor Detail |
|---|
public TreeComponentLayouter(Layouter treeCoreLayouter)
TreeComponentLayouter instance using the specified layouter for arranging the subtrees.
treeCoreLayouter - the layout algorithm used for arranging the tree components
java.lang.IllegalArgumentException - if the specified layout algorithm is null| Method Detail |
|---|
public boolean canLayout(LayoutGraph graph)
core layout algorithm and a
tree layout algorithm.
canLayout in interface Layoutergraph - the input graph
true if both a core layout algorithm and a tree layout algorithm are specified,
false otherwiseLayouter.doLayout(LayoutGraph)public void doLayout(LayoutGraph graph)
tree layout
to them.
doLayout in interface Layoutergraph - the input graphLayouter.canLayout(LayoutGraph)
protected void doLayoutUsingDummies(LayoutGraph graph,
DataProvider dummyDp)
core layout algorithm and handles the dummy
nodes.
The dummy nodes are marked using the given DataProvider.
This implementation just registers the dummy node DataProvider with the graph with key
DUMMY_NODE_DPKEY, executes the core layout algorithm and finally removes the data provider again.
This method is called by doLayout(LayoutGraph) to invoke the core layout algorithm. It may be overridden
to customize the handling of the dummy nodes.
core layout algorithm is null.graph - the input graphdummyDp - the DataProvider which marks the dummy nodespublic Layouter getCoreLayouter()
LayoutStageLayouter.doLayout(LayoutGraph). The LayoutStage
may add pre- and post-processing steps before and after calling the core layout algorithm.
getCoreLayouter in interface LayoutStagepublic void setCoreLayouter(Layouter l)
LayoutStageLayouter.doLayout(LayoutGraph). The LayoutStage
may add pre- and post-processing steps before and after calling the core layout algorithm.
setCoreLayouter in interface LayoutStagel - the core layout algorithmpublic Layouter getTreeComponentCoreLayouter()
setTreeComponentCoreLayouter(Layouter)public void setTreeComponentCoreLayouter(Layouter treeComponentCoreLayouter)
treeComponentCoreLayouter - the layout algorithm for tree components
java.lang.IllegalArgumentException - if the specified layout algorithm is nullpublic boolean isOrientationOptimizationActive()
true if the component arrangement is optimized, false otherwisesetOrientationOptimizationActive(boolean)public void setOrientationOptimizationActive(boolean orientationOptimizationActive)
orientationOptimizationActive - true if the component arrangement should be optimized,
false otherwisepublic boolean isUndirectedTreeConsiderationEnabled()
When enabled, the direction of the edges that define a subtree is not relevant. Therefore, also
undirected trees are detected and handled as a tree component. Otherwise, only trees that are consistently
directed from the root are handled (directed rooted trees).
true if undirected subtrees are considered, false otherwisesetUndirectedTreeConsiderationEnabled(boolean)public void setUndirectedTreeConsiderationEnabled(boolean undirectedTreeConsiderationEnabled)
When enabled, the direction of the edges that define a subtree is not relevant. Therefore, also
undirected trees are detected and handled as a tree component. Otherwise, only trees that are consistently
directed from the root are handled (directed rooted trees).
undirectedTreeConsiderationEnabled - true if undirected subtrees should be considered,
false otherwise
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||