anl.aida.viz.layout
Class FRLayout

java.lang.Object
  extended by anl.aida.viz.layout.FRLayout
All Implemented Interfaces:
Layout2D<TermNode>

public class FRLayout
extends java.lang.Object
implements Layout2D<TermNode>

Layout2D that wraps the Jung FRLayout2


Field Summary
private  edu.uci.ics.jung.algorithms.layout.FRLayout2<TermNode,CGEdge> layout
           
 
Constructor Summary
FRLayout(ConceptGraph graph, java.awt.Dimension size)
           
 
Method Summary
 java.awt.geom.Point2D getLocation(TermNode 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.
private  void initLayout(ConceptGraph graph, java.awt.Dimension size)
           
 void setLocation(TermNode 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<TermNode> 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

layout

private edu.uci.ics.jung.algorithms.layout.FRLayout2<TermNode,CGEdge> layout
Constructor Detail

FRLayout

public FRLayout(ConceptGraph graph,
                java.awt.Dimension size)
Method Detail

initLayout

private void initLayout(ConceptGraph graph,
                        java.awt.Dimension size)

initialize

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

Specified by:
initialize in interface Layout2D<TermNode>

swapGraph

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

Specified by:
swapGraph in interface Layout2D<TermNode>
Parameters:
graph - the graph to swap in.

initialize

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

Specified by:
initialize in interface Layout2D<TermNode>
Parameters:
size - the size

setLocation

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

Specified by:
setLocation in interface Layout2D<TermNode>
Parameters:
node - the node whose location we want to set
x - the x coordinate
y - the y coordinate

getLocation

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

Specified by:
getLocation in interface Layout2D<TermNode>
Parameters:
obj - the object whose location we want
Returns:
the location of the object.

sizeChanged

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

Specified by:
sizeChanged in interface Layout2D<TermNode>
Parameters:
size - the new size