pedviz.graph
Class Layout<N extends NodeView,E extends EdgeView>

java.lang.Object
  extended by pedviz.graph.Layout<N,E>
Type Parameters:
N - extended NodeView with additional properties.
E - extended EdgeView with additional properties.
All Implemented Interfaces:
java.lang.Runnable, Algorithm
Direct Known Subclasses:
SugiyamaLayout

public abstract class Layout<N extends NodeView,E extends EdgeView>
extends java.lang.Object
implements Algorithm

Author:
lukas

Constructor Summary
Layout(Graph graph, DefaultNodeView defaultNodeView, DefaultEdgeView defaulEdgeView)
          Creates a new Layout object for the given Graph object width the given settings.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Registers a ChangeListener.
abstract  E createEdgeView(Edge edge, DefaultEdgeView defaultEdgeView)
          Factory method for creating a EdgeView object.
abstract  N createNodeView(Node node, DefaultNodeView defaultNodeView)
          Factory method for creating a NodeView object.
 LayoutedGraph getLayoutGraph()
          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
 void rerun(LayoutedGraph layoutedGraph)
          Reruns the layoutalgorithm.
 void run()
          Starts the algorithm.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Layout

public Layout(Graph graph,
              DefaultNodeView defaultNodeView,
              DefaultEdgeView defaulEdgeView)
Creates a new Layout object for the given Graph object width the given settings.

Parameters:
graph - Graph object.
defaultNodeView - node settings.
defaulEdgeView - edge settings.
Method Detail

getLayoutGraph

public LayoutedGraph getLayoutGraph()
Returns the layouted graph.

Returns:

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

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

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

rerun

public void rerun(LayoutedGraph layoutedGraph)
Reruns the layoutalgorithm.

Parameters:
layoutedGraph -

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

createNodeView

public abstract N createNodeView(Node node,
                                 DefaultNodeView defaultNodeView)
Factory method for creating a NodeView object.

Parameters:
node - Node object.
defaultNodeView - node settings.
Returns:
new NodeView object.

createEdgeView

public abstract E createEdgeView(Edge edge,
                                 DefaultEdgeView defaultEdgeView)
Factory method for creating a EdgeView object.

Parameters:
edge - Edge object.
defaultEdgeView - edge settings.
Returns:
new EdgeView object.