Class TimedAnimation

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class TimedAnimation extends Animation

A time-based Animation.

AdwTimedAnimation implements a simple animation interpolating the given value from TimedAnimation:value-from to TimedAnimation:value-to over TimedAnimation:duration milliseconds using the curve described by TimedAnimation:easing.

If TimedAnimation:reverse is set to TRUE, AdwTimedAnimation will instead animate from TimedAnimation:value-to to TimedAnimation:value-from, and the easing curve will be inverted.

The animation can repeat a certain amount of times, or endlessly, depending on the TimedAnimation:repeat-count value. If TimedAnimation:alternate is set to TRUE, it will also change the direction every other iteration.

  • Constructor Details

    • TimedAnimation

      public TimedAnimation(MemorySegment address)
      Create a TimedAnimation instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TimedAnimation

      public TimedAnimation(Widget widget, double from, double to, int duration, AnimationTarget target)
      Creates a new AdwTimedAnimation on widget to animate target from from to to.
      Parameters:
      widget - a widget to create animation on
      from - a value to animate from
      to - a value to animate to
      duration - a duration for the animation
      target - a target value to animate
    • TimedAnimation

      public TimedAnimation()
      Create a new TimedAnimation.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TimedAnimation class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TimedAnimation asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Animation
      Returns:
      the instance as if it were its parent type
    • getAlternate

      public boolean getAlternate()
      Gets whether this TimedAnimation changes direction on every iteration.
      Returns:
      whether this TimedAnimation alternates
    • getDuration

      public int getDuration()
      Gets the duration of self.
      Returns:
      the duration of self, in milliseconds
    • getEasing

      public Easing getEasing()
      Gets the easing function this TimedAnimation uses.
      Returns:
      the easing function this TimedAnimation uses
    • getRepeatCount

      public int getRepeatCount()
      Gets the number of times this TimedAnimation will play.
      Returns:
      the number of times this TimedAnimation will play
    • getReverse

      public boolean getReverse()
      Gets whether this TimedAnimation plays backwards.
      Returns:
      whether this TimedAnimation plays backwards
    • getValueFrom

      public double getValueFrom()
      Gets the value this TimedAnimation will animate from.
      Returns:
      the value to animate from
    • getValueTo

      public double getValueTo()
      Gets the value this TimedAnimation will animate to.
      Returns:
      the value to animate to
    • setAlternate

      public void setAlternate(boolean alternate)
      Sets whether this TimedAnimation changes direction on every iteration.
      Parameters:
      alternate - whether this TimedAnimation alternates
    • setDuration

      public void setDuration(int duration)

      Sets the duration of self.

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

      Parameters:
      duration - the duration to use, in milliseconds
    • setEasing

      public void setEasing(Easing easing)

      Sets the easing function this TimedAnimation will use.

      See Easing for the description of specific easing functions.

      Parameters:
      easing - the easing function to use
    • setRepeatCount

      public void setRepeatCount(int repeatCount)

      Sets the number of times this TimedAnimation will play.

      If set to 0, this TimedAnimation will repeat endlessly.

      Parameters:
      repeatCount - the number of times this TimedAnimation will play
    • setReverse

      public void setReverse(boolean reverse)
      Sets whether this TimedAnimation plays backwards.
      Parameters:
      reverse - whether this TimedAnimation plays backwards
    • setValueFrom

      public void setValueFrom(double value)

      Sets the value this TimedAnimation will 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:
      value - the value to animate from
    • setValueTo

      public void setValueTo(double value)

      Sets the value this TimedAnimation will 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:
      value - the value to animate to
    • builder

      public static TimedAnimation.Builder<? extends TimedAnimation.Builder> builder()
      A TimedAnimation.Builder object constructs a TimedAnimation with the specified properties. Use the various set...() methods to set properties, and finish construction with TimedAnimation.Builder.build().
      Returns:
      the builder object