prefuse.util.force
Class GravitationalForce

java.lang.Object
  extended by prefuse.util.force.AbstractForce
      extended by prefuse.util.force.GravitationalForce
All Implemented Interfaces:
Force

public class GravitationalForce
extends AbstractForce

Represents a constant gravitational force, like the pull of gravity for an object on the Earth (F = mg). The force experienced by a given item is calculated as the product of a GravitationalConstant parameter and the mass of the item.

Author:
jeffrey heer

Field Summary
static float DEFAULT_DIRECTION
           
static float DEFAULT_FORCE_CONSTANT
           
static float DEFAULT_MAX_DIRECTION
           
static float DEFAULT_MAX_FORCE_CONSTANT
           
static float DEFAULT_MIN_DIRECTION
           
static float DEFAULT_MIN_FORCE_CONSTANT
           
static int DIRECTION
           
static int GRAVITATIONAL_CONST
           
 
Fields inherited from class prefuse.util.force.AbstractForce
maxValues, minValues, params
 
Constructor Summary
GravitationalForce()
          Create a new GravitationalForce with default gravitational constant and direction.
GravitationalForce(float forceConstant, float direction)
          Create a new GravitationForce.
 
Method Summary
 void getForce(ForceItem item)
          Throws an UnsupportedOperationException.
protected  java.lang.String[] getParameterNames()
           
 boolean isItemForce()
          Returns true.
 
Methods inherited from class prefuse.util.force.AbstractForce
getForce, getMaxValue, getMinValue, getParameter, getParameterCount, getParameterName, init, isSpringForce, setMaxValue, setMinValue, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAVITATIONAL_CONST

public static final int GRAVITATIONAL_CONST
See Also:
Constant Field Values

DIRECTION

public static final int DIRECTION
See Also:
Constant Field Values

DEFAULT_FORCE_CONSTANT

public static final float DEFAULT_FORCE_CONSTANT
See Also:
Constant Field Values

DEFAULT_MIN_FORCE_CONSTANT

public static final float DEFAULT_MIN_FORCE_CONSTANT
See Also:
Constant Field Values

DEFAULT_MAX_FORCE_CONSTANT

public static final float DEFAULT_MAX_FORCE_CONSTANT
See Also:
Constant Field Values

DEFAULT_DIRECTION

public static final float DEFAULT_DIRECTION
See Also:
Constant Field Values

DEFAULT_MIN_DIRECTION

public static final float DEFAULT_MIN_DIRECTION
See Also:
Constant Field Values

DEFAULT_MAX_DIRECTION

public static final float DEFAULT_MAX_DIRECTION
See Also:
Constant Field Values
Constructor Detail

GravitationalForce

public GravitationalForce(float forceConstant,
                          float direction)
Create a new GravitationForce.

Parameters:
forceConstant - the gravitational constant to use
direction - the direction in which gravity should act, in radians.

GravitationalForce

public GravitationalForce()
Create a new GravitationalForce with default gravitational constant and direction.

Method Detail

isItemForce

public boolean isItemForce()
Returns true.

Specified by:
isItemForce in interface Force
Overrides:
isItemForce in class AbstractForce
Returns:
true if this force function processes Force instances
See Also:
Force.isItemForce()

getParameterNames

protected java.lang.String[] getParameterNames()
Specified by:
getParameterNames in class AbstractForce
See Also:
AbstractForce.getParameterNames()

getForce

public void getForce(ForceItem item)
Description copied from class: AbstractForce
Throws an UnsupportedOperationException.

Specified by:
getForce in interface Force
Overrides:
getForce in class AbstractForce
Parameters:
item - the ForceItem on which to compute updated forces
See Also:
Force.getForce(prefuse.util.force.ForceItem)


Copyright © 2007 Regents of the University of California