prefuse.util.force
Class SpringForce

java.lang.Object
  extended by prefuse.util.force.AbstractForce
      extended by prefuse.util.force.SpringForce
All Implemented Interfaces:
Force

public class SpringForce
extends AbstractForce

Force function that computes the force acting on ForceItems due to a given Spring.

Author:
jeffrey heer

Field Summary
static float DEFAULT_MAX_SPRING_COEFF
           
static float DEFAULT_MAX_SPRING_LENGTH
           
static float DEFAULT_MIN_SPRING_COEFF
           
static float DEFAULT_MIN_SPRING_LENGTH
           
static float DEFAULT_SPRING_COEFF
           
static float DEFAULT_SPRING_LENGTH
           
static int SPRING_COEFF
           
static int SPRING_LENGTH
           
 
Fields inherited from class prefuse.util.force.AbstractForce
maxValues, minValues, params
 
Constructor Summary
SpringForce()
          Constructs a new SpringForce instance with default parameters.
SpringForce(float springCoeff, float defaultLength)
          Create a new SpringForce.
 
Method Summary
 void getForce(Spring s)
          Calculates the force vector acting on the items due to the given spring.
protected  java.lang.String[] getParameterNames()
           
 boolean isSpringForce()
          Returns true.
 
Methods inherited from class prefuse.util.force.AbstractForce
getForce, getMaxValue, getMinValue, getParameter, getParameterCount, getParameterName, init, isItemForce, setMaxValue, setMinValue, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SPRING_COEFF

public static final float DEFAULT_SPRING_COEFF
See Also:
Constant Field Values

DEFAULT_MAX_SPRING_COEFF

public static final float DEFAULT_MAX_SPRING_COEFF
See Also:
Constant Field Values

DEFAULT_MIN_SPRING_COEFF

public static final float DEFAULT_MIN_SPRING_COEFF
See Also:
Constant Field Values

DEFAULT_SPRING_LENGTH

public static final float DEFAULT_SPRING_LENGTH
See Also:
Constant Field Values

DEFAULT_MIN_SPRING_LENGTH

public static final float DEFAULT_MIN_SPRING_LENGTH
See Also:
Constant Field Values

DEFAULT_MAX_SPRING_LENGTH

public static final float DEFAULT_MAX_SPRING_LENGTH
See Also:
Constant Field Values

SPRING_COEFF

public static final int SPRING_COEFF
See Also:
Constant Field Values

SPRING_LENGTH

public static final int SPRING_LENGTH
See Also:
Constant Field Values
Constructor Detail

SpringForce

public SpringForce(float springCoeff,
                   float defaultLength)
Create a new SpringForce.

Parameters:
springCoeff - the default spring co-efficient to use. This will be used if the spring's own co-efficient is less than zero.
defaultLength - the default spring length to use. This will be used if the spring's own length is less than zero.

SpringForce

public SpringForce()
Constructs a new SpringForce instance with default parameters.

Method Detail

isSpringForce

public boolean isSpringForce()
Returns true.

Specified by:
isSpringForce in interface Force
Overrides:
isSpringForce in class AbstractForce
Returns:
true if this force function processes Spring instances
See Also:
Force.isSpringForce()

getParameterNames

protected java.lang.String[] getParameterNames()
Specified by:
getParameterNames in class AbstractForce
See Also:
AbstractForce.getParameterNames()

getForce

public void getForce(Spring s)
Calculates the force vector acting on the items due to the given spring.

Specified by:
getForce in interface Force
Overrides:
getForce in class AbstractForce
Parameters:
s - the Spring for which to compute the force
See Also:
Force.getForce(prefuse.util.force.Spring)


Copyright © 2007 Regents of the University of California