Class SpringAnimation.Builder<B extends SpringAnimation.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
SpringAnimation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSpringAnimation
object.setClamp
(boolean clamp) Whether the animation should be clamped.setEpsilon
(double epsilon) Precision of the spring.setInitialVelocity
(double initialVelocity) The initial velocity to start the animation with.setSpringParams
(SpringParams springParams) Physical parameters describing the spring.setValueFrom
(double valueFrom) The value to animate from.setValueTo
(double valueTo) The value to animate to.Methods inherited from class org.gnome.adw.Animation.Builder
onDone, setFollowEnableAnimationsSetting, setTarget, setWidget
Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theSpringAnimation
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toSpringAnimation
.- Overrides:
build
in classAnimation.Builder<B extends SpringAnimation.Builder<B>>
- Returns:
- a new instance of
SpringAnimation
with the properties that were set in the Builder object.
-
setClamp
Whether the animation should be clamped.If set to
TRUE
, the animation will abruptly end as soon as it reaches the final value, preventing overshooting.It won't prevent overshooting
SpringAnimation:value-from
if a relative negativeSpringAnimation:initial-velocity
is set.- Parameters:
clamp
- the value for theclamp
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setEpsilon
Precision of the spring.The level of precision used to determine when the animation has come to a rest, that is, when the amplitude of the oscillations becomes smaller than this value.
If the epsilon value is too small, the animation will take a long time to stop after the animated value has stopped visibly changing.
If the epsilon value is too large, the animation will end prematurely.
The default value is 0.001.
- Parameters:
epsilon
- the value for theepsilon
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setInitialVelocity
The initial velocity to start the animation with.Initial velocity affects only the animation curve, but not its duration.
- Parameters:
initialVelocity
- the value for theinitial-velocity
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSpringParams
Physical parameters describing the spring.- Parameters:
springParams
- the value for thespring-params
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setValueFrom
The value to animate from.The animation will start at this value and end at
SpringAnimation:value-to
.- Parameters:
valueFrom
- the value for thevalue-from
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setValueTo
The value to animate to.The animation will start at
SpringAnimation:value-from
and end at this value.- Parameters:
valueTo
- the value for thevalue-to
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-