anl.aida.viz.layout
Class CircleLayout<T>

java.lang.Object
  extended by anl.aida.viz.layout.AbstractLayout2D<T>
      extended by anl.aida.viz.layout.CircleLayout<T>
All Implemented Interfaces:
Layout2D<T>

public class CircleLayout<T>
extends AbstractLayout2D<T>

Date: Feb 11, 2009 11:25:50 AM


Field Summary
private  double radius
           
 
Fields inherited from class anl.aida.viz.layout.AbstractLayout2D
locations, size
 
Constructor Summary
CircleLayout(java.util.Collection<T> objs, java.awt.Dimension size)
           
 
Method Summary
 java.awt.geom.Point2D getCentroid()
           
 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.
 
Methods inherited from class anl.aida.viz.layout.AbstractLayout2D
getLocation, initNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radius

private double radius
Constructor Detail

CircleLayout

public CircleLayout(java.util.Collection<T> objs,
                    java.awt.Dimension size)
Method Detail

sizeChanged

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

Parameters:
size - the new size

swapGraph

public 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.

initialize

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

Parameters:
size - the size

setLocation

public 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

initialize

public void initialize()
Description copied from interface: Layout2D
Initializes the layout. This should be called prior to calling getLocation.


getCentroid

public java.awt.geom.Point2D getCentroid()