Author: jcrowley
Date: 2007-08-21 23:07:00 -0700 (Tue, 21 Aug 2007)
New Revision: 6178

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
Log:
Change 20070821-jcrowley-w by [EMAIL PROTECTED] on 2007-08-21 19:09:27 EDT
    in /Users/jcrowley/src/svn/openlaszlo/legals-d
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Contributor Fixes: "LzAnimatorGroup" should declare the field
        "isactive" at init-time; "LzAnimatorGroup" should pass on "duration"
        to embedded animators

New Features:

Bugs Fixed: LPP-4391; LPP-4392

Technical Reviewer: pbr
QA Reviewer: max
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Applied Andre Bargull's fixes.

Tests: Run the following test in a modified/unmodified branch:

<canvas width="500" height="500">

    <view name="tview" width="100" height="100" bgcolor="0xAA00AA">
        <animatorgroup name="hat" duration="10000" start="false"
            oninit="Debug.write(this.isactive);">
            <animator attribute="x" to="${parent.parent.x + 20}" 
duration="7000"/>
        </animatorgroup>
    </view>
    
    <button onclick="tview.hat.doStart()" y="110">Go</button>
    <button onclick="tview.hat.setDuration(7000)" y="135">7000</button>
    <button onclick="tview.hat.setDuration(1000)" y="160">1000</button>

</canvas>



Modified: 
openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs  
2007-08-22 04:58:22 UTC (rev 6177)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs  
2007-08-22 06:07:00 UTC (rev 6178)
@@ -88,6 +88,7 @@
     * @lzxtype xsd:float {minInclusive="0"} | constraint
     */
   var duration;
+  setters.duration = "setDuration";
   
   /** 
     * @type Boolean
@@ -174,6 +175,15 @@
 
 //setters.view = "defaultSet";
 
+/** The active-state of the animator. If true, the animator is currently 
processing its animation.
+   * This field is read-only.
+   *
+   * @type Boolean
+   * @lzxtype boolean
+   * @modifier read-only
+   */
+  var isactive = false;
+
 DeclareEvent(prototype, 'ontarget' );
 DeclareEvent(prototype, 'onduration' );
 DeclareEvent(prototype, 'onstarted' );
@@ -438,6 +448,26 @@
     this.__LZhalt();
 }
 
+function setDuration(duration){
+    if(isNaN(duration) || duration == null){
+        duration = 0;
+    } else if(typeof(duration) == "string"){
+        duration = Number(duration);
+    }
+    this.duration = duration;
+    if(!(this instanceof LzAnimator)){
+        var sn = this.subnodes;
+        if(sn){
+            for(var i = 0; i < sn.length; ++i){
+                if(sn[i] instanceof LzAnimatorGroup){
+                    sn[i].setDuration(duration);
+                }
+            }
+        }
+    }
+    this.onduration.sendEvent(duration);
+}
+
 /**
   * @access private
   */


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to