public class SpringForce extends AbstractForce
Modifier and Type | Field and Description |
---|---|
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 |
maxValues, minValues, params
Constructor and Description |
---|
SpringForce()
Constructs a new SpringForce instance with default parameters.
|
SpringForce(float springCoeff,
float defaultLength)
Create a new SpringForce.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getForce, getMaxValue, getMinValue, getParameter, getParameterCount, getParameterName, init, isItemForce, setMaxValue, setMinValue, setParameter
public static final float DEFAULT_SPRING_COEFF
public static final float DEFAULT_MAX_SPRING_COEFF
public static final float DEFAULT_MIN_SPRING_COEFF
public static final float DEFAULT_SPRING_LENGTH
public static final float DEFAULT_MIN_SPRING_LENGTH
public static final float DEFAULT_MAX_SPRING_LENGTH
public static final int SPRING_COEFF
public static final int SPRING_LENGTH
public SpringForce(float springCoeff, float defaultLength)
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.public SpringForce()
public boolean isSpringForce()
isSpringForce
in interface Force
isSpringForce
in class AbstractForce
Force.isSpringForce()
protected java.lang.String[] getParameterNames()
getParameterNames
in class AbstractForce
AbstractForce.getParameterNames()
public void getForce(Spring s)
getForce
in interface Force
getForce
in class AbstractForce
s
- the Spring for which to compute the forceForce.getForce(prefuse.util.force.Spring)
Copyright ? 2013 Regents of the University of California