Package ch.bailu.gtk.adw
Class TimedAnimation
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.adw.Animation
ch.bailu.gtk.adw.TimedAnimation
- All Implemented Interfaces:
PointerInterface
A time-based [class@Animation].
`AdwTimedAnimation` implements a simple animation interpolating the given
value from [property@TimedAnimation:value-from] to
[property@TimedAnimation:value-to] over
[property@TimedAnimation:duration] milliseconds using the curve described by
[property@TimedAnimation:easing].
If [property@TimedAnimation:reverse] is set to `TRUE`, `AdwTimedAnimation`
will instead animate from [property@TimedAnimation:value-to] to
[property@TimedAnimation:value-from], and the easing curve will be inverted.
The animation can repeat a certain amount of times, or endlessly, depending
on the [property@TimedAnimation:repeat-count] value. If
[property@TimedAnimation:alternate] is set to `TRUE`, it will also change the
direction every other iteration.
`AdwTimedAnimation` implements a simple animation interpolating the given
value from [property@TimedAnimation:value-from] to
[property@TimedAnimation:value-to] over
[property@TimedAnimation:duration] milliseconds using the curve described by
[property@TimedAnimation:easing].
If [property@TimedAnimation:reverse] is set to `TRUE`, `AdwTimedAnimation`
will instead animate from [property@TimedAnimation:value-to] to
[property@TimedAnimation:value-from], and the easing curve will be inverted.
The animation can repeat a certain amount of times, or endlessly, depending
on the [property@TimedAnimation:repeat-count] value. If
[property@TimedAnimation:alternate] is set to `TRUE`, it will also change the
direction every other iteration.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.TimedAnimation.html
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.adw.Animation
Animation.OnDone
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.adw.Animation
SIGNAL_ON_DONE
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionTimedAnimation
(Widget widget, double from, double to, int duration, AnimationTarget target) Creates a new `AdwTimedAnimation` on @widget to animate @target from @from
to @to.TimedAnimation
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets whether @self changes direction on every iteration.static ClassHandler
int
Gets the duration of @self.int
Gets the easing function @self uses.static int
static long
static TypeSystem.TypeSize
int
Gets the number of times @self will play.boolean
Gets whether @self plays backwards.static long
static TypeSystem.TypeSize
double
Gets the value @self will animate from.double
Gets the value @self will animate to.void
setAlternate
(boolean alternate) Sets whether @self changes direction on every iteration.void
setDuration
(int duration) Sets the duration of @self.void
setEasing
(int easing) Sets the easing function @self will use.void
setRepeatCount
(int repeat_count) Sets the number of times @self will play.void
setReverse
(boolean reverse) Sets whether @self plays backwards.void
setValueFrom
(double value) Sets the value @self will animate from.void
setValueTo
(double value) Sets the value @self will animate to.Methods inherited from class ch.bailu.gtk.adw.Animation
getState, getTarget, getValue, getWidget, onDone, pause, play, reset, resume, setTarget, skip
Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
TimedAnimation
-
TimedAnimation
public TimedAnimation(@Nonnull Widget widget, double from, double to, int duration, @Nonnull AnimationTarget target) Creates a new `AdwTimedAnimation` on @widget to animate @target from @from
to @to.- 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
-
getClassHandler
-
getAlternate
public boolean getAlternate()Gets whether @self changes direction on every iteration.- Returns:
- whether @self alternates
-
getDuration
public int getDuration()Gets the duration of @self.- Returns:
- the duration of @self, in milliseconds
-
getEasing
public int getEasing()Gets the easing function @self uses.- Returns:
- the easing function @self uses
-
getRepeatCount
public int getRepeatCount()Gets the number of times @self will play.- Returns:
- the number of times @self will play
-
getReverse
public boolean getReverse()Gets whether @self plays backwards.- Returns:
- whether @self plays backwards
-
getValueFrom
public double getValueFrom()Gets the value @self will animate from.- Returns:
- the value to animate from
-
getValueTo
public double getValueTo()Gets the value @self will animate to.- Returns:
- the value to animate to
-
setAlternate
public void setAlternate(boolean alternate) Sets whether @self changes direction on every iteration.- Parameters:
alternate
- whether @self 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(int easing) Sets the easing function @self will use.
See [enum@Easing] for the description of specific easing functions.- Parameters:
easing
- the easing function to use
-
setRepeatCount
public void setRepeatCount(int repeat_count) Sets the number of times @self will play.
If set to 0, @self will repeat endlessly.- Parameters:
repeat_count
- the number of times @self will play
-
setReverse
public void setReverse(boolean reverse) Sets whether @self plays backwards.- Parameters:
reverse
- whether @self plays backwards
-
setValueFrom
public void setValueFrom(double value) Sets the value @self will animate from.
The animation will start at this value and end at
[property@TimedAnimation:value-to].
If [property@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 @self will animate to.
The animation will start at [property@TimedAnimation:value-from] and end at
this value.
If [property@TimedAnimation:reverse] is `TRUE`, the animation will start
at this value instead.- Parameters:
value
- the value to animate to
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-