Class AbstractEffect
java.lang.Object
org.eclipse.nebula.cwt.animation.effects.AbstractEffect
- All Implemented Interfaces:
IEffect
- Direct Known Subclasses:
Grow
,MoveControl
,MoveScrollBar
,Resize
,SetAlpha
,SetBounds
,Shake
public abstract class AbstractEffect extends java.lang.Object implements IEffect
Abstract implementation for IEffect.
-
Field Summary
Fields Modifier and Type Field Description protected boolean
done
protected IMovement
easingFunction
protected long
length
protected java.lang.Runnable
runnableOnCancel
protected java.lang.Runnable
runnableOnStop
protected long
startTime
-
Constructor Summary
Constructors Constructor Description AbstractEffect(long lengthMilli, IMovement movement, java.lang.Runnable onStop, java.lang.Runnable onCancel)
-
Method Summary
Modifier and Type Method 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.
-
Field Details
-
runnableOnStop
protected java.lang.Runnable runnableOnStop -
runnableOnCancel
protected java.lang.Runnable runnableOnCancel -
length
protected long length -
startTime
protected long startTime -
done
protected boolean done -
easingFunction
-
-
Constructor Details
-
AbstractEffect
public AbstractEffect(long lengthMilli, IMovement movement, java.lang.Runnable onStop, java.lang.Runnable onCancel)
-
-
Method Details
-
applyEffect
public abstract void applyEffect(long currentTime)Apply this effect.- Parameters:
currentTime
-
-
doCancel
protected void doCancel()Run the onCancel runnable if any. -
doStop
protected void doStop()Run the onStop runnable if any. -
getCurrentTime
public long getCurrentTime() -
processEnd
public void processEnd()Check if the effect has ended. In that case, start the onStop runnable. -
cancel
public void cancel()Description copied from interface:IEffect
Set the effect as done and run the cancel runnable. -
doEffect
public void doEffect()Description copied from interface:IEffect
Apply effect to the target according to the current time. -
isDone
public boolean isDone()
-