Class WAnimation
This class defines an animation used as a transition to show or hide a widget.
The animation can be defined as a motion effect (e.g. sliding in or out), optionally combined with a fade effect. A timing function defines how the effects(s) are animated during the total duration of the animation.
-
Constructor Summary
ConstructorDescriptionDefault constructor.WAnimation
(AnimationEffect effect) Creates an animation.WAnimation
(AnimationEffect effect1, AnimationEffect effect2) Creates an animation.WAnimation
(AnimationEffect effect1, AnimationEffect effect2, TimingFunction timing) Creates an animation.WAnimation
(AnimationEffect effect1, AnimationEffect effect2, TimingFunction timing, int duration) Creates an animation.WAnimation
(AnimationEffect effect, TimingFunction timing) Creates an animation.WAnimation
(AnimationEffect effect, TimingFunction timing, int duration) Creates an animation.WAnimation
(EnumSet<AnimationEffect> effects) Creates an animation.WAnimation
(EnumSet<AnimationEffect> effects, TimingFunction timing) Creates an animation.WAnimation
(EnumSet<AnimationEffect> effects, TimingFunction timing, int duration) Creates an animation. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone method.boolean
equals
(WAnimation animation) Indicates whether some other object is "equal to" this one.int
Returns the duration.Returns animation effects.Returns the timing function.boolean
isEmpty()
Returns whether the animation is empty.void
setDuration
(int msecs) Sets the duration.final void
setEffects
(AnimationEffect effect, AnimationEffect... effects) Sets the animation effects.void
setEffects
(EnumSet<AnimationEffect> effects) Sets the animation effects.void
Sets a timing function.
-
Constructor Details
-
WAnimation
public WAnimation()Default constructor.Creates an animation that actually represent no animation. (
getEffects()
== 0). -
WAnimation
Creates an animation.An animation is created with given effects, timing and duration.
-
WAnimation
Creates an animation. -
WAnimation
Creates an animation. -
WAnimation
Creates an animation.An animation is created with one effect, timing and duration.
-
WAnimation
Creates an animation. -
WAnimation
Creates an animation. -
WAnimation
public WAnimation(AnimationEffect effect1, AnimationEffect effect2, TimingFunction timing, int duration) Creates an animation.An animation is created with two effects (a motion and Fade).
-
WAnimation
Creates an animation. -
WAnimation
Creates an animation.
-
-
Method Details
-
clone
Clone method.Clones this animation object.
-
setEffects
Sets the animation effects.A motion effect (
AnimationEffect.SlideInFromLeft
,AnimationEffect.SlideInFromRight
,AnimationEffect.SlideInFromBottom
,AnimationEffect.SlideInFromTop
orAnimationEffect.Pop
) can be combined with a fade effect (AnimationEffect.Fade
).When effects are 0, the animation does not actually specify an animation, but instead an instant transition.
-
setEffects
Sets the animation effects. -
getEffects
Returns animation effects.- See Also:
-
equals
Indicates whether some other object is "equal to" this one.Returns
true
if the transitions are exactly the same. -
setDuration
public void setDuration(int msecs) Sets the duration.The default animation duration is 250 ms.
- See Also:
-
getDuration
public int getDuration()Returns the duration.- See Also:
-
setTimingFunction
Sets a timing function.The default timinig function is
TimingFunction.Linear
. -
getTimingFunction
Returns the timing function.- See Also:
-
isEmpty
public boolean isEmpty()Returns whether the animation is empty.An animation is empty (meaning the transition is instant), if the duration is 0, or if no effects are defined.
-