fang
Class TrackerAdapter

java.lang.Object
  extended by fang.TrackerAdapter
All Implemented Interfaces:
Tracker
Direct Known Subclasses:
AbsoluteTransformer, AlternateTracker, InputFieldSprite.InputTracker, StringField.InputTracker

public abstract class TrackerAdapter
extends Object
implements Tracker

provides a default implementation of the Tracker interface methods except for advanceTime

Author:
Jam Jenkins

Constructor Summary
TrackerAdapter()
           
 
Method Summary
abstract  void advanceTime(double time)
          this method is called between each frame.
 double getRotationAddition()
          returns 0.
 double getRotationAdditionDegrees()
          returns 0.
 double getRotationAdditionRadians()
          returns 0.
 double getRotationAdditionRevolutions()
          returns 0.
 double getScaleFactor()
          returns 1
 Point2D.Double getTranslation()
          returns (0, 0)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackerAdapter

public TrackerAdapter()
Method Detail

getTranslation

public Point2D.Double getTranslation()
returns (0, 0)

Specified by:
getTranslation in interface Tracker
Returns:
the absolute location of the Sprite
See Also:
fang.core.Tracker#getTranslation()

getScaleFactor

public double getScaleFactor()
returns 1

Specified by:
getScaleFactor in interface Tracker
Returns:
the multiplicative scaling factor
See Also:
fang.core.Tracker#getScaleFactor()

getRotationAddition

public double getRotationAddition()
returns 0. This method is the same as getRotationAddition. The name was changed to make the units explicit, and therefore this method has been deprecated. Please use getRotationAdditionRadians instead.

Specified by:
getRotationAddition in interface Tracker
Returns:
the radians to add
See Also:
fang.core.Tracker#getRotationAddition()

getRotationAdditionRadians

public double getRotationAdditionRadians()
returns 0. This method calls getRotationAdditionDegrees and converts the result from degrees to radians. If you want a non-zero value returned, you can override this method. Override this method, the getRotationAdditionDegrees method, or the getRotationAdditionRevolutions method, but not a combination of the three.

Returns:
the radians to add
See Also:
fang.core.Tracker#getRotationAddition()

getRotationAdditionDegrees

public double getRotationAdditionDegrees()
returns 0. This method may be overridden to return a non-zero number of degrees to add. Override this method, the getRotationAddition method, or the getRotationAdditionRevolutions method, but not a combination of the three.

Returns:
the degrees to add

getRotationAdditionRevolutions

public double getRotationAdditionRevolutions()
returns 0. This method may be overridden to return a non-zero number of revolutions to add. Override this method, the getRotationAdditionDegrees method, or the getRotationAddition method, but not a combination of the three.

Returns:
the degrees to add

advanceTime

public abstract void advanceTime(double time)
this method is called between each frame. The time parameter is the amount of time which has pased since the last frame, which is typically about 1/26 of a second.

Specified by:
advanceTime in interface Tracker
Parameters:
time - the amount of time passed since the last call to this method