edu.uci.ics.jung.visualization
Class FRLayout

java.lang.Object
  extended byedu.uci.ics.jung.visualization.AbstractLayout
      extended byedu.uci.ics.jung.visualization.FRLayout
All Implemented Interfaces:
Layout, LayoutMutable

public class FRLayout
extends AbstractLayout
implements LayoutMutable

Implements the Fruchterman-Reingold algorithm for node layout.

Author:
Scott White, Yan-Biao Boey, Danyel Fisher

Nested Class Summary
static class FRLayout.FRVertexData
           
 
Constructor Summary
FRLayout(Graph g)
           
 
Method Summary
 void advancePositions()
          Moves the iteration forward one notch, calculation attraction and repulsion between vertices and edges and cooling the temperature.
 void calcAttraction(Edge e)
           
 void calcPositions(Vertex v)
           
 void calcRepulsion(Vertex v1)
           
 void forceMove(Vertex picked, int x, int y)
          Forces a node to be moved to location x,y
 FRLayout.FRVertexData getFRData(Vertex v)
           
 java.lang.Object getKey()
          Returns a visualization-specific key (that is, specific both to this instance and AbstractLayout) that can be used to access UserData related to the AbstractLayout.
 java.lang.String getStatus()
          Returns the current temperature and number of iterations elapsed, as a string.
 boolean incrementsAreDone()
          Returns true once the current iteration has passed the maximum count, MAX_ITERATIONS.
 boolean isIncremental()
          This one is an incremental visualization.
 void setMaxIterations(int maxIterations)
           
 void update()
           
 
Methods inherited from class edu.uci.ics.jung.visualization.AbstractLayout
applyFilter, dontMove, getBaseKey, getCoordinates, getCurrentSize, getEdge, getEdge, getGraph, getVertex, getVertex, getVisibleEdges, getVisibleVertices, getX, getY, initialize, lockVertex, resize, restart, unlockVertex
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.visualization.Layout
applyFilter, getCurrentSize, getGraph, getVertex, getVertex, getVisibleEdges, getVisibleVertices, getX, getY, initialize, lockVertex, resize, restart, unlockVertex
 

Constructor Detail

FRLayout

public FRLayout(Graph g)
Method Detail

update

public void update()
Specified by:
update in interface LayoutMutable

getStatus

public java.lang.String getStatus()
Returns the current temperature and number of iterations elapsed, as a string.

Specified by:
getStatus in interface Layout
Overrides:
getStatus in class AbstractLayout

forceMove

public void forceMove(Vertex picked,
                      int x,
                      int y)
Description copied from interface: Layout
Forces a node to be moved to location x,y

Specified by:
forceMove in interface Layout
Overrides:
forceMove in class AbstractLayout

getKey

public java.lang.Object getKey()
Returns a visualization-specific key (that is, specific both to this instance and AbstractLayout) that can be used to access UserData related to the AbstractLayout.


advancePositions

public void advancePositions()
Moves the iteration forward one notch, calculation attraction and repulsion between vertices and edges and cooling the temperature.

Specified by:
advancePositions in interface Layout
Specified by:
advancePositions in class AbstractLayout
See Also:
Layout.advancePositions()

calcPositions

public void calcPositions(Vertex v)

calcAttraction

public void calcAttraction(Edge e)

calcRepulsion

public void calcRepulsion(Vertex v1)

setMaxIterations

public void setMaxIterations(int maxIterations)

getFRData

public FRLayout.FRVertexData getFRData(Vertex v)

isIncremental

public boolean isIncremental()
This one is an incremental visualization.

Specified by:
isIncremental in interface Layout

incrementsAreDone

public boolean incrementsAreDone()
Returns true once the current iteration has passed the maximum count, MAX_ITERATIONS.

Specified by:
incrementsAreDone in interface Layout