pedviz.algorithms
Class Sugiyama

java.lang.Object
  extended by pedviz.algorithms.Sugiyama
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, javax.swing.event.ChangeListener, Algorithm

public class Sugiyama
extends java.lang.Object
implements Algorithm, javax.swing.event.ChangeListener

This class combines all steps that are necessary to create a layout for a Graph object. It implements the Algorithm interface, so it's possible to visualize the progress with the DialogProgress class.

Author:
lukas forer

Constructor Summary
Sugiyama(Graph graph)
          Creates a new Sugyiama object for the given Graph object with default settings.
Sugiyama(Graph graph, DefaultNodeView defaultNodeView, DefaultEdgeView defaultEdgeView)
          Creates a new Sugyiama object for the given Graph object with given settings
Sugiyama(Graph graph, DefaultNodeView defaultNodeView, DefaultEdgeView defaultEdgeView, Splitter splitter)
          Creates a new Sugyiama object for the given Graph object with given settings and the given Splitter object.
Sugiyama(Graph graph, Splitter splitter)
          Creates a new Sugyiama object for the given Graph object with default settings.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Registers a ChangeListener.
 SugiyamaLayout getLayout()
          Returns the SugiyamaLayout object.
 LayoutedGraph getLayoutedGraph()
          Returns the layouted graph.
 java.lang.String getMessage()
          Returns a short description of the algorithm.
 int getPercentComplete()
          Returns the progress in percents from 0 to 100
 RubberBands getRubberBands()
          Returns the RubberBands object.
 void run()
          Starts the algorithm.
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sugiyama

public Sugiyama(Graph graph)
Creates a new Sugyiama object for the given Graph object with default settings.

Parameters:
graph - Graph object, which will be layouted.

Sugiyama

public Sugiyama(Graph graph,
                Splitter splitter)
Creates a new Sugyiama object for the given Graph object with default settings.

Parameters:
graph - Graph object
splitter - Splitter object

Sugiyama

public Sugiyama(Graph graph,
                DefaultNodeView defaultNodeView,
                DefaultEdgeView defaultEdgeView)
Creates a new Sugyiama object for the given Graph object with given settings

Parameters:
graph - Graph object, which will be layouted.
defaultNodeView - default node settings.
defaultEdgeView - default edge settings.

Sugiyama

public Sugiyama(Graph graph,
                DefaultNodeView defaultNodeView,
                DefaultEdgeView defaultEdgeView,
                Splitter splitter)
Creates a new Sugyiama object for the given Graph object with given settings and the given Splitter object.

Parameters:
graph - Graph object, which will be layouted.
defaultNodeView - default node settings.
defaultEdgeView - default edge settings.
splitter - Splitter object, which will be used to divide nodes into walls.
Method Detail

getLayoutedGraph

public LayoutedGraph getLayoutedGraph()
Returns the layouted graph.

Returns:
returns the layouted graph.

getMessage

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

Specified by:
getMessage in interface Algorithm
Returns:
a short description of the algorithm

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

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

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
Parameters:
l - Change

getPercentComplete

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

Specified by:
getPercentComplete in interface Algorithm
Returns:
the progress in percents

getLayout

public SugiyamaLayout getLayout()
Returns the SugiyamaLayout object.

Returns:
the SugiyamaLayout object.

getRubberBands

public RubberBands getRubberBands()
Returns the RubberBands object.

Returns:
the RubberBands object.