public abstract class AbstractEffect extends java.lang.Object implements IEffect
Modifier and Type | Field and Description |
---|---|
protected boolean |
done |
protected IMovement |
easingFunction |
protected long |
length |
protected java.lang.Runnable |
runnableOnCancel |
protected java.lang.Runnable |
runnableOnStop |
protected long |
startTime |
Constructor and Description |
---|
AbstractEffect(long lengthMilli,
IMovement movement,
java.lang.Runnable onStop,
java.lang.Runnable onCancel) |
Modifier and Type | Method and Description |
---|---|
abstract void |
applyEffect(long currentTime)
Apply this effect.
|
void |
cancel()
Set the effect as done and run the cancel runnable.
|
protected void |
doCancel()
Run the onCancel runnable if any.
|
void |
doEffect()
Apply effect to the target according to the current time.
|
protected void |
doStop()
Run the onStop runnable if any.
|
long |
getCurrentTime() |
boolean |
isDone() |
void |
processEnd()
Check if the effect has ended.
|
protected java.lang.Runnable runnableOnStop
protected java.lang.Runnable runnableOnCancel
protected long length
protected long startTime
protected boolean done
protected IMovement easingFunction
public AbstractEffect(long lengthMilli, IMovement movement, java.lang.Runnable onStop, java.lang.Runnable onCancel)
public abstract void applyEffect(long currentTime)
currentTime
- protected void doCancel()
protected void doStop()
public long getCurrentTime()
public void processEnd()
public void cancel()
IEffect
public void doEffect()
IEffect