info.aduna.linkmap.layout
Class GraphLayoutManager

java.lang.Object
  extended by info.aduna.linkmap.layout.GraphLayoutManager
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
GemLayoutManager, IteratingLayoutManager, SubgraphRelocationManager

public abstract class GraphLayoutManager
extends Object
implements Runnable

GraphLayoutManager is the superclass of all classes that are capable of calculating a layout for a Graph. Doing this is as easy as invoking setGraph(graph) and doLayout() on the GraphLayoutManager.


Constructor Summary
GraphLayoutManager()
          Create a new GraphLayoutManager with initially no Graph.
 
Method Summary
abstract  LayoutConverter createLayoutConverter()
          Returns a LayoutConverter that allows the rendering mechanism to retrieve and adapt the layout of a graph, while abstracting from the specified GraphLayoutManager implementation that is used.
abstract  void doLayout()
          Calculate a layout for the Graph registered in this GraphLayoutManager.
 Graph getGraph()
           
abstract  void initialize(Graph graph)
          Makes the Graph ready for layout calculation.
 void run()
          Runnable implementation, invokes doLayout.
 void setGraph(Graph graph)
          Set the Graph whose layout is calculated by this GraphLayoutManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphLayoutManager

public GraphLayoutManager()
Create a new GraphLayoutManager with initially no Graph.

Method Detail

setGraph

public void setGraph(Graph graph)
Set the Graph whose layout is calculated by this GraphLayoutManager. This invokes 'initialize' with the specified Graph.


getGraph

public Graph getGraph()

initialize

public abstract void initialize(Graph graph)
Makes the Graph ready for layout calculation. This should therefore be invoked before the GraphLayoutManager starts its layout calculation and probably also before a GraphRenderer tries to display the Graph, since the rendering coordinates it uses are most likely derived from the coordinates in the layout attributes installed by this method.


doLayout

public abstract void doLayout()
Calculate a layout for the Graph registered in this GraphLayoutManager.


run

public void run()
Runnable implementation, invokes doLayout. Useful for running a GraphLayoutManager in a separate Thread.

Specified by:
run in interface Runnable

createLayoutConverter

public abstract LayoutConverter createLayoutConverter()
Returns a LayoutConverter that allows the rendering mechanism to retrieve and adapt the layout of a graph, while abstracting from the specified GraphLayoutManager implementation that is used.



Copyright © 1997-2008 Aduna. All Rights Reserved.