|
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.BFSLayerer
public class BFSLayerer
Layerer that uses a breadth first search to assign layers to the nodes.
The nodes of the first layer can be freely chosen (see CORE_NODES
).
The nodes belonging to a subsequent layer are determined as follows:
Add all yet unassigned nodes to the new layer that are connected to nodes
already assigned.
Field Summary | |
---|---|
static Object |
CORE_NODES
The data provider key used to look up the core nodes of the bfs layering. |
Constructor Summary | |
---|---|
BFSLayerer()
|
Method Summary | |
---|---|
void |
assignLayers(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
This method assigns all nodes in the graph to layers and registers them in the Layers instance. |
int |
assignNodeLayer(LayoutGraph graph,
NodeMap layer,
EdgeList reversedEdges)
This method assigns the nodes in the graph to layers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object CORE_NODES
Constructor Detail |
---|
public BFSLayerer()
Method Detail |
---|
public int assignNodeLayer(LayoutGraph graph, NodeMap layer, EdgeList reversedEdges)
graph
- the graph for which the layers are determined.layer
- here the layers are storedreversedEdges
- here the edges are stored which had been reversed.
public void assignLayers(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
Layerer
Layers
instance. In order to create new layers, the factory
method Layers.insert(byte, int)
must be used.
assignLayers
in interface Layerer
graph
- the graph that contains the nodes that should be distributed
into the layerslayers
- the object that will be filled with the results of the
calculationldp
- LayoutDataProvider that can be used to query information about
the nodes - note that positional information
(see NodeData.getPosition()
and NodeData.getLayer()
) cannot
be available at any time.Layers.insert(byte, int)
,
Layer.add(y.base.Node)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |