Ticket #6671 (assigned enhancement)
[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