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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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.
      Specified by:
      cancel in interface IEffect
    • doEffect

      public void doEffect()
      Description copied from interface: IEffect
      Apply effect to the target according to the current time.
      Specified by:
      doEffect in interface IEffect
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface IEffect
      Returns:
      true if the effect as already reached its end.