edu.uci.ics.jung.algorithms.layout
Class FRLayout<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout.AbstractLayout<V,E>
      extended by edu.uci.ics.jung.algorithms.layout.FRLayout<V,E>
All Implemented Interfaces:
Layout<V,E>, IterativeContext

public class FRLayout<V,E>
extends AbstractLayout<V,E>
implements IterativeContext

Implements the Fruchterman-Reingold algorithm for node layout.

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

Nested Class Summary
static class FRLayout.FRVertexData
           
 
Field Summary
 
Fields inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
initialized, locations
 
Constructor Summary
FRLayout(Graph<V,E> g)
           
FRLayout(Graph<V,E> g, Dimension d)
           
 
Method Summary
 void calcAttraction(E e)
           
 void calcPositions(V v)
           
 void calcRepulsion(V v1)
           
 boolean done()
          Returns true once the current iteration has passed the maximum count, MAX_ITERATIONS.
 FRLayout.FRVertexData getFRData(V v)
           
 void initialize()
          Initializes fields in the node that may not have been set during the constructor.
 boolean isIncremental()
          This one is an incremental visualization.
 void reset()
           
 void setAttractionMultiplier(double attraction)
           
 void setMaxIterations(int maxIterations)
           
 void setRepulsionMultiplier(double repulsion)
           
 void setSize(Dimension size)
          When a visualization is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data.
 void step()
          Moves the iteration forward one notch, calculation attraction and repulsion between vertices and edges and cooling the temperature.
 
Methods inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
getGraph, getSize, getVertices, getX, getY, isLocked, lock, lock, offsetVertex, setGraph, setInitializer, setLocation, setLocation, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FRLayout

public FRLayout(Graph<V,E> g)

FRLayout

public FRLayout(Graph<V,E> g,
                Dimension d)
Method Detail

setSize

public void setSize(Dimension size)
Description copied from class: AbstractLayout
When a visualization is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data. The current method calls initializeLocations followed by initialize_local.

Specified by:
setSize in interface Layout<V,E>
Overrides:
setSize in class AbstractLayout<V,E>

setAttractionMultiplier

public void setAttractionMultiplier(double attraction)

setRepulsionMultiplier

public void setRepulsionMultiplier(double repulsion)

reset

public void reset()
Specified by:
reset in interface Layout<V,E>

initialize

public void initialize()
Description copied from interface: Layout
Initializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.

Specified by:
initialize in interface Layout<V,E>

step

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

Specified by:
step in interface IterativeContext

calcPositions

public void calcPositions(V v)

calcAttraction

public void calcAttraction(E e)

calcRepulsion

public void calcRepulsion(V v1)

setMaxIterations

public void setMaxIterations(int maxIterations)

getFRData

public FRLayout.FRVertexData getFRData(V v)

isIncremental

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


done

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

Specified by:
done in interface IterativeContext


Copyright © 2008 null. All Rights Reserved.