y.layout.hierarchic
Class GivenLayersLayerer

java.lang.Object
  |
  +--y.layout.hierarchic.GivenLayersLayerer
All Implemented Interfaces:
Layerer

public class GivenLayersLayerer
extends Object
implements Layerer

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
 int assignNodeLayer(LayoutGraph g, NodeMap layerMap, EdgeList reversedEdges)
          Assigns layers to the graph that were given by the DataProvider g.getDataProvider(LAYER_ID_KEY).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYER_ID_KEY

public static final 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 Detail

GivenLayersLayerer

public GivenLayersLayerer()
Method Detail

assignNodeLayer

public int assignNodeLayer(LayoutGraph g,
                           NodeMap layerMap,
                           EdgeList reversedEdges)
Assigns layers to the graph that were given by the DataProvider g.getDataProvider(LAYER_ID_KEY). The returned layerMap will be a normalized variant of the user given dataprovider. A normalized variant has no empty layers and a minimum layerID 0.

Specified by:
assignNodeLayer in interface Layerer
Parameters:
g - the graph for which the layers are determined.
layerMap - here the layers are stored
reversedEdges - here the edges are stored which had been reversed.
Returns:
the number of layers

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003