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 booleandoneprotected IMovementeasingFunctionprotected longlengthprotected java.lang.RunnablerunnableOnCancelprotected java.lang.RunnablerunnableOnStopprotected longstartTime
-
Constructor Summary
Constructors Constructor Description AbstractEffect(long lengthMilli, IMovement movement, java.lang.Runnable onStop, java.lang.Runnable onCancel)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidapplyEffect(long currentTime)Apply this effect.voidcancel()Set the effect as done and run the cancel runnable.protected voiddoCancel()Run the onCancel runnable if any.voiddoEffect()Apply effect to the target according to the current time.protected voiddoStop()Run the onStop runnable if any.longgetCurrentTime()booleanisDone()voidprocessEnd()Check if the effect has ended.
-
-
-
Field Detail
-
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
protected IMovement easingFunction
-
-
Constructor Detail
-
AbstractEffect
public AbstractEffect(long lengthMilli, IMovement movement, java.lang.Runnable onStop, java.lang.Runnable onCancel)
-
-
Method Detail
-
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:IEffectSet the effect as done and run the cancel runnable.
-
doEffect
public void doEffect()
Description copied from interface:IEffectApply effect to the target according to the current time.
-
-