Interface Effect<T>

All Known Implementing Classes:
AbstractEffect

public interface Effect<T>
Represents a sort of 'factory' that can create animations for a particular target. An Effect in an EffectControl can be connected with a particular channel and when run can receive information about any last-run or currently running effects on that channel.

The Effect object is basically a stylable animation that can be applied to GUI elements. Many GUI elements can share the same Effect object as it's only a factory that creates the animation objects when the effect is run.

  • Method Summary

    Modifier and Type
    Method
    Description
    create(T target, EffectInfo existing)
    Creates a new animation task that will replace any existing animation task for this Effect's channel.
    Returns the channel name that will be used for looking up existing animations for a given target.
  • Method Details

    • getChannel

      String getChannel()
      Returns the channel name that will be used for looking up existing animations for a given target. Effects that are on the 'null' channel are not tracked in this way. Otherwise, when the effect is run, the channel is used to provide information to the effect about any previous effects that were run. This allows the new effect to adjust its own animations accordingly, either reducing time, starting from a different point, or entirely custom behavior depending on the needs of the effect.
    • create

      Animation create(T target, EffectInfo existing)
      Creates a new animation task that will replace any existing animation task for this Effect's channel. The last run animation is passed as the 'existing' parameter that this factory method can use to see if the previous one is still running and adjust accordingly. (For example, a close window animation might do something different if the open window animation hadn't completed yet.) By default, if the caller requests it when running the effect, the EffectControl will attempt to manage this by fast forwarding the new animation to catch up to what was left of the old animation.