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()
Force
getParameterCount
in interface Force
Force.getParameterCount()
public float getParameter(int i)
Force
getParameter
in interface Force
i
- the index of the parameter to returnForce.getParameter(int)
public float getMinValue(int i)
Force
getMinValue
in interface Force
i
- the parameter indexForce.getMinValue(int)
public float getMaxValue(int i)
Force
getMaxValue
in interface Force
i
- the parameter indexForce.getMaxValue(int)
public java.lang.String getParameterName(int i)
Force
getParameterName
in interface Force
i
- the index of the parameterForce.getParameterName(int)
public void setParameter(int i, float val)
Force
setParameter
in interface Force
i
- the index of the parameterval
- the new value of the parameterForce.setParameter(int, float)
public void setMinValue(int i, float val)
Force
setMinValue
in interface Force
i
- the parameter indexval
- the suggested minimum value to useForce.setMinValue(int, float)
public void setMaxValue(int i, float val)
Force
setMaxValue
in interface Force
i
- the parameter indexForce.setMaxValue(int, float)
protected abstract java.lang.String[] getParameterNames()
public boolean isItemForce()
isItemForce
in interface Force
Force.isItemForce()
public boolean isSpringForce()
isSpringForce
in interface Force
Force.isSpringForce()
public void getForce(ForceItem item)
getForce
in interface Force
item
- the ForceItem on which to compute updated forcesForce.getForce(prefuse.util.force.ForceItem)
public void getForce(Spring spring)
getForce
in interface Force
spring
- the Spring on which to compute updated forcesForce.getForce(prefuse.util.force.Spring)
Copyright ? 2013 Regents of the University of California