prefuse.util.force
Class WallForce

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

public class WallForce
extends AbstractForce

Uses a gravitational force model to act as a "wall". Can be used to construct line segments 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
WallForce(float x1, float y1, float x2, float y2)
          Create a new WallForce with default gravitational constant.
WallForce(float gravConst, float x1, float y1, float x2, float y2)
          Create a new WallForce.
 
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

WallForce

public WallForce(float gravConst,
                 float x1,
                 float y1,
                 float x2,
                 float y2)
Create a new WallForce.

Parameters:
gravConst - the gravitational constant of the wall
x1 - the first x-coordinate of the wall
y1 - the first y-coordinate of the wall
x2 - the second x-coordinate of the wall
y2 - the second y-coordinate of the wall

WallForce

public WallForce(float x1,
                 float y1,
                 float x2,
                 float y2)
Create a new WallForce with default gravitational constant.

Parameters:
x1 - the first x-coordinate of the wall
y1 - the first y-coordinate of the wall
x2 - the second x-coordinate of the wall
y2 - the second y-coordinate of the wall
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