Packagecom.yworks.yfiles.layout.hierarchic
Classpublic class GivenLayersLayerer
InheritanceGivenLayersLayerer Inheritance YObject Inheritance Object
Implements OldLayerer, 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.



Public Methods
 MethodDefined By
  
GivenLayersLayerer(init:Boolean = true)
GivenLayersLayerer
  
GivenLayersLayerer
  
assignNodeLayer(g:LayoutGraph, layerMap:NodeMap, reversedEdges:EdgeList):int
Assigns layers to the graph that were given by the DataProvider g.getDataProvider(LAYER_ID_KEY).
GivenLayersLayerer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
GivenLayersLayerer
 Inherited
hashCode():int
YObject
  
[static]
GivenLayersLayerer
  
normalize(g:Graph, layerId:DataProvider, normalizedLayerId:DataAcceptor):int
Convenience method which removes empty layers and ensures that the smallest layer has value 0.
GivenLayersLayerer
Protected Methods
 MethodDefined By
  
GivenLayersLayerer
Public Constants
 ConstantDefined By
  LAYER_ID_KEY : Object = y.layout.hierarchic.GivenLayersLayerer.LAYER_ID_KEY
[static] The key used by this class to query a graph for a DataProvider that yields the layerID for each node in the graph.
GivenLayersLayerer
Constructor Detail
GivenLayersLayerer()Constructor
public function GivenLayersLayerer(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
assignLayers()method
public function assignLayers(graph:LayoutGraph, layers:Layers, ldp:LayoutDataProvider):void

Parameters

graph:LayoutGraph
 
layers:Layers
 
ldp:LayoutDataProvider

assignNodeLayer()method 
public function assignNodeLayer(g:LayoutGraph, layerMap:NodeMap, reversedEdges:EdgeList):int

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 data provider. A normalized variant has no empty layers and a minimum layerID 0.

Parameters

g:LayoutGraph
 
layerMap:NodeMap
 
reversedEdges:EdgeList

Returns
int
getClass()method 
override public function getClass():Class

Returns
Class
initGivenLayersLayerer()method 
protected final function initGivenLayersLayerer():void

newGivenLayersLayerer()method 
public static function newGivenLayersLayerer():GivenLayersLayerer

Returns
GivenLayersLayerer
normalize()method 
public function normalize(g:Graph, layerId:DataProvider, normalizedLayerId:DataAcceptor):int

Convenience method which removes empty layers and ensures that the smallest layer has value 0.

Parameters

g:Graph
 
layerId:DataProvider — provides the current layer ids for nodes in g
 
normalizedLayerId:DataAcceptor — accepts the new layer ids that result after normalization.

Returns
int — The amount of layers left after removing all empty layers.
Constant Detail
LAYER_ID_KEYConstant
public static const LAYER_ID_KEY:Object = y.layout.hierarchic.GivenLayersLayerer.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.