fr.inria.zvtm.animation
Class AnimationFactory

java.lang.Object
  extended by fr.inria.zvtm.animation.AnimationFactory

@Immutable
public class AnimationFactory
extends Object

A class that provides creation methods for animations. The createAnimation() methods are generic and flexible, while the create[TargetType][AnimationType] methods are pre-made and easier to use (but offer less flexibility and only cover the most common animation cases).


Method Summary
 Animation createAnimation(int duration, double repeatCount, Animation.RepeatBehavior repeatBehavior, Object subject, Animation.Dimension dimension, TimingHandler handler)
          Creates a new Animation object that will be handled by the associated AnimationManager.
 Animation createAnimation(int duration, double repeatCount, Animation.RepeatBehavior repeatBehavior, Object subject, Animation.Dimension dimension, TimingHandler handler, org.jdesktop.animation.timing.interpolation.Interpolator interpolator)
          Creates a new Animation object that will be handled by this AnimationManager.
 Animation createAnimation(int duration, Object subject, Animation.Dimension dimension, TimingHandler handler)
          Creates a new Animation object that will be handled by the associated AnimationManager.
 Animation createCameraAltAnim(int duration, Camera camera, double data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a camera altitude animation that will not repeat.
 Animation createCameraTranslation(int duration, Camera camera, Point2D.Double data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a camera translation that will not repeat.
 Animation createGlyphBorderColorAnim(int duration, Glyph glyph, float[] data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a border fill color animation that will not repeat.
 Animation createGlyphFillColorAnim(int duration, Glyph glyph, float[] data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a glyph fill color animation that will not repeat.
 Animation createGlyphOrientationAnim(int duration, Glyph glyph, double data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a glyph orientation animation that will not repeat.
 Animation createGlyphSizeAnim(int duration, Glyph glyph, double data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a glyph size animation that will not repeat.
 Animation createGlyphTranslation(int duration, Glyph glyph, Point2D.Double data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a glyph translation that will not repeat.
 Animation createLensMagAnim(int duration, FixedSizeLens lens, float data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a lens magnification animation that will not repeat.
 Animation createLensMagRadiusAnim(int duration, FixedSizeLens lens, float magData, int orData, int irData, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a lens magnification and radii animation that will not repeat.
 Animation createLensRadiusAnim(int duration, FixedSizeLens lens, int orData, int irData, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a lens radii animation that will not repeat.
 Animation createPathAnim(int duration, DPath path, Point2D.Double[] data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a path animation that will not repeat.
 Animation createPortalSizeAnim(int duration, Portal portal, int wdata, int hdata, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a portal size animation that will not repeat.
 Animation createPortalTranslation(int duration, Portal portal, Point data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns a portal translation animation that will not repeat.
 Animation createTranslucencyAnim(int duration, Translucent translucent, float data, boolean relative, org.jdesktop.animation.timing.interpolation.Interpolator interpolator, EndAction endAction)
          Creates and returns an animation that targets the alpha property of a Translucent object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createAnimation

public Animation createAnimation(int duration,
                                 Object subject,
                                 Animation.Dimension dimension,
                                 TimingHandler handler)
Creates a new Animation object that will be handled by the associated AnimationManager.

Parameters:
duration - duration of the animation, in milliseconds. duration may be set to Animation.INFINITE, in which case the animation will run indefinitely. In that case, the fraction passed to the timingEvent method of the handler is meaningless.
subject - object that will be animated
dimension - dimension of the animation
handler - timing handler that will receive callbacks for each animation event. The handler is responsible for implementing the animation code itself (e.g. move a Camera or change the color of a Glyph).

createAnimation

public Animation createAnimation(int duration,
                                 double repeatCount,
                                 Animation.RepeatBehavior repeatBehavior,
                                 Object subject,
                                 Animation.Dimension dimension,
                                 TimingHandler handler)
Creates a new Animation object that will be handled by the associated AnimationManager.

Parameters:
duration - duration of the animation, in milliseconds
repeatCount - the number of times this Animation will be repeated. This is not necessarily an integer, i.e. an animation may be repeated 2.5 times. repeatCount may be set to Animation.INFINITE, in which case the animation will be repeated indefinitely.
repeatBehavior - controls whether an animation loops or reverse when repeating
subject - object that will be animated
dimension - dimension of the animation
handler - timing handler that will receive callbacks for each animation event. The handler is responsible for implementing the animation code itself (e.g. move a Camera or change the color of a Glyph).

createAnimation

public Animation createAnimation(int duration,
                                 double repeatCount,
                                 Animation.RepeatBehavior repeatBehavior,
                                 Object subject,
                                 Animation.Dimension dimension,
                                 TimingHandler handler,
                                 org.jdesktop.animation.timing.interpolation.Interpolator interpolator)
Creates a new Animation object that will be handled by this AnimationManager.

Parameters:
duration - duration of the animation, in milliseconds
repeatCount - the number of times this Animation will be repeated. This is not necessarily an integer, i.e. an animation may be repeated 2.5 times
repeatBehavior - controls whether an animation loops or reverse when repeating
subject - object that will be animated
dimension - dimension of the animation
handler - timing handler that will receive callbacks for each animation event. The handler is responsible for implementing the animation code itself (e.g. move a Camera or change the color of a Glyph).
interpolator - an Interpolator, ie a functor that takes a float between 0 and 1 and returns a float between 0 and 1. By default a linear Interpolator is used, but spline interpolators may be used to provide different animation behaviors: slow in/slow out, fast in/slow out et caetera. You may also provide your own interpolator.

createCameraTranslation

public Animation createCameraTranslation(int duration,
                                         Camera camera,
                                         Point2D.Double data,
                                         boolean relative,
                                         org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                         EndAction endAction)
Creates and returns a camera translation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
camera - camera to animate
data - animation data, interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as absolute target coordinates, otherwise it will be interpreted as an offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.
See Also:
EndAction

createCameraAltAnim

public Animation createCameraAltAnim(int duration,
                                     Camera camera,
                                     double data,
                                     boolean relative,
                                     org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                     EndAction endAction)
Creates and returns a camera altitude animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
camera - camera to animate
data - animation data, interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as an absolute target altitude, otherwise it will be interpreted as an offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createGlyphTranslation

public Animation createGlyphTranslation(int duration,
                                        Glyph glyph,
                                        Point2D.Double data,
                                        boolean relative,
                                        org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                        EndAction endAction)
Creates and returns a glyph translation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
glyph - glyph to animate
data - animation data, interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as absolute target coordinates, otherwise it will be interpreted as an offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createGlyphSizeAnim

public Animation createGlyphSizeAnim(int duration,
                                     Glyph glyph,
                                     double data,
                                     boolean relative,
                                     org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                     EndAction endAction)
Creates and returns a glyph size animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
glyph - glyph to animate
data - animation data (size or size offset), interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as an absolute size, otherwise it will be interpreted as a size offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createGlyphOrientationAnim

public Animation createGlyphOrientationAnim(int duration,
                                            Glyph glyph,
                                            double data,
                                            boolean relative,
                                            org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                            EndAction endAction)
Creates and returns a glyph orientation animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
glyph - glyph to animate
data - animation data (angle or angle offset, in radian), interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as an absolute orientation, otherwise it will be interpreted as an orientation offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createGlyphFillColorAnim

public Animation createGlyphFillColorAnim(int duration,
                                          Glyph glyph,
                                          float[] data,
                                          boolean relative,
                                          org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                          EndAction endAction)
Creates and returns a glyph fill color animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
glyph - glyph to animate
data - animation data (color or color offset, in the HSV space), interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as an absolute color, otherwise it will be interpreted as a color offset. 'data' should be an array of size 3, containing the hue, saturation and brightness, in order. H, S, and V are in the interval [0, 1]
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createGlyphBorderColorAnim

public Animation createGlyphBorderColorAnim(int duration,
                                            Glyph glyph,
                                            float[] data,
                                            boolean relative,
                                            org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                            EndAction endAction)
Creates and returns a border fill color animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
glyph - glyph to animate
data - animation data (color or color offset, in the HSV space), interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as an absolute color, otherwise it will be interpreted as a color offset. 'data' should be an array of size 3, containing the hue, saturation and brightness, in order. H, S, and V are in the interval [0, 1]
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createTranslucencyAnim

public Animation createTranslucencyAnim(int duration,
                                        Translucent translucent,
                                        float data,
                                        boolean relative,
                                        org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                        EndAction endAction)
Creates and returns an animation that targets the alpha property of a Translucent object

Parameters:
duration - duration of the animation, in milliseconds.
translucent - Translucent object to animate
data - animation data (alpha value or offset, in [0, 1] - 0 means transparent and 1 opaque), interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as an absolute opacity, otherwise it will be interpreted as an opacity offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createPortalTranslation

public Animation createPortalTranslation(int duration,
                                         Portal portal,
                                         Point data,
                                         boolean relative,
                                         org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                         EndAction endAction)
Creates and returns a portal translation animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
portal - portal to animate
data - animation data, interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as absolute target coordinates, otherwise it will be interpreted as an offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createPortalSizeAnim

public Animation createPortalSizeAnim(int duration,
                                      Portal portal,
                                      int wdata,
                                      int hdata,
                                      boolean relative,
                                      org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                      EndAction endAction)
Creates and returns a portal size animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
portal - portal to animate
wdata - animation data, interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'wdata' will be interpreted as an absolute width, otherwise it will be interpreted as an offset.
hdata - animation data, interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'hdata' will be interpreted as an absolute height, otherwise it will be interpreted as an offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createLensMagAnim

public Animation createLensMagAnim(int duration,
                                   FixedSizeLens lens,
                                   float data,
                                   boolean relative,
                                   org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                   EndAction endAction)
Creates and returns a lens magnification animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
lens - lens to animate
data - animation data, interpreted according to the 'relative' boolean argument. If 'relative' is false, then 'data' will be interpreted as an absolute maximum magnification factor, otherwise it will be interpreted as an offset.
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createLensMagRadiusAnim

public Animation createLensMagRadiusAnim(int duration,
                                         FixedSizeLens lens,
                                         float magData,
                                         int orData,
                                         int irData,
                                         boolean relative,
                                         org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                         EndAction endAction)
Creates and returns a lens magnification and radii animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
lens - lens to animate
magData - target max magnification factor (absolute value or offset, depending on 'relative')
orData - target outer radius (absolute value or offset, depending on 'relative'), in view coordinates
irData - target inner radius (absolute value or offset, depending on 'relative'), in view coordinates Warning: outer radius and magnification should change in the same direction (both should either increase or decrease), otherwise the behavior of the resulting Animation is undefined
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createLensRadiusAnim

public Animation createLensRadiusAnim(int duration,
                                      FixedSizeLens lens,
                                      int orData,
                                      int irData,
                                      boolean relative,
                                      org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                      EndAction endAction)
Creates and returns a lens radii animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
lens - lens to animate
orData - target outer radius (absolute value or offset, depending on 'relative'), in view coordinates
irData - target inner radius (absolute value or offset, depending on 'relative'), in view coordinates
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.

createPathAnim

public Animation createPathAnim(int duration,
                                DPath path,
                                Point2D.Double[] data,
                                boolean relative,
                                org.jdesktop.animation.timing.interpolation.Interpolator interpolator,
                                EndAction endAction)
Creates and returns a path animation that will not repeat.

Parameters:
duration - duration of the animation, in milliseconds.
path - path to animate
data - path animation data
relative - true if 'data' is to be interpreted relatively.
interpolator - Interpolator that governs the time behavior of the animation (constant speed, constant acceleration, slow in/slow out...)
endAction - a functor that will be executed when the animation ends. May be set to null, in which case it is ignored.


Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2011 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.