Transferred from the Adobe Open Source Subversion Repository

Revision: 6122
Author:   chaase@adobe.com
Date:     2009-04-10T14:30:17.762458Z

Log Message:
-----------
Various refactorings/renamings/changes from effects PARB review.

QE Notes: mx/effects and spark/effects currently broken (and disabled) due to these API changes. Matt is fixing.
Doc Notes: None
Bugs:
Reviewer: Hans
tests: checkintests, mustella tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EaseInOut.as" copyfrom-rev="5944" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EaseInOutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/CompositeEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EaseInOut.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EasingFraction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/EffectEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/TweenEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/RepeatBehavior.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/NumberArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/IEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Animate3DInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimationProperty.as" copyfrom-rev="5944" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SimpleMotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTransitionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateFilterInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Rotate3DInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/events/AnimationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/ArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/IEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/RotateInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/IAnimationTarget.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimationProperty.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260486 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as
+++ frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as
@@ -122,253 +122,15 @@

         return _duration;
     }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Overridden methods
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    override public function play():void
-    {
-        // Create a new queue.
-        activeEffectQueue = [];
-
-        // Start at the beginning or the end
-        // depending if we are playing backwards.
-        currentSetIndex = playReversed ? childSets.length : -1;
-
-        var n:int;
-        var i:int;
-        var m:int;
-        var j:int;
-
-        // Each childSets contains an instance of an effect for each target.
-        // Flatten these instances into the effectQueue.
-        // Put a null object between each effect so that the sequence knows
-        // when to stop and wait for the previous instances to finish.
-        n = childSets.length;
-        for (i = 0; i < n; i++)
-        {
-            var instances:Array = childSets[i];
-            activeEffectQueue.push(instances);
-        }
-
-        // Dispatch an effectStart event from the target.
-        super.play();
-
-        startTime = Tween.intervalTime;
-
-        if (activeEffectQueue.length == 0)
-        {
-             finishRepeat();
-             return;
-        }
-
-        playNextChildSet();
-    }
-
-    /**
-     *  @private
-     */
-    override public function pause():void
-    {
-        super.pause();
-
-        if (currentSet && currentSet.length > 0)
-        {
-            var n:int = currentSet.length;
-            for (var i:int = 0; i < n; i++)
-            {
-                currentSet[i].pause();
-            }
-        }
-    }
-
-    /**
-     *  @private
-     */
-    override public function stop():void
-    {
-        if (activeEffectQueue && activeEffectQueue.length > 0)
-        {
-            var queueCopy:Array = activeEffectQueue.concat();
-            activeEffectQueue = null;
-
-            // Call stop on the currently playing set
-            var currentInstances:Array = queueCopy[currentSetIndex];
-            var currentCount:int = currentInstances.length;
-
-            for (var i:int = 0; i < currentCount; i++)
-                currentInstances[i].stop();
-
-            // For instances that have yet to run, we will delete them
-            // without dispatching events.
-            // (Another alternative would have been add them into
-            // currentInstances and currentSet, then just stop them
-            // along with the others. In this case, they would have
-            // dispatched effectEnd events).
-            var n:int = queueCopy.length;
-            for (var j:int = currentSetIndex + 1; j < n; j++)
-            {
-                var waitingInstances:Array = queueCopy[j];
-                var m:int = waitingInstances.length;
-
-                for (var k:int = 0; k < m; k++)
-                {
-                    var instance:IEffectInstance = waitingInstances[k];
-                    instance.effect.deleteInstance(instance);
-                }
-            }
-        }
-
-        super.stop();
-    }
-
-    /**
-     *  @private
-     */
-    override public function resume():void
-    {
-        super.resume();
-
-        if (currentSet && currentSet.length > 0)
-        {
-            var n:int = currentSet.length;
-            for (var i:int = 0; i < n; i++)
-            {
-                currentSet[i].resume();
-            }
-        }
-    }
-
-    /**
-     *  @private
-     */
-    override public function reverse():void
-    {
-        super.reverse();
-
-        if (currentSet && currentSet.length > 0)
-        {
-            // PlayNextChildSet handles the logic of playing previously completed effects
-            var n:int = currentSet.length;
-            for (var i:int = 0; i < n; i++)
-            {
-                currentSet[i].reverse();
-            }
-        }
-    }
-
-    /**
-     *  Interrupts any effects that are currently playing, skips over
-     *  any effects that haven't started playing, and jumps immediately
-     *  to the end of the composite effect.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    override public function end():void
-    {
-        endEffectCalled = true;
-
-        // activeEffectQueue are all effects to play
-        // currentSetIndex is where we want to start
-        // if play() hasn't been called on us yet (b/c of startDelay),
-        // activeEffectQueue will have nothing in it.  In this case,
-        // we leave the component in it's current state, rather than
-        // call .playWithNoDuration() on all the effects that haven't
-        // been run (or even added to the activeEffectQueue yet)
-        if (activeEffectQueue && activeEffectQueue.length > 0)
-        {
-            var queueCopy:Array = activeEffectQueue.concat();
-            activeEffectQueue = null;
-
-            // Call end on the currently playing set
-            var currentInstances:Array = queueCopy[currentSetIndex];
-            var currentCount:int = currentInstances.length;
-
-            for (var i:int = 0; i < currentCount; i++)
-            {
-                currentInstances[i].end();
-            }
-
-            var n:int = queueCopy.length;
-            for (var j:int = currentSetIndex + 1; j < n; j++)
-            {
-                var waitingInstances:Array = queueCopy[j];
-                var m:int = waitingInstances.length;
-
-                for (var k:int = 0; k < m; k++)
-                {
-                    EffectInstance(waitingInstances[k]).playWithNoDuration();
-                }
-            }
-        }
-
-        super.end();
-    }
-
-    /**
-    *  Each time a child effect of SequenceInstance finishes,
-    *  Flex calls the onEffectEnd() method.
-    *  For SequenceInstance, it plays the next effect.
-    *  This method implements the method of the superclass.
-    *
-    *  @param childEffect The child effect.
-    *
-    *  @langversion 3.0
-    *  @playerversion Flash 9
-    *  @playerversion AIR 1.1
-    *  @productversion Flex 3
-    */
-    override protected function onEffectEnd(childEffect:IEffectInstance):void
-    {
-        // Each child effect notifies us when it is finished.
-        // Remove the notifying child from childSets,
-        // so that the end() method doesn't call it.
-        // When the last child notifies us that it's finished,
-        // notify our listener that we're finished.
-        // Resume the background processing that was suspended earlier
-        if (Object(childEffect).suspendBackgroundProcessing)
-            UIComponent.resumeBackgroundProcessing();
-
-        // See endEffect, above.
-        if (endEffectCalled)
-            return;
-
-        for (var i:int = 0; i < currentSet.length; i++)
-        {
-            if (childEffect == currentSet[i])
-            {
-                currentSet.splice(i, 1);
-                break;
-            }
-        }
-
-        if (currentSet.length == 0)
-        {
-            if (false == playNextChildSet())
-                finishRepeat();
-        }
-    }
-
-    // Note that we implement seek() in the instance class for Sequence,
-    // but in the factory class for Parallel. This is because we can do
-    // it at the factory level for Parallel, but for Sequence we need
-    // extra functionality that is only available in the instance class.
+
     /**
      * @inheritDoc
      *
-     * In a Sequence effect, seek determines which child effect should be
-     * the active one and seeks to the appropriate time in that effect.
+     * In a Sequence effect, playheadTime determines
+     * which child effect should be the active one and sets the
+     * appropriate playheadTime in that effect.
      * Previous effects in the sequence will be ended (if playing) or
-     * skipped (if not yet started but seekTime is past the time
+     * skipped (if not yet started but playheadTime is past the time
      * when they would have ended). Note that 'skipping' a child effect may
      * entail playing it with zero duration to avoid side-effects that may
      * occur from not playing the effect at all.
@@ -378,28 +140,29 @@
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    override public function seek(seekTime:Number):void
+    override public function set playheadTime(value:Number):void
     {
         /**
         * Behavior of this command depends on what state we're in:
-        * - if we're in a startDelay, then cut down the seekTime by
+        * - if we're in a startDelay, then cut down the playheadTime by
         * the amount of time we have left to sleep
-        * - if the seekTime doesn't get us past the startDelay, then
+        * - if the playheadTime doesn't get us past the startDelay, then
         * reduce the amount of startDelay appropriately and return
-        * - if the seekTime is greater than the current playheadTime
-        *   - if the seekTime puts the playheadTime into a different
-        *   child effect, end the currently playing child effects,
+        * - if the playheadTime is greater than the current playheadTime
+        *   - if the playheadTime puts the sequence into a different
+        *   child effect, end the currently playing child effect,
         *   play intervening ones with no duration (or skip?),
-        *   and start the ones that should be active and seek to their
-        *   appropriate time
-        *   - if the seektime is still in the currently playing effects
-        *   just seek to the appropriate time
-        * - else the seekTime is less than the current time
-        *   - if the seektime is still in the currently playing effects
-        *   just seek to the appropriate time
-        *   - else end the currently playing effects and start over from
+        *   and start the ones that should be active and set their
+        *   playheadTime appropriately
+        *   - if the playheadTime is still in the currently playing effects
+        *   just set the appropriate playheadTime in that effect
+        * - else the playheadTime is less than the current time
+        *   - if the playheadTime is still in the currently playing effect
+        *   just set the appropriate playheadTime in the current effect
+        *   - else end the currently playing effect and start over from
         *   the beginning (playing effects with no duration or skipping,
-        *   then playing/seeking for the correct child effect
+        *   then playing and setting the appropriate playheadTime for
+        *   the correct child effect)
         *
         *  @langversion 3.0
         *  @playerversion Flash 9
@@ -408,7 +171,7 @@
         */
         // TODO (chaase): handle startDelay

-        if (seekTime < playheadTime)
+        if (value < playheadTime)
         {
             // TODO (chaase): Handle seeking back in time
             // idea: Maybe once we get playing a sequence in reverse
@@ -431,7 +194,7 @@
                     var startTime:Number = cumulativeDuration;
                     var endTime:Number = cumulativeDuration +
                         instances[0].actualDuration;
-                    if (seekTime < endTime)
+                    if (value < endTime)
                     {
                         // These are the effects that should be active
                         // simply seek to the right time in the effect
@@ -441,7 +204,7 @@
                             playCurrentChildSet();
                         }
                         for (var k:int = 0; k < instances.length; k++)
-                            instances[k].seek(seekTime - startTime);
+                            instances[k].playheadTime = (value - startTime);
                         break;
                         // otherwise, skip to the next instance
                     }
@@ -476,7 +239,243 @@
         }
         // Seek in the SequenceInstance itself, which advances the
         // Tween timer running on the effect
-        super.seek(seekTime);
+        super.playheadTime = value;
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function play():void
+    {
+        // Create a new queue.
+        activeEffectQueue = [];
+
+        // Start at the beginning or the end
+        // depending if we are playing backwards.
+        currentSetIndex = playReversed ? childSets.length : -1;
+
+        var n:int;
+        var i:int;
+        var m:int;
+        var j:int;
+
+        // Each childSets contains an instance of an effect for each target.
+        // Flatten these instances into the effectQueue.
+        // Put a null object between each effect so that the sequence knows
+        // when to stop and wait for the previous instances to finish.
+        n = childSets.length;
+        for (i = 0; i < n; i++)
+        {
+            var instances:Array = childSets[i];
+            activeEffectQueue.push(instances);
+        }
+
+        // Dispatch an effectStart event from the target.
+        super.play();
+
+        startTime = Tween.intervalTime;
+
+        if (activeEffectQueue.length == 0)
+        {
+             finishRepeat();
+             return;
+        }
+
+        playNextChildSet();
+    }
+
+    /**
+     *  @private
+     */
+    override public function pause():void
+    {
+        super.pause();
+
+        if (currentSet && currentSet.length > 0)
+        {
+            var n:int = currentSet.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                currentSet[i].pause();
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override public function stop():void
+    {
+        if (activeEffectQueue && activeEffectQueue.length > 0)
+        {
+            var queueCopy:Array = activeEffectQueue.concat();
+            activeEffectQueue = null;
+
+            // Call stop on the currently playing set
+            var currentInstances:Array = queueCopy[currentSetIndex];
+            var currentCount:int = currentInstances.length;
+
+            for (var i:int = 0; i < currentCount; i++)
+                currentInstances[i].stop();
+
+            // For instances that have yet to run, we will delete them
+            // without dispatching events.
+            // (Another alternative would have been add them into
+            // currentInstances and currentSet, then just stop them
+            // along with the others. In this case, they would have
+            // dispatched effectEnd events).
+            var n:int = queueCopy.length;
+            for (var j:int = currentSetIndex + 1; j < n; j++)
+            {
+                var waitingInstances:Array = queueCopy[j];
+                var m:int = waitingInstances.length;
+
+                for (var k:int = 0; k < m; k++)
+                {
+                    var instance:IEffectInstance = waitingInstances[k];
+                    instance.effect.deleteInstance(instance);
+                }
+            }
+        }
+
+        super.stop();
+    }
+
+    /**
+     *  @private
+     */
+    override public function resume():void
+    {
+        super.resume();
+
+        if (currentSet && currentSet.length > 0)
+        {
+            var n:int = currentSet.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                currentSet[i].resume();
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override public function reverse():void
+    {
+        super.reverse();
+
+        if (currentSet && currentSet.length > 0)
+        {
+            // PlayNextChildSet handles the logic of playing previously completed effects
+            var n:int = currentSet.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                currentSet[i].reverse();
+            }
+        }
+    }
+
+    /**
+     *  Interrupts any effects that are currently playing, skips over
+     *  any effects that haven't started playing, and jumps immediately
+     *  to the end of the composite effect.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function end():void
+    {
+        endEffectCalled = true;
+
+        // activeEffectQueue are all effects to play
+        // currentSetIndex is where we want to start
+        // if play() hasn't been called on us yet (b/c of startDelay),
+        // activeEffectQueue will have nothing in it.  In this case,
+        // we leave the component in it's current state, rather than
+        // call .playWithNoDuration() on all the effects that haven't
+        // been run (or even added to the activeEffectQueue yet)
+        if (activeEffectQueue && activeEffectQueue.length > 0)
+        {
+            var queueCopy:Array = activeEffectQueue.concat();
+            activeEffectQueue = null;
+
+            // Call end on the currently playing set
+            var currentInstances:Array = queueCopy[currentSetIndex];
+            var currentCount:int = currentInstances.length;
+
+            for (var i:int = 0; i < currentCount; i++)
+            {
+                currentInstances[i].end();
+            }
+
+            var n:int = queueCopy.length;
+            for (var j:int = currentSetIndex + 1; j < n; j++)
+            {
+                var waitingInstances:Array = queueCopy[j];
+                var m:int = waitingInstances.length;
+
+                for (var k:int = 0; k < m; k++)
+                {
+                    EffectInstance(waitingInstances[k]).playWithNoDuration();
+                }
+            }
+        }
+
+        super.end();
+    }
+
+    /**
+    *  Each time a child effect of SequenceInstance finishes,
+    *  Flex calls the onEffectEnd() method.
+    *  For SequenceInstance, it plays the next effect.
+    *  This method implements the method of the superclass.
+    *
+    *  @param childEffect The child effect.
+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
+    */
+    override protected function onEffectEnd(childEffect:IEffectInstance):void
+    {
+        // Each child effect notifies us when it is finished.
+        // Remove the notifying child from childSets,
+        // so that the end() method doesn't call it.
+        // When the last child notifies us that it's finished,
+        // notify our listener that we're finished.
+        // Resume the background processing that was suspended earlier
+        if (Object(childEffect).suspendBackgroundProcessing)
+            UIComponent.resumeBackgroundProcessing();
+
+        // See endEffect, above.
+        if (endEffectCalled)
+            return;
+
+        for (var i:int = 0; i < currentSet.length; i++)
+        {
+            if (childEffect == currentSet[i])
+            {
+                currentSet.splice(i, 1);
+                break;
+            }
+        }
+
+        if (currentSet.length == 0)
+        {
+            if (false == playNextChildSet())
+                finishRepeat();
+        }
     }

     //--------------------------------------------------------------------------
@@ -495,16 +494,6 @@
         for (var i:int = 0; i < instances.length; i++)
         {
             childEffect = instances[i];
-
-            /*
-            if (childEffect is TweenEffectInstance)
-            {
-                var offset:Number =
-                    Tween.intervalTime - startTime - currentInstanceDuration;
-                offset = isNaN(offset) ? 0 : offset;
-                TweenEffectInstance(childEffect).seek(offset);
-            }
-            */

             currentSet.push(childEffect);
             childEffect.playReversed = playReversed;
@@ -540,33 +529,6 @@

         playCurrentChildSet();

-        /*
-        while (activeEffectQueue[activeChildCount])
-        {
-            childEffect = activeEffectQueue[activeChildCount];
-            activeChildCount++;
-
-
-            if (childEffect is TweenEffectInstance)
-            {
-                var offset:Number =
-                    Tween.intervalTime - startTime - currentInstanceDuration;
-                offset = isNaN(offset) ? 0 : offset;
-                TweenEffectInstance(childEffect).seek(offset);
-            }
-            childEffect.startEffect();
-            // Block all layout, responses from web services, and other
-            // background processing until the effect finishes executing.
-            if (childEffect.suspendBackgroundProcessing)
-                UIComponent.suspendBackgroundProcessing();
-
-            if (!activeEffectQueue)
-                break;
-        }
-
-        currentInstanceDuration += childEffect.duration;
-        */
-
         return true;
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1282548 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.components.baseClasses
+package spark.components.supportClasses
 {

 import flash.events.Event;
@@ -17,8 +17,8 @@
 import flash.events.TimerEvent;
 import flash.geom.Point;
 import flash.utils.Timer;
-import mx.components.FxButton;
-import mx.core.IViewport;
+import spark.components.Button;
+import spark.core.IViewport;
 import mx.events.PropertyChangeEvent;
 import mx.events.ResizeEvent;

@@ -33,18 +33,18 @@
 [Style(name="symbolColor", type="uint", format="Color", inherit="yes")]

 /**
- *  The FxScrollBar class helps to position
+ *  The ScrollBar class helps to position
  *  the portion of data that is displayed when there is too much data
  *  to fit in a display area.
- *  The FxScrollBar class displays a pair of scrollbars and a viewport.
+ *  The ScrollBar class displays a pair of scrollbars and a viewport.
  *  A viewport is a UIComponent that implements IViewport, such as Group.
  *
- *
This control extends the FxTrackBase class and
- *  is the base class for the FxHScrollBar and FxVScrollBar
+ *
This control extends the TrackBase class and
+ *  is the base class for the HScrollBar and VScrollBar
  *  controls.

  *
  *
A scroll bar consists of a track, a variable-size scroll thumb, and
- *  two optional arrow buttons. The FxScrollBar class uses four parameters
+ *  two optional arrow buttons. The ScrollBar class uses four parameters
  *  to calculate its display state:

  *
  *

@@ -66,7 +66,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class FxScrollBar extends FxTrackBase
+public class ScrollBar extends TrackBase
 {
     include "../../core/Version.as";

@@ -95,7 +95,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function FxScrollBar():void
+    public function ScrollBar():void
     {
         super();
     }
@@ -118,7 +118,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var decrementButton:FxButton;
+    public var decrementButton:Button;

     [SkinPart(required="false")]

@@ -133,7 +133,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var incrementButton:FxButton;
+    public var incrementButton:Button;

     //--------------------------------------------------------------------------
     //
@@ -243,15 +243,15 @@
      *
viewportHorizontalScrollPositionChangeHandler()

      *

      *
-     *
The FxVScrollBar and FxHScrollBar classes override these methods to
+     *
The VScrollBar and HScrollBar classes override these methods to
      *  keep their pageSize, maximum, and value properties in sync with the
      *  viewport.   Similarly, they override their page and step methods to
      *  use the viewport's scrollPositionDelta methods to compute page and
      *  and step offsets.

      *
      *  @default null
-     *  @see mx.components.FxVScrollBar
-     *  @see mx.components.FxHScrollBar
+     *  @see mx.components.VScrollBar
+     *  @see mx.components.HScrollBar
      *
      *
      *  @langversion 3.0


- change: Old inner dimensions in UIComponent are now accessible by inheriting classes. Sometimes, these need to know if their inner dimensions have changed so that they can update their layout accordingly

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@757 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/ui/UIComponent.as
+++ src/reprise/ui/UIComponent.as
@@ -117,6 +117,8 @@
 		protected var m_dimensionsChanged : Boolean;
 		protected var m_specifiedDimensionsChanged : Boolean;
 		protected var m_selectorPathChanged : Boolean;
+		protected var m_oldContentBoxWidth : int;
+		protected var m_oldContentBoxHeight : int;

 		//dimensions and position
 		protected var m_contentBoxWidth : int = 0;
@@ -163,9 +165,7 @@
 		private var m_scrollbarsDisplay : Sprite;
 		private var m_oldInFlowStatus : int = -1;
 		private var m_oldOuterBoxDimension : Point;
-		protected var m_invalidateStylesAfterValidation : Boolean;
-		private var m_oldContentBoxWidth : int;
-		private var m_oldContentBoxHeight : int;
+		private var m_invalidateStylesAfterValidation : Boolean;

 		/***************************************************************************


Update record status label when record is saved

--- collect-client/src/main/flex/org/openforis/collect/presenter/DetailPresenter.as
+++ collect-client/src/main/flex/org/openforis/collect/presenter/DetailPresenter.as
@@ -231,6 +231,7 @@
 		internal function saveActiveRecordResultHandler(event:ResultEvent, token:Object = null):void {
 			Application.activeRecord.showErrors();
 			Application.activeRecord.updated = false;
+			updateStatusLabel();
 			var applicationEvent:ApplicationEvent = new ApplicationEvent(ApplicationEvent.RECORD_SAVED);
 			eventDispatcher.dispatchEvent(applicationEvent);
 		}
@@ -262,13 +263,17 @@
 		}

 		protected function updateResponseReceivedHandler(event:ApplicationEvent):void {
+			updateStatusLabel();
+		}
+
+		protected function updateStatusLabel():void {
 			var updateMessageKey:String;
 			if ( Application.activeRecord.updated ) {
 				updateMessageKey = "edit.changes_not_saved";
 			} else {
 				updateMessageKey = "edit.all_changes_saved";
 			}
-			_view.updateStatusLabel.text = Message.get(updateMessageKey);
+			_view.updateStatusLabel.text = Message.get(updateMessageKey);
 		}

 		protected function stageKeyDownHandler(event:KeyboardEvent):void {


using VertexComponent.size instead of VertexComponent.dwordsPerVertex in VertexBuffer3DResource

--- src/aerys/minko/render/resource/VertexBuffer3DResource.as
+++ src/aerys/minko/render/resource/VertexBuffer3DResource.as
@@ -69,7 +69,7 @@

 				_vertexBuffer = context.createVertexBuffer(
 					_numVertices,
-					_stream.format.dwordsPerVertex
+					_stream.format.size
 				);

 				update = true;


Transferred from the Adobe Open Source Subversion Repository

Revision: 17274
Author:   rfrishbe@adobe.com
Date:     2010-08-11T18:08:34.293087Z

Log Message:
-----------
A lot of changes, most involving touch scrolling.

UIComponent: remove keepControlOfMouseDown, which was checked in accidentally

FocusManager: move a check for event.isPreventDefauled() from the mouseDown handler to the mouseFocusHandler.  It was probably accidentally added in the mouseDown handler in the first place since mousedown events were not prevent defaultable (they are now, though)

SystemManager: Make MouseDown events prevent defaultable.  We do this for mouseWheel handlers already.  This allows our components to communicate a little with regards to who's handling this event.  Currently only ButtonBase and ItemRenderer check for this.

Split up IconItemRenderer in to MobileItemRenderer and MobileIconItemRenderer.  MobileItemRenderer is still based on UIComponent and is in charge of drawing the background and has a single text component.  MobileIconItemRenderer will be a more complex item renderer that developers can use. I'm also moving both of these classes in to the mobilecomponents project and mapping them in the spark manifest so that developers can now use them.

ButtonBase and List: Clean up code around how we deal with touch scrolling and adding a delay to button.  We also make sure that if the Button was clicked quickly before the delay fires that we show the button in the down state for some minimum amount of time.

Scroller: clean up a lot of the touch scrolling code

QE notes: None
Doc notes: None
Bugs: SDK-27263, SDK-27173, SDK-27157, SDK-27016
Reviewer: Jason SJ for MobileItemRenderer/MobileIconItemRenderer, Hans for the rest (he's still working through it though)
Tests run: checkintests, all mustella (some mustella failed for me locally but also in a clean sandbox)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollingEasing.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/IconItemRenderer.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/IconItemRenderer.as" copyfrom-rev="17121" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/PaddingStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/GapStyles.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1264752 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mobilecomponents/src/spark/styles/metadata/PaddingStyles.as
+++ frameworks/projects/mobilecomponents/src/spark/styles/metadata/PaddingStyles.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  Number of pixels between the component's left border
+ *  and the left edge of its content area.
+ *
The default value is 0.

+ *
The default value for a Button control in the Halo theme is 10
+ *     and in the Spark theme is 6.

+ *
The default value for the ComboBox control is 5.

+ *
The default value for the Form container is 16.

+ *
The default value for the Tree control is 2.

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="paddingLeft", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Number of pixels between the component's right border
+ *  and the right edge of its content area.
+ *
The default value is 0.

+ *
The default value for a Button control in the Halo theme is 10
+ *     and in the Spark theme is 6.

+ *
The default value for the ComboBox control is 5.

+ *
The default value for the Form container is 16.

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="paddingRight", type="Number", format="Length", inherit="no")]


Added comments

Added comments

--- src/org/flintparticles/integration/away3d/v4/initializers/BufferInitializer.as
+++ src/org/flintparticles/integration/away3d/v4/initializers/BufferInitializer.as
@@ -2,6 +2,7 @@
 {
 	import away3d.containers.ObjectContainer3D;
 	import away3d.core.base.Object3D;
+	import away3d.entities.Mesh;
 	import away3d.entities.Sprite3D;

 	import org.flintparticles.common.emitters.Emitter;
@@ -46,6 +47,7 @@
 		}
 		private function initBuffer(obj3d:Object3D):void{
 			for(var i:uint=0;i<_bufferLength;++i){
+
 				_buffer.push(obj3d.clone()as Object3D);
 			}
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1258546 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/binding/RepeaterComponentWatcher.as
+++ frameworks/projects/framework/src/mx/binding/RepeaterComponentWatcher.as
@@ -134,6 +134,11 @@

     /**
      *  Invokes super's notifyListeners() on each of the clones.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     override public function notifyListeners(commitEvent:Boolean):void
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1268681 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/controls/colorPickerClasses/SwatchPanel.as
+++ frameworks/projects/mx/src/mx/controls/colorPickerClasses/SwatchPanel.as
@@ -0,0 +1,1344 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls.colorPickerClasses
+{
+
+import flash.events.Event;
+import flash.events.EventPhase;
+import flash.events.KeyboardEvent;
+import flash.events.MouseEvent;
+import flash.geom.Rectangle;
+import flash.ui.Keyboard;
+import mx.collections.ArrayList;
+import mx.collections.IList;
+import mx.controls.ColorPicker;
+import mx.controls.TextInput;
+import mx.core.FlexVersion;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.events.ColorPickerEvent;
+import mx.managers.IFocusManagerContainer;
+import mx.skins.halo.SwatchPanelSkin;
+import mx.skins.halo.SwatchSkin;
+import mx.styles.StyleManager;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the selected color changes.
+ *
+ *  @eventType flash.events.Event.CHANGE
+ */
+[Event(name="change", type="flash.events.Event")]
+
+/**
+ *  Dispatched when the user presses the Enter key.
+ *
+ *  @eventType mx.events.FlexEvent.ENTER
+ */
+[Event(name="enter", type="flash.events.Event")]
+
+/**
+ *  Dispatched when the mouse rolls over a color.
+ *
+ *  @eventType mx.events.ColorPickerEvent.ITEM_ROLL_OVER
+ */
+[Event(name="itemRollOver", type="mx.events.ColorPickerEvent")]
+
+/**
+ *  Dispatched when the mouse rolls out of a color.
+ *
+ *  @eventType mx.events.ColorPickerEvent.ITEM_ROLL_OUT
+ */
+[Event(name="itemRollOut", type="mx.events.ColorPickerEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../../styles/metadata/GapStyles.as"
+include "../../styles/metadata/PaddingStyles.as"
+
+/**
+ *  Background color of the component.
+ *  You can either have a backgroundColor or a
+ *  backgroundImage, but not both.
+ *  Note that some components, like a Button, do not have a background
+ *  because they are completely filled with the button face or other graphics.
+ *  The DataGrid control also ignores this style.
+ *  The default value is undefined. If both this style and the
+ *  backgroundImage style are undefined, the control has a transparent background.
+ */
+[Style(name="backgroundColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Black section of a three-dimensional border, or the color section
+ *  of a two-dimensional border.
+ *  The following components support this style: Button, CheckBox,
+ *  ComboBox, MenuBar,
+ *  NumericStepper, ProgressBar, RadioButton, ScrollBar, Slider, and all
+ *  components that support the borderStyle style.
+ *  The default value depends on the component class;
+ *  if not overriden for the class, it is 0xAAB3B3.
+ */
+[Style(name="borderColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Number of columns in the swatch grid.
+ *  The default value is 20.
+ */
+[Style(name="columnCount", type="int", inherit="no")]
+
+/**
+ *  Color of the control border highlight.
+ *  The default value is 0xC4CCCC (medium gray) .
+ */
+[Style(name="highlightColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Color for the left and right inside edges of a component's skin.
+ *  The default value is 0xD5DDDD.
+ */
+[Style(name="shadowCapColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Bottom inside color of a button's skin.
+ *  A section of the three-dimensional border.
+ *  The default value is 0xEEEEEE (light gray).
+ */
+[Style(name="shadowColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Height of the larger preview swatch that appears above the swatch grid on
+ *  the top left of the SwatchPanel object.
+ *  The default value is 22.
+ */
+[Style(name="previewHeight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Width of the larger preview swatch.
+ *  The default value is 45.
+ */
+[Style(name="previewWidth", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Size of the swatchBorder outlines.
+ *  The default value is 1.
+ */
+[Style(name="swatchBorderSize", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Color of the swatch borders.
+ *  The default value is 0x000000.
+ */
+[Style(name="swatchBorderColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Size of the single border around the grid of swatches.
+ *  The default value is 0.
+ */
+[Style(name="swatchGridBorderSize", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Color of the background rectangle behind the swatch grid.
+ *  The default value is 0x000000.
+ */
+[Style(name="swatchGridBackgroundColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Height of each swatch.
+ *  The default value is 12.
+ */
+[Style(name="swatchHeight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Color of the highlight that appears around the swatch when the user
+ *  rolls over a swatch.
+ *  The default value is 0xFFFFFF.
+ */
+[Style(name="swatchHighlightColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  Size of the highlight that appears around the swatch when the user
+ *  rolls over a swatch.
+ *  The default value is 1.
+ */
+[Style(name="swatchHighlightSize", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Width of each swatch.
+ *  The default value is 12.
+ */
+[Style(name="swatchWidth", type="Number", format="Length", inherit="no")]
+
+/**
+ *  @REVIEW
+ *  Name of the style sheet definition to configure the text input control.
+ *  The default value is "swatchPanelTextField"
+ */
+[Style(name="textFieldStyleName", type="String", inherit="no")]
+
+/**
+ *  Width of the hexadecimal text box that appears above the swatch grid.
+ *  The default value is 72.
+ */
+[Style(name="textFieldWidth", type="Number", format="Length", inherit="no")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[ExcludeClass]
+
+/**
+ *  @private
+ */
+public class SwatchPanel extends UIComponent implements IFocusManagerContainer
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function SwatchPanel()
+    {
+        super();
+
+        // Register for events.
+        addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
+        addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    mx_internal var textInput:TextInput;
+
+    /**
+     *  @private
+     */
+    private var border:SwatchPanelSkin;
+
+    /**
+     *  @private
+     */
+    private var preview:SwatchSkin;
+
+    /**
+     *  @private
+     */
+    private var swatches:SwatchSkin;
+
+    /**
+     *  @private
+     */
+    private var highlight:SwatchSkin;
+
+    /**
+     *  @private
+     *  Used by ColorPicker
+     */
+    mx_internal var isOverGrid:Boolean = false;
+
+    /**
+     *  @private
+     *  Used by ColorPicker
+     */
+    mx_internal var isOpening:Boolean = false;
+
+    /**
+     *  @private
+     *  Used by ColorPicker
+     */
+    mx_internal var focusedIndex:int = -1;
+
+    /**
+     *  @private
+     *  Used by ColorPicker
+     */
+    mx_internal var tweenUp:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var initializing:Boolean = true;
+
+    /**
+     *  @private
+     */
+    private var indexFlag:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var lastIndex:int = -1;
+
+    /**
+     *  @private
+     */
+    private var grid:Rectangle;
+
+    /**
+     *  @private
+     */
+    private var rows:int;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var horizontalGap:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var verticalGap:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var columnCount:int;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var paddingLeft:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var paddingRight:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var paddingTop:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var paddingBottom:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var textFieldWidth:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var previewWidth:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var previewHeight:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var swatchWidth:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var swatchHeight:Number;
+
+    /**
+     *  @private
+	 *  Cached style.
+     */
+    private var swatchGridBorderSize:Number;
+
+    /**
+     *  @private
+     */
+	private var cellOffset:Number = 1;
+
+    /**
+     *  @private
+     */
+    private var itemOffset:Number = 3;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  height
+    //----------------------------------
+
+    /**
+     *  @private
+     *  We set our size internally based on style values.
+	 *  Setting height has no effect on the panel.
+	 *  Override to return the preferred width and height of our contents.
+     */
+    override public function get height():Number
+    {
+        return getExplicitOrMeasuredHeight();
+    }
+
+    /**
+     *  @private
+     */
+    override public function set height(value:Number):void
+    {
+        // do nothing...
+    }
+
+    //----------------------------------
+    //  width
+    //----------------------------------
+
+    /**
+     *  @private
+     *  We set our size internally based on style values.
+	 *  Setting width has no effect on the panel.
+	 *  Override to return the preferred width and height of our contents.
+     */
+    override public function get width():Number
+    {
+        return getExplicitOrMeasuredWidth();
+    }
+
+    /**
+     *  @private
+     */
+    override public function set width(value:Number):void
+    {
+        // do nothing...
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  colorField
+    //----------------------------------
+
+    /**
+	 *  Storage for the colorField property.
+	 */
+    private var _colorField:String = "color";
+
+    /**
+     *  @private
+     */
+    public function get colorField():String
+    {
+        return _colorField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set colorField(value:String):void
+    {
+        _colorField = value;
+    }
+
+    //----------------------------------
+    //  dataProvider
+    //----------------------------------
+
+    /**
+	 *  Storage for the dataProvider property.
+	 */
+	private var _dataProvider:IList;
+
+    /**
+     *  @private
+     */
+    public function get dataProvider():Object
+    {
+        return _dataProvider;
+    }
+
+    /**
+     *  @private
+     */
+    public function set dataProvider(value:Object):void
+    {
+        if (value is IList)
+        {
+	        _dataProvider = IList(value);
+        }
+        else if (value is Array)
+		{
+			var tmpDP:IList = new ArrayList(value as Array);
+			value = tmpDP;
+		}
+		else
+		{
+	        _dataProvider = null;
+        }
+
+        if (!initializing)
+        {
+            // Adjust if dataProvider is empty
+            if (length == 0 || isNaN(length))
+            {
+                highlight.visible = false;
+                _selectedIndex = -1;
+            }
+
+			// Redraw using new dataProvider
+            refresh();
+        }
+    }
+
+    //----------------------------------
+    //  editable
+    //----------------------------------
+
+    /**
+	 *  Storage for the editable property.
+	 */
+	private var _editable:Boolean = true;
+
+    /**
+     *  @private
+     */
+    public function get editable():Boolean
+    {
+        return _editable;
+    }
+
+    /**
+     *  @private
+     */
+    public function set editable(value:Boolean):void
+    {
+        _editable = value;
+
+		if (!initializing)
+            textInput.editable = value;
+    }
+
+    //----------------------------------
+    //  labelField
+    //----------------------------------
+
+    /**
+	 *  Storage for the labelField property.
+	 */
+    private var _labelField:String = "label";
+
+    /**
+     *  @private
+     */
+    public function get labelField():String
+    {
+        return _labelField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set labelField(value:String):void
+    {
+        _labelField = value;
+    }
+
+    //----------------------------------
+    //  length
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    public function get length():int
+    {
+        return _dataProvider ? _dataProvider.length : 0;
+    }
+
+    //----------------------------------
+    //  selectedColor
+    //----------------------------------
+
+    /**
+	 *  Storage for the selectedColor property.
+	 */
+    private var _selectedColor:uint = 0x000000;
+
+    /**
+     *  @private
+     */
+    public function get selectedColor():uint
+    {
+        return _selectedColor;
+    }
+
+    /**
+     *  @private
+     */
+    public function set selectedColor(value:uint):void
+    {
+        // Set index unless it set us
+        if (!indexFlag)
+        {
+            var SI:int = findColorByName(value);
+            if (SI != -1)
+            {
+                focusedIndex = findColorByName(value);
+                _selectedIndex = focusedIndex;
+            }
+            else
+			{
+                selectedIndex = -1;
+			}
+        }
+        else
+        {
+            indexFlag = false;
+        }
+
+		if (value != selectedColor || !isOverGrid || isOpening)
+        {
+            _selectedColor = value;
+            updateColor(value);
+
+            if (isOverGrid || isOpening)
+                setFocusOnSwatch(selectedIndex);
+            if (isOpening)
+                isOpening = false;
+        }
+    }
+
+    //----------------------------------
+    //  selectedIndex
+    //----------------------------------
+
+    /**
+	 *  Storage for the selectedIndex property.
+	 */
+    private var _selectedIndex:int = 0;
+
+    /**
+     *  @private
+     */
+    public function get selectedIndex():int
+    {
+        return _selectedIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set selectedIndex(value:int):void
+    {
+        if (value != selectedIndex && !initializing)
+        {
+            focusedIndex = value;
+            _selectedIndex = focusedIndex;
+
+			if (value >= 0)
+            {
+                indexFlag = true;
+                selectedColor = getColor(value);
+            }
+        }
+    }
+
+    //----------------------------------
+    //  selectedItem
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    public function get selectedItem():Object
+    {
+        return dataProvider ? dataProvider.getItemAt(selectedIndex) : null;
+    }
+
+    /**
+     *  @private
+     */
+    public function set selectedItem(value:Object):void
+    {
+        if (value != selectedItem)
+        {
+            var color:Number;
+			if (typeof(value) == "object")
+                color = Number(value[colorField]);
+            else if (typeof(value) == "number")
+                color = Number(value);
+
+			selectedIndex = findColorByName(color);
+        }
+    }
+
+    //----------------------------------
+    //  showTextField
+    //----------------------------------
+
+    /**
+	 *  Storage for the showTextField property.
+	 */
+    private var _showTextField:Boolean = true;
+
+    /**
+     *  @private
+     */
+    public function get showTextField():Boolean
+    {
+        return _showTextField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set showTextField(value:Boolean):void
+    {
+        _showTextField = value;
+
+        if (!initializing)
+            textInput.visible = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        // Create the panel background
+        if (!border)
+		{
+			border = new SwatchPanelSkin();
+
+			border.styleName = this;
+			border.name = "swatchPanelBorder";
+
+			addChild(border);
+		}
+
+        // Create the preview swatch
+        if (!preview)
+		{
+			preview = new SwatchSkin();
+
+			preview.styleName = this;
+			preview.color = selectedColor;
+			preview.name = "swatchPreview";
+
+			preview.setStyle("swatchBorderSize", 0);
+
+			addChild(preview);
+		}
+
+        // Create the hex text field
+        if (!textInput)
+		{
+			textInput = new TextInput();
+
+			if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+			{
+				textInput.styleName = this;
+				textInput.setStyle("borderCapColor", 0x919999);
+				textInput.setStyle("buttonColor", 0x6F7777);
+				textInput.setStyle("highlightColor", 0xC4CCCC);
+				textInput.setStyle("shadowColor", 0xc);
+				textInput.setStyle("shadowCapColor", 0xD5DDDD);
+				textInput.setStyle("borderStyle", "inset");
+				textInput.setStyle("backgroundColor", 0xFFFFFF);
+				textInput.setStyle("borderColor", 0xD5DDDD);
+			}
+			else
+			{
+				textInput.styleName = getStyle("textFieldStyleName");
+			}
+
+			textInput.editable = _editable;
+			textInput.maxChars = 6;
+			textInput.name = "inset";
+			textInput.text = rgbToHex(selectedColor);
+			textInput.restrict = "#xa-fA-F0-9";
+
+			textInput.addEventListener(Event.CHANGE, textInput_changeHandler);
+			textInput.addEventListener(KeyboardEvent.KEY_DOWN, textInput_keyDownHandler);
+
+			addChild(textInput);
+		}
+
+        // Create the swatches grid
+        if (!swatches)
+		{
+			swatches = new SwatchSkin();
+
+			swatches.styleName = this;
+			swatches.colorField = colorField;
+			swatches.name = "swatchGrid";
+
+			swatches.addEventListener(MouseEvent.CLICK, swatches_clickHandler);
+
+			addChild(swatches);
+		}
+
+        // Create the swatch highlight for grid rollovers
+        if (!highlight)
+		{
+			highlight = new SwatchSkin();
+
+			highlight.styleName = this;
+			highlight.visible = false;
+			highlight.name = "swatchHighlight";
+
+			addChild(highlight);
+		}
+
+        refresh();
+
+        initializing = false;
+    }
+
+    /**
+     *  @private
+     *  Change
+     */
+    override protected function measure():void
+    {
+		super.measure();
+
+        swatches.updateGrid(IList(dataProvider));
+
+        // Make sure we're at least 100 pixels wide
+
+		measuredWidth = Math.max(
+			paddingLeft + paddingRight + swatches.width, 100);
+
+		measuredHeight = Math.max(
+			paddingTop + previewHeight + itemOffset +
+			paddingBottom + swatches.height, 100);
+    }
+
+    /**
+     *  @private
+     */
+	override protected function updateDisplayList(unscaledWidth:Number,
+												  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // Layout preview position.
+        preview.updateSkin(selectedColor);
+        preview.move(paddingLeft, paddingTop);
+
+        // Layout hex text field position.
+        textInput.setActualSize(textFieldWidth, previewHeight);
+        textInput.move(paddingLeft + previewWidth + itemOffset, paddingTop);
+
+        // Layout grid position.
+        swatches.updateGrid(IList(dataProvider));
+        swatches.move(paddingLeft, paddingTop + previewHeight + itemOffset);
+
+        // Layout highlight skin.
+		// Highlight doesn't require a color, hence we pass 0.
+        highlight.updateSkin(0);
+
+        // Layout panel skin.
+        border.setActualSize(unscaledWidth, unscaledHeight);
+
+        // Define area surrounding the swatches.
+        if (!grid)
+            grid = new Rectangle();
+        grid.left = swatches.x + swatchGridBorderSize;
+        grid.top = swatches.y + swatchGridBorderSize;
+        grid.right = swatches.x + swatchGridBorderSize +
+					 (swatchWidth - 1) * columnCount + 1 +
+					 horizontalGap * (columnCount - 1);
+        grid.bottom = swatches.y + swatchGridBorderSize +
+					  (swatchHeight - 1) * rows + 1 +
+					  verticalGap * (rows - 1);
+    }
+
+
+    /**
+     *  @private
+     */
+    override public function styleChanged(styleProp:String):void
+    {
+        if (!initializing)
+            refresh();
+    }
+
+    /**
+     *  @private
+     */
+    override public function drawFocus(isFocused:Boolean):void
+    {
+        // do nothing...
+    }
+
+    /**
+     *  @private
+     */
+    override public function setFocus():void
+    {
+        // Our text field controls focus
+        if (showTextField && editable)
+        {
+            textInput.setFocus();
+            //ensure text field has the correct color value
+	        textInput.text = rgbToHex(selectedColor);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function updateStyleCache():void
+    {
+        horizontalGap = getStyle("horizontalGap");
+        verticalGap = getStyle("verticalGap");
+        columnCount = getStyle("columnCount");
+        paddingLeft = getStyle("paddingLeft");
+        paddingRight = getStyle("paddingRight");
+        paddingTop = getStyle("paddingTop");
+        paddingBottom = getStyle("paddingBottom");
+        textFieldWidth = getStyle("textFieldWidth");
+        previewWidth = getStyle("previewWidth");
+        previewHeight = getStyle("previewHeight");
+        swatchWidth = getStyle("swatchWidth");
+        swatchHeight = getStyle("swatchHeight");
+        swatchGridBorderSize = getStyle("swatchGridBorderSize");
+
+        // Adjust if columnCount is greater than # of swatches
+        if (columnCount > length)
+            columnCount = length;
+
+        // Rows based on columnCount and list length
+        rows = Math.ceil(length / columnCount);
+    }
+
+    /**
+     *  @private
+     */
+    private function refresh():void
+    {
+        updateStyleCache();
+        updateDisplayList(unscaledWidth, unscaledHeight);
+    }
+
+    /**
+     *  @private
+	 *  Update color values in preview
+     */
+    private function updateColor(color:uint):void
+    {
+        if (initializing || isNaN(color))
+            return;
+
+        // Update the preview swatch
+        preview.updateSkin(color);
+
+        // Set hex field
+        if (isOverGrid)
+        {
+            var label:String = null;
+
+			if (focusedIndex >= 0 &&
+                typeof(dataProvider.getItemAt(focusedIndex)) == "object")
+            {
+                label = dataProvider.getItemAt(focusedIndex)[labelField];
+            }
+
+            textInput.text = label != null && label.length != 0 ?
+							 label :
+                             rgbToHex(color);
+        }
+    }
+
+    /**
+     *  @private
+	 *  Convert RGB offset to Hex.
+     */
+    private function rgbToHex(color:uint):String
+    {
+        // Find hex number in the RGB offset
+        var colorInHex:String = color.toString(16);
+        var c:String = "00000" + colorInHex;
+        var e:int = c.length;
+        c = c.substring(e - 6, e);
+        return c.toUpperCase();
+    }
+
+    /**
+     *  @private
+     */
+    private function findColorByName(name:Number):int
+    {
+        if (name == getColor(selectedIndex))
+            return selectedIndex;
+
+        for (var i:int = 0; i < length; i++)
+		{
+            if (name == getColor(i))
+                return i;
+		}
+
+        return -1;
+    }
+
+    /**
+     *  @private
+     */
+    private function getColor(index:int):uint
+    {
+		if (!dataProvider || dataProvider.length < 1 ||
+			index < 0 || index >= length)
+		{
+			return StyleManager.NOT_A_COLOR;
+		}
+
+		return uint(typeof(dataProvider.getItemAt(index)) == "object" ?
+        	   		dataProvider.getItemAt(index)[colorField] :
+					dataProvider.getItemAt(index));
+    }
+
+    /**
+     *  @private
+     */
+    private function setFocusOnSwatch(index:int):void
+    {
+        if (index < 0 || index > length - 1)
+        {
+            highlight.visible = false;
+            return;
+        }
+
+		// Swatch highlight activated by mouse move or key events
+        var row:Number = Math.floor(index / columnCount);
+        var column:Number = index - (row * columnCount);
+
+		var xPos:Number = swatchWidth * column + horizontalGap * column -
+						  cellOffset * column + paddingLeft +
+						  swatchGridBorderSize;
+        var yPos:Number = swatchHeight * row + verticalGap * row -
+						  cellOffset * row + paddingTop + previewHeight +
+						  itemOffset + swatchGridBorderSize;
+
+		highlight.move(xPos, yPos);
+        highlight.visible = true;
+
+		isOverGrid = true;
+
+		updateColor(getColor(index));
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden event handlers: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function keyDownHandler(event:KeyboardEvent):void
+    {
+		// Ignore events that bubbling from the owner ColorPicker.
+		// through the textInput's keyDownHandler
+		if (event.eventPhase != EventPhase.AT_TARGET || !enabled)
+			return;
+
+        if (focusedIndex == -1 || isNaN(focusedIndex))
+            focusedIndex = 0;
+
+        var currentRow:int = Math.floor(focusedIndex / columnCount);
+
+        switch (event.keyCode)
+        {
+            case Keyboard.UP:
+            {
+                // Move up in column / jump to bottom of next column at end.
+                focusedIndex = focusedIndex - columnCount < 0 ?
+							   (rows - 1) * columnCount + focusedIndex + 1 :
+							   focusedIndex - columnCount;
+                isOverGrid = true;
+                break;
+            }
+
+            case Keyboard.DOWN:
+            {
+                // Move down in column / jump to top of last column at end.
+                focusedIndex = focusedIndex + columnCount > length ?
+							   (focusedIndex - 1) - (rows - 1) * columnCount :
+							   focusedIndex + columnCount;
+                isOverGrid = true;
+                break;
+            }
+
+            case Keyboard.LEFT:
+            {
+                // Move left in row / jump to right of last row at end.
+                focusedIndex = focusedIndex < 1 ?
+							   length - 1 :
+							   focusedIndex - 1;
+                isOverGrid = true;
+                break;
+            }
+
+            case Keyboard.RIGHT:
+            {
+                // Move right in row / jump to left of next row at end.
+                focusedIndex = focusedIndex >= length - 1 ?
+							   0 :
+							   focusedIndex + 1;
+                isOverGrid = true;
+                break;
+            }
+
+            case Keyboard.PAGE_UP:
+            {
+                // Move to first swatch in column.
+                focusedIndex = focusedIndex - currentRow * columnCount;
+                isOverGrid = true;
+                break;
+            }
+
+            case Keyboard.PAGE_DOWN:
+            {
+                // Move to last swatch in column.
+                focusedIndex = focusedIndex + (rows - 1) * columnCount -
+							   currentRow * columnCount;
+                isOverGrid = true;
+                break;
+            }
+
+            case Keyboard.HOME:
+            {
+                // Move to first swatch in row.
+                focusedIndex = focusedIndex -
+							   (focusedIndex - currentRow * columnCount);
+                isOverGrid = true;
+                break;
+            }
+
+            case Keyboard.END:
+            {
+                // Move to last swatch in row.
+                focusedIndex = focusedIndex +
+							   (currentRow * columnCount - focusedIndex) +
+							   (columnCount - 1);
+                isOverGrid = true;
+                break;
+            }
+        }
+
+        // Draw focus on new swatch.
+        if (focusedIndex < length && isOverGrid)
+        {
+            setFocusOnSwatch(focusedIndex);
+			dispatchEvent(new Event("change"));
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function mouseMoveHandler(event:MouseEvent):void
+    {
+        if (ColorPicker(owner).isDown && enabled)
+        {
+            var colorPickerEvent:ColorPickerEvent;
+
+            // Only assess movements that occur over the swatch grid.
+            if (mouseX > grid.left && mouseX < grid.right &&
+                mouseY > grid.top && mouseY < grid.bottom)
+            {
+                // Calculate location
+                var column:Number = Math.floor(
+					(Math.floor(mouseX) - (grid.left + verticalGap)) /
+					(swatchWidth + horizontalGap - cellOffset));
+				var row:Number = Math.floor(
+					(Math.floor(mouseY) - grid.top) /
+					((swatchHeight + verticalGap) - cellOffset));
+                var index:Number = row * columnCount + column;
+
+                // Adjust for edges
+                if (column == -1)
+					index++;
+                else if (column > (columnCount - 1))
+				    index--;
+                else if (row > (rows - 1))
+					index -= columnCount;
+                else if (index < 0)
+					index += columnCount;
+
+                // Set state
+                if ((lastIndex != index || highlight.visible == false) &&
+					index < length)
+                {
+                    if (lastIndex != -1 && lastIndex != index)
+                    {
+                        // Dispatch a ColorPickerEvent with type "itemRollOut".
+						colorPickerEvent = new ColorPickerEvent(
+                            ColorPickerEvent.ITEM_ROLL_OUT);
+                        colorPickerEvent.index = lastIndex;
+						colorPickerEvent.color = getColor(lastIndex);
+                        dispatchEvent(colorPickerEvent);
+                    }
+
+                    focusedIndex = index;
+                    lastIndex = focusedIndex;
+                    setFocusOnSwatch(focusedIndex);
+
+                    // Dispatch a ColorPickerEvent with type "itemRollOver".
+					colorPickerEvent = new ColorPickerEvent(
+                        ColorPickerEvent.ITEM_ROLL_OVER);
+                    colorPickerEvent.index =  focusedIndex;
+					colorPickerEvent.color = getColor(focusedIndex);
+                    dispatchEvent(colorPickerEvent);
+                }
+            }
+            else
+            {
+                if (highlight.visible == true && isOverGrid && lastIndex != -1)
+                {
+                    highlight.visible = false;
+
+                    // Dispatch a ColorPickerEvent with type "itemRollOut".
+                    colorPickerEvent = new ColorPickerEvent(
+                        ColorPickerEvent.ITEM_ROLL_OUT);
+                    colorPickerEvent.index = lastIndex;
+					colorPickerEvent.color = getColor(lastIndex);
+                    dispatchEvent(colorPickerEvent);
+                }
+
+                isOverGrid = false;
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function swatches_clickHandler(event:MouseEvent):void
+    {
+		if (!enabled)
+			return;
+
+        if (mouseX > grid.left && mouseX < grid.right &&
+            mouseY > grid.top && mouseY < grid.bottom)
+        {
+            selectedIndex = focusedIndex;
+
+			if (ColorPicker(owner).selectedIndex != selectedIndex)
+            {
+                ColorPicker(owner).selectedIndex = selectedIndex;
+
+				var cpEvent:ColorPickerEvent =
+                    new ColorPickerEvent(ColorPickerEvent.CHANGE);
+                cpEvent.index = selectedIndex;
+                cpEvent.color = getColor(selectedIndex);
+                ColorPicker(owner).dispatchEvent(cpEvent);
+            }
+
+            ColorPicker(owner).close(); // owner = ColorPicker
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function textInput_keyDownHandler(event:KeyboardEvent):void
+    {
+        // Redispatch the event from the ColorPicker
+		// and let its keyDownHandler() handle it.
+        ColorPicker(owner).dispatchEvent(event);
+    }
+
+    /**
+     *  @private
+     */
+    private function textInput_changeHandler(event:Event):void
+    {
+        // Handle events from hex TextField.
+        var color:String = TextInput(event.target).text;
+        if (color.charAt(0) == "#")
+        {
+            textInput.maxChars = 7;
+            color = "0x"+color.substring(1);
+        }
+        else if (color.substring(0,2) == "0x")
+        {
+            textInput.maxChars = 8;
+        }
+        else
+        {
+            textInput.maxChars = 6;
+            color = "0x"+color;
+        }
+
+		highlight.visible = false;
+        isOverGrid = false;
+		selectedColor = Number(color);
+
+		dispatchEvent(new Event("change"));
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1270032 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/styles/metadata/SelectedFillColorsStyle.as
+++ frameworks/projects/mx/src/mx/styles/metadata/SelectedFillColorsStyle.as
@@ -0,0 +1,19 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2006 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  The two colors used to tint the background of the component
+ *  when in its selected state.
+ *  Pass the same color for both values for "flat" looking control.
+ *  The default value is undefined, which means the colors
+ *  are derived from themeColor.
+ */
+[Style(name="selectedFillColors", type="Array", arrayType="uint", format="Color", inherit="no")]


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1281715 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2010 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

Revision: 18514
Author:   dthakkar@adobe.com
Date:     2010-11-10T00:38:39.528767Z

Log Message:
-----------
QE notes: Some testcases in spark formatters are failing because of behavior change. These testcases are excluded prior to submission. Globalization QE team has been informed about this.
Doc notes: Spark Formatters ASDocs are updated and also added samples for the spark formatters.
Bugs: SDK-28145, SDK-28345 ,SDK-28320 ,SDK-28287,SDK-28314
Reviewer: Gordon , Craig, Masa, Xie
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/MatchingCollatorExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/NumberValidatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/CurrencyValidatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/NumberValidatorTests.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/CurrencyValidatorTests.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/CollatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/NumberFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/NumberFormatterExample1.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses/NumberBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/CurrencyFormatterExample1.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/bundles/en_US/validators.properties</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/SortingCollator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/SortingCollatorExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/globalization/StringToolsExample.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/validators/IValidator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests-config.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/NumberValidatorBase.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/NumberFormatterExample2.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/CurrencyFormatterExample2.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/NumberValidator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/CurrencyValidator.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/validators/Validator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationUtils.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/GlobalizationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/formatters/IFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/asdoc/en_US/spark/formatters/examples/DateTimeFormatterExample.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses/NumberFormatterBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/MatchingCollator.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1284887 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as
+++ frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as
@@ -27,10 +27,10 @@
  *
  *  @see flash.globalization.LastOperationStatus

+ *  @langversion 3.0
  *  @playerversion Flash 10.1
- *  @playerversion AIR 2
- *  @langversion 3.0
- *  @productversion Flex 4.5
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.55
  */
 public final class LastOperationStatus
 {
@@ -54,9 +54,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.NO_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const NO_ERROR:String
@@ -66,15 +66,15 @@
      *  Indicates that a fallback value was set during the most recent
      *  operation.
      *
-     *  This status can be returned by constructors and methods like
+     *  This status can be returned by constructors and methods such as
      *  DateTimeFormatter.setDateTimeStyles(), and when retrieving
-     *  properties like CurrencyFormatter.groupingPattern.
+     *  properties such as CurrencyFormatter.groupingPattern.
      *
      *  @see flash.globalization.LastOperationStatus.USING_FALLBACK_WARNING
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const USING_FALLBACK_WARNING:String
@@ -88,9 +88,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.USING_DEFAULT_WARNING
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const USING_DEFAULT_WARNING:String
@@ -109,9 +109,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.PARSE_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const PARSE_ERROR:String
@@ -120,15 +120,15 @@
     /**
      *  Indicates that the requested operation or option is not supported.
      *
-     *  This status can be returned by methods like
+     *  This status can be returned by methods such as
      *  DateTimeFormatter.setDateTimePattern() and when retrieving
-     *  properties like Collator.ignoreCase.
+     *  properties suce as Collator.ignoreCase.
      *
      *  @see flash.globalization.LastOperationStatus.UNSUPPORTED_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const UNSUPPORTED_ERROR:String
@@ -143,10 +143,10 @@
      *
      *  @see flash.globalization.LastOperationStatus.ERROR_CODE_UNKNOWN
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
-     *  @productversion Flex 4.5
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5s
      */

     public static const ERROR_CODE_UNKNOWN:String
@@ -163,16 +163,17 @@
      *  is used for date formatting:

      *
      *  <listing version="3.0">
-     *  var df:DateTimeFormatter = new DateTimeFormatter("en-US");
+     *  var df:DateTimeFormatter = new DateTimeFormatter();
+     *  df.setStyle("locale","en_US");
      *  df.setDateTimePattern("xx");
      *  trace(df.lastOperationStatus); // "patternSyntaxError"
      *  </listing>
      *
      *  @see flash.globalization.LastOperationStatus.PATTERN_SYNTAX_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const PATTERN_SYNTAX_ERROR:String
@@ -183,9 +184,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.MEMORY_ALLOCATION_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const MEMORY_ALLOCATION_ERROR:String
@@ -199,16 +200,17 @@
      *  set to the invalid value "3;".

      *
      *  <listing version="3.0">
-     *  var cf:CurrencyFormatter = new CurrencyFormatter("en-US");
+     *  var cf:CurrencyFormatter = new CurrencyFormatter();
+     *  cf.setStyle("locale","en_US");
      *  cf.groupingPattern = "3;";
      *  trace(cf.lastOperationStatus); // "illegalArgumentError"
      *  </listing>
      *
      *  @see flash.globalization.LastOperationStatus.ILLEGAL_ARGUMENT_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const ILLEGAL_ARGUMENT_ERROR:String
@@ -219,9 +221,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.BUFFER_OVERFLOW_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */

@@ -236,16 +238,17 @@
      *  out-of-range value results in an invalid attribute value status.

      *
      *  <listing version="3.0">
-     *  var nf:NumberFormatter = new NumberFormatter(LocaleID.DEFAULT);
+     *  var nf:NumberFormatter = new NumberFormatter();
+     *  nf.setStyle("locale","en_US");
      *  nf.negativeNumberFormat = 9;
      *  nf.lastOperationStatus; // "invalidAttrValue"
      *  </listing>
      *
      *  @see flash.globalization.LastOperationStatus.INVALID_ATTR_VALUE
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const INVALID_ATTR_VALUE:String
@@ -257,9 +260,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.NUMBER_OVERFLOW_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const NUMBER_OVERFLOW_ERROR:String
@@ -270,9 +273,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.INVALID_CHAR_FOUND
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const INVALID_CHAR_FOUND:String
@@ -283,9 +286,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.TRUNCATED_CHAR_FOUND
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const TRUNCATED_CHAR_FOUND:String
@@ -297,9 +300,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.INDEX_OUT_OF_BOUNDS_ERROR
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const INDEX_OUT_OF_BOUNDS_ERROR:String
@@ -310,9 +313,9 @@
      *
      *  @see flash.globalization.LastOperationStatus.PLATFORM_API_FAILED
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const PLATFORM_API_FAILED:String
@@ -329,16 +332,16 @@
      *  LocaleID.getKeysAndValues() method.

      *
      *  <listing version="3.0">
-     *  var locale:LocaleID = new LocaleID("en-US@Collation");
+     *  var locale:flash.globalization.LocaleID = new flash.globalization.LocaleID("en-US@Collation");
      *  var kav:Object = locale.getKeysAndValues();
      *  trace(locale.lastOperationStatus); // "unexpectedToken"
      *  </listing>
      *
      *  @see flash.globalization.LastOperationStatus.UNEXPECTED_TOKEN
      *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const UNEXPECTED_TOKEN:String
@@ -350,11 +353,11 @@
     //--------------------------------------------------------------------------

     /**
-     *  Locale undefined error.
-     *
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2
-     *  @langversion 3.0
+     *  Indicates that Locale is not defined.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public static const LOCALE_UNDEFINED_ERROR:String = "localeUndefinedError";
@@ -367,11 +370,11 @@

     /**
     *  @private
-    *  Check if given lastOperationStatus is a fatal error.
+    *  Check if given lastOperationStatus is a error (not a warning).
     *
     *  A fatal error means errors other than no-error and warnings.
     */
-    mx_internal static function isFatalError(lastOperationStatus:String):Boolean
+    mx_internal static function isError(lastOperationStatus:String):Boolean
     {
         switch (lastOperationStatus)
         {