Transferred from the Adobe Open Source Subversion Repository

Revision: 2668
Author:   kelin@adobe.com
Date:     2008-07-30T21:05:00.806335Z

Log Message:
-----------
Massive check-in:

Updated Range, TrackBase, Slider, Spinner to use valueInterval to constrain values. In Slider, snapInterval was removed in favor of just using stepSize (for simplicity). TrackBase also is able to handle a resizable thumb.

Refactored ScrollBar to subclass TrackBase instead of Range in order to share thumb dragging code. pageSize was also moved from Range into ScrollBar.

Added a basic version of NumericStepper that can handle simple operations like committing the value when the enter key is pressed.

Skins for each of the components were also updated/added as needed. I also updated flex4test/CircularScrollBar.

QE: Yes!
Reviewer: Chet, Gordon, Jason

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/HSliderThumbSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/HScrollBarSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Range.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/VSliderTrackSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/VScrollBarTrackSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/MyVScrollBarSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/Flex4Classes.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/NumericStepper.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/NumericStepperSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/SpinnerDecrButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/VSliderThumbSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/VScrollBarSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/SpinnerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/HSliderTrackSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/HScrollBarTrackSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/SpinnerIncrButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/components/CircularScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/CircularScrollBarSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
@@ -43,7 +43,7 @@
  *    the minimum range value and the maximum range value.

  *

  */
-public class ScrollBar extends Range
+public class ScrollBar extends TrackBase
 {
     include "../core/Version.as";

@@ -81,48 +81,26 @@
     [SkinPart(required="false")]

     /**
-     * upButton is an optional SkinPart that defines a button that, when
-     * pressed, will step the scrollbar "up", which is equivalent to a decreasing step
-     * in the value property.
-     */
-    public var upButton:Button;
+     *  decrementButton is an optional SkinPart that defines a button
+     *  that, when pressed, will step the scrollbar "up", which is equivalent
+     *  to a decreasing step in the value property.
+     */
+    public var decrementButton:Button;

     [SkinPart(required="false")]

     /**
-     * downButton is an optional SkinPart that defines a button that, when
-     * pressed, will step the scrollbar "down", which is equivalent to a increasing step
-     * in the value property.
-     */
-    public var downButton:Button;
-
-    [SkinPart]
-
-    /**
-     * thumb is a SkinPart that defines a button that can be dragged on the track
-     * to increase or decrease the scrollbar's value property. Updates
-     * to the value through other means will automatically
-     * update the position of the thumb with respect to the track.
-     */
-    public var thumb:Button;
-
-    [SkinPart]
-
-    /**
-     * track is a SkinPart that defines a button that, when
-     * pressed, will page the scrollbar.
-     */
-    public var track:Button;
+     *  incrementButton is an optional SkinPart that defines a button
+     *  that, when pressed, will step the scrollbar "down", which is equivalent
+     *  to a increasing step in the value property.
+     */
+    public var incrementButton:Button;

     //--------------------------------------------------------------------------
     //
     //  Variables
     //
     //--------------------------------------------------------------------------
-
-    // TODO: transient?
-    // Holds previous thumb location during thumb drags
-    private var prevValue:Number;

     // TODO: transient?
     // Direction indicator for current track-scrolling operations
@@ -141,356 +119,230 @@

     //--------------------------------------------------------------------------
     //
-    //  Overridden properties
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     * Enable/disable this component. This also enables/disables any of the skin parts
-     * for this component.
-     */
-    override public function set enabled(value:Boolean):void
-    {
-        super.enabled = value;
-        enableSkinParts(value);
-    }
-
-    override public function set maximum(value:Number):void
-    {
-        super.maximum = value;
+    //  Overridden properties: Range
+    //
+    //--------------------------------------------------------------------------
+
+    override public function set valueInterval(value:Number):void
+    {
+        super.valueInterval = value;
+
+        // setting valueInterval may change the pageSize
+        pageSizeChanged = true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    // pageSize
+    //---------------------------------
+
+    private var _pageSize:Number = 20;
+
+    private var pageSizeChanged:Boolean = false;
+
+    /**
+     *  Amount of change in value when
+     *  the range is paged. Affects the thumb size.
+     *
+     *  @default 20
+     */
+    public function get pageSize():Number
+    {
+        return _pageSize;
+    }
+
+    public function set pageSize(value:Number):void
+    {
+        if (value == _pageSize)
+            return;
+
+        _pageSize = value;
+        pageSizeChanged = true;
+
+        invalidateProperties();
         invalidateDisplayList();
     }
-
-    override public function set minimum(value:Number):void
-    {
-        super.minimum = value;
-        invalidateDisplayList();
-    }
-
-    /**
-     * Handle changes to the value property, which affects the position of
-     * the thumb on the track.
-     */
-    override public function set value(newValue:Number):void
-    {
-        super.value = newValue;
-        invalidateDisplayList();
-    }
-
-
-
-    //--------------------------------------------------------------------------
-    //
-    // Properties
-    //
-    //--------------------------------------------------------------------------
-
-    // Implement thumbSize property as an overridable setter/getter so that
-    // subclasses can modify the size as necessary.
-    private var _thumbSize:Number;
-
-    /**
-     * Subclasses may choose to override this method to constrain the size
-     * within certain limits. For example, a vertically oriented scrollbar
-     * may choose to constrain the size to be at least as high as the
-     * minHeight of the skin button.
-     */
-    protected function get thumbSize():Number
-    {
-        return _thumbSize;
-    }
-
-    protected function set thumbSize(size:Number):void
-    {
-        _thumbSize = size;
-    }

     //--------------------------------------------------------------------------
     //
     // Methods
     //
     //--------------------------------------------------------------------------
-
-    /**
-     * Add behaviors associated with our skin. For example, we add listeners
-     * for various events to the skin parts here.
-     */
-    override protected function attachBehaviors():void
-    {
-        super.attachBehaviors();
-
-        if (upButton)
-        {
-            upButton.addEventListener("buttonDown", upButton_buttonDownHandler);
-            upButton.autoRepeat = true;
-        }
-        if (downButton)
-        {
-            downButton.addEventListener("buttonDown", downButton_buttonDownHandler);
-            downButton.autoRepeat = true;
-        }
-
-        thumb.stickyHighlighting = true;
-        thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumb_mouseDownHandler);
-        track.addEventListener(MouseEvent.MOUSE_DOWN, track_mouseDownHandler);
-        track.addEventListener(MouseEvent.ROLL_OVER, track_rollOverHandler);
-        track.addEventListener(MouseEvent.ROLL_OUT, track_rollOutHandler);
-
-        skinObject.addEventListener("updateComplete", skin_updateCompleteHandler);
-
-        enableSkinParts(enabled);
-        calculateThumbSize();
-        calculateThumbPosition();
-    }
-
-    /**
-     * Make the skins reflect the enabled state of the scrollbar
-     */
-    protected function enableSkinParts(value:Boolean):void
-    {
-        if (thumb)
-            thumb.enabled = value;
-        if (upButton)
-            upButton.enabled = value;
-        if (downButton)
-            downButton.enabled = value;
-        if (track)
-            track.enabled = value;
-    }
-
-    /**
-     * Remove the behaviors associated with our skin. For example, listeners
-     * for events on skin parts should be removed here.
-     */
-    override protected function removeBehaviors():void
-    {
-        if (upButton)
-            upButton.removeEventListener("buttonDown",
-                                         upButton_buttonDownHandler);
-        if (downButton)
-            downButton.removeEventListener("buttonDown",
-                                           downButton_buttonDownHandler);
-
-        thumb.removeEventListener(MouseEvent.MOUSE_DOWN, thumb_mouseDownHandler);
-        track.removeEventListener(MouseEvent.MOUSE_DOWN, track_mouseDownHandler);
-        track.removeEventListener(MouseEvent.ROLL_OVER, track_rollOverHandler);
-        track.removeEventListener(MouseEvent.ROLL_OUT, track_rollOutHandler);
-
-        skinObject.removeEventListener("updateComplete", skin_updateCompleteHandler);
-    }
-
-    /**
-     * Utility function to handle positioning the thumb on the scrollbar,
-     * given the current range value.
-     */
-    protected function calculateThumbPosition():void
-    {
-        // To calculate the thumb position, we first calculate the
-        // thumb size, based on the range, page size, and track size.
-        // The thumb position on the track is based on the current
-        // scrolling fraction and the thumb and track size.
-        var range:Number = Math.max(1, maximum - minimum);
-        var thumbPos:Number =
-            (trackSize - thumbSize) * (value - minimum) / range;
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        if (pageSizeChanged)
+        {
+            if (valueInterval != 0)
+                _pageSize = nearestValidInterval(_pageSize, valueInterval);

-        // Defer to subclasses to actually position the thumb; this is
-        // completely dependent upon scrollbar orientation and shape
-        positionThumb(thumbPos);
-    }
-
-    /**
-     * This method positions and sizes the thumb button correctly, given
-     * the position and sizing arguments. Subclasses should override this
-     * method to position the thumb appropriately for their situation.
-     */
-    protected function positionThumb(thumbPos:Number):void {}
-
-    /**
-     * Utility method which returns the range value for a given
-     * position on the track.
-     */
-    protected function valueFromPosition(position:Number):Number
+            pageSizeChanged = false;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function partAdded(partName:String, instance:*):void
+    {
+        super.partAdded(partName, instance);
+
+        if (instance == decrementButton)
+        {
+            decrementButton.addEventListener("buttonDown",
+                                            decrementButton_buttonDownHandler);
+            decrementButton.autoRepeat = true;
+        }
+        else if (instance == incrementButton)
+        {
+            incrementButton.addEventListener("buttonDown",
+                                            incrementButton_buttonDownHandler);
+            incrementButton.autoRepeat = true;
+        }
+        else if (instance == track)
+        {
+            track.addEventListener(MouseEvent.ROLL_OVER,
+                                   track_rollOverHandler);
+            track.addEventListener(MouseEvent.ROLL_OUT,
+                                   track_rollOutHandler);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function partRemoved(partName:String, instance:*):void
+    {
+        super.partRemoved(partName, instance);
+
+        if (instance == decrementButton)
+        {
+            decrementButton.removeEventListener("buttonDown",
+                                            decrementButton_buttonDownHandler);
+        }
+        else if (instance == incrementButton)
+        {
+            incrementButton.removeEventListener("buttonDown",
+                                            incrementButton_buttonDownHandler);
+        }
+        else if (instance == track)
+        {
+            track.removeEventListener(MouseEvent.ROLL_OVER,
+                                      track_rollOverHandler);
+            track.removeEventListener(MouseEvent.ROLL_OUT,
+                                      track_rollOutHandler);
+        }
+    }
+
+    /**
+     *  Make the skins reflect the enabled state of the ScrollBar.
+     */
+    override protected function enableSkinParts(value:Boolean):void
+    {
+        super.enableSkinParts(value);
+
+        if (decrementButton)
+            decrementButton.enabled = value;
+        if (incrementButton)
+            incrementButton.enabled = value;
+    }
+
+    /**
+     *  Pages the value up or down.
+     *
+     *  @param increase Whether the paging action increases or
+     *  decreases value.
+     */
+    public function page(increase:Boolean = true):void
+    {
+        if (increase)
+            setValue(nearestValidValue(value + pageSize, pageSize));
+        else
+            setValue(nearestValidValue(value - pageSize, pageSize));
+    }
+
+    /**
+     *  This utility method calculates an appropriate size for
+     *  the thumb, given the current range, pageSize, and
+     *  trackSize settings.
+     */
+    override protected function calculateThumbSize():Number
     {
         var range:Number = maximum - minimum;
-        var visibleTrack:Number = Math.max(1, trackSize - thumbSize);
-        var val:Number = minimum + range * (position / visibleTrack);
-        return val;
-    }
-
-    /**
-     * This method returns the size of the scrollbar's track. Subclasses need
-     * to override this method to return an appropriate value. Note that this
-     * number can represent any units, but those units must be consistent with
-     * the units for the thumbSize property and the values returned by
-     * getScrollPosition.
-     */
-    protected function get trackSize():Number
-    {
-        return 0;
-    }
-
-    /**
-     * This utility method calculates an appropriate size for the thumb
-     * button, given the current range, pageSize, and trackSize settings.
-     */
-    protected function calculateThumbSize():void
-    {
-        var range:Number = Math.max(1, (maximum - minimum));
-        thumbSize = Math.round(Math.min(1, pageSize / range) * trackSize);
-    }
-
-    /**
-     * Calculate thumb position and size on track according to data which
-     * has changed since the last updateDisplayList() call
-     */
-    override protected function updateDisplayList(unscaledWidth:Number,
-                                                  unscaledHeight:Number):void
-    {
-        super.updateDisplayList(unscaledWidth, unscaledHeight);
-        calculateThumbSize();
-        calculateThumbPosition();
-    }
-
+
+        // Thumb takes up entire track.
+        if (range == 0)
+            return trackSize;
+
+        return Math.min((pageSize / range) * trackSize, trackSize);
+    }
+
     //--------------------------------------------------------------------------
     //
     // Event Handlers
     //
     //--------------------------------------------------------------------------
-
+
     //---------------------------------
     // Mouse up/down handlers
     //---------------------------------

     /**
-     * Handle a click on the up button of the scroll bar. This should
-     * up one step.
-     */
-    protected function upButton_buttonDownHandler(event:Event):void
-    {
+     *  Handle a click on the up button of the scroll bar. This
+     *  should up one step.
+     */
+    protected function decrementButton_buttonDownHandler(event:Event):void
+    {
+        var oldValue:Number = value;
+
         step(false); // up
-    }
-
-    /**
-     * Handle a click on the down button of the scroll bar. This should
-     * down one step.
-     */
-    protected function downButton_buttonDownHandler(event:Event):void
-    {
+
+        if (value != oldValue)
+        {
+            positionThumb(valueToPosition(value));
+            dispatchEvent(new Event("change"));
+        }
+    }
+
+    /**
+     *  Handle a click on the down button of the scroll bar. This
+     *  should down one step.
+     */
+    protected function incrementButton_buttonDownHandler(event:Event):void
+    {
+        var oldValue:Number = value;
+
         step(true); // down
-    }
-
-    //---------------------------------
-    // Thumb dragging handlers
-    //---------------------------------
-
-    /**
-    * Handle mouse-down events on the scroll thumb.
-    */
-    protected function thumb_mouseDownHandler(event:MouseEvent):void
-    {
-        // TODO (chaase): We might want a different event mechanism eventually
-        // which would push this enabled check into the child/skin components
-        if (!enabled)
-            return;
-
-        addSystemHandlers(MouseEvent.MOUSE_MOVE, system_mouseMoveHandler,
-                stage_mouseMoveHandler);
-        addSystemHandlers(MouseEvent.MOUSE_UP, system_mouseUpHandler,
-                stage_mouseUpHandler);
-
-        // Record the location where this mouse-down event occurred; we will
-        // use this in later drag operations to determine how much to move the
-        // thumb button
-        var pt:Point = new Point(event.stageX, event.stageY);
-        pt = globalToLocal(pt);
-        var position:Number = getScrollPosition(pt.x, pt.y);
-        prevValue = valueFromPosition(position);
-    }
-
-    /**
-    * @private
-    * Capture mouse-move events on the thumb anywhere on the stage
-    */
-    private function stage_mouseMoveHandler(event:MouseEvent):void
-    {
-        if (event.target != stage)
-            return;
-
-        system_mouseMoveHandler(event);
-    }
-
-    /**
-    * @private
-    * Capture mouse-move events anywhere on or off the stage.
-    * We calculate the delta between the current location and the past
-    * location during this drag and move the thumb by that amount.
-    */
-    private function system_mouseMoveHandler(event:MouseEvent):void
-    {
-        var pt:Point = new Point(event.stageX, event.stageY);
-        pt = globalToLocal(pt);
-        var tempPosition:Number = getScrollPosition(pt.x, pt.y);
-        var newValue:Number = valueFromPosition(tempPosition);
-        var delta:Number = newValue - prevValue;
-        var tempValue:Number = value + delta;
-        // Clamp the move to lie within the range
-        // and set the scroll fraction accordingly
-        if (tempValue < minimum)
-        {
-            newValue += (minimum - tempValue);
-            tempValue = minimum;
-        }
-        else if (tempValue > maximum)
-        {
-            newValue -= (tempValue - maximum);
-            tempValue = maximum;
-        }
-        value = tempValue;
-        prevValue = newValue;
-
-        // Force the visual update now to make scrolling smooth
-        event.updateAfterEvent();
-    }
-
-    /**
-    * @private
-    * Handle mouse-up events anywhere on the stage
-    */
-    private function stage_mouseUpHandler(event:MouseEvent):void
-    {
-        if (event.target != stage)
-            return;
-
-        system_mouseUpHandler(event);
-    }
-
-    /**
-    * @private
-    * Handle mouse-up events anywhere on or off the stage. When we receive
-    * a mouse-up event for the thumb button, we remove our event handlers
-    * for everything except mouse-down.
-    */
-    private function system_mouseUpHandler(event:MouseEvent):void
-    {
-        removeSystemHandlers(MouseEvent.MOUSE_MOVE, system_mouseMoveHandler,
-                stage_mouseMoveHandler);
-        removeSystemHandlers(MouseEvent.MOUSE_UP, system_mouseUpHandler,
-                stage_mouseUpHandler);
-    }
-
+
+        if (value != oldValue)
+        {
+            positionThumb(valueToPosition(value));
+            dispatchEvent(new Event("change"));
+        }
+    }

     //---------------------------------
     // Track dragging handlers
     //---------------------------------

     /**
-     * Handle mouse-down events for the scroll track.  In our handler,
-     * we figure out where the event occurred on the track and begin
-     * paging the scroll position toward that location. We start a
-     * timer to handle repeating events if the user keeps the button
-     * pressed on the track.
-     */
-    protected function track_mouseDownHandler(event:MouseEvent):void
+     *  Handle mouse-down events for the scroll track. In our handler,
+     *  we figure out where the event occurred on the track and begin
+     *  paging the scroll position toward that location. We start a
+     *  timer to handle repeating events if the user keeps the button
+     *  pressed on the track.
+     */
+    override protected function track_mouseDownHandler(event:MouseEvent):void
     {
         // TODO (chaase): We might want a different event mechanism eventually
         // which would push this enabled check into the child/skin components
@@ -500,11 +352,20 @@
         var pt:Point = new Point(event.stageX, event.stageY);
         // Cache original event location for use on later repeating events
         trackPosition = track.globalToLocal(pt);
-        var newScrollPosition:Number = getScrollPosition(trackPosition.x, trackPosition.y);
-        var newScrollValue:Number = valueFromPosition(newScrollPosition);
+        var newScrollPosition:Number = pointToPosition(trackPosition.x, trackPosition.y);
+        var newScrollValue:Number = positionToValue(newScrollPosition);

         trackScrollDown = (newScrollValue > value);
+
+        var oldValue:Number = value;
+
         page(trackScrollDown);
+
+        if (value != oldValue)
+        {
+            positionThumb(valueToPosition(value));
+            dispatchEvent(new Event("change"));
+        }

         trackScrolling = true;

@@ -551,22 +412,34 @@
         // Only repeat the scrolling if the current scroll position
         // (represented by fraction) is not past the current
         // mouse position on the track
-        var newScrollPosition:Number = getScrollPosition(
+        var newScrollPosition:Number = pointToPosition(
             trackPosition.x, trackPosition.y);
-        var newScrollValue:Number = valueFromPosition(newScrollPosition);
-
+        var newScrollValue:Number = positionToValue(newScrollPosition);
+
         if (trackScrollDown)
         {
-            var range:Number = Math.max(1, maximum - minimum);
-            if (newScrollValue <= (value + (thumbSize / trackSize) * range))
+            var range:Number = maximum - minimum;
+            if (range == 0)
                 return;
+
+            //if (newScrollValue <= (value + (thumbSize / trackSize) * range))
+            if ((value + pageSize) > newScrollValue)
+                return;
         }
         else if (newScrollValue > value)
         {
             return;
         }
+
+        var oldValue:Number = value;

         page(trackScrollDown);
+
+        if (value != oldValue)
+        {
+            positionThumb(valueToPosition(value));
+            dispatchEvent(new Event("change"));
+        }

         if (trackScrollTimer && trackScrollTimer.repeatCount == 1)
         {
@@ -578,7 +451,7 @@
     }

     /**
-     * Handle mouse-move events for track scrolling anywhere on the stage
+     *  Handle mouse-move events for track scrolling anywhere on the stage
      */
     private function stage_track_mouseMoveHandler(event:MouseEvent):void
     {
@@ -609,17 +482,17 @@
     }

     /**
-     * @private
-     * Stop scrolling the track if the mouse leaves the stage
-     * area. Remove the listeners and stop the Timer.
+     *  @private
+     *  Stop scrolling the track if the mouse leaves the stage
+     *  area. Remove the listeners and stop the Timer.
      */
     private function track_mouseLeaveHandler(event:Event):void
     {
         trackScrolling = false;
         removeSystemHandlers(MouseEvent.MOUSE_MOVE, track_mouseMoveHandler,
                 stage_track_mouseMoveHandler);
-        systemManager.removeEventListener(
-            MouseEvent.MOUSE_UP, track_mouseLeaveHandler, true);
+        systemManager.removeEventListener(MouseEvent.MOUSE_UP,
+                track_mouseLeaveHandler, true);
         systemManager.stage.removeEventListener(Event.MOUSE_LEAVE,
                             track_mouseLeaveHandler);

@@ -628,9 +501,9 @@
     }

     /**
-     * @private
-     * If we are still in the middle of track-scrolling, restart the
-     * timer when the mouse re-enters the track area.
+     *  @private
+     *  If we are still in the middle of track-scrolling, restart the
+     *  timer when the mouse re-enters the track area.
      */
     private function track_rollOverHandler(event:MouseEvent):void
     {
@@ -639,39 +512,15 @@
     }

     /**
-     * @private
-     * Stop the track-scrolling repeat events if the mouse leaves
-     * the track area.
+     *  @private
+     *  Stop the track-scrolling repeat events if the mouse leaves
+     *  the track area.
      */
     private function track_rollOutHandler(event:MouseEvent):void
     {
         if (trackScrolling)
             trackScrollTimer.stop();
     }
-
-    /**
-     * @private
-     * Force the scrollbar to set itself up correctly now that the
-     * skins have completed loading.
-     */
-    private function skin_updateCompleteHandler(event:Event):void
-    {
-        invalidateDisplayList();
-    }
-
-    /**
-     * This function returns a position on the scrollbar relative to its
-     * orientation and shape. The localX and localY
-     * values represent the location in the local coordinate system of the
-     * scrollbar. Subclasses must override this method and return the
-     * appropriate value for their situation. Values should not be clamped to
-     * the ends of the scrollbar, as that clamping will happen later, prior
-     * to setting the thumb position.
-     */
-    protected function getScrollPosition(localX:Number, localY:Number):Number
-    {
-        return 0;
-    }
 }

-}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 7836
Author:   chaase@adobe.com
Date:     2009-06-15T14:37:21.379918Z

Log Message:
-----------
PARB changes for effects. This includes various property renames, a couple of class renames, moving 3 classes to a sub-package, and various doc cleanups. This also includes changing a handful of Array properties to typed Vectors.

QE: This breaks Mustella due to the renames
Doc: Docs will need to be updated to reflect the changes as well
Bugs: None
Reviewer: Jason
Tests: checkintests, Thermo's transitionbug test

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/utils/BitmapUtil.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/MotionPath.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/flex4/src/spark/effects/easing/EasingFraction.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/RGBInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/HSBInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CallAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.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/animation/RepeatBehavior.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/IInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/NumberInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/CallActionInstance.as</path>
<path kind="file" action="D">/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/Rotate.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTransitionInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTransitionInstance.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransitionShaderInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Wipe.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/Move.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/flex4/src/spark/effects/CrossFade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SimpleMotionPath.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/SimpleMotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/HSBColor.as</path>
<path kind="file" action="M">/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/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Keyframe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CrossFade.pbk</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/WipeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>

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

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

 package spark.components.supportClasses
 {
+import __AS3__.vec.Vector;

 import flash.events.Event;
 import flash.events.MouseEvent;
@@ -25,8 +26,9 @@

 import spark.components.Button;
 import spark.core.IViewport;
-import spark.effects.SimpleMotionPath;
 import spark.effects.animation.Animation;
+import spark.effects.animation.MotionPath;
+import spark.effects.animation.SimpleMotionPath;
 import spark.effects.easing.IEaser;
 import spark.effects.easing.Linear;
 import spark.effects.easing.Sine;
@@ -241,7 +243,7 @@
         _animator.animationTarget = animTarget;
         return _animator;
     }
-
+
     /**
      * @private
      * These variables track whether we are currently involved in a stepping
@@ -258,7 +260,11 @@
      */
     private var animatingSinglePage:Boolean;

-
+    /**
+     * @private
+     * Easers used in animated scrolling operations
+     */
+    private static var linearEaser:IEaser = new Linear();
     private static var easyInLinearEaser:IEaser = new Linear(.1);
     private static var deceleratingSineEaser:IEaser = new Sine(0);

@@ -425,7 +431,8 @@
         animator.stop();
         animator.duration = duration;
         animator.easer = easer;
-        animator.motionPaths = [new SimpleMotionPath("value", value, valueTo)];
+        animator.motionPaths = new <MotionPath>[
+            new SimpleMotionPath("value", value, valueTo)];
         animator.startDelay = startDelay;
         animator.play();
     }
@@ -551,7 +558,7 @@
         else
             val = Math.max(value - pageSize, minimum);
         if (getStyle("smoothScrolling")) {
-            startAnimation(getStyle("repeatInterval"), val, Linear.getInstance());
+            startAnimation(getStyle("repeatInterval"), val, linearEaser);
             animatingSinglePage = true;
         }
         else
@@ -895,7 +902,7 @@
         // TODO (chaase): hard-coding easing behavior, how to style it?
         startAnimation(
             getStyle("repeatInterval") * (Math.abs(newValue - value) / pageSize),
-            nearestValidValue(newValue, pageSize), Linear.getInstance());
+            nearestValidValue(newValue, pageSize), linearEaser);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 5770
Author:   gruehle@adobe.com
Date:     2009-03-30T20:58:54.529722Z

Log Message:
-----------
Add [Alternative] metadata to the Halo components that have a Gumbo replacement.

Bugs: SDK-20190
QA notes: none
Doc notes: Additional ASDoc comments added for many of the classes. These should all be reviewed.
Reviewer: Chet

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TileList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Zoom.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToggleButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/HBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Cubic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/RemoveChildAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/TweenEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeRight.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/VBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Glow.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Quartic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Box.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeLeft.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ApplicationControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Quintic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Tween.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Tile.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Quadratic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/AddChildAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeDown.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/SetPropertyAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Canvas.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Blur.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Text.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/HorizontalList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeUp.as</path>

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

--- frameworks/projects/mx/src/mx/controls/CheckBox.as
+++ frameworks/projects/mx/src/mx/controls/CheckBox.as
@@ -56,6 +56,8 @@

 [IconFile("CheckBox.png")]

+[Alternative(replacement="spark.components.CheckBox", since="4.0")]
+
 /**
  *  The CheckBox control consists of an optional label and a small box
  *  that can contain a check mark or not.


Work in progress

Work in progress

--- utils/peephole.as
+++ utils/peephole.as
@@ -49,38 +49,46 @@
      ident    ::= C++ identifier
      eol      ::= newline or end-of-file

-   The idea is that the identifiers in the pattern are opcode values that
-   are resolved at compile time and which drive the peephole optimizer
-   state machine.  The guard is evaluated in case there are side conditions
-   apart from the opcode values; it must be a C++ expression.  The action
-   represents individual instruction words that replace the instructions
-   matched by the pattern.
+   Identifiers in the pattern must be opcode names; these are resolved at
+   compile time and the peephole optimizer state machine uses them to
+   transition from one state to another.  The guard is evaluated in case
+   there are side conditions apart from the opcode values; the guard must
+   be a C++ expression.  The action represents individual instruction
+   words that replace the instructions matched by the pattern; each word
+   should be a C++ expression.

    The syntax $n.m refers to the m'th word of the n'th matched instruction.
-
-   The guard will normally be evaluated zero or one times, but it would
-   be good not to depend on that.
-
-   For example (this one has only one instruction in the action)
+   It can be used in the guard and action.
+
+   The guard will be evaluated zero or one times per match.  (The current
+   implementation only invokes a guard after longer matches have failed,
+   so zero times is typical - you can't track state machine progress by
+   having side effects in the guard.)
+
+   For example (this one has only one instruction in the action):

      pattern  OP_getlocal ; OP_getlocal ; OP_getlocal
      guard    $0.1 < 1024 && $1.1 < 1024 && $2.1 < 1024
-     action   OP_get2locals ; (($2.1 << 20) | ($1.1 << 10) | $0.1)
+     action   OP_get3locals ; ($2.1 << 20) | ($1.1 << 10) | $0.1

    Continuation lines are allowed, they start with '*' in the first column.
-
-   Comment lines start with //.  Comment lines and blank lines are ignored
-   everywhere before continuation lines are resolved.
-
-   Restrictions:
+   The continuation line, less its '*', is pasted onto the end of the
+   preceding line.
+
+   Comment lines start with // (possibly preceded by blanks).  Comment lines
+   and blank lines are ignored everywhere before continuation lines are
+   resolved.  Comments can't follow patterns, guards, or actions on the
+   same line.
+
+   Restrictions (not checked by this program):

    - The action cannot introduce more words than the instruction originally
      occupied  (it would not be hard to lift this restriction).

-   - Lookupswitch may not appear in these patterns
-
-   - Any PC-relative branch instruction must be the last in the pattern as
-     well as in the replacement code
+   - Lookupswitch must not appear in these patterns.
+
+   - Any PC-relative branch instruction must be the last in the pattern or
+     in the replacement code.

  */

@@ -103,7 +111,7 @@
             throw new Error("Assertion failed");
     }

-    function cleanup(lines) {
+    function preprocess(lines) {
 	var j = 0;
 	var first = true;
 	for ( var i=0, limit=lines.length ; i < limit ; i++ ) {
@@ -124,14 +132,14 @@
 	return lines;
     }

-    function patterns(lines) {
+    function parse(lines) {
 	var output = [];
 	var P = null;
 	var G = null;
 	var A = null;
 	var res;
 	for ( var i=0, limit=lines.length ; i < limit ; i++ ) {
-	    var L = lines[i];
+	    var L = lines[i].replace(/\$([0-9]+)\.([0-9]+)/g, "I[$1][$2]");
 	    if (P == null) {
 		res = /^pattern\s+(.*)$/.exec(L);
 		assert(res != null);
@@ -160,24 +168,14 @@
 	return output;
     }

-    function printT(x) {
-	var s = "{";
-	for ( var i in x ) {
-	    if (i == "toString") continue;
-	    s += i + ": " + x[i] + ", ";
-	}
-	s += "}";
-	return s;
-    }
-
     function build(patterns) {
-	var T = { toString: function () { return printT(this); } };
+	var T = {};
 	for ( var i=0, ilimit=patterns.length ; i < ilimit ; i++ ) {
 	    var p = patterns[i];
 	    var container = T;
 	    for ( var j=0, jlimit=p.P.length ; j < jlimit ; j++ ) {
 		if (!(p.P[j] in container))
-		    container[p.P[j]] = { toString: function () { return printT(this); } };
+		    container[p.P[j]] = {};
 		container = container[p.P[j]];
 	    }
 	    if (!("actions" in container))
@@ -216,7 +214,6 @@
         System.exit(1);
     }

-    var T = build(patterns(cleanup(File.read(System.argv[0]).split("\n"))));
-    print(String(T));
+    var T = build(parse(preprocess(File.read(System.argv[0]).split("\n"))));
     display(T, null);
 }


FLEX-34837 As noticed in FLEX-26808, if the dimensions are not specified the grid layout will not render its GridViews. Test still passes.


Added license

Added license

--- src/Flashcam.as
+++ src/Flashcam.as
@@ -1,74 +1,96 @@
-package
-{
-  import flash.display.BitmapData;
-  import flash.display.Sprite;
-  import flash.events.Event;
-  import flash.events.StatusEvent;
-  import flash.external.ExternalInterface;
-  import flash.media.Camera;
-  import flash.media.Video;
-
-  [SWF(width = "320", height = "230", backgroundColor = "#ff0000")]
-
-  public class Flashcam extends Sprite
-  {
-    private static var camera:Camera;
-    private static var video:Video;
-    private static var bitmap:BitmapData;
-    private static var pixels:String;
-
-    public function Flashcam():void {
-      if (stage){
-        onAddedToStage();
-      }else {
-        addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
-      }
-    }
-
-    private function onAddedToStage(e:Event = null):void{
-      removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
-
-      Flashcam.camera = Camera.getCamera();
-      Flashcam.camera.setMode(320, 240, 24);
-      Flashcam.camera.addEventListener(StatusEvent.STATUS, statusHandler);
-
-      Flashcam.video = new Video(Flashcam.camera.width, Flashcam.camera.height);
-      Flashcam.video.attachCamera(Flashcam.camera);
-
-      Flashcam.bitmap = new BitmapData(video.width, video.height, false);
-
-      ExternalInterface.addCallback("snapshot", Flashcam.snapshot);
-    }
-
-    private function statusHandler(event:StatusEvent):void{
-      if (event.code == "Camera.Unmuted"){
-          Flashcam.camera.removeEventListener(StatusEvent.STATUS, statusHandler);
-
-          ExternalInterface.call("cameraUnmuted");
-      }
-    }
-
-    public static function snapshot():String{
-      var h:int = Flashcam.bitmap.rect.height,
-          w:int = Flashcam.bitmap.rect.width,
-          prev:uint = 0, curr:uint, i:int, j:int;
-
-      Flashcam.bitmap.draw(Flashcam.video);
-
-      pixels = "";
-
-      for (i = 0; i < h; ++ i){
-        for (j = 0; j < w; ++ j){
-          curr = Flashcam.bitmap.getPixel(j, i);
-
-          pixels += (curr - prev).toString(36);
-          pixels += ',';
-
-          prev = curr;
-        }
-      }
-
-      return pixels;
-    }
-  }
+/*
+Copyright (c) 2011 Juan Mellado
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+package
+{
+  import flash.display.BitmapData;
+  import flash.display.Sprite;
+  import flash.events.Event;
+  import flash.events.StatusEvent;
+  import flash.external.ExternalInterface;
+  import flash.media.Camera;
+  import flash.media.Video;
+
+  [SWF(width = "320", height = "230", backgroundColor = "#ff0000")]
+
+  public class Flashcam extends Sprite
+  {
+    private static var camera:Camera;
+    private static var video:Video;
+    private static var bitmap:BitmapData;
+    private static var pixels:String;
+
+    public function Flashcam():void {
+      if (stage){
+        onAddedToStage();
+      }else {
+        addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
+      }
+    }
+
+    private function onAddedToStage(e:Event = null):void{
+      removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
+
+      Flashcam.camera = Camera.getCamera();
+      Flashcam.camera.setMode(320, 240, 24);
+      Flashcam.camera.addEventListener(StatusEvent.STATUS, statusHandler);
+
+      Flashcam.video = new Video(Flashcam.camera.width, Flashcam.camera.height);
+      Flashcam.video.attachCamera(Flashcam.camera);
+
+      Flashcam.bitmap = new BitmapData(video.width, video.height, false);
+
+      ExternalInterface.addCallback("snapshot", Flashcam.snapshot);
+    }
+
+    private function statusHandler(event:StatusEvent):void{
+      if (event.code == "Camera.Unmuted"){
+          Flashcam.camera.removeEventListener(StatusEvent.STATUS, statusHandler);
+
+          ExternalInterface.call("cameraUnmuted");
+      }
+    }
+
+    public static function snapshot():String{
+      var h:int = Flashcam.bitmap.rect.height,
+          w:int = Flashcam.bitmap.rect.width,
+          prev:uint = 0, curr:uint, i:int, j:int;
+
+      Flashcam.bitmap.draw(Flashcam.video);
+
+      pixels = "";
+
+      for (i = 0; i < h; ++ i){
+        for (j = 0; j < w; ++ j){
+          curr = Flashcam.bitmap.getPixel(j, i);
+
+          pixels += (curr - prev).toString(36);
+          pixels += ',';
+
+          prev = curr;
+        }
+      }
+
+      return pixels;
+    }
+  }
 }


- change: very slight optimization

- change: very slight optimization

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

--- src/reprise/ui/UIObject.as
+++ src/reprise/ui/UIObject.as
@@ -928,7 +928,7 @@
 			}
 			else
 			{
-				m_children.splice(m_children.indexOf(child), 1);
+				m_children.splice(index, 1);
 			}
 			child.parent && child.parent.removeChild(child);
 			child.m_parentElement = null;


Transferred from the Adobe Open Source Subversion Repository

Revision: 20129
Author:   deeptika@adobe.com
Date:     2011-02-04T12:02:12.114051Z

Log Message:
-----------
Setting fill of current item to the legend.

QE notes:
Doc notes:
Bugs: FLEXDMV-2515 (PieSeries incorrectly generates PieSeriesLegendData)
Reviewer:
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/charts/src/mx/charts/series/PieSeries.as

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

--- frameworks/projects/charts/src/mx/charts/series/PieSeries.as
+++ frameworks/projects/charts/src/mx/charts/series/PieSeries.as
@@ -503,8 +503,7 @@

             legendData = new PieSeriesLegendData();

-            legendData.fill = GraphicsUtilities.fillFromStyle(
-                localFills[i % localFills.length]);
+            legendData.fill = current.fill;

             if (_nameField != null && _nameField != "")
                 legendData.label = current.item[_nameField];


Transferred from the Adobe Open Source Subversion Repository

Revision: 3509
Author:   jimurphy@adobe.com
Date:     2008-10-07T18:19:17.646255Z

Log Message:
-----------
Rename of flex -> mx.

For compatibility reasons it was decided that the new functionality remain integrated with the old framework, although we will continue to build two separate SWCs, one with primarily existing framework classes, and one with new Flex 4 classes. This change removes duplicate names from the Flex 4 framework to avoid class name overlapping with the old framework code.  The naming overlap consists of two major areas:  New Components, and New Effects

Modified Paths:
--------------
386 paths were modified

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

--- frameworks/projects/spark/src/spark/effects/easing/Linear.as
+++ frameworks/projects/spark/src/spark/effects/easing/Linear.as
@@ -8,7 +8,7 @@
 //  in accordance with the terms of the license agreement accompanying it.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package flex.effects.easing
+package mx.effects.easing
 {
 /**
  * Provides easing functionality with three phases during


import unnecessary

import unnecessary

--- src/org/puremvc/as3/multicore/utilities/pipes/messages/FilterControlMessage.as
+++ src/org/puremvc/as3/multicore/utilities/pipes/messages/FilterControlMessage.as
@@ -5,7 +5,7 @@
  */
 package org.puremvc.as3.multicore.utilities.pipes.messages
 {
-	import org.puremvc.as3.multicore.utilities.pipes.plumbing.Filter;
+
 	/**
 	 * Filter Control Message.
 	 * <P>


Transferred from the Adobe Open Source Subversion Repository

Revision: 19363
Author:   mhorn@adobe.com
Date:     2010-12-14T16:57:25.600360Z

Log Message:
-----------
ASDoc updates

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/styles/metadata/BasicInheritingTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/graphics/GradientEntry.as</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/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/Path.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -388,20 +388,20 @@
     {
         return _alwaysCreateDisplayObject;
     }
-
-	/**
-	 *  @private
-	 */
-	public function set alwaysCreateDisplayObject(value:Boolean):void
-	{
-		if (value != _alwaysCreateDisplayObject)
-		{
-			var previous:Boolean = needsDisplayObject;
-			_alwaysCreateDisplayObject = value;
-			if (previous != needsDisplayObject)
-				invalidateDisplayObjectSharing();
-		}
-	}
+
+    /**
+     *  @private
+     */
+    public function set alwaysCreateDisplayObject(value:Boolean):void
+    {
+        if (value != _alwaysCreateDisplayObject)
+        {
+            var previous:Boolean = needsDisplayObject;
+            _alwaysCreateDisplayObject = value;
+            if (previous != needsDisplayObject)
+                invalidateDisplayObjectSharing();
+        }
+    }

     //----------------------------------
     //  baseline
@@ -4289,6 +4289,8 @@
      *  @param width The target pre-transform width.
      *
      *  @param height The target pre-transform height.
+     *
+     *  @param postLayoutTransform
      *
      *  @return Returns the transformed width. Transformation is this element's
      *  layout transformation matrix.
@@ -4673,7 +4675,7 @@
      *  Returns the amount of pixels occupied by the stroke on each side
      *  of the element's bounds.
      *
-     *  @param postLayoutTransform - if true, the stroke extents are calculated
+     *  @param postLayoutTransform If true, the stroke extents are calculated
      *  in parent coordinate space (after applying the element's transformations).
      *
      *  @return Rectangle of the stroke extents. The rectangle's left,


Transferred from the Adobe Open Source Subversion Repository

Revision: 11065
Author:   dsubrama@adobe.com
Date:     2009-10-21T22:22:44.093939Z

Log Message:
-----------
Check-in of runtime implementation of FXG 2.0 additional blendModes and luminosity mask. Additionally, cleaned up the code formatting and whitespace in the AS wrapper classes around the .pbj files.

With this check-in the static FXG and runtime FXG implementations are complete (sans bugfixing)!

QE notes: Test!
Doc notes: Yes
Bugs: None
Reviewer: Evtim (before break)
Tests run: FXG testsuite
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/ColorDodgeShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/HueShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/SoftLightShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/ColorBurnShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/LuminosityMaskShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/ExclusionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/SaturationShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/LuminosityShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/ColorShader.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -16,11 +16,12 @@
 import flash.display.BlendMode;
 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
-import flash.display.Shape;
+import flash.display.Shape;
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.EventDispatcher;
 import flash.events.IEventDispatcher;
+import flash.filters.ShaderFilter;
 import flash.geom.ColorTransform;
 import flash.geom.Matrix;
 import flash.geom.Matrix3D;
@@ -39,7 +40,7 @@
 import mx.core.UIComponent;
 import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
-import mx.events.FlexEvent;
+import mx.events.FlexEvent;
 import mx.events.PropertyChangeEvent;
 import mx.filters.BaseFilter;
 import mx.filters.IBitmapFilter;
@@ -53,6 +54,15 @@
 import spark.core.DisplayObjectSharingMode;
 import spark.core.IGraphicElement;
 import spark.core.MaskType;
+import spark.primitives.shaders.ColorBurnShader;
+import spark.primitives.shaders.ColorDodgeShader;
+import spark.primitives.shaders.ColorShader;
+import spark.primitives.shaders.ExclusionShader;
+import spark.primitives.shaders.HueShader;
+import spark.primitives.shaders.LuminosityShader;
+import spark.primitives.shaders.SaturationShader;
+import spark.primitives.shaders.SoftLightShader;
+import spark.primitives.shaders.LuminosityMaskShader;

 use namespace mx_internal;

@@ -443,11 +453,12 @@
      *  Storage for the blendMode property.
      */
     private var _blendMode:String = "auto";
-
-    /**
+
+	/**
      *  @private
      */
     private var blendModeChanged:Boolean;
+	private var blendShaderChanged:Boolean;
     private var blendModeExplicitlySet:Boolean = false;

     [Inspectable(category="General", enumeration="auto,add,alpha,darken,difference,erase,hardlight,invert,layer,lighten,multiply,normal,subtract,screen,overlay,colordodge,colorburn,exclusion,softlight,hue,saturation,color,luminosity", defaultValue="auto")]
@@ -476,16 +487,6 @@
     public function set blendMode(value:String):void
     {
         if (blendModeExplicitlySet && value == _blendMode)
-            return;
-
-        // FIXME (dsubrama): Temporarily exit when blendMode is set
-    	// to one of the AIM blendModes; support for this will come
-    	// shortly.
-        if (value == "colordodge" ||
-        	value =="colorburn" || value =="exclusion" ||
-        	value =="softlight" || value =="hue" ||
-        	value =="saturation" || value =="color"
-        	|| value =="luminosity")
             return;

         //The default blendMode in FXG is 'auto'. There are only
@@ -514,14 +515,22 @@
         }
         else
         {
-            var previous:Boolean = needsDisplayObject;
             _blendMode = value;
-            if (previous != needsDisplayObject)
-                invalidateDisplayObjectSharing();
-
-            blendModeExplicitlySet = true;
-            blendModeChanged = true;
-            invalidateProperties();
+
+			// If one of the non-native Flash blendModes is set,
+			// record the new value and set the appropriate
+			// blendShader on the display object.
+			if (value == "colordodge" ||
+				value =="colorburn" || value =="exclusion" ||
+				value =="softlight" || value =="hue" ||
+				value =="saturation" || value =="color"
+				|| value =="luminosity")
+				blendShaderChanged = true;
+			else
+				blendModeChanged = true;
+
+			blendModeExplicitlySet = true;
+			invalidateProperties();
         }
     }

@@ -1208,16 +1217,10 @@
      */
     public function set maskType(value:String):void
     {
-    	// FIXME (dsubrama): Temporarily exit when maskType is
-    	// set to luminosity; support for this will come shortly.
-    	if (value == "luminosity")
-    		return;
-
         if (_maskType == value)
             return;

         _maskType = value;
-
         maskTypeChanged = true;
         invalidateProperties();
     }
@@ -3141,6 +3144,32 @@
                 //notifyElementLayerChanged(); // Trigger recreation of the layers
                 drawnDisplayObject.cacheAsBitmap = true;
             }
+			else if (_maskType == MaskType.LUMINOSITY)
+			{
+				// Sets up the mask's mode property based on
+				// whether the luminosityClip and
+				// luminosityInvert properties are on or off.
+				var mode:int;
+				if (luminosityClip && !luminosityInvert)
+					mode = 0;
+				if (luminosityClip && luminosityInvert)
+					mode = 1;
+				if (!luminosityClip && !luminosityInvert)
+					mode = 2;
+				if (!luminosityClip && luminosityInvert)
+					mode = 3;
+
+				_mask.cacheAsBitmap = true;
+
+				// Create the luminosityMask shader, apply the correct mode to it,
+				// and create the filter
+				var luminosityMaskShader:LuminosityMaskShader = new LuminosityMaskShader();
+				luminosityMaskShader.mode = mode;
+				var maskFilter:ShaderFilter = new ShaderFilter(luminosityMaskShader);
+
+				// Apply the filter to the mask
+				_mask.filters = [maskFilter];
+			}
         }
     }

@@ -3407,7 +3436,7 @@
                     displayObject.alpha = _effectiveAlpha;
             }

-            if (blendModeChanged || displayObjectChanged)
+            if (blendModeChanged || displayObjectChanged && !blendShaderChanged)
             {
                 blendModeChanged = false;
                 if (_blendMode == "auto" && alpha < 1 && alpha > 0)
@@ -3415,8 +3444,36 @@
                 else if (_blendMode == "auto" && alpha == 1 || alpha == 0)
                     displayObject.blendMode = BlendMode.NORMAL;
                 else
-                    displayObject.blendMode = _blendMode;
+                    displayObject.blendMode = _blendMode;
             }
+
+			if (blendShaderChanged || displayObjectChanged)
+			{
+				// The graphic element's blendMode was set to a non-Flash
+				// blendMode. We mimic the look by instantiating the
+				// appropriate shader class and setting the blendShader
+				// property on the displayObject.
+				blendShaderChanged = false;
+				switch(_blendMode)
+				{
+					case "color":
+						displayObject.blendShader = new ColorShader();
+					case "colordodge":
+						displayObject.blendShader = new ColorDodgeShader();
+					case "colorburn":
+						displayObject.blendShader = new ColorBurnShader();
+					case "exclusion":
+						displayObject.blendShader = new ExclusionShader();
+					case "hue":
+						displayObject.blendShader = new HueShader();
+					case "luminosity":
+						displayObject.blendShader = new LuminosityShader();
+					case "saturation":
+						displayObject.blendShader = new SaturationShader();
+					case "softlight":
+						displayObject.blendShader = new SoftLightShader();
+				}
+			}

             if (filtersChanged || displayObjectChanged)
             {


If no map class is passed in (should only happen on deserialization, and the real source map is provided on readObject), pass an empty immutable map to super, which is less weird and probably better than just ignoring and forcibly not calling the super constructor, which is what was happening.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@6105 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/util/StreamableHashMap.as
+++ src/as/com/threerings/util/StreamableHashMap.as
@@ -27,6 +27,8 @@

 import com.threerings.util.Maps;
 import com.threerings.util.maps.ForwardingMap;
+import com.threerings.util.maps.HashMap;
+import com.threerings.util.maps.ImmutableMap;

 /**
  * A Map that can be sent over the wire, bearing in mind that all keys and values must
@@ -40,9 +42,7 @@
 {
     public function StreamableHashMap (keyClazz :Class = null)
     {
-        if (keyClazz != null) {
-            super(Maps.newMapOf(keyClazz));
-        }
+        super(keyClazz == null ? DEFAULT_MAP : Maps.newMapOf(keyClazz));
     }

     // documentation inherited from interface Streamable
@@ -73,5 +73,7 @@
             _source = Maps.newMapOf(String); // hope for the best
         }
     }
+
+    protected static const DEFAULT_MAP :Map = new ImmutableMap(new HashMap());
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20661
Author:   mhorn@adobe.com
Date:     2011-03-07T21:41:06.124806Z

Log Message:
-----------
ASdoc updates

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.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/spark/src/spark/globalization/supportClasses/CollatorBase.as</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="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/Path.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@1286018 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -2919,6 +2919,11 @@

     /**
      *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get layoutDirection():String
     {
@@ -2943,6 +2948,11 @@

     /**
      * @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function invalidateLayoutDirection():void
     {
@@ -4294,6 +4304,13 @@
     /**
      *  Used for the implementation of the ILayoutElement interface,
      *  returns the explicit of measured width pre-transform.
+     *
+     * @return The explicit measured height, pre-transform.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     protected function preferredWidthPreTransform():Number
     {
@@ -4302,7 +4319,14 @@

     /**
      *  Used for the implementation of the ILayoutElement interface,
-     *  returns the explicit of measured height pre-transform.
+     *  returns the explicit measured height pre-transform.
+     *
+     * @return The explicit measured height, pre-transform.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     protected function preferredHeightPreTransform():Number
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 18533
Author:   chiedozi@adobe.com
Date:     2010-11-10T22:15:24.428497Z

Log Message:
-----------
View is now a SkinnableContainer
Added an ActionScript skin for SkinnableContainer

QE notes:
Doc notes:
Bugs: SDK-28385
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.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/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as
@@ -0,0 +1,136 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 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 spark.skins.mobile
+{
+import spark.components.Group;
+import spark.components.SkinnableContainer;
+import spark.components.View;
+import spark.skins.mobile.supportClasses.MobileSkin;
+
+/**
+ *  Actionscript based skin for SkinnableContainer.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public class SkinnableContainerSkin extends MobileSkin
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     *
+     */
+    public function SkinnableContainerSkin()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  SkinParts
+    //
+    //--------------------------------------------------------------------------
+    /**
+     *  An optional skin part that defines the Group where the content
+     *  children get pushed into and laid out.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public var contentGroup:Group;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @copy spark.skins.spark.ApplicationSkin#hostComponent
+     */
+    public var hostComponent:SkinnableContainer; // SkinnableComponent will popuplate
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function commitCurrentState():void
+    {
+        super.commitCurrentState();
+
+        alpha = currentState.indexOf("disabled") == -1 ? 1 : 0.5;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        contentGroup = new Group();
+        contentGroup.id = "contentGroup";
+        contentGroup.left = contentGroup.right = contentGroup.top = contentGroup.bottom = 0;
+        contentGroup.minWidth = contentGroup.minHeight = 0;
+
+        addChild(contentGroup);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        measuredWidth = contentGroup.getPreferredBoundsWidth();
+        measuredHeight = contentGroup.getPreferredBoundsHeight();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        graphics.clear();
+
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        contentGroup.setLayoutBoundsSize(unscaledWidth, unscaledHeight);
+        contentGroup.setLayoutBoundsPosition(0, 0);
+
+        // Draw the background
+        var bgColor:uint = getStyle("backgroundColor");
+        var bgAlpha:Number = getStyle("backgroundAlpha");
+
+        graphics.beginFill(bgColor, bgAlpha);
+        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+        graphics.endFill();
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 7952
Author:   cframpto@adobe.com
Date:     2009-06-18T09:57:23.131767Z

Log Message:
-----------
PARB changes for RichEditableText, TextArea and TextInput

RichEditableText, TextArea
--------------------------
content:Object setter only for use by MXML compiler
textFlow:TextFlow getter/setter added
scrollToPosition -> scrollToRange()
getSelectionFormat() -> getFormatOfRange(requestedFormats:Vector.<String> = null, anchorPosition=-1,                  activePosition=-1):TextLayoutFormat
    If either position is -1, the current selection will be used.
setSelectionFormat() -> setFormatOfRange(format:TextLayoutFormat, anchorPosition=-1, activePosition=-1):void
    If either position is -1, the current selection will be used.
export() removed

RichEditableText, TextBase
--------------------------
autoSize removed
widthInChars defaults to NaN
heightInLines defaults to NaN
    If both are NaN, and not in scroller, it will autoSize.
    If both are NaN, and in scroller, widthInChars effectively 15, heightInLines effectively 10.
    If widthInChars is NaN and heightInLines is not, widthInChars effectively 1.
    If heightInLines is NaN and widthInChars is not, heightInLines effectively 1.
selectionVisibility:String -> selectionHighlighting:String
TextSelectionVisibiliy.as -> TextSelectionHightlighting.as
setSelection -> selectRange(anchor, active) and the args are no longer optional
selectAll() added

TextBase
--------
TextBase.as -> SkinnableTextBase.as
it will not support any non-inheriting styles
textView skin part -> textDisplay
widthInChars property removed and moved to TextInput and TextArea

Styles
-------
Renamed style selectionColor -> focusedTextSelectionColor
Renamed style unfocusedSelectionColor -> unfocusedTextSelectionColor
Renamed inactiveSelectionColor -> inactiveTextSelectionColor

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/TextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/SelectionFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/TextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as" copyfrom-rev="7834" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextSelectionVisibility.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/NumericStepperTextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextSelectionVisibility.as" copyfrom-rev="7834" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextSelectionHighlighting.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>

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

--- frameworks/projects/spark/src/spark/styles/metadata/SelectionFormatTextStyles.as
+++ frameworks/projects/spark/src/spark/styles/metadata/SelectionFormatTextStyles.as
@@ -17,7 +17,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Style(name="selectionColor", type="uint", format="Color", inherit="yes")]
+[Style(name="focusedTextSelectionColor", type="uint", format="Color", inherit="yes")]

 /**
  *  The color of text when the component is disabled.
@@ -27,7 +27,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Style(name="inactiveSelectionColor", type="uint", format="Color", inherit="yes")]
+[Style(name="inactiveTextSelectionColor", type="uint", format="Color", inherit="yes")]

 /**
  *  The color of text when the component is enabled but does not have focus.
@@ -37,4 +37,4 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Style(name="unfocusedSelectionColor", type="uint", format="Color", inherit="yes")]
+[Style(name="unfocusedTextSelectionColor", type="uint", format="Color", inherit="yes")]


Улучшение Asset

Улучшение Asset


instanciate a ParserOptions object is the one provided to the load* functions is null

--- src/aerys/minko/type/loader/SceneLoader.as
+++ src/aerys/minko/type/loader/SceneLoader.as
@@ -86,7 +86,7 @@
 			_data			= null;
 			_isComplete		= false;

-			_parserOptions	= parserOptions;
+			_parserOptions	= parserOptions || new ParserOptions();
 		}

 		public function load(urlRequest : URLRequest) : void
@@ -122,14 +122,15 @@

 		public function loadBytes(byteArray : ByteArray) : void
 		{
+			var startPosition : uint = byteArray.position;
+
 			if (_currentState != STATE_IDLE)
 				throw new Error('This controller is already loading an asset.');

 			_currentState = STATE_PARSING;
-
 			_progress.execute(this, 0.5);

-			if (_parserOptions.parser != null)
+			if (_parserOptions != null && _parserOptions.parser != null)
 			{
 				_parser = new (_parserOptions.parser)(_parserOptions);
 			}
@@ -140,6 +141,7 @@
 				for (var parserId : uint = 0; parserId < numRegisteredParser; ++parserId)
 				{
 					_parser = new REGISTERED_PARSERS[parserId](_parserOptions);
+					byteArray.position = startPosition;
 					if (_parser.isParsable(byteArray))
 						break;
 				}
@@ -147,6 +149,8 @@
 				if (parserId == numRegisteredParser)
 					throw new Error('No parser could be found for this datatype');
 			}
+
+			byteArray.position = startPosition;

 			_dependencies	 = _parser.getDependencies(byteArray);
 			_numDependencies = 0;


Fix singleton.

Fix singleton.

--- src/flash/tandem/model/ApplicationModel.as
+++ src/flash/tandem/model/ApplicationModel.as
@@ -54,10 +54,10 @@
     /**
      *  Constructor.
      */
-    public function ApplicationModel()
+    public function ApplicationModel(enforcer:SingletonEnforcer)
     {
-        if ( instance != null )
-            throw new Error( "Hey, I'm a singleton, please don't instantiate me!" )
+        if (!enforcer)
+            throw new Error("Can’t instantiate singleton directly." )

         instance = this
     }
@@ -73,10 +73,12 @@
     public static function getInstance() : ApplicationModel
     {
         if ( instance == null )
-            instance = new ApplicationModel()
+            instance = new ApplicationModel(new SingletonEnforcer())

             return instance
     }
 }

-}+}
+
+class SingletonEnforcer {}


Transferred from the Adobe Open Source Subversion Repository

Revision: 18072
Author:   chiedozi@adobe.com
Date:     2010-10-07T21:09:04.099363Z

Log Message:
-----------
PARB Changes to ViewNavigator feature set.  Changes summarized below:

View
active getter renamed to isActive
Removed context property from View and moved it to ViewNavigator

ViewNavigator
context property is now typed Object
navigationStack property now mx_internal in ViewNavigatorBase
factory parameter for push operations renamed to  viewClass
NavigationStack push and pop api names changed to match ViewNavigator methods
active getter renamed isActive
viewNavigator no longer dispatches a COMPLETE event
defaultTransitions are no longer skin parts.  They are now  mx_internal vars.

TabbedViewNavigator
No longer dispatches complete, instead dispatches IndexChangeEvent.CHANGE

ViewProxy
ViewProxy renamed to ViewDescriptor
persistedData renamed to persistenceData

QE notes:
Doc notes:
Bugs:
Reviewer: Ryan
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/ContainerDestructionPolicy.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewReturnObject.as</path>
<path kind="dir" action="M">/private/flex/sdk/branches/hero_private</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.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/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewProxy.as" copyfrom-rev="18044" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewDescriptor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewProxy.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/core/ContainerDestructionPolicy.as
+++ frameworks/projects/mobilecomponents/src/spark/core/ContainerDestructionPolicy.as
@@ -33,21 +33,9 @@
     //--------------------------------------------------------------------------

     /**
-     *  The container will always destroy its children when the container
-     *  deactivated.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public static const ALWAYS:String = "always";
-
-    /**
      *  The lifespan of the container's children will automatically
      *  be managed by the container based on the container's own
-     *  heuristic. The default implementation mimics that behavior of
-     *  ContainerDestructionPolicy.ALWAYS
+     *  heuristic.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 12969
Author:   egeorgie@adobe.com
Date:     2009-12-15T21:56:35.581732Z

Log Message:
-----------
Cleanup FIXMEs.

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Hans
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ToggleButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Rect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListItemDragProxy.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as
@@ -17,13 +17,12 @@
 /**
  *  @private
  *  The LayoutElementHelper class is for internal use only.
+ *  TODO (egeorgie): move to a more general place, this is not specific to the LayoutElementHelper
  */
 public class LayoutElementHelper
 {
     include "../../core/Version.as";

-    // FIXME (egeorgie): move to a more general place, this is not specific to the LayoutElementHelper
-
     //--------------------------------------------------------------------------
     //
     //  Class methods
@@ -69,7 +68,6 @@
         return result[0];
     }

-    // FIXME (egeorgie): Duplicated code! Share this code with the Flex3 Canvas:
     /**
      *  @private
      *  Parses a constraint expression, like left="col1:10"


Issue #33 initialized serializers and de-serializers in codec chain

--- jetclient-as3/src/main/flex/org/menacheri/jetclient/protocol/impl/AMF3Protocol.as
+++ jetclient-as3/src/main/flex/org/menacheri/jetclient/protocol/impl/AMF3Protocol.as
@@ -27,7 +27,9 @@

 		public function AMF3Protocol()
 		{
-
+			lengthFieldPrepender = new LengthFieldPrepender();
+			amfSerializer = new AMFSerializer();
+			amfDeSerializer = new AMFDeserializer();
 		}

 		public function getName():String


Modified for BufferInitializer

Modified for BufferInitializer

--- src/org/flintparticles/integration/away3d/v4/A3D4Renderer.as
+++ src/org/flintparticles/integration/away3d/v4/A3D4Renderer.as
@@ -63,10 +63,13 @@
 		 * @param container An Away3D object container. The particle display
 		 * objects are created inside this object container.
 		 */
-		public function A3D4Renderer( container:ObjectContainer3D )
+		///Added by Michael--second param defines recycling mode
+		private var _recycleParticles:Boolean=false;
+		public function A3D4Renderer( container:ObjectContainer3D ,recycleParticles:Boolean=false)
 		{
 			super();
 			_container = container;
+			_recycleParticles=recycleParticles;
 		}

 		/**
@@ -134,6 +137,7 @@
 		 */
 		override protected function addParticle( particle:Particle ):void
 		{
+
 			if( particle.image is ObjectContainer3D )
 			{
 				_container.addChild( ObjectContainer3D( particle.image ) );


M Add 2 useless computations to the relevant shader visitor: mul(0, x), mul(x, 0)

--- src/aerys/minko/render/shader/compiler/graph/visitors/RemoveUselessComputation.as
+++ src/aerys/minko/render/shader/compiler/graph/visitors/RemoveUselessComputation.as
@@ -60,9 +60,9 @@
 					break;

 				case Instruction.MUL:
-					if (arg1Value == 1)
+					if (arg1Value == 1 || arg2Value == 0)
 						replaceInParentsAndSwizzle(instruction, instruction.argument2, instruction.component2);
-					else if (arg2Value == 1)
+					else if (arg1Value == 0 || arg2Value == 1)
 						replaceInParentsAndSwizzle(instruction, instruction.argument1, instruction.component1);

 					break;