pedviz.algorithms.sugiyama
Class SugiyamaLayout

java.lang.Object
  extended by pedviz.graph.Layout<SugiyamaNodeView,SugiyamaEdgeView>
      extended by pedviz.algorithms.sugiyama.SugiyamaLayout
All Implemented Interfaces:
java.lang.Runnable, Algorithm

public class SugiyamaLayout
extends Layout<SugiyamaNodeView,SugiyamaEdgeView>

This class applies the Sugiyama-Algorihm on the specified graph. It works in 3 phases:

The final position for every node will not be calculated in this class. (see RubberBands)

Version:
0.1
Author:
Lukas Forer

Constructor Summary
SugiyamaLayout(Graph graph, DefaultNodeView defaultNodeView, DefaultEdgeView defaulEdgeView)
          Creates the SugiyamaLayout with the given Graph object.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Registers a ChangeListener.
 SugiyamaEdgeView createEdgeView(Edge edge, DefaultEdgeView defaultEdgeView)
          Factory method for creating a EdgeView object.
 SugiyamaNodeView createNodeView(Node node, DefaultNodeView defaultNodeView)
          Factory method for creating a NodeView object.
 java.lang.String getMessage()
          Returns a short description of the algorithm.
 int getPercentComplete()
          Returns the progress in percents from 0 to 100
 Splitter getSplitter()
          Returns the used WallSplitter.
 void run()
          Starts the algorithm.
 void setSplitter(Splitter splitter)
          Sets what WallSplitter will be used.
 
Methods inherited from class pedviz.graph.Layout
getLayoutGraph, rerun
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SugiyamaLayout

public SugiyamaLayout(Graph graph,
                      DefaultNodeView defaultNodeView,
                      DefaultEdgeView defaulEdgeView)
Creates the SugiyamaLayout with the given Graph object.

Parameters:
graph - the Graph object
Method Detail

getSplitter

public Splitter getSplitter()
Returns the used WallSplitter.

Returns:
sed WallSplitter

setSplitter

public void setSplitter(Splitter splitter)
Sets what WallSplitter will be used. By default the algorithm uses the RamdomSplitter.

Parameters:
splitter -

run

public void run()
Description copied from interface: Algorithm
Starts the algorithm.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface Algorithm
Overrides:
run in class Layout<SugiyamaNodeView,SugiyamaEdgeView>

getMessage

public java.lang.String getMessage()
Description copied from interface: Algorithm
Returns a short description of the algorithm.

Specified by:
getMessage in interface Algorithm
Overrides:
getMessage in class Layout<SugiyamaNodeView,SugiyamaEdgeView>
Returns:
a short description of the algorithm

getPercentComplete

public int getPercentComplete()
Description copied from interface: Algorithm
Returns the progress in percents from 0 to 100

Specified by:
getPercentComplete in interface Algorithm
Overrides:
getPercentComplete in class Layout<SugiyamaNodeView,SugiyamaEdgeView>
Returns:
the progress in percents

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Description copied from interface: Algorithm
Registers a ChangeListener. It will be notified about the progress of the algorithm.

Specified by:
addChangeListener in interface Algorithm
Overrides:
addChangeListener in class Layout<SugiyamaNodeView,SugiyamaEdgeView>
Parameters:
l - Change

createNodeView

public SugiyamaNodeView createNodeView(Node node,
                                       DefaultNodeView defaultNodeView)
Description copied from class: Layout
Factory method for creating a NodeView object.

Specified by:
createNodeView in class Layout<SugiyamaNodeView,SugiyamaEdgeView>
Parameters:
node - Node object.
defaultNodeView - node settings.
Returns:
new NodeView object.

createEdgeView

public SugiyamaEdgeView createEdgeView(Edge edge,
                                       DefaultEdgeView defaultEdgeView)
Description copied from class: Layout
Factory method for creating a EdgeView object.

Specified by:
createEdgeView in class Layout<SugiyamaNodeView,SugiyamaEdgeView>
Parameters:
edge - Edge object.
defaultEdgeView - edge settings.
Returns:
new EdgeView object.