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 |
Constructor and Description |
---|
AbstractEffect(long lengthMilli,
IMovement movement)
Create a new effect.
|
AbstractEffect(long lengthMilli,
IMovement movement,
java.lang.Runnable onStop,
java.lang.Runnable onCancel)
Create a new effect, with listeners for stop and cancel events.
|
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() |
void |
doEffect(long time)
Apply effect to the target according to the given time.
|
protected void |
doStop()
Run the onStop runnable if any.
|
long |
getLength()
Get effect length
|
boolean |
isDone() |
void |
processEnd(long time)
Check if the effect has ended.
|
protected boolean done
protected IMovement easingFunction
protected long length
protected java.lang.Runnable runnableOnCancel
protected java.lang.Runnable runnableOnStop
public AbstractEffect(long lengthMilli, IMovement movement)
lengthMilli
- movement
- public AbstractEffect(long lengthMilli, IMovement movement, java.lang.Runnable onStop, java.lang.Runnable onCancel)
lengthMilli
- movement
- onStop
- onCancel
- public abstract void applyEffect(long currentTime)
currentTime
- public void cancel()
IEffect
cancel
in interface IEffect
IEffect.cancel()
protected void doCancel()
public void doEffect()
org.eclipse.nebula.animation.effects.IEffect#doEffect()
public void doEffect(long time)
IEffect
doEffect
in interface IEffect
time
- - Current time in ms. This value may be larger than the effect
length.IEffect.doEffect(long)
protected void doStop()
public long getLength()
IEffect
getLength
in interface IEffect
IEffect.getLength()
public boolean isDone()
isDone
in interface IEffect
IEffect.isDone()
public void processEnd(long time)