|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectfang.TrackerAdapter
fang.AlternateTracker
public abstract class AlternateTracker
This class provides an alternative interface to the Tracker interface. Instead of providing relative location, scaling, and rotation information, this one allow setting the absolute location, scaling, and rotation information. The class takes care of taking the differences and returning the relative values that the Tracker interface expects. To use this class, simply provide an advanceTime method which calls setScale, setLocation, or setRotation methods.
| Constructor Summary | |
|---|---|
AlternateTracker()
|
|
AlternateTracker(double rotation,
double scale,
Point2D.Double location)
sets up the current state of the tracker |
|
| Method Summary | |
|---|---|
abstract void |
advanceTime(double time)
this method is called automatically every time the frame is advanced. |
double |
getRotationAddition()
gets the amount to scale from the current rotation in radians |
double |
getScaleFactor()
gets the amount to scale from the current scale |
Point2D.Double |
getTranslation()
gets the amount to move from the current location |
void |
setLocation(Point2D.Double l)
sets the next location. |
void |
setRotation(double r)
sets the next rotation. |
void |
setRotationDegrees(double d)
sets the next rotation. |
void |
setRotationRevolutions(double rev)
sets the next rotation. |
void |
setScale(double s)
sets the next scale. |
| Methods inherited from class fang.TrackerAdapter |
|---|
getRotationAdditionDegrees, getRotationAdditionRadians, getRotationAdditionRevolutions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AlternateTracker()
public AlternateTracker(double rotation,
double scale,
Point2D.Double location)
rotation - the rotation in radiansscale - the current scalelocation - the current position| Method Detail |
|---|
public final double getRotationAddition()
getRotationAddition in interface TrackergetRotationAddition in class TrackerAdapterfang.core.Tracker#getRotationAddition()public final double getScaleFactor()
getScaleFactor in interface TrackergetScaleFactor in class TrackerAdapterfang.core.Tracker#getScaleFactor()public final Point2D.Double getTranslation()
getTranslation in interface TrackergetTranslation in class TrackerAdapterfang.core.Tracker#getTranslation()public final void setRotation(double r)
r - the next orientation in radianspublic final void setRotationDegrees(double d)
d - the next orientation in degreespublic final void setRotationRevolutions(double rev)
rev - the next orientation in degreespublic final void setScale(double s)
s - the next scalepublic final void setLocation(Point2D.Double l)
l - the next locationpublic abstract void advanceTime(double time)
advanceTime in interface TrackeradvanceTime in class TrackerAdaptertime - the amount of time which has
passed since the last frame
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||