Class AbstractEffect

    • Constructor Summary

      Constructors 
      Constructor 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.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      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()  
      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.
      • Methods inherited from class java.lang.Object

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

      • done

        protected boolean done
      • easingFunction

        protected IMovement easingFunction
      • length

        protected long length
      • runnableOnCancel

        protected java.lang.Runnable runnableOnCancel
      • runnableOnStop

        protected java.lang.Runnable runnableOnStop
    • Constructor Detail

      • AbstractEffect

        public AbstractEffect​(long lengthMilli,
                              IMovement movement)
        Create a new effect.
        Parameters:
        lengthMilli -
        movement -
      • AbstractEffect

        public AbstractEffect​(long lengthMilli,
                              IMovement movement,
                              java.lang.Runnable onStop,
                              java.lang.Runnable onCancel)
        Create a new effect, with listeners for stop and cancel events.
        Parameters:
        lengthMilli -
        movement -
        onStop -
        onCancel -
    • Method Detail

      • applyEffect

        public abstract void applyEffect​(long currentTime)
        Apply this effect.
        Parameters:
        currentTime -
      • 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
        See Also:
        IEffect.cancel()
      • doCancel

        protected void doCancel()
        Run the onCancel runnable if any.
      • doEffect

        public void doEffect()
        See Also:
        org.eclipse.nebula.animation.effects.IEffect#doEffect()
      • doEffect

        public void doEffect​(long time)
        Description copied from interface: IEffect
        Apply effect to the target according to the given time.
        Specified by:
        doEffect in interface IEffect
        Parameters:
        time - - Current time in ms. This value may be larger than the effect length.
        See Also:
        IEffect.doEffect(long)
      • doStop

        protected void doStop()
        Run the onStop runnable if any.
      • isDone

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

        public void processEnd​(long time)
        Check if the effect has ended. In that case, start the onStop runnable.