prefuse.util.force
Class GravitationalForce
java.lang.Object
prefuse.util.force.AbstractForce
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
Constructor Summary |
GravitationalForce()
Create a new GravitationalForce with default gravitational
constant and direction. |
GravitationalForce(float forceConstant,
float direction)
Create a new GravitationForce. |
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 |
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
GravitationalForce
public GravitationalForce(float forceConstant,
float direction)
- Create a new GravitationForce.
- Parameters:
forceConstant
- the gravitational constant to usedirection
- the direction in which gravity should act,
in radians.
GravitationalForce
public GravitationalForce()
- Create a new GravitationalForce with default gravitational
constant and direction.
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