y.layout.hierarchic
Class AsIsLayerer

java.lang.Object
  |
  +--y.layout.hierarchic.AsIsLayerer
All Implemented Interfaces:
Layerer, LayoutOrientation

public class AsIsLayerer
extends Object
implements Layerer, LayoutOrientation

This layerer implementation assigns layers by analysing already existing node coordinates. Nodes whose bounding boxes intesect a common y-coordinate are assigned to the same layer.


Field Summary
 
Fields inherited from interface y.layout.LayoutOrientation
BOTTOM_TO_TOP, LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM
 
Constructor Summary
AsIsLayerer()
           
 
Method Summary
 int assignNodeLayer(LayoutGraph g, NodeMap layerMap, EdgeList reversedEdges)
          This method assigns the nodes in the graph to layers.
 byte getOrientation()
          Returns the orientation assumed by this layerer.
 void setOrientation(byte orientation)
          Sets the orientation assumed by this layerer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsIsLayerer

public AsIsLayerer()
Method Detail

setOrientation

public void setOrientation(byte orientation)
Sets the orientation assumed by this layerer. By default LayoutOrientation.TOP_TO_BOTTOM is set.

Parameters:
orientation - one of LayoutOrientation.TOP_TO_BOTTOM, LayoutOrientation.LEFT_TO_RIGHT, LayoutOrientation.RIGHT_TO_LEFT, and LayoutOrientation.BOTTOM_TO_TOP.

getOrientation

public byte getOrientation()
Returns the orientation assumed by this layerer.

See Also:
AsIsLayerer.setOrientation(byte)

assignNodeLayer

public int assignNodeLayer(LayoutGraph g,
                           NodeMap layerMap,
                           EdgeList reversedEdges)
Description copied from interface: Layerer
This method assigns the nodes in the graph to layers.

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