Class TimedAnimation
- All Implemented Interfaces:
Proxy
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TimedAnimation.Builder<B extends TimedAnimation.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.adw.Animation
Animation.AnimationClass, Animation.AnimationImpl, Animation.DoneCallback
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionTimedAnimation
(MemorySegment address) Create a TimedAnimation proxy instance for the provided memory address.TimedAnimation
(Widget widget, double from, double to, int duration, AnimationTarget target) Creates a newAdwTimedAnimation
onwidget
to animatetarget
fromfrom
toto
. -
Method Summary
Modifier and TypeMethodDescriptionprotected TimedAnimation
asParent()
Returns this instance as if it were its parent type.static TimedAnimation.Builder
<? extends TimedAnimation.Builder> builder()
ATimedAnimation.Builder
object constructs aTimedAnimation
with the specified properties.boolean
Gets whether this TimedAnimation changes direction on every iteration.int
Gets the duration of this TimedAnimation.Gets the easing function this TimedAnimation uses.int
Gets the number of times this TimedAnimation will play.boolean
Gets whether this TimedAnimation plays backwards.static Type
getType()
Get the GType of the TimedAnimation classdouble
Gets the value this TimedAnimation will animate from.double
Gets the value this TimedAnimation will animate to.void
setAlternate
(boolean alternate) Sets whether this TimedAnimation changes direction on every iteration.void
setDuration
(int duration) Sets the duration of this TimedAnimation.void
Sets the easing function this TimedAnimation will use.void
setRepeatCount
(int repeatCount) Sets the number of times this TimedAnimation will play.void
setReverse
(boolean reverse) Sets whether this TimedAnimation plays backwards.void
setValueFrom
(double value) Sets the value this TimedAnimation will animate from.void
setValueTo
(double value) Sets the value this TimedAnimation will animate to.Methods inherited from class org.gnome.adw.Animation
emitDone, getFollowEnableAnimationsSetting, getMemoryLayout, getState, getTarget, getValue, getWidget, onDone, pause, play, reset, resume, setFollowEnableAnimationsSetting, setTarget, skip
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TimedAnimation
Create a TimedAnimation proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
TimedAnimation
Creates a newAdwTimedAnimation
onwidget
to animatetarget
fromfrom
toto
.- Parameters:
widget
- a widget to create animation onfrom
- a value to animate fromto
- a value to animate toduration
- a duration for the animationtarget
- a target value to animate
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the 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 this TimedAnimation.- Returns:
- the duration of this TimedAnimation, in milliseconds
-
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 this TimedAnimation.If the animation repeats more than once, sets the duration of one iteration.
- Parameters:
duration
- the duration to use, in milliseconds
-
setEasing
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
isTRUE
, 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
isTRUE
, the animation will start at this value instead.- Parameters:
value
- the value to animate to
-
builder
ATimedAnimation.Builder
object constructs aTimedAnimation
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withTimedAnimation.Builder.build()
.
-