|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisual.dynamic.described.AbstractSprite
visual.dynamic.described.TweeningSprite
public abstract class TweeningSprite
A TweeningSprite is a Sprite that contains "key times" and the ability to generate "in between times"
Field Summary | |
---|---|
protected java.util.Vector<java.lang.Integer> |
keyTimes
|
protected java.util.Vector<java.awt.geom.Point2D> |
locations
|
static int |
REMAIN
|
static int |
REMOVE
|
protected java.util.Vector<java.lang.Double> |
rotations
|
protected java.util.Vector<java.lang.Double> |
scalings
|
Fields inherited from class visual.dynamic.described.AbstractSprite |
---|
angle, rotationPoint, rotationX, rotationY, scaleX, scaleY, visible, x, y |
Constructor Summary | |
---|---|
TweeningSprite()
Default Constructor |
Method Summary | |
---|---|
protected int |
addKeyTime(int keyTime,
java.awt.geom.Point2D location,
java.lang.Double rotation,
java.lang.Double scaling)
Add a key time |
protected double |
getInterpolationFraction()
Get the interpolation fraction |
protected int |
getKeyTimeIndex()
Get the active key time index |
protected int |
getNextKeyTimeIndex()
Get the next key time index |
void |
handleTick(int time)
Handle a tick event (generated by the Stage) |
protected void |
initialize()
Initialize state variables |
protected void |
reinitialize()
Re-initialize state variables |
void |
setEndState(int endState)
Set the "end state" for this Sprite |
protected void |
tweenLocation(int currentIndex,
int nextIndex,
double frac)
Determine the current 'tweened location |
protected void |
tweenRotation(int currentIndex,
int nextIndex,
double frac)
Determine the current 'tweened rotation |
protected void |
tweenScaling(int currentIndex,
int nextIndex,
double frac)
Determine the current 'tweened scaling |
Methods inherited from class visual.dynamic.described.AbstractSprite |
---|
getBounds2D, getBounds2D, getContent, intersects, render, setLocation, setRotation, setRotation, setScale, setScale, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<java.lang.Integer> keyTimes
protected java.util.Vector<java.awt.geom.Point2D> locations
protected java.util.Vector<java.lang.Double> rotations
protected java.util.Vector<java.lang.Double> scalings
public static final int REMAIN
public static final int REMOVE
Constructor Detail |
---|
public TweeningSprite()
Method Detail |
---|
protected int addKeyTime(int keyTime, java.awt.geom.Point2D location, java.lang.Double rotation, java.lang.Double scaling)
keyTime
- The timelocation
- The location of the sprite at this timerotation
- The rotation of the sprite (null to align with path)scaling
- The scaling of the sprite at this time
public void handleTick(int time)
handleTick
in interface MetronomeListener
handleTick
in class AbstractSprite
time
- The current time (in milliseconds)protected double getInterpolationFraction()
protected int getKeyTimeIndex()
protected int getNextKeyTimeIndex()
protected void initialize()
protected void reinitialize()
reinitialize
in class AbstractSprite
public void setEndState(int endState)
endState
- Either REMOVE, REMAIN, or REPEATprotected void tweenLocation(int currentIndex, int nextIndex, double frac)
currentIndex
- The index of the current key timenextIndex
- The index of the next key timefrac
- The interpolation fractionprotected void tweenRotation(int currentIndex, int nextIndex, double frac)
currentIndex
- The index of the current key timenextIndex
- The index of the next key timefrac
- The interpolation fractionprotected void tweenScaling(int currentIndex, int nextIndex, double frac)
currentIndex
- The index of the current key timenextIndex
- The index of the next key timefrac
- The interpolation fraction
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |