|
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 layering algorithm implementation assigns nodes to layers given a mapping of nodes to layer IDs.
The layer IDs are given by a DataProvider
that returns the integer layer ID of each node of the graph.
Nodes with the same ID are in the same layer while the layers are sorted according to their IDs such that the
smallest ID represents the top layer.
IncrementalHierarchicLayouter
as well as HierarchicLayouter
and
HierarchicGroupLayouter
.Field Summary | |
---|---|
static java.lang.Object |
LAYER_ID_KEY
A DataProvider key for storing the layer IDs.
|
Constructor Summary | |
---|---|
GivenLayersLayerer()
Creates an instance of GivenLayersLayerer . |
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)
Assigns the nodes of the graph to layers given by the DataProvider registered with the graph using key
LAYER_ID_KEY . |
int |
normalize(Graph graph,
DataProvider layerId,
DataAcceptor normalizedLayerId)
Convenience method that 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 java.lang.Object LAYER_ID_KEY
DataProvider
key for storing the layer IDs.
This DataProvider
stores for each node the layer ID to which it belongs. Nodes with the same ID are
in the same layer while the layers are sorted according to their IDs such that the
smallest ID represents the top layer.
Constructor Detail |
---|
public GivenLayersLayerer()
GivenLayersLayerer
.
Method Detail |
---|
public int normalize(Graph graph, DataProvider layerId, DataAcceptor normalizedLayerId)
0
.
graph
- the graphlayerId
- the DataProvider
that returns an integer value (layer) for each node; the first layer has
the number 0
normalizedLayerId
- the DataAcceptor
that will be filled by the layout algorithm and holds an
integer value (layer ID after normalization) for each node
public int assignNodeLayer(LayoutGraph graph, NodeMap layerID, EdgeList reversedEdges)
DataProvider
registered with the graph using key
LAYER_ID_KEY
.
graph
- the graphlayerID
- the NodeMap
that will be filled during the execution and holds the zero-based index of the
layer to which each node belongs; this NodeMap
is a normalized variant of the given DataProvider
registered with the graph using key LAYER_ID_KEY
and the first layer has the number
0
reversedEdges
- the EdgeList
containing the edges that have been reversed
java.lang.IllegalArgumentException
- if no DataProvider
with key LAYER_ID_KEY
is registered with
the given graphpublic 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 |