com.hp.hpl.guess.layout
Class SugiyamaLayout

java.lang.Object
  extended bycom.hp.hpl.guess.layout.SugiyamaLayout

public class SugiyamaLayout
extends Object

Arranges the nodes with the Sugiyama Layout Algorithm.
Link to the algorithm

Version:
1.0 init
Author:
Sven Luzar
modified by Gaudenz Alder

Field Summary
static String SUGIYAMA_CELL_WRAPPER
          Const to add the Cell Wrapper to the Nodes
static String SUGIYAMA_VISITED
          Const to add Attributes at the Nodes
 
Constructor Summary
SugiyamaLayout(Graph originalGraph, boolean bends)
          Implementation.
 
Method Summary
 double averageTension(Vector curLayer)
           
 String getHint()
          Get a human readable hint for using this layout.
 Point getSpacing()
           
 boolean isVertical()
           
 void setSpacing(Point spacing)
           
 void setVertical(boolean vertical)
           
 void shiftLayer(Vector curLayer, double inc)
           
 void shiftLayers(Vector levels)
           
 String toString()
          Returns the name of this algorithm in human readable form.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SUGIYAMA_VISITED

public static final String SUGIYAMA_VISITED
Const to add Attributes at the Nodes

See Also:
Constant Field Values

SUGIYAMA_CELL_WRAPPER

public static final String SUGIYAMA_CELL_WRAPPER
Const to add the Cell Wrapper to the Nodes

See Also:
Constant Field Values
Constructor Detail

SugiyamaLayout

public SugiyamaLayout(Graph originalGraph,
                      boolean bends)
Implementation. First of all the Algorithm searches the roots from the Graph. Starting from this roots the Algorithm creates levels and stores them in the member levels. The Member levels contains Vector Objects and the Vector per level contains Cell Wrapper Objects. After that the Algorithm tries to solve the edge crosses from level to level and goes top down and bottom up. After minimization of the edge crosses the algorithm moves each node to its bary center. Last but not Least the method draws the Graph.

See Also:
LayoutAlgorithm
Method Detail

toString

public String toString()
Returns the name of this algorithm in human readable form.


getHint

public String getHint()
Get a human readable hint for using this layout.


shiftLayers

public void shiftLayers(Vector levels)

shiftLayer

public void shiftLayer(Vector curLayer,
                       double inc)

averageTension

public double averageTension(Vector curLayer)

getSpacing

public Point getSpacing()
Returns:
Returns the spacing.

setSpacing

public void setSpacing(Point spacing)
Parameters:
spacing - The spacing to set.

isVertical

public boolean isVertical()

setVertical

public void setVertical(boolean vertical)