|
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.EdgeReversalStage
public class EdgeReversalStage
A layout stage that can be used to (selectively) reverse edges in a graph while keeping the layout and label positions of the reversed edges as close to the pre-reversal layout and positions as possible.
Field Summary | |
---|---|
static Object |
REVERSE_EDGES_DPKEY
This key can be used to select specific edges for reversal. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
EdgeReversalStage()
|
|
EdgeReversalStage(Layouter core)
|
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Returns true iff the given graph can be laid
out by this algorithm. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
static void |
findReversedTreeEdges(LayoutGraph graph,
Node root,
DataAcceptor reversedEdges)
Marks edges in a tree-structured graph component that need to be reversed to make the specified node the root of the tree component. |
void |
reverseEdge(LayoutGraph graph,
Edge edge)
Reverse the specified edge in the specified graph. |
void |
reverseEdges(LayoutGraph graph)
Reverses selected edges in the specified graph. |
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 REVERSE_EDGES_DPKEY
DataProvider
returns true
for
said edge.
Note:
If there is no DataProvider
for this key, all edges are
considered selected.
Constructor Detail |
---|
public EdgeReversalStage()
public EdgeReversalStage(Layouter core)
Method Detail |
---|
public boolean canLayout(LayoutGraph graph)
Layouter
true
iff the given graph can be laid
out by this algorithm. Calling doLayout
with
the given graph as its argument will only success if
this method returns true
.
public void doLayout(LayoutGraph graph)
Layouter
public void reverseEdges(LayoutGraph graph)
REVERSE_EDGES_DPKEY
.
Implementation detail: This method calls
reverseEdge(LayoutGraph, y.base.Edge)
in order to reverse a
selected edge.
graph
- the graph in which to reverse edges.REVERSE_EDGES_DPKEY
public void reverseEdge(LayoutGraph graph, Edge edge)
LayoutTool.reverseEdgeLayout(EdgeLayout)
.
Moreover, the positions of all labels associated to the specified edge
are adjusted to match the pre-reversal position as closely as possible.
(Depending on a label's model it might not always be possible to achieve
an exact match.)
graph
- the graph to which the specified edge belongs.edge
- the edge to be reversed.public static void findReversedTreeEdges(LayoutGraph graph, Node root, DataAcceptor reversedEdges)
boolean
true
flag.
IllegalArgumentException
- if the specified node does not belong to
the specified graph.graph
- the graph to which the specified node belongs.root
- the node to be considered the root of its tree component.reversedEdges
- a data acceptor that is used to mark edges for
reversal.REVERSE_EDGES_DPKEY
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |