org.diamondspin
Class DSInertiaManager

java.lang.Object
  extended by 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

Nested Class Summary
 class DSInertiaManager.PointInTime
           
 
Field Summary
protected  DSElementAdapter adapter
           
static double DEFAULT_FRICTION
           
protected  DSElement elem
           
protected  boolean frameBounceOnCorners
           
protected  double frictionFactor
           
protected static HashMap<DSElement,DSInertiaManager> inertiaManagerTable
           
protected  boolean isFree
           
protected  Point2D.Double lastSpeed
           
static int MAXINTGR
           
protected  double maxspeed
           
static int MININTGR
           
protected  DSTabletopPane pane
           
protected  LinkedList<DSInertiaManager.PointInTime> past
           
protected  Timer timer
           
protected  DSDefaultView view
           
 
Method Summary
static DSInertiaManager attachManager(DSElement el, DSTabletopPane p, double maxspeed)
          Creates a new instance of DSInertiaManager
 void detach()
           
 double getFrictionFactor()
           
static DSInertiaManager getInertiaManager(DSElement elem)
           
 Point2D.Double getSpeed()
           
protected  void launch()
           
 void launch(int dx, int dy)
           
 void setFrictionFactor(double frictionFactor)
          between 0 and 1
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Method Detail

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.