|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprefuse.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 Forcefsim - the encompassing ForceSimulatorpublic int getParameterCount()
Force
getParameterCount in interface ForceForce.getParameterCount()public float getParameter(int i)
Force
getParameter in interface Forcei - the index of the parameter to return
Force.getParameter(int)public float getMinValue(int i)
Force
getMinValue in interface Forcei - the parameter index
Force.getMinValue(int)public float getMaxValue(int i)
Force
getMaxValue in interface Forcei - the parameter index
Force.getMaxValue(int)public java.lang.String getParameterName(int i)
Force
getParameterName in interface Forcei - the index of the parameter
Force.getParameterName(int)
public void setParameter(int i,
float val)
Force
setParameter in interface Forcei - 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 Forcei - the parameter indexval - the suggested minimum value to useForce.setMinValue(int, float)
public void setMaxValue(int i,
float val)
Force
setMaxValue 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||