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

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout.AbstractLayout<V,E>
      extended by edu.uci.ics.jung.algorithms.layout.SpringLayout<V,E>
          extended by edu.uci.ics.jung.algorithms.layout.SpringLayout2<V,E>
All Implemented Interfaces:
Layout<V,E>, IterativeContext, org.apache.commons.collections15.Transformer<V,Point2D>

public class SpringLayout2<V,E>
extends SpringLayout<V,E>

The SpringLayout package represents a visualization of a set of nodes. The SpringLayout, which is initialized with a Graph, assigns X/Y locations to each node. When called relax(), the SpringLayout moves the visualization forward one step.

Author:
Danyel Fisher, Joshua O'Madadhain

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.uci.ics.jung.algorithms.layout.SpringLayout
SpringLayout.SpringDimensionChecker, SpringLayout.SpringVertexData
 
Field Summary
protected  int averageCounter
           
protected  Point2D averageDelta
           
protected  int currentIteration
           
protected  boolean done
           
protected  int loopCountMax
           
 
Fields inherited from class edu.uci.ics.jung.algorithms.layout.SpringLayout
force_multiplier, lengthFunction, repulsion_range_sq, springVertexData, stretch
 
Fields inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
graph, initialized, locations, size
 
Constructor Summary
SpringLayout2(Graph<V,E> g)
          Constructor for a SpringLayout for a raw graph with associated dimension--the input knows how big the graph is.
SpringLayout2(Graph<V,E> g, org.apache.commons.collections15.Transformer<E,Integer> length_function)
          Constructor for a SpringLayout for a raw graph with associated component.
 
Method Summary
 boolean done()
          For now, we pretend it never finishes.
protected  void moveNodes()
           
 void step()
          Relaxation step.
 
Methods inherited from class edu.uci.ics.jung.algorithms.layout.SpringLayout
calculateRepulsion, getForceMultiplier, getRepulsionRange, getStretch, initialize, isIncremental, relaxEdges, reset, setForceMultiplier, setRepulsionRange, setSize, setStretch
 
Methods inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
getGraph, getSize, 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
 

Field Detail

currentIteration

protected int currentIteration

averageCounter

protected int averageCounter

loopCountMax

protected int loopCountMax

done

protected boolean done

averageDelta

protected Point2D averageDelta
Constructor Detail

SpringLayout2

public SpringLayout2(Graph<V,E> g)
Constructor for a SpringLayout for a raw graph with associated dimension--the input knows how big the graph is. Defaults to the unit length function.


SpringLayout2

public SpringLayout2(Graph<V,E> g,
                     org.apache.commons.collections15.Transformer<E,Integer> length_function)
Constructor for a SpringLayout for a raw graph with associated component.

Parameters:
g - the Graph to lay out
length_function - provides a length for each edge
Method Detail

step

public void step()
Relaxation step. Moves all nodes a smidge.

Specified by:
step in interface IterativeContext
Overrides:
step in class SpringLayout<V,E>

moveNodes

protected void moveNodes()
Overrides:
moveNodes in class SpringLayout<V,E>

done

public boolean done()
Description copied from class: SpringLayout
For now, we pretend it never finishes.

Specified by:
done in interface IterativeContext
Overrides:
done in class SpringLayout<V,E>


Copyright © 2009. All Rights Reserved.