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

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout3d.AbstractLayout<V,E>
      extended by edu.uci.ics.jung.algorithms.layout3d.FRLayout<V,E>
All Implemented Interfaces:
Layout<V,E>, IterativeContext, org.apache.commons.collections15.Transformer<V,javax.vecmath.Point3f>

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

Field Summary
 
Fields inherited from class edu.uci.ics.jung.algorithms.layout3d.AbstractLayout
locations
 
Constructor Summary
FRLayout(Graph<V,E> g)
           
FRLayout(Graph<V,E> g, javax.media.j3d.BoundingSphere 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.
 void initialize()
          Initializer, calls intialize_local and initializeLocations to start construction process.
 boolean isIncremental()
          This one is an incremental visualization.
 void reset()
           
 void setAttractionMultiplier(double attraction)
           
 void setMaxIterations(int maxIterations)
           
 void setRepulsionMultiplier(double repulsion)
           
 void setSize(javax.media.j3d.BoundingSphere 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.layout3d.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,
                javax.media.j3d.BoundingSphere d)
Method Detail

setSize

public void setSize(javax.media.j3d.BoundingSphere 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. TODO: A better implementation wouldn't destroy the current information, but would either scale the current visualization, or move the nodes toward the new center.

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 class: AbstractLayout
Initializer, calls intialize_local and initializeLocations to start construction process.

Specified by:
initialize in interface Layout<V,E>
Specified by:
initialize in class AbstractLayout<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)

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 © 2009. All Rights Reserved.