org.gwtbootstrap3.extras.animate.client.ui
Class Animate

java.lang.Object
  extended by org.gwtbootstrap3.extras.animate.client.ui.Animate

public class Animate
extends Object

Utility class to dynamically animate objects using CSS animations.

Author:
Pavel Zlámal

Constructor Summary
Animate()
           
 
Method Summary
static
<T extends UIObject>
String
animate(T widget, Animation animation)
          Animate any element with specific animation.
static
<T extends UIObject>
String
animate(T widget, Animation animation, int count)
          Animate any element with specific animation.
static
<T extends UIObject>
String
animate(T widget, Animation animation, int count, int duration)
          Animate any element with specific animation.
static
<T extends UIObject>
String
animate(T widget, Animation animation, int count, int duration, int delay)
          Animate any element with specific animation.
static
<T extends UIObject>
String
animate(T widget, String animation)
          Animate any element with specific animation.
static
<T extends UIObject>
String
animate(T widget, String animation, int count)
          Animate any element with specific animation.
static
<T extends UIObject>
String
animate(T widget, String animation, int count, int duration)
          Animate any element with specific animation.
static
<T extends UIObject>
String
animate(T widget, String animation, int count, int duration, int delay)
          Animate any element with specific animation.
static
<T extends UIObject>
void
removeAnimationOnEnd(T widget, String animation)
          Removes custom animation class on animation end.
static
<T extends UIObject>
void
stopAnimation(T widget, String animation)
          Removes custom animation class and stops animation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Animate

public Animate()
Method Detail

animate

public static <T extends UIObject> String animate(T widget,
                                                  Animation animation)
Animate any element with specific animation. Animation is done by CSS and runs only once. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Type of animation to apply.
Returns:
Animation's CSS class name, which can be removed to stop animation.

animate

public static <T extends UIObject> String animate(T widget,
                                                  Animation animation,
                                                  int count)
Animate any element with specific animation. Animation is done by CSS and runs multiple times. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Type of animation to apply.
count - Number of animation repeats. 0 disables animation, any negative value set repeats to infinite.
Returns:
Animation's CSS class name, which can be removed to stop animation.

animate

public static <T extends UIObject> String animate(T widget,
                                                  Animation animation,
                                                  int count,
                                                  int duration)
Animate any element with specific animation. Animation is done by CSS and runs multiple times. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Type of animation to apply.
count - Number of animation repeats. 0 disables animation, any negative value set repeats to infinite.
duration - Animation duration in ms. 0 disables animation, any negative value keeps default of original animation.
Returns:
Animation's CSS class name, which can be removed to stop animation.

animate

public static <T extends UIObject> String animate(T widget,
                                                  Animation animation,
                                                  int count,
                                                  int duration,
                                                  int delay)
Animate any element with specific animation. Animation is done by CSS and runs multiple times. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Type of animation to apply.
count - Number of animation repeats. 0 disables animation, any negative value set repeats to infinite.
duration - Animation duration in ms. 0 disables animation, any negative value keeps default of original animation.
delay - Delay before starting the animation loop in ms. Value <= 0 means no delay.
Returns:
Animation's CSS class name, which can be removed to stop animation.

animate

public static <T extends UIObject> String animate(T widget,
                                                  String animation)
Animate any element with specific animation. Animation is done by CSS and runs only once. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Custom CSS class name used as animation.
Returns:
Animation's CSS class name, which can be removed to stop animation.

animate

public static <T extends UIObject> String animate(T widget,
                                                  String animation,
                                                  int count)
Animate any element with specific animation. Animation is done by CSS and runs multiple times. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Custom CSS class name used as animation.
count - Number of animation repeats. 0 disables animation, any negative value set repeats to infinite.
Returns:
Animation's CSS class name, which can be removed to stop animation.

animate

public static <T extends UIObject> String animate(T widget,
                                                  String animation,
                                                  int count,
                                                  int duration)
Animate any element with specific animation. Animation is done by CSS and runs multiple times. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Custom CSS class name used as animation.
count - Number of animation repeats. 0 disables animation, any negative value set repeats to infinite.
duration - Animation duration in ms. 0 disables animation, any negative value keeps default of original animation.
Returns:
Animation's CSS class name, which can be removed to stop animation.

animate

public static <T extends UIObject> String animate(T widget,
                                                  String animation,
                                                  int count,
                                                  int duration,
                                                  int delay)
Animate any element with specific animation. Animation is done by CSS and runs multiple times. Animation is started when element is appended to the DOM or new (not same) animation is added to already displayed element. Animation runs on hidden elements too and is not paused/stopped when element is set as hidden.

Type Parameters:
T - Any object extending UIObject class (typically Widget).
Parameters:
widget - Widget to apply animation to.
animation - Custom CSS class name used as animation.
count - Number of animation repeats. 0 disables animation, any negative value set repeats to infinite.
duration - Animation duration in ms. 0 disables animation, any negative value keeps default of original animation.
delay - Delay before starting the animation loop in ms. Value <= 0 means no delay.
Returns:
Animation's CSS class name, which can be removed to stop animation.

removeAnimationOnEnd

public static final <T extends UIObject> void removeAnimationOnEnd(T widget,
                                                                   String animation)
Removes custom animation class on animation end.

Parameters:
widget - Element to remove style from.
animation - Animation CSS class to remove.

stopAnimation

public static final <T extends UIObject> void stopAnimation(T widget,
                                                            String animation)
Removes custom animation class and stops animation.

Parameters:
widget - Element to remove style from.
animation - Animation CSS class to remove.


Copyright © 2015. All rights reserved.