Class WAnimation
public class WAnimation
extends java.lang.Object
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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WAnimation.AnimationEffect
An enumeration describing an animation effect.static class
WAnimation.TimingFunction
A timing function. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description WAnimation
clone()
Clone method.boolean
equals(WAnimation animation)
Indicates whether some other object is "equal to" this one.int
getDuration()
Returns the duration.java.util.EnumSet<WAnimation.AnimationEffect>
getEffects()
Returns animation effects.WAnimation.TimingFunction
getTimingFunction()
Returns the timing function.boolean
isEmpty()
Returns whether the animation is empty.void
setDuration(int msecs)
Sets the duration.void
setEffects(WAnimation.AnimationEffect effect, WAnimation.AnimationEffect... effects)
Sets the animation effects.void
setEffects(java.util.EnumSet<WAnimation.AnimationEffect> effects)
Sets the animation effects.void
setTimingFunction(WAnimation.TimingFunction tf)
Sets a timing function.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WAnimation
public WAnimation()Default constructor.Creates an animation that actually represent no animation. (
getEffects()
== 0). -
WAnimation
public WAnimation(java.util.EnumSet<WAnimation.AnimationEffect> effects, WAnimation.TimingFunction timing, int duration)Creates an animation.An animation is created with given effects, timing and duration.
-
WAnimation
Creates an animation. -
WAnimation
public WAnimation(java.util.EnumSet<WAnimation.AnimationEffect> effects, WAnimation.TimingFunction timing)Creates an animation. -
WAnimation
public WAnimation(WAnimation.AnimationEffect effect, WAnimation.TimingFunction timing, int duration)Creates an animation.An animation is created with one effect, timing and duration.
-
WAnimation
Creates an animation. -
WAnimation
Creates an animation. -
WAnimation
public WAnimation(WAnimation.AnimationEffect effect1, WAnimation.AnimationEffect effect2, WAnimation.TimingFunction timing, int duration)Creates an animation.An animation is created with two effects (a motion and Fade).
-
WAnimation
Creates an animation.Calls
this(effect1, effect2, WAnimation.TimingFunction.Linear, 250)
-
WAnimation
public WAnimation(WAnimation.AnimationEffect effect1, WAnimation.AnimationEffect effect2, WAnimation.TimingFunction timing)Creates an animation.
-
-
Method Details
-
clone
Clone method.Clones this animation object.
- Overrides:
clone
in classjava.lang.Object
-
setEffects
Sets the animation effects.A motion effect (
SlideInFromLeft
,SlideInFromRight
,SlideInFromBottom
,SlideInFromTop
orPop
) can be combined with a fade effect (Fade
).When effects are 0, the animation does not actually specify an animation, but instead an instant transition.
-
setEffects
public final void setEffects(WAnimation.AnimationEffect effect, WAnimation.AnimationEffect... effects)Sets the animation effects. -
getEffects
Returns animation effects.- See Also:
setEffects(EnumSet effects)
-
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()
-
getDuration
public int getDuration()Returns the duration.- See Also:
setDuration(int msecs)
-
setTimingFunction
Sets a timing function.The default timinig function is
Linear
. -
getTimingFunction
Returns the timing function. -
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.
-