y.layout.hierarchic
Class TopologicalLayerer

java.lang.Object
  extended by y.layout.hierarchic.TopologicalLayerer
All Implemented Interfaces:
Layerer

public class TopologicalLayerer
extends Object
implements Layerer

This class implements the first phase of the Sugiyama algorithm. It uses topological sorting to assign layers to the nodes.

 
Your browser does not support SVG content.

Field Summary
static byte DOWN_SHIFT
          Ranking policy specifier.
static byte NO_RERANKING
          Ranking policy specifier.
static byte TIGHT_TREE
          Ranking policy specifier.
 
Constructor Summary
TopologicalLayerer()
           
 
Method Summary
 int assignNodeLayer(LayoutGraph g, NodeMap layer, EdgeList reversedEdges)
          This method assigns the nodes in the graph to layers.
 byte getRankingPolicy()
          Returns the currently active ranking policy within this layerer.
 void setRankingPolicy(byte p)
          Sets the (re)ranking policy used within this layerer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_RERANKING

public static final byte NO_RERANKING
Ranking policy specifier. Nodes do not get re-ranked after the initial topological layering step.

See Also:
Constant Field Values

DOWN_SHIFT

public static final byte DOWN_SHIFT
Ranking policy specifier. Nodes get re-ranked by an inexpensive downshift rule.

See Also:
Constant Field Values

TIGHT_TREE

public static final byte TIGHT_TREE
Ranking policy specifier. Nodes get re-ranked by finding a spanning tree that contains only tight (length 1) edges.

See Also:
Constant Field Values
Constructor Detail

TopologicalLayerer

public TopologicalLayerer()
Method Detail

setRankingPolicy

public void setRankingPolicy(byte p)
Sets the (re)ranking policy used within this layerer. By default NO_RERANKING is set.

Parameters:
p - one of NO_RERANKING, DOWN_SHIFT and TIGHT_TREE.

getRankingPolicy

public byte getRankingPolicy()
Returns the currently active ranking policy within this layerer.

See Also:
setRankingPolicy(byte)

assignNodeLayer

public int assignNodeLayer(LayoutGraph g,
                           NodeMap layer,
                           EdgeList reversedEdges)
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.
layer - here the layers are stored
reversedEdges - here the edges are stored which had been reversed.
Returns:
the number of layers
Postcondition:
Forall (v,w) in E: layer(v) < layer(w)

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