|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.TopologicalLayerer
public class TopologicalLayerer
This class implements the layering phase of the IncrementalHierarchicLayouter
(i.e., assignment of the nodes to layers).
It uses topological sorting to assign layers to the nodes.
IncrementalHierarchicLayouter
as well as HierarchicLayouter
and
HierarchicGroupLayouter
.Field Summary | |
---|---|
static byte |
DOWN_SHIFT
A ranking policy that specifies that nodes are re-ranked by an inexpensive downshift rule. |
static byte |
NO_RERANKING
A ranking policy that specifies that nodes are not re-ranked after the initial topological layering step. |
static byte |
TIGHT_TREE
A ranking policy that specifies that nodes are re-ranked by finding a spanning tree that contains only tight (length 1 ) edges. |
Constructor Summary | |
---|---|
TopologicalLayerer()
Creates a new instance of TopologicalLayerer with default settings. |
Method Summary | |
---|---|
void |
assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Assigns all nodes of the graph to layers and adds them to the Layers instance. |
int |
assignNodeLayer(LayoutGraph graph,
NodeMap layerID,
EdgeList reversedEdges)
This method assigns the nodes in the graph to layers. |
byte |
getRankingPolicy()
Returns the (re-)ranking policy used by this TopologicalLayerer instance. |
void |
setRankingPolicy(byte p)
Specifies the (re-)ranking policy used by this TopologicalLayerer instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte NO_RERANKING
public static final byte DOWN_SHIFT
public static final byte TIGHT_TREE
1
) edges.
Constructor Detail |
---|
public TopologicalLayerer()
TopologicalLayerer
with default settings.
Method Detail |
---|
public void setRankingPolicy(byte p)
TopologicalLayerer
instance.
NO_RERANKING
p
- one of the predefined ranking policies
java.lang.IllegalArgumentException
- if an unknown ranking policy is givenpublic byte getRankingPolicy()
TopologicalLayerer
instance.
setRankingPolicy(byte)
public int assignNodeLayer(LayoutGraph graph, NodeMap layerID, EdgeList reversedEdges)
(v,w)
in E
: layer(v) < layer(w)
graph
- the given graphlayerID
- the NodeMap
that will be filled by the layout algorithm and returns the zero-based index
of the layer to which each node belongsreversedEdges
- an EdgeList
containing the edges which had been reversed
public void assignLayers(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
Layers
instance.
assignLayers
in interface Layerer
graph
- the input graphlayers
- the Layers
instance that will be filled with the results of the calculationldp
- the LayoutDataProvider
used for querying information about the nodes and edgesLayers.insert(byte, int)
,
Layer.add(y.base.Node)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |