Ticket #6671 (assigned enhancement)

Opened 14 months ago

Last modified 11 months ago

[patch/cla] Cacheable Animation Framework / API + dojox.fx.WipeLeft Contribution

Reported by: guest Owned by: dante
Priority: normal Milestone: future
Component: General Version: 1.1.0
Severity: normal Keywords:
Cc: ole.ersoy@…, alex

Description

This ticket is related to: http://trac.dojotoolkit.org/ticket/6060

This API has the following goals:

(1) Work just like Dojo's current animation framework

(2) Support caching of animations / dom node switching

(3) Support simple unit testing

(4) Enhance reuse through an animation class hierarchy

(5) Simple animation debugging

(1) I think I implemented all the methods and semantics in dojox.fx.Animation that come with the use of dojo.animateProperty().

onEnd, onBegin, and perFrame template methods have been added that can be implemented by subclasses of dojox.fx.Animation.

These are automatically called by dojox.fx.Animation per the template design pattern.

(2) Caching is supported. Just change the animation instances DOM node reference, and the new reference is animated when calling Animation.play() on the Animation instance.

(3) Unit testing of the animation is supported by isolating each frame inside the Animation.frame() method.

This allows animation developers to test node properties before and after each frame.

(4) If you take a look at dojox.fx.AbsoluteDimension? you'll see that this could easily be reused by dojox.fx.sizeTo...however dojox.fx.sizeTo would have to be reimplemented as dojox.fx.SizeTo?, which would be a subclass of dojox.fx.AbsoluteDimension?.

(5) I personally think this is easier to debug, since each class in the hierarchy provides specific services, implemented on framework methods. I'm naturally biased though :-)

Cheers, - Ole

Attachments

AbsoluteDimension.js (1.5 kB) - added by guest 14 months ago.
Animation.js (4.5 kB) - added by guest 14 months ago.
WipeLeft.js (1.8 kB) - added by guest 14 months ago.
Animation.html (1.8 kB) - added by guest 14 months ago.
WipeRight.js (2.0 kB) - added by guest 14 months ago.
CombinedAnimation.js (1.4 kB) - added by ole 11 months ago.

Change History

Changed 14 months ago by guest

Changed 14 months ago by guest

Changed 14 months ago by guest

Changed 14 months ago by guest

Changed 14 months ago by dante

  • owner changed from anonymous to dante
  • status changed from new to assigned
  • summary changed from Cacheable Animation Framework / API + dojox.fx.WipeLeft Contribution to [patch/cla] Cacheable Animation Framework / API + dojox.fx.WipeLeft Contribution

Changed 14 months ago by guest

Oooops - That would be WipeToMyOtherLeft?...WipeRight?

Changed 14 months ago by guest

Changed 14 months ago by guest

Note also that I used to have an Animation.initialize() method, but that was silly, since all initialization should be done in the constructor of Animation subclasses.

Changed 14 months ago by alex

  • cc alex added

Changed 12 months ago by dante

  • milestone set to future

Changed 11 months ago by ole

Changed 11 months ago by ole

I added a CombinedAnimation? class that takes an array of Animation instances and runs them simultaneously. The motivation was this:

http://www.schillmania.com/content/projects/javascript-animation-2/

Specifically the single timer function loop section. So instead of each animation looping through it's frames separately, the CombinedAnimation? creates a new frame that calles Animation.frame() on each animation in the array passed to the CombinedAnimation? constructor, and thus on each tick of the timer all animation frames are run...

Note: See TracTickets for help on using tickets.