|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.monte.media.Interpolator
public abstract class Interpolator
A linear interpolator for use in conjunction with an Animator object.
| Constructor Summary | |
|---|---|
Interpolator()
Creates a new interpolator which interpolates from 0 to 1 within one second. |
|
Interpolator(boolean reverse)
Creates a new interpolator which interpolates into the specified direction within one second. |
|
Interpolator(float startValue,
float endValue)
Creates a new interpolator which interpolates from the specified start value to the specified end value within one second. |
|
Interpolator(float startValue,
float endValue,
long timespan)
Creates a new interpolator which interpolates from the specified start value to the specified end value within the specified timespan. |
|
Interpolator(long timespan)
Creates a new interpolator which interpolates from 0 to 1 within the specified timespan. |
|
| Method Summary | |
|---|---|
void |
finish(long currentTimeMillis)
Finishes the interpolation and calls this.notifyAll() allowing other threads to synchronize on isFinished() of the interpolator. |
protected float |
getFraction(float linearFraction)
Computes a fraction from the specified linear fraction. |
void |
initialize(long currentTimeMillis)
Initializes the interpolation. |
void |
interpolate(long currentTimeMillis)
Interpolates with the current time millis. |
boolean |
isElapsed(long currentTimeMillis)
Returns true, if the timespan of the Interpolator has elapsed since initialize was called. |
boolean |
isFinished()
|
boolean |
isSequential(Interpolator that)
|
boolean |
replaces(Interpolator that)
Returns true, if this interpolator replaces interpolations by that interpolator. |
void |
setTimespan(long t)
|
protected abstract void |
update(float fraction)
Updates the interpolator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Interpolator()
public Interpolator(long timespan)
public Interpolator(boolean reverse)
reverse - Set this to true, if you want to interpolate from 1 to 0
instead of from 0 to 1.
public Interpolator(float startValue,
float endValue)
startValue - A value between 0 and 1.endValue - A value between 0 and 1.
public Interpolator(float startValue,
float endValue,
long timespan)
startValue - A value between 0 and 1.endValue - A value between 0 and 1.timespan - A timespan in milliseconds.| Method Detail |
|---|
protected abstract void update(float fraction)
fraction - An interpolated fraction between 0 and 1.protected float getFraction(float linearFraction)
linearFraction - The linear fraction between 0 and 1.
public boolean replaces(Interpolator that)
public void initialize(long currentTimeMillis)
Once this method has been called, method #finish must be called before the interpolator can be destroyed.
currentTimeMillis - public boolean isElapsed(long currentTimeMillis)
currentTimeMillis - The current time.
public void interpolate(long currentTimeMillis)
currentTimeMillis - public void finish(long currentTimeMillis)
currentTimeMillis - public boolean isFinished()
public boolean isSequential(Interpolator that)
public void setTimespan(long t)
|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||