|
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.NormalizingGraphElementOrderStage
public class NormalizingGraphElementOrderStage
Layout stage that can be used to normalize the order of the elements within a graph. Amongst other factors,
the results produced by layout algorithms usually depend on the order of the nodes and edges within a graph.
Unfortunately, useful operations such as hiding or unhiding elements from a graph or
simply invoking layout algorithms on a graph will have the potential side effect of changing that order.
With this layout stage it is possible to establish a predefined order of nodes and edges within a graph to
avoid non-deterministic layout behavior. Defining the order of nodes and edges is done by
associating each node or edge in the graph with a Comparable
value using DataProviders
registered with the key COMPARABLE_NODE_DPKEY
, or COMPARABLE_EDGE_DPKEY
respectively.
the DataProvider key
Field Summary | |
---|---|
static Object |
COMPARABLE_EDGE_DPKEY
The DataProvider registered with this key must return a
Comparable object for each edge thereby inducing a (global) order
for edges. |
static Object |
COMPARABLE_NODE_DPKEY
The DataProvider registered with this key must return a
Comparable object for each node thereby inducing a (global) order
for nodes. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
NormalizingGraphElementOrderStage()
|
|
NormalizingGraphElementOrderStage(Layouter coreLayouter)
|
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 |
fillComparableMapFromGraph(Graph graph,
DataMap comparableNodeMap,
DataMap comparableEdgeMap)
Convenience method that assigns comparable values for each node and edge. |
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 COMPARABLE_NODE_DPKEY
DataProvider
registered with this key must return a
Comparable
object for each node thereby inducing a (global) order
for nodes.
public static final Object COMPARABLE_EDGE_DPKEY
DataProvider
registered with this key must return a
Comparable
object for each edge thereby inducing a (global) order
for edges.
Constructor Detail |
---|
public NormalizingGraphElementOrderStage()
public NormalizingGraphElementOrderStage(Layouter coreLayouter)
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 static void fillComparableMapFromGraph(Graph graph, DataMap comparableNodeMap, DataMap comparableEdgeMap)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |