prefuse.util.force
Class CircularWallForce

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

public class CircularWallForce
extends AbstractForce

Uses a gravitational force model to act as a circular "wall". Can be used to construct circles which either attract or repel items.

Author:
jeffrey heer

Field Summary
static float DEFAULT_GRAV_CONSTANT
           
static float DEFAULT_MAX_GRAV_CONSTANT
           
static float DEFAULT_MIN_GRAV_CONSTANT
           
static int GRAVITATIONAL_CONST
           
 
Fields inherited from class prefuse.util.force.AbstractForce
maxValues, minValues, params
 
Constructor Summary
CircularWallForce(float x, float y, float r)
          Create a new CircularWallForce with default gravitational constant.
CircularWallForce(float gravConst, float x, float y, float r)
          Create a new CircularWallForce.
 
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

DEFAULT_GRAV_CONSTANT

public static final float DEFAULT_GRAV_CONSTANT
See Also:
Constant Field Values

DEFAULT_MIN_GRAV_CONSTANT

public static final float DEFAULT_MIN_GRAV_CONSTANT
See Also:
Constant Field Values

DEFAULT_MAX_GRAV_CONSTANT

public static final float DEFAULT_MAX_GRAV_CONSTANT
See Also:
Constant Field Values

GRAVITATIONAL_CONST

public static final int GRAVITATIONAL_CONST
See Also:
Constant Field Values
Constructor Detail

CircularWallForce

public CircularWallForce(float gravConst,
                         float x,
                         float y,
                         float r)
Create a new CircularWallForce.

Parameters:
gravConst - the gravitational constant to use
x - the center x-coordinate of the circle
y - the center y-coordinate of the circle
r - the radius of the circle

CircularWallForce

public CircularWallForce(float x,
                         float y,
                         float r)
Create a new CircularWallForce with default gravitational constant.

Parameters:
x - the center x-coordinate of the circle
y - the center y-coordinate of the circle
r - the radius of the circle
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