anl.aida.plot
Class CircleLayout<T extends ValueNode>

java.lang.Object
  extended by anl.aida.plot.CircleLayout<T>

public class CircleLayout<T extends ValueNode>
extends java.lang.Object

Feb 11, 2009 11:25:50 AM


Field Summary
protected  java.util.Map<T,java.awt.geom.Point2D> locations
           
private  double radius
           
protected  java.awt.Dimension size
           
 
Constructor Summary
CircleLayout(java.util.Collection<T> objs, java.awt.Dimension size)
           
 
Method Summary
 java.awt.geom.Point2D getCentroid()
           
 java.awt.geom.Point2D getLocation(T obj)
           
 void initialize()
           
 void initialize(java.awt.Dimension size)
          Initializes the layout with the specified size.
protected  void initNodes(java.util.Collection<T> objs)
           
 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(edu.uci.ics.jung.graph.Graph<ValueNode,java.lang.Object> graph)
          Swaps the layouts current graph with the specified one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radius

private double radius

locations

protected java.util.Map<T extends ValueNode,java.awt.geom.Point2D> locations

size

protected java.awt.Dimension size
Constructor Detail

CircleLayout

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

initNodes

protected void initNodes(java.util.Collection<T> objs)

getLocation

public java.awt.geom.Point2D getLocation(T obj)

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(edu.uci.ics.jung.graph.Graph<ValueNode,java.lang.Object> 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()

getCentroid

public java.awt.geom.Point2D getCentroid()