|
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.tree.TreeReductionStage
public class TreeReductionStage
This stage can be used to layout non-tree structures with a tree layout algorithm. First this stage transforms a graph into a tree or forest by removing some edges. Then it invokes the core layout algorithm on the reduced graph. Finally, it reinserts the hidden non-tree edges to the graph again and optionally routes these edges.
Typical usage:
TreeLayouter tl = new TreeLayouter(); TreeReductionStage trs = new TreeReductionStage(); trs.setNonTreeEdgeRouter(new OrganicEdgeRouter()); trs.setNonTreeEdgeSelectionKey(OrganicEdgeRouter.ROUTE_EDGE_DPKEY); tl.appendStage(trs); new BufferedLayouter(tl).doLayout(graph); tl.removeStage(trs);
OrganicEdgeRouter
,
OrthogonalEdgeRouter
Field Summary | |
---|---|
static Object |
NON_TREE_EDGES_DPKEY
DataProvider key that can be used to explicitly mark (some) edges that should not be considered to belong to a tree. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
TreeReductionStage()
|
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Returns true . |
Layouter |
createStraightlineRouter()
Creates a layouter that can be used to route all non-tree edges as a single straight-line segment. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
Layouter |
getNonTreeEdgeRouter()
Returns the currently set edge router for non-tree edges. |
Object |
getNonTreeEdgeSelectionKey()
Returns the currently set non-tree edge selection key. |
protected void |
routeNonTreeEdges(LayoutGraph graph,
EdgeMap nonTreeEdgeMap)
Routes the non-tree edges. |
void |
setNonTreeEdgeRouter(Layouter nonTreeEdgeRouter)
Sets the edge router for non-tree edges. |
void |
setNonTreeEdgeSelectionKey(Object nonTreeEdgeSelectionKey)
Sets the DataProvider key that will be used by the non-tree edge router to determine the set of edges that should be routed. |
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 Object NON_TREE_EDGES_DPKEY
Constructor Detail |
---|
public TreeReductionStage()
Method Detail |
---|
public boolean canLayout(LayoutGraph graph)
true
.
public void doLayout(LayoutGraph graph)
Layouter
protected void routeNonTreeEdges(LayoutGraph graph, EdgeMap nonTreeEdgeMap)
graph
- graph that can contain tree and non-tree edges.nonTreeEdgeMap
- an edge map that marks all non-tree edges
in the graph with boolean value true
.public Layouter getNonTreeEdgeRouter()
public void setNonTreeEdgeRouter(Layouter nonTreeEdgeRouter)
setNonTreeEdgeSelectionKey(Object)
to
control the set of edges that should be handled by the edge router.
public Object getNonTreeEdgeSelectionKey()
public void setNonTreeEdgeSelectionKey(Object nonTreeEdgeSelectionKey)
Graph.addDataProvider(Object, DataProvider)
,
setNonTreeEdgeRouter(Layouter)
public Layouter createStraightlineRouter()
setNonTreeEdgeRouter(Layouter)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |