prefuse.util.force
Interface Force

All Known Implementing Classes:
AbstractForce, CircularWallForce, DragForce, GravitationalForce, NBodyForce, SpringForce, WallForce

public interface Force

Interface for force functions in a force simulation.

Author:
jeffrey heer

Method Summary
 void getForce(ForceItem item)
          Updates the force calculation on the given ForceItem
 void getForce(Spring spring)
          Updates the force calculation on the given Spring.
 float getMaxValue(int param)
          Get the suggested maximum value for a parameter.
 float getMinValue(int param)
          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.
 void init(ForceSimulator fsim)
          Initialize this force function.
 boolean isItemForce()
          Indicates if this force function will compute forces on ForceItem instances
 boolean isSpringForce()
          Indicates if this force function will compute forces on Spring instances.
 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.
 

Method Detail

init

void init(ForceSimulator fsim)
Initialize this force function.

Parameters:
fsim - the encompassing ForceSimulator

getParameterCount

int getParameterCount()
Returns the number of parameters (e.g., gravitational constant or spring force coefficient) affecting this force function.

Returns:
the number of parameters

getParameter

float getParameter(int i)
Returns the specified, numbered parameter.

Parameters:
i - the index of the parameter to return
Returns:
the parameter value

getMinValue

float getMinValue(int param)
Get the suggested minimum value for a parameter. This value is not strictly enforced, but is used by interface components that allow force parameters to be varied.

Parameters:
param - the parameter index
Returns:
the suggested minimum value.

getMaxValue

float getMaxValue(int param)
Get the suggested maximum value for a parameter. This value is not strictly enforced, but is used by interface components that allow force parameters to be varied.

Parameters:
param - the parameter index
Returns:
the suggested maximum value.

getParameterName

java.lang.String getParameterName(int i)
Gets the text name of the requested parameter.

Parameters:
i - the index of the parameter
Returns:
a String containing the name of this parameter

setParameter

void setParameter(int i,
                  float val)
Sets the specified parameter value.

Parameters:
i - the index of the parameter
val - the new value of the parameter

setMinValue

void setMinValue(int i,
                 float val)
Set the suggested minimum value for a parameter. This value is not strictly enforced, but is used by interface components that allow force parameters to be varied.

Parameters:
i - the parameter index
val - the suggested minimum value to use

setMaxValue

void setMaxValue(int i,
                 float val)
Set the suggested maximum value for a parameter. This value is not strictly enforced, but is used by interface components that allow force parameters to be varied.

Parameters:
i - the parameter index
val - the suggested maximum value to use

isSpringForce

boolean isSpringForce()
Indicates if this force function will compute forces on Spring instances.

Returns:
true if this force function processes Spring instances

isItemForce

boolean isItemForce()
Indicates if this force function will compute forces on ForceItem instances

Returns:
true if this force function processes Force instances

getForce

void getForce(ForceItem item)
Updates the force calculation on the given ForceItem

Parameters:
item - the ForceItem on which to compute updated forces

getForce

void getForce(Spring spring)
Updates the force calculation on the given Spring. The ForceItems attached to Spring will have their force values updated appropriately.

Parameters:
spring - the Spring on which to compute updated forces


Copyright © 2007 Regents of the University of California