prefuse.util.force
Class WallForce
java.lang.Object
prefuse.util.force.AbstractForce
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
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. |
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 |
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
WallForce
public WallForce(float gravConst,
float x1,
float y1,
float x2,
float y2)
- Create a new WallForce.
- Parameters:
gravConst
- the gravitational constant of the wallx1
- the first x-coordinate of the wally1
- the first y-coordinate of the wallx2
- the second x-coordinate of the wally2
- 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 wally1
- the first y-coordinate of the wallx2
- the second x-coordinate of the wally2
- the second y-coordinate of the wall
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