anl.aida.viz.layout
Interface Layout2D<T>

All Known Implementing Classes:
AbstractLayout2D, CircleLayout, FRLayout, ISOMLayout, KKLayout, SpringLayout

public interface Layout2D<T>

Interface for 2D layouts.


Method Summary
 java.awt.geom.Point2D getLocation(T obj)
          Gets the location of the object.
 void initialize()
          Initializes the layout.
 void initialize(java.awt.Dimension size)
          Initializes the layout with the specified size.
 void setLocation(T node, double x, double y)
          Sets the location of the specified node.
 void sizeChanged(java.awt.Dimension size)
          Called when the display area size has changed.
 void swapGraph(ConceptGraph<T> graph)
          Swaps the layouts current graph with the specified one.
 

Method Detail

initialize

void initialize()
Initializes the layout. This should be called prior to calling getLocation.


initialize

void initialize(java.awt.Dimension size)
Initializes the layout with the specified size.

Parameters:
size - the size

getLocation

java.awt.geom.Point2D getLocation(T obj)
Gets the location of the object.

Parameters:
obj - the object whose location we want
Returns:
the location of the object.

sizeChanged

void sizeChanged(java.awt.Dimension size)
Called when the display area size has changed.

Parameters:
size - the new size

swapGraph

void swapGraph(ConceptGraph<T> graph)
Swaps the layouts current graph with the specified one. This assumes the graphs have equivalent term nodes and it preserves the locations.

Parameters:
graph - the graph to swap in.

setLocation

void setLocation(T node,
                 double x,
                 double y)
Sets the location of the specified node.

Parameters:
node - the node whose location we want to set
x - the x coordinate
y - the y coordinate