Class TimedAnimation.Builder<B extends TimedAnimation.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
TimedAnimation

public static class TimedAnimation.Builder<B extends TimedAnimation.Builder<B>> extends Animation.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public TimedAnimation build()
      Finish building the TimedAnimation object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to TimedAnimation.
      Overrides:
      build in class Animation.Builder<B extends TimedAnimation.Builder<B>>
      Returns:
      a new instance of TimedAnimation with the properties that were set in the Builder object.
    • setAlternate

      public B setAlternate(boolean alternate)
      Whether the animation changes direction on every iteration.
      Parameters:
      alternate - the value for the alternate property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDuration

      public B setDuration(int duration)

      Duration of the animation, in milliseconds.

      Describes how much time the animation will take.

      If the animation repeats more than once, describes the duration of one iteration.

      Parameters:
      duration - the value for the duration property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setEasing

      public B setEasing(Easing easing)

      Easing function used in the animation.

      Describes the curve the value is interpolated on.

      See Easing for the description of specific easing functions.

      Parameters:
      easing - the value for the easing property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRepeatCount

      public B setRepeatCount(int repeatCount)

      Number of times the animation will play.

      If set to 0, the animation will repeat endlessly.

      Parameters:
      repeatCount - the value for the repeat-count property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setReverse

      public B setReverse(boolean reverse)
      Whether the animation plays backwards.
      Parameters:
      reverse - the value for the reverse property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setValueFrom

      public B setValueFrom(double valueFrom)

      The value to animate from.

      The animation will start at this value and end at TimedAnimation:value-to.

      If TimedAnimation:reverse is TRUE, the animation will end at this value instead.

      Parameters:
      valueFrom - the value for the value-from property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setValueTo

      public B setValueTo(double valueTo)

      The value to animate to.

      The animation will start at TimedAnimation:value-from and end at this value.

      If TimedAnimation:reverse is TRUE, the animation will start at this value instead.

      Parameters:
      valueTo - the value for the value-to property
      Returns:
      the Builder instance is returned, to allow method chaining