|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.util.force.AbstractForce
public abstract class AbstractForce
Abstract base class for force functions in a force simulation. This
skeletal version provides support for storing and retrieving float-valued
parameters of the force function. Subclasses should use the protected
field params
to store parameter values.
Field Summary | |
---|---|
protected float[] |
maxValues
|
protected float[] |
minValues
|
protected float[] |
params
|
Constructor Summary | |
---|---|
AbstractForce()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected float[] params
protected float[] minValues
protected float[] maxValues
Constructor Detail |
---|
public AbstractForce()
Method Detail |
---|
public void init(ForceSimulator fsim)
init
in interface Force
fsim
- the encompassing ForceSimulatorpublic 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 return
Force.getParameter(int)
public float getMinValue(int i)
Force
getMinValue
in interface Force
i
- the parameter index
Force.getMinValue(int)
public float getMaxValue(int i)
Force
getMaxValue
in interface Force
i
- the parameter index
Force.getMaxValue(int)
public java.lang.String getParameterName(int i)
Force
getParameterName
in interface Force
i
- the index of the parameter
Force.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 indexval
- the suggested maximum value to useForce.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |