org.diamondspin
Class DSInertiaManager
java.lang.Object
org.diamondspin.DSInertiaManager
public class DSInertiaManager
- extends Object
an inertiaManager is a dselement helper to make it move when dropped with given inertia
- Author:
- vernier
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAXINTGR
public static final int MAXINTGR
- See Also:
- Constant Field Values
MININTGR
public static final int MININTGR
- See Also:
- Constant Field Values
maxspeed
protected double maxspeed
lastSpeed
protected Point2D.Double lastSpeed
past
protected LinkedList<DSInertiaManager.PointInTime> past
elem
protected DSElement elem
pane
protected DSTabletopPane pane
view
protected DSDefaultView view
isFree
protected boolean isFree
DEFAULT_FRICTION
public static final double DEFAULT_FRICTION
- See Also:
- Constant Field Values
frictionFactor
protected double frictionFactor
frameBounceOnCorners
protected boolean frameBounceOnCorners
timer
protected Timer timer
inertiaManagerTable
protected static HashMap<DSElement,DSInertiaManager> inertiaManagerTable
adapter
protected DSElementAdapter adapter
attachManager
public static DSInertiaManager attachManager(DSElement el,
DSTabletopPane p,
double maxspeed)
- Creates a new instance of DSInertiaManager
launch
public void launch(int dx,
int dy)
stop
public void stop()
detach
public void detach()
getInertiaManager
public static DSInertiaManager getInertiaManager(DSElement elem)
launch
protected void launch()
getFrictionFactor
public double getFrictionFactor()
getSpeed
public Point2D.Double getSpeed()
setFrictionFactor
public void setFrictionFactor(double frictionFactor)
- between 0 and 1
Copyright © 2006 Frederic Vernier(LIMSI) Chia Shen(MERL) Guillaume Besacier(LIMSI). All Rights Reserved.