|
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.GivenLayersLayerer
public class GivenLayersLayerer
This layerer implementation layers the nodes by given layer IDs. The layer IDs are given by a DataProvider that returns the integral layer ID of each node in the graph.
Field Summary | |
---|---|
static Object |
LAYER_ID_KEY
The key used by this class to query a graph for a DataProvider that yields the layerID for each node in the graph. |
Constructor Summary | |
---|---|
GivenLayersLayerer()
|
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 g,
NodeMap layerMap,
EdgeList reversedEdges)
Assigns layers to the graph that were given by the DataProvider g.getDataProvider(LAYER_ID_KEY) . |
int |
normalize(Graph g,
DataProvider layerId,
DataAcceptor normalizedLayerId)
Convenience method which removes empty layers and ensures that the smallest layer has value 0. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object LAYER_ID_KEY
Constructor Detail |
---|
public GivenLayersLayerer()
Method Detail |
---|
public int normalize(Graph g, DataProvider layerId, DataAcceptor normalizedLayerId)
layerId
- provides the current layer ids for nodes in g
normalizedLayerId
- accepts the new layer ids that result after normalization.
public int assignNodeLayer(LayoutGraph g, NodeMap layerMap, EdgeList reversedEdges)
g.getDataProvider(LAYER_ID_KEY)
.
The returned layerMap will be a normalized variant of
the user given data provider. A normalized variant has
no empty layers and a minimum layerID 0.
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 |