prefuse.util.force
Class Spring

java.lang.Object
  extended by prefuse.util.force.Spring

public class Spring
extends java.lang.Object

Represents a spring in a force simulation.

Author:
jeffrey heer

Nested Class Summary
static class Spring.SpringFactory
          The SpringFactory is responsible for generating Spring instances and maintaining an object pool of Springs to reduce garbage collection overheads while force simulations are running.
 
Field Summary
 float coeff
          The spring tension co-efficient
 ForceItem item1
          The first ForceItem endpoint
 ForceItem item2
          The second ForceItem endpoint
 float length
          The spring's resting length
 
Constructor Summary
Spring(ForceItem fi1, ForceItem fi2, float k, float len)
          Create a new Spring instance
 
Method Summary
static Spring.SpringFactory getFactory()
          Retrieve the SpringFactory instance, which serves as an object pool for Spring instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

item1

public ForceItem item1
The first ForceItem endpoint


item2

public ForceItem item2
The second ForceItem endpoint


length

public float length
The spring's resting length


coeff

public float coeff
The spring tension co-efficient

Constructor Detail

Spring

public Spring(ForceItem fi1,
              ForceItem fi2,
              float k,
              float len)
Create a new Spring instance

Parameters:
fi1 - the first ForceItem endpoint
fi2 - the second ForceItem endpoint
k - the spring tension co-efficient
len - the spring's resting length
Method Detail

getFactory

public static Spring.SpringFactory getFactory()
Retrieve the SpringFactory instance, which serves as an object pool for Spring instances.

Returns:
the Spring Factory


Copyright © 2007 Regents of the University of California