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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theSpringAnimationobject.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, setWidgetMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theSpringAnimationobject. 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:
buildin classAnimation.Builder<B extends SpringAnimation.Builder<B>>- Returns:
- a new instance of
SpringAnimationwith 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-fromif a relative negativeSpringAnimation:initial-velocityis set.- Parameters:
clamp- the value for theclampproperty- Returns:
- the
Builderinstance 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 theepsilonproperty- Returns:
- the
Builderinstance 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-velocityproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setSpringParams
Physical parameters describing the spring.- Parameters:
springParams- the value for thespring-paramsproperty- Returns:
- the
Builderinstance 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-fromproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setValueTo
The value to animate to.The animation will start at
SpringAnimation:value-fromand end at this value.- Parameters:
valueTo- the value for thevalue-toproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-