public abstract class AbstractForce extends java.lang.Object implements Force
params to store parameter values.| Modifier and Type | Field and Description |
|---|---|
protected float[] |
maxValues |
protected float[] |
minValues |
protected float[] |
params |
| Constructor and Description |
|---|
AbstractForce() |
| Modifier and Type | Method and Description |
|---|---|
void |
getForce(ForceItem item)
Throws an UnsupportedOperationException.
|
void |
getForce(Spring spring)
Throws an UnsupportedOperationException.
|
float |
getMaxValue(int i)
Get the suggested maximum value for a parameter.
|
float |
getMinValue(int i)
Get the suggested minimum value for a parameter.
|
float |
getParameter(int i)
Returns the specified, numbered parameter.
|
int |
getParameterCount()
Returns the number of parameters (e.g., gravitational constant or
spring force coefficient) affecting this force function.
|
java.lang.String |
getParameterName(int i)
Gets the text name of the requested parameter.
|
protected abstract java.lang.String[] |
getParameterNames() |
void |
init(ForceSimulator fSim)
Initialize this force function.
|
boolean |
isItemForce()
Returns false.
|
boolean |
isSpringForce()
Returns false.
|
void |
setMaxValue(int i,
float val)
Set the suggested maximum value for a parameter.
|
void |
setMinValue(int i,
float val)
Set the suggested minimum value for a parameter.
|
void |
setParameter(int i,
float val)
Sets the specified parameter value.
|
protected float[] params
protected float[] minValues
protected float[] maxValues
public void init(ForceSimulator fSim)
public int getParameterCount()
ForcegetParameterCount in interface ForceForce.getParameterCount()public float getParameter(int i)
ForcegetParameter in interface Forcei - the index of the parameter to returnForce.getParameter(int)public float getMinValue(int i)
ForcegetMinValue in interface Forcei - the parameter indexForce.getMinValue(int)public float getMaxValue(int i)
ForcegetMaxValue in interface Forcei - the parameter indexForce.getMaxValue(int)public java.lang.String getParameterName(int i)
ForcegetParameterName in interface Forcei - the index of the parameterForce.getParameterName(int)public void setParameter(int i,
float val)
ForcesetParameter in interface Forcei - the index of the parameterval - the new value of the parameterForce.setParameter(int, float)public void setMinValue(int i,
float val)
ForcesetMinValue in interface Forcei - the parameter indexval - the suggested minimum value to useForce.setMinValue(int, float)public void setMaxValue(int i,
float val)
ForcesetMaxValue in interface Forcei - the parameter indexval - the suggested maximum value to useForce.setMaxValue(int, float)protected abstract java.lang.String[] getParameterNames()
public boolean isItemForce()
isItemForce in interface ForceForce.isItemForce()public boolean isSpringForce()
isSpringForce in interface ForceForce.isSpringForce()public void getForce(ForceItem item)
getForce in interface Forceitem - the ForceItem on which to compute updated forcesForce.getForce(prefuse.util.force.ForceItem)public void getForce(Spring spring)
getForce in interface Forcespring - the Spring on which to compute updated forcesForce.getForce(prefuse.util.force.Spring)