Transferred from the Adobe Open Source Subversion Repository

Revision: 19231
Author:   jszeto@adobe.com
Date:     2010-12-09T19:25:51.943016Z

Log Message:
-----------
Mobile Skin Fixes

Merging in revisions 18989-19158 from hero_skin_sandbox.

The following component skins have been updated and 320 DPI skins added:

Button
CheckBox
RadioButton
TextInput
TextArea
ActionBar
HSlider

Updating MobileSkins test project

QE notes: baseline regen
Doc notes: none
Bugs: none
Reviewer: Jason San Jose, Tom Krakit
Tests run: full cyclone
Is noteworthy for integration: yes, updated skins!

Modified Paths:
--------------
129 paths were modified

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as
@@ -11,566 +11,571 @@

 package spark.skins.mobile.supportClasses
 {
-
-import flash.display.DisplayObject;
-import flash.display.GradientType;
-import flash.display.Graphics;
-import flash.events.Event;
-import flash.events.EventDispatcher;
-import flash.geom.Matrix;
-import flash.geom.Point;
-import flash.text.TextField;
-import flash.text.TextFormat;
-import flash.text.TextFormatAlign;
-
-import mx.core.IFlexDisplayObject;
-import mx.core.ILayoutElement;
-import mx.core.IUITextField;
-import mx.core.UITextField;
-import mx.core.mx_internal;
-import mx.events.FlexEvent;
-import mx.managers.LayoutManager;
-import mx.states.SetProperty;
-import mx.states.State;
-import mx.utils.ColorUtil;
-
-import spark.components.Group;
-import spark.components.IconPlacement;
-import spark.components.supportClasses.ButtonBase;
-import spark.components.supportClasses.StyleableTextField;
-import spark.primitives.BitmapImage;
-import spark.skins.mobile.supportClasses.MobileSkin;
-
-use namespace mx_internal;
-
-/*
-ISSUES:
-- should we support textAlign (if not, remove extra code)
-*/
-/**
- *  Actionscript based skin for mobile applications. The skin supports
- *  icon and iconPlacement. It uses a couple of FXG classes to
- *  implement the vector drawing.
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
- */
-public class ButtonSkinBase extends MobileSkin
-{
-    //--------------------------------------------------------------------------
-    //
-    //  Constructor
-    //
-    //--------------------------------------------------------------------------

-    public function ButtonSkinBase()
+    import flash.display.DisplayObject;
+    import flash.display.GradientType;
+    import flash.display.Graphics;
+    import flash.events.Event;
+    import flash.events.EventDispatcher;
+    import flash.geom.Matrix;
+    import flash.geom.Point;
+    import flash.text.TextField;
+    import flash.text.TextFormat;
+    import flash.text.TextFormatAlign;
+    import flash.text.TextLineMetrics;
+
+    import mx.core.IFlexDisplayObject;
+    import mx.core.ILayoutElement;
+    import mx.core.IUITextField;
+    import mx.core.UITextField;
+    import mx.core.mx_internal;
+    import mx.events.FlexEvent;
+    import mx.managers.LayoutManager;
+    import mx.states.SetProperty;
+    import mx.states.State;
+    import mx.utils.ColorUtil;
+
+    import spark.components.Group;
+    import spark.components.IconPlacement;
+    import spark.components.supportClasses.ButtonBase;
+    import spark.components.supportClasses.StyleableTextField;
+    import spark.primitives.BitmapImage;
+    import spark.skins.mobile.supportClasses.MobileSkin;
+
+    use namespace mx_internal;
+
+    /*
+    ISSUES:
+    - should we support textAlign (if not, remove extra code)
+    */
+    /**
+     *  Actionscript based skin for mobile applications. The skin supports
+     *  icon and iconPlacement. It uses a couple of FXG classes to
+     *  implement the vector drawing.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public class ButtonSkinBase extends MobileSkin
     {
-        super();
-
-        setStyle("textAlign", "center");
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Variables
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  iconDisplay skin part.
-     */
-    private var iconChanged:Boolean = false;
-    private var iconInstance:Object;    // Can be either DisplayObject or BitmapImage
-    private var iconHolder:Group;       // Needed when iconInstance is a BitmapImage
-    private var _icon:Object;           // The currently set icon, can be Class, DisplayObject, URL
-
-    /**
-     *  labelDisplay skin part.
-     */
-    public var labelDisplay:StyleableTextField;
-
-    public var labelDisplayShadow:StyleableTextField;
-
-    /**
-     *  If true, then create the iconDisplay using the icon style
-     *
-     *  @default true
-     */
-    protected var useIconStyle:Boolean = true;
-
-
-    //--------------------------------------------------------------------------
-    //
-    //  Layout variables
-    //
-    //--------------------------------------------------------------------------
-
-    protected var layoutBorderSize:uint;
-
-    protected var layoutGap:int;
-
-    protected var layoutPaddingLeft:int;
-
-    protected var layoutPaddingRight:int;
-
-    protected var layoutPaddingTop:int;
-
-    protected var layoutPaddingBottom:int;
-
-    //--------------------------------------------------------------------------
-    //
-    //  Overridden properties
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     * @copy spark.skins.spark.ApplicationSkin#hostComponent
-     */
-    public var hostComponent:ButtonBase; // 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
-    {
-        labelDisplay = StyleableTextField(createInFontContext(StyleableTextField));
-        labelDisplay.styleName = this;
-        labelDisplay.addEventListener(FlexEvent.VALUE_COMMIT, labelDisplay_valueCommitHandler);
-
-        labelDisplayShadow = StyleableTextField(createInFontContext(StyleableTextField));
-        labelDisplayShadow.styleName = this;
-
-        labelDisplayShadow.colorName = "textShadowColor";
-
-        addChild(labelDisplayShadow);
-        addChild(labelDisplay);
-    }
-
-    /**
-     *  @private
-     */
-    override public function styleChanged(styleProp:String):void
-    {
-        var allStyles:Boolean = !styleProp || styleProp == "styleName";
-
-        if (allStyles || styleProp == "iconPlacement")
-        {
+        //--------------------------------------------------------------------------
+        //
+        //  Constructor
+        //
+        //--------------------------------------------------------------------------
+
+        public function ButtonSkinBase()
+        {
+            super();
+
+            setStyle("textAlign", "center");
+        }
+
+        //--------------------------------------------------------------------------
+        //
+        //  Variables
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  iconDisplay skin part.
+         */
+        private var iconChanged:Boolean = false;
+        private var iconInstance:Object;    // Can be either DisplayObject or BitmapImage
+        private var iconHolder:Group;       // Needed when iconInstance is a BitmapImage
+        private var _icon:Object;           // The currently set icon, can be Class, DisplayObject, URL
+
+        /**
+         *  labelDisplay skin part.
+         */
+        public var labelDisplay:StyleableTextField;
+
+        public var labelDisplayShadow:StyleableTextField;
+
+        /**
+         *  If true, then create the iconDisplay using the icon style
+         *
+         *  @default true
+         */
+        protected var useIconStyle:Boolean = true;
+
+        //--------------------------------------------------------------------------
+        //
+        //  Layout variables
+        //
+        //--------------------------------------------------------------------------
+
+        protected var layoutBorderSize:uint;
+
+        protected var layoutGap:int;
+
+        protected var layoutPaddingLeft:int;
+
+        protected var layoutPaddingRight:int;
+
+        protected var layoutPaddingTop:int;
+
+        protected var layoutPaddingBottom:int;
+
+        //--------------------------------------------------------------------------
+        //
+        //  Overridden properties
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         * @copy spark.skins.spark.ApplicationSkin#hostComponent
+         */
+        public var hostComponent:ButtonBase; // SkinnableComponent will popuplate
+
+        //--------------------------------------------------------------------------
+        //
+        //  Overridden methods
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  @private
+         */
+        override protected function commitCurrentState():void
+        {
+            super.commitCurrentState();
+
+            commitDisabled(currentState.indexOf("disabled") >= 0);
+        }
+
+        protected function commitDisabled(isDisabled:Boolean):void
+        {
+            alpha = isDisabled ? 0.5 : 1;
+        }
+
+        /**
+         *  @private
+         */
+        override protected function createChildren():void
+        {
+            labelDisplay = StyleableTextField(createInFontContext(StyleableTextField));
+            labelDisplay.styleName = this;
+            labelDisplay.addEventListener(FlexEvent.VALUE_COMMIT, labelDisplay_valueCommitHandler);
+
+            labelDisplayShadow = StyleableTextField(createInFontContext(StyleableTextField));
+            labelDisplayShadow.styleName = this;
+            labelDisplayShadow.colorName = "textShadowColor";
+
+            addChild(labelDisplayShadow);
+            addChild(labelDisplay);
+        }
+
+        /**
+         *  @private
+         */
+        override public function styleChanged(styleProp:String):void
+        {
+            var allStyles:Boolean = !styleProp || styleProp == "styleName";
+
+            if (allStyles || styleProp == "iconPlacement")
+            {
+                invalidateSize();
+                invalidateDisplayList();
+            }
+
+            if (useIconStyle && (allStyles || styleProp == "icon"))
+            {
+                iconChanged = true;
+                invalidateProperties();
+            }
+
+            if (styleProp == "textShadowAlpha")
+            {
+                invalidateDisplayList();
+            }
+
+            super.styleChanged(styleProp);
+        }
+
+        /**
+         *  @private
+         */
+        override protected function commitProperties():void
+        {
+            super.commitProperties();
+
+            if (iconChanged)
+            {
+                iconChanged = false;
+                if (useIconStyle)
+                    setIcon(getStyle("icon"));
+            }
+        }
+
+        /**
+         *  @private
+         */
+        override protected function measure():void
+        {
+            super.measure();
+
+            var iconPlacement:String = getStyle("iconPlacement");
+
+            var textWidth:Number = 0;
+            var textHeight:Number = 0;
+
+            // reset text if it was truncated before.
+            if (hostComponent && labelDisplay.isTruncated)
+                labelDisplay.text = hostComponent.label;
+            labelDisplay.commitStyles();
+
+            if (hostComponent && hostComponent.label != "")
+            {
+                // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
+                //                  +1 originates from MX Button without explaination
+                var textSize:Point = labelDisplay.measuredTextSize;
+                textWidth = textSize.x + 1;
+                textHeight = textSize.y;
+            }
+            else
+            {
+                textHeight = measureText("Wj").height + UITextField.TEXT_HEIGHT_PADDING;
+            }
+
+            var iconDisplay:DisplayObject = getIconDisplay();
+            var iconWidth:Number = iconDisplay ? iconDisplay.width : 0;
+            var iconHeight:Number = iconDisplay ? iconDisplay.height : 0;
+            var w:Number = 0;
+            var h:Number = 0;
+
+            if (iconDisplay is ILayoutElement)
+            {
+                iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth(false);
+                iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight(false);
+            }
+
+            if (iconPlacement == IconPlacement.LEFT ||
+                iconPlacement == IconPlacement.RIGHT)
+            {
+                w = textWidth + iconWidth;
+                if (textWidth && iconWidth)
+                    w += layoutGap;
+                h = Math.max(textHeight, iconHeight);
+            }
+            else
+            {
+                w = Math.max(textWidth, iconWidth);
+                h = textHeight + iconHeight;
+                if (textHeight && iconHeight)
+                    h += layoutGap;
+            }
+
+            w += layoutPaddingLeft + layoutPaddingRight;
+            h += layoutPaddingTop + layoutPaddingBottom;
+
+            measuredWidth = Math.max(w, layoutMeasuredWidth);
+            measuredMinHeight = measuredHeight = Math.max(h, layoutMeasuredHeight);
+            measuredMinWidth = iconWidth + layoutPaddingLeft + layoutPaddingRight;
+        }
+
+        /**
+         *  @private
+         */
+        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+        {
+            var labelWidth:Number = 0;
+            var labelHeight:Number = 0;
+
+            var labelX:Number = 0;
+            var labelY:Number = 0;
+
+            var iconWidth:Number = 0;
+            var iconHeight:Number = 0;
+
+            var iconX:Number = 0;
+            var iconY:Number = 0;
+
+            var horizontalGap:Number = 0;
+            var verticalGap:Number = 0;
+
+            var iconPlacement:String = getStyle("iconPlacement");
+
+            var textWidth:Number = 0;
+            var textHeight:Number = 0;
+            var textDescent:Number = 0;
+
+            // reset text if it was truncated before.
+            if (hostComponent && labelDisplay.isTruncated)
+                labelDisplay.text = hostComponent.label;
+            labelDisplay.commitStyles();
+
+            if (hostComponent && hostComponent.label != "")
+            {
+                // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
+                //                  +1 originates from MX Button without explaination
+                var textSize:Point = labelDisplay.measuredTextSize;
+                textWidth = textSize.x + 1;
+                textHeight = textSize.y;
+                textDescent = labelDisplay.getLineMetrics(0).descent;
+            }
+            else
+            {
+                var metrics:TextLineMetrics = measureText("Wj");
+                textHeight = metrics.height + UITextField.TEXT_HEIGHT_PADDING;
+                textDescent = metrics.descent;
+            }
+
+            var textAlign:String = "center"; // getStyle("textAlign");
+            // Map new Spark values that might be set in a selector
+            // affecting both Halo and Spark components.
+            /*if (textAlign == "start")
+            textAlign = TextFormatAlign.LEFT;
+            else if (textAlign == "end")
+            textAlign = TextFormatAlign.RIGHT;*/
+
+            var viewWidth:Number = unscaledWidth;
+            var viewHeight:Number = unscaledHeight;
+
+            var iconDisplay:DisplayObject = getIconDisplay();
+            if (iconDisplay)
+            {
+                if (iconDisplay is ILayoutElement)
+                {
+                    iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth();
+                    iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight();
+                }
+                else
+                {
+                    iconWidth = iconDisplay.width;
+                    iconHeight = iconDisplay.height;
+                }
+            }
+
+            if (iconPlacement == IconPlacement.LEFT ||
+                iconPlacement == IconPlacement.RIGHT)
+            {
+                horizontalGap = layoutGap;
+
+                if (iconWidth == 0 || textWidth == 0)
+                    horizontalGap = 0;
+
+                if (textWidth > 0)
+                {
+                    labelWidth =
+                        Math.max(Math.min(viewWidth - iconWidth - horizontalGap -
+                            layoutPaddingLeft - layoutPaddingRight, textWidth), 0);
+                }
+                else
+                {
+                    labelWidth = 0;
+                }
+                labelHeight = Math.min(viewHeight, textHeight);
+
+                if (textAlign == "left")
+                {
+                    labelX += layoutPaddingLeft;
+                }
+                else if (textAlign == "right")
+                {
+                    labelX += (viewWidth - labelWidth - iconWidth -
+                        horizontalGap - layoutPaddingRight);
+                }
+                else // "center" -- default value
+                {
+                    labelX += ((viewWidth - labelWidth - iconWidth -
+                        horizontalGap - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
+                }
+
+                if (iconPlacement == IconPlacement.LEFT)
+                {
+                    labelX += iconWidth + horizontalGap;
+                    iconX = labelX - (iconWidth + horizontalGap);
+                }
+                else
+                {
+                    iconX  = labelX + labelWidth + horizontalGap;
+                }
+
+                // FIXME (jasonsj): enforcement of layoutPaddingTop && layoutPaddingBottom for text
+                iconY  = ((viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom) / 2) + layoutPaddingTop;
+                labelY = ((viewHeight - labelHeight + textDescent - StyleableTextField.TEXT_HEIGHT_PADDING) / 2);
+            }
+            else
+            {
+                verticalGap = layoutGap;
+
+                if (iconHeight == 0 || !hostComponent || hostComponent.label == "")
+                    verticalGap = 0;
+
+                if (textWidth > 0)
+                {
+                    labelWidth = Math.max(viewWidth - layoutPaddingLeft - layoutPaddingRight, 0);
+                    labelHeight =
+                        Math.min(viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom - verticalGap, textHeight);
+                }
+                else
+                {
+                    labelWidth = 0;
+                    labelHeight = 0;
+                }
+
+                labelX = layoutPaddingLeft;
+
+                if (textAlign == "left")
+                {
+                    iconX += layoutPaddingLeft;
+                }
+                else if (textAlign == "right")
+                {
+                    iconX += Math.max(viewWidth - iconWidth - layoutPaddingRight, layoutPaddingLeft);
+                }
+                else
+                {
+                    iconX += ((viewWidth - iconWidth - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
+                }
+
+                if (iconPlacement == IconPlacement.BOTTOM)
+                {
+                    labelY += ((viewHeight - labelHeight - iconHeight -
+                        layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
+                    iconY += labelY + labelHeight + verticalGap;
+                }
+                else
+                {
+                    iconY += ((viewHeight - labelHeight - iconHeight -
+                        layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
+                    labelY += iconY + iconHeight + verticalGap;
+                }
+            }
+
+            labelX = Math.max(0, Math.round(labelX));
+            labelY = Math.max(0, Math.round(labelY));
+
+            labelDisplay.commitStyles();
+            setElementSize(labelDisplay, labelWidth, labelHeight);
+            setElementPosition(labelDisplay, labelX, labelY);
+
+            if (textWidth > labelWidth)
+            {
+                labelDisplay.truncateToFit();
+            }
+
+            labelDisplayShadow.alpha = getStyle("textShadowAlpha");
+            labelDisplayShadow.commitStyles();
+
+            // FIXME (jasonsj): this resize causes scaling issues at 1.5x and 2x
+            // artifacts show below ActionBar buttons
+            setElementSize(labelDisplayShadow, labelWidth, labelHeight);
+            setElementPosition(labelDisplayShadow, labelX, labelY + 1);
+
+            // if labelDisplay is truncated, then push it down here as well.
+            // otherwise, it would have gotten pushed in the labelDisplay_valueCommitHandler()
+            if (labelDisplay.isTruncated)
+                labelDisplayShadow.text = labelDisplay.text;
+
+            if (iconDisplay)
+            {
+                setElementSize(iconDisplay, iconWidth, iconHeight);
+                setElementPosition(iconDisplay, Math.max(0, Math.round(iconX)), Math.max(0, Math.round(iconY)));
+            }
+
+            // draw chromeColor after parts have been positioned
+            super.updateDisplayList(unscaledWidth, unscaledHeight);
+        }
+
+        //--------------------------------------------------------------------------
+        //
+        //  Class methods
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  The current skin part that displays the icon.
+         *  If the icon is a Class, then the iconDisplay is an instance of that class.
+         *  If the icon is a DisplayObject instance, then the iconDisplay is that instance.
+         *  If the icon is URL, then iconDisplay is the Group that holds the BitmapImage with that URL.
+         *
+         *  @see #setIcon
+         *  @see #useIconStyle
+         */
+        protected function getIconDisplay():DisplayObject
+        {
+            return iconHolder ? iconHolder : iconInstance as DisplayObject;
+        }
+
+        /**
+         *  Sets the current icon for the iconDisplay skin part.
+         *  The iconDisplay skin part is created/set-up on demand.
+         *
+         *  @see #getIconDisplay
+         *  @see #useIconStyle
+         */
+        protected function setIcon(icon:Object):void
+        {
+            if (_icon == icon)
+                return;
+            _icon = icon;
+
+            // Clean-up the iconInstance
+            if (iconInstance)
+            {
+                if (iconHolder)
+                    iconHolder.removeAllElements();
+                else
+                    this.removeChild(iconInstance as DisplayObject);
+            }
+            iconInstance = null;
+
+            // Set-up the iconHolder
+            var needsHolder:Boolean = icon && !(icon is Class) && !(icon is DisplayObject);
+            if (needsHolder && !iconHolder)
+            {
+                iconHolder = new Group();
+                this.addChildAt(iconHolder, 0);
+            }
+            else if (!needsHolder && iconHolder)
+            {
+                this.removeChild(iconHolder);
+                iconHolder = null;
+            }
+
+            // Set-up the icon
+            if (icon)
+            {
+                if (needsHolder)
+                {
+                    iconInstance = new BitmapImage();
+                    iconInstance.source = icon;
+                    iconHolder.addElementAt(iconInstance as BitmapImage, 0);
+                }
+                else
+                {
+                    if (icon is Class)
+                        iconInstance = new (Class(icon))();
+                    else
+                        iconInstance = icon;
+
+                    addChildAt(iconInstance as DisplayObject, 0);
+                }
+            }
+
+            // explicitly invalidate, since addChild/removeChild don't invalidate for us
             invalidateSize();
             invalidateDisplayList();
         }

-        if (useIconStyle && (allStyles || styleProp == "icon"))
-        {
-            iconChanged = true;
-            invalidateProperties();
-        }
-
-        if (styleProp == "textShadowAlpha")
-        {
+        //--------------------------------------------------------------------------
+        //
+        //  Event Handlers
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  @private
+         */
+        private function labelDisplay_valueCommitHandler(event:FlexEvent):void
+        {
+            labelDisplayShadow.text = labelDisplay.text;
+            invalidateSize();
             invalidateDisplayList();
         }
-
-        super.styleChanged(styleProp);
     }
-
-    /**
-     *  @private
-     */
-    override protected function commitProperties():void
-    {
-        super.commitProperties();
-
-        if (iconChanged)
-        {
-            iconChanged = false;
-            if (useIconStyle)
-                setIcon(getStyle("icon"));
-        }
-    }
-
-    /**
-     *  @private
-     */
-    override protected function measure():void
-    {
-        super.measure();
-
-        var iconPlacement:String = getStyle("iconPlacement");
-
-        var textWidth:Number = 0;
-        var textHeight:Number = 0;
-
-        // reset text if it was truncated before.
-        if (hostComponent && labelDisplay.isTruncated)
-            labelDisplay.text = hostComponent.label;
-        labelDisplay.commitStyles();
-
-        if (hostComponent && hostComponent.label != "")
-        {
-            // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
-            //                  +1 originates from MX Button without explaination
-            var textSize:Point = labelDisplay.measuredTextSize;
-            textWidth = textSize.x + 1;
-            textHeight = textSize.y;
-        }
-        else
-        {
-            textHeight = measureText("Wj").height + UITextField.TEXT_HEIGHT_PADDING;
-        }
-
-        var iconDisplay:DisplayObject = getIconDisplay();
-        var iconWidth:Number = iconDisplay ? iconDisplay.width : 0;
-        var iconHeight:Number = iconDisplay ? iconDisplay.height : 0;
-        var w:Number = 0;
-        var h:Number = 0;
-
-        if (iconDisplay is ILayoutElement)
-        {
-            iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth(false);
-            iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight(false);
-        }
-
-        if (iconPlacement == IconPlacement.LEFT ||
-            iconPlacement == IconPlacement.RIGHT)
-        {
-            w = textWidth + iconWidth;
-            if (textWidth && iconWidth)
-                w += layoutGap; //getStyle("horizontalGap");
-            h = Math.max(textHeight, iconHeight);
-        }
-        else
-        {
-            w = Math.max(textWidth, iconWidth);
-            h = textHeight + iconHeight;
-            if (textHeight && iconHeight)
-                h += layoutGap; // getStyle("verticalGap");
-        }
-
-        w += layoutPaddingLeft + layoutPaddingRight; //getStyle("paddingLeft") + getStyle("paddingRight");
-        h += layoutPaddingTop + layoutPaddingBottom; //getStyle("paddingTop") + getStyle("paddingBottom");
-
-        measuredWidth = Math.max(w, layoutMeasuredWidth);
-        measuredMinHeight = measuredHeight = h;
-        measuredMinWidth = iconWidth + layoutPaddingLeft + layoutPaddingRight;
-    }
-
-    /**
-     *  @private
-     *  CheckBox <code>chromeColor</code> is flat, no gradient.
-     */
-    override protected function beginChromeColorFill(chromeColorGraphics:Graphics):void
-    {
-        // solid color fill for selectable buttons
-        chromeColorGraphics.beginFill(getChromeColor());
-    }
-
-    /**
-     *  @private
-     */
-    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        var labelWidth:Number = 0;
-        var labelHeight:Number = 0;
-
-        var labelX:Number = 0;
-        var labelY:Number = 0;
-
-        var iconWidth:Number = 0;
-        var iconHeight:Number = 0;
-
-        var iconX:Number = 0;
-        var iconY:Number = 0;
-
-        var horizontalGap:Number = 0;
-        var verticalGap:Number = 0;
-
-        var iconPlacement:String = getStyle("iconPlacement");
-
-        var textWidth:Number = 0;
-        var textHeight:Number = 0;
-
-        // reset text if it was truncated before.
-        if (hostComponent && labelDisplay.isTruncated)
-            labelDisplay.text = hostComponent.label;
-        labelDisplay.commitStyles();
-
-        if (hostComponent && hostComponent.label != "")
-        {
-            // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
-            //                  +1 originates from MX Button without explaination
-            var textSize:Point = labelDisplay.measuredTextSize;
-            textWidth = textSize.x + 1;
-            textHeight = textSize.y;
-        }
-        else
-        {
-            textHeight = measureText("Wj").height + UITextField.TEXT_HEIGHT_PADDING;
-        }
-
-        var textAlign:String = "center"; // getStyle("textAlign");
-        // Map new Spark values that might be set in a selector
-        // affecting both Halo and Spark components.
-        /*if (textAlign == "start")
-        textAlign = TextFormatAlign.LEFT;
-        else if (textAlign == "end")
-        textAlign = TextFormatAlign.RIGHT;*/
-
-        var viewWidth:Number = unscaledWidth;
-        var viewHeight:Number = unscaledHeight;
-
-        var iconDisplay:DisplayObject = getIconDisplay();
-        if (iconDisplay)
-        {
-            if (iconDisplay is ILayoutElement)
-            {
-                iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth();
-                iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight();
-            }
-            else
-            {
-                iconWidth = iconDisplay.width;
-                iconHeight = iconDisplay.height;
-            }
-        }
-
-        if (iconPlacement == IconPlacement.LEFT ||
-            iconPlacement == IconPlacement.RIGHT)
-        {
-            horizontalGap = layoutGap;
-
-            if (iconWidth == 0 || textWidth == 0)
-                horizontalGap = 0;
-
-            if (textWidth > 0)
-            {
-                labelWidth =
-                    Math.max(Math.min(viewWidth - iconWidth - horizontalGap -
-                        layoutPaddingLeft - layoutPaddingRight, textWidth), 0);
-            }
-            else
-            {
-                labelWidth = 0;
-            }
-            labelHeight = Math.min(viewHeight, textHeight);
-
-            if (textAlign == "left")
-            {
-                labelX += layoutPaddingLeft;
-            }
-            else if (textAlign == "right")
-            {
-                labelX += (viewWidth - labelWidth - iconWidth -
-                    horizontalGap - layoutPaddingRight);
-            }
-            else // "center" -- default value
-            {
-                labelX += ((viewWidth - labelWidth - iconWidth -
-                    horizontalGap - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
-            }
-
-            if (iconPlacement == IconPlacement.LEFT)
-            {
-                labelX += iconWidth + horizontalGap;
-                iconX = labelX - (iconWidth + horizontalGap);
-            }
-            else
-            {
-                iconX  = labelX + labelWidth + horizontalGap;
-            }
-
-            iconY  = ((viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom) / 2) + layoutPaddingTop;
-            labelY = ((viewHeight - labelHeight - layoutPaddingTop - layoutPaddingBottom) / 2) + layoutPaddingTop;
-        }
-        else
-        {
-            verticalGap = layoutGap;
-
-            if (iconHeight == 0 || !hostComponent || hostComponent.label == "")
-                verticalGap = 0;
-
-            if (textWidth > 0)
-            {
-                labelWidth = Math.max(viewWidth - layoutPaddingLeft - layoutPaddingRight, 0);
-                labelHeight =
-                    Math.min(viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom - verticalGap, textHeight);
-            }
-            else
-            {
-                labelWidth = 0;
-                labelHeight = 0;
-            }
-
-            labelX = layoutPaddingLeft;
-
-            if (textAlign == "left")
-            {
-                iconX += layoutPaddingLeft;
-            }
-            else if (textAlign == "right")
-            {
-                iconX += Math.max(viewWidth - iconWidth - layoutPaddingRight, layoutPaddingLeft);
-            }
-            else
-            {
-                iconX += ((viewWidth - iconWidth - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
-            }
-
-            if (iconPlacement == IconPlacement.BOTTOM)
-            {
-                labelY += ((viewHeight - labelHeight - iconHeight -
-                    layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
-                iconY += labelY + labelHeight + verticalGap;
-            }
-            else
-            {
-                iconY += ((viewHeight - labelHeight - iconHeight -
-                    layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
-                labelY += iconY + iconHeight + verticalGap;
-            }
-        }
-
-        labelDisplay.commitStyles();
-        setElementSize(labelDisplay, labelWidth, labelHeight);
-        setElementPosition(labelDisplay, Math.max(0, Math.round(labelX)), Math.max(0, Math.round(labelY)));
-
-        if (textWidth > labelWidth)
-        {
-            labelDisplay.truncateToFit();
-        }
-
-        labelDisplayShadow.alpha = getStyle("textShadowAlpha");
-        labelDisplayShadow.commitStyles();
-        setElementSize(labelDisplayShadow, labelWidth, labelHeight);
-        setElementPosition(labelDisplayShadow, Math.max(0, Math.round(labelX)), Math.max(0, Math.round(labelY + 1)));
-
-        // if labelDisplay is truncated, then push it down here as well.
-        // otherwise, it would have gotten pushed in the labelDisplay_valueCommitHandler()
-        if (labelDisplay.isTruncated)
-            labelDisplayShadow.text = labelDisplay.text;
-
-        if (iconDisplay)
-        {
-            setElementSize(iconDisplay, iconWidth, iconHeight);
-            setElementPosition(iconDisplay, Math.max(0, Math.round(iconX)), Math.max(0, Math.round(iconY)));
-        }
-
-        // draw chromeColor after parts have been positioned
-        super.updateDisplayList(unscaledWidth, unscaledHeight);
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Class methods
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  The current skin part that displays the icon.
-     *  If the icon is a Class, then the iconDisplay is an instance of that class.
-     *  If the icon is a DisplayObject instance, then the iconDisplay is that instance.
-     *  If the icon is URL, then iconDisplay is the Group that holds the BitmapImage with that URL.
-     *
-     *  @see #setIcon
-     *  @see #useIconStyle
-     */
-    protected function getIconDisplay():DisplayObject
-    {
-        return iconHolder ? iconHolder : iconInstance as DisplayObject;
-    }
-
-    /**
-     *  Sets the current icon for the iconDisplay skin part.
-     *  The iconDisplay skin part is created/set-up on demand.
-     *
-     *  @see #getIconDisplay
-     *  @see #useIconStyle
-     */
-    protected function setIcon(icon:Object):void
-    {
-        if (_icon == icon)
-            return;
-        _icon = icon;
-
-        // Clean-up the iconInstance
-        if (iconInstance)
-        {
-            if (iconHolder)
-                iconHolder.removeAllElements();
-            else
-                this.removeChild(iconInstance as DisplayObject);
-        }
-        iconInstance = null;
-
-        // Set-up the iconHolder
-        var needsHolder:Boolean = icon && !(icon is Class) && !(icon is DisplayObject);
-        if (needsHolder && !iconHolder)
-        {
-            iconHolder = new Group();
-            this.addChildAt(iconHolder, 0);
-        }
-        else if (!needsHolder && iconHolder)
-        {
-            this.removeChild(iconHolder);
-            iconHolder = null;
-        }
-
-        // Set-up the icon
-        if (icon)
-        {
-            if (needsHolder)
-            {
-                iconInstance = new BitmapImage();
-                iconInstance.source = icon;
-                iconHolder.addElementAt(iconInstance as BitmapImage, 0);
-            }
-            else
-            {
-                if (icon is Class)
-                    iconInstance = new (Class(icon))();
-                else
-                    iconInstance = icon;
-
-                addChildAt(iconInstance as DisplayObject, 0);
-            }
-        }
-
-        // explicitly invalidate, since addChild/removeChild don't invalidate for us
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Event Handlers
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    private function labelDisplay_valueCommitHandler(event:FlexEvent):void
-    {
-        labelDisplayShadow.text = labelDisplay.text;
-        invalidateSize();
-        invalidateDisplayList();
-    }
-}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 21789
Author:   tkraikit@adobe.com
Date:     2011-08-03T06:18:54.848967Z

Log Message:
-----------
DateSpinner changes:
* refactoring for cleaner organization
* minor fixes to min and max date handling and minuteStepSize handling
* updated REGEXP for globalization (fixes ko_KR and en_SG in DATE_AND_TIME mode)

QE notes: n/a
Doc notes: n/a
Bugs: n/a
Reviewer: Jason Szeto
Tests run: checkintests, cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateAndTimeRangeList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/globalization/supportClasses/DateTimeFormatterEx.as</path>

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

--- frameworks/projects/spark/src/spark/globalization/supportClasses/DateTimeFormatterEx.as
+++ frameworks/projects/spark/src/spark/globalization/supportClasses/DateTimeFormatterEx.as
@@ -77,8 +77,7 @@
         /(^(?:[^'m]*(?:'[^']*')*[^m']*)*)(m+('分'|分|'분'|분)?)/;
     private static const REGEXP_SECOND:RegExp =
         /(^(?:[^'s]*(?:'[^']*')*[^s']*)*)(s+('秒'|秒|'초'|초)?)/;
-    private static const REGEXP_AMPM:RegExp =
-        /(^(?:[^'a]*(?:'[^']*')*[^a']*)*)(a+)/;
+    private static const REGEXP_AMPM:RegExp =  /^(.*)(a)(?:[^']*'[^']*')*[^']*$/;
     private static const REGEXP_DAYOFWEEK:RegExp =
         /(^(?:[^'E]*(?:'[^']*')*[^E']*)*)(E+)/;

@@ -825,7 +824,12 @@
         if (pattern)
         {
             // 'L' is not supported by most systems so relace with 'M'
+            // Problem if pattern has L or c in string literals.
+            // TBD: Discuss with Masa.
             pattern = pattern.replace(/L/g, "M");
+            // ru locale uses c as symbol for day name of the week instead E.
+            // catering to only skeleton patterns.
+            pattern = pattern.replace(/ccc/g, "EEE");
         }

         return pattern;


change package of ActionScript class

change package of ActionScript class

--- KeyGenerator.as
+++ KeyGenerator.as
@@ -1,4 +1,4 @@
-package mns.crypto{
+package dse{
 	import com.hurlant.crypto.prng.Random;
 	import com.hurlant.crypto.rsa.RSAKey;
 	import com.hurlant.util.Hex;


XIFF part of SASL mechanism not found error handling (which is CS-5841), r=Daniel

git-svn-id: c197267f952b24206666de142881703007ca05d5@10542 b35dd754-fafc-0310-a699-88a17e54d16e

--- src/org/jivesoftware/xiff/core/XMPPBOSHConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPBOSHConnection.as
@@ -241,9 +241,7 @@
 		private function httpError(req:XMLNode, isPollResponse:Boolean, evt:FaultEvent):void
 		{
 			active = false;
-			var err:XIFFErrorEvent = new XIFFErrorEvent();
-			err.errorMessage = "HTTP Error";
-			dispatchEvent(err);
+			dispatchError("Unknown HTTP Error", "A BOSH error occurred", "sasl", -1);
 		}

 		protected override function sendXML(body:*):void
@@ -398,14 +396,15 @@
 	        {
 	        	authClass = saslMechanisms[mechanism.firstChild.nodeValue];
 	   			if(authClass)
-	   				return new authClass(this);
+	   				break;
 	        }

-	        if (!authMechanism) {
-	            throw new Error("No auth mechanisms found");
+	        if (!authClass) {
+	        	dispatchError("SASL missing", "The server is not configured to support any available SASL mechanisms", "SASL", -1);
+	        	return null;
 	        }

-	        return authMechanism;
+	   		return new authClass(this);
 	    }

 	    public function handleBindResponse(packet:IQ):void


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


organize imports

organize imports

--- WeaveJS/src/weavejs/core/Locale.as
+++ WeaveJS/src/weavejs/core/Locale.as
@@ -17,7 +17,6 @@
 {
 	import weavejs.WeaveAPI;
 	import weavejs.api.core.ILocale;
-	import weavejs.net.RequestMethod;
 	import weavejs.net.ResponseType;
 	import weavejs.net.URLRequest;
 	import weavejs.util.WeavePromise;


Added config fur debug logger

Added config fur debug logger

--- src/Player.as
+++ src/Player.as
@@ -51,8 +51,7 @@
     private var config:Object = {
       'buffer': 1,
       'scaleUp': false,
-      'allowFullscreen': true,
-      'debugLogger': {'trace': false, 'js': false}
+      'allowFullscreen': true
     };
     private var video:Video;
     private var audioTransmit:AxisTransmit = new AxisTransmit();
@@ -183,6 +182,16 @@
         if (!config.allowFullscreen)
           this.stage.displayState = StageDisplayState.NORMAL;
       }
+
+      if (iconfig.debugLogger !== undefined) {
+        if (iconfig.debugLogger.trace) {
+          Player.debugLogger.trace = iconfig.debugLogger.trace;
+        }
+
+        if (iconfig.debugLogger.js) {
+          Player.debugLogger.js = iconfig.debugLogger.js;
+        }
+      }
     }

     public function play(iurl:String = null):void {


add missing colon and indent in HLSSettings.as

--- src/org/mangui/hls/HLSSettings.as
+++ src/org/mangui/hls/HLSSettings.as
@@ -223,7 +223,7 @@
          *
          * Default is 4000
          */
-        public static var fragmentLoadMaxRetryTimeout : Number = 4000
+        public static var fragmentLoadMaxRetryTimeout : Number = 4000;

         /**
          * fragmentLoadSkipAfterMaxRetry
@@ -253,7 +253,7 @@
          *
          * Default is 1
          */
-        public static var initialLiveManifestSize: uint = 1;
+        public static var initialLiveManifestSize : uint = 1;

         /**
          * manifestLoadMaxRetry
@@ -283,7 +283,7 @@
 		 *    0  means looping exactly once (no retries) - default behaviour
 		 *   -1  means infinite retry
 		 */
-		public static var manifestRedundantLoadmaxRetry : int = 3;
+        public static var manifestRedundantLoadmaxRetry : int = 3;

         /**
          * startFromBitrate


better rounding for FPS calculation

better rounding for FPS calculation

--- src/battlecode/client/viewer/MatchController.as
+++ src/battlecode/client/viewer/MatchController.as
@@ -127,11 +127,11 @@
             rollingFramerates.push(framerate);
             while (rollingFramerates.length > limit)
                 rollingFramerates.shift();
-            var total:uint = 0;
+            var total:Number = 0;
             for (var i:uint = 0; i < rollingFramerates.length; i++) {
                 total += rollingFramerates[i];
             }
-            _fps = total / rollingFramerates.length;
+            _fps = Math.ceil(total / rollingFramerates.length);

             // update
             _currentRound = value;


Transferred from the Adobe Open Source Subversion Repository

Revision: 5309
Author:   gruehle@adobe.com
Date:     2009-03-13T21:54:51.752954Z

Log Message:
-----------
Add Spark style metadata to Halo components.

baseColor - added to:
 UIComponent
 ScrollControlBase

symbolColor - added to:
 CheckBox
 ComboBase
 Container
 DateChooser
 ScrollBar
 NumericStepper
 PopUpButton
 RadioButton
 ScrollControlBase

contentBackgroundColor - added to:
 ComboBase
 Container
 DateChooser
 NumericStepper
 ScrollControlBase
 TextInput

focusColor - added to:
 Button
 ComboBase
 Container
 DateChooser
 NumericStepper
 ScrollControlBase
 Slider
 TextInput

The remaining Spark styles - alternatingItemColors, rollOverColor, and selectionColor are already defined for the Halo components.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.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/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ScrollControlBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.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/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.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/Container.as</path>

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

--- frameworks/projects/mx/src/mx/core/ScrollControlBase.as
+++ frameworks/projects/mx/src/mx/core/ScrollControlBase.as
@@ -49,6 +49,40 @@
 include "../styles/metadata/TextStyles.as"

 /**
+ *  The main color for a component.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="baseColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Color of the content area of the component.
+ *
+ *  @default 0xFFFFFF
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="contentBackgroundColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Color of focus ring when the component is in focus
+ *
+ *  @default 0x70B2EE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="focusColor", type="uint", format="Color", inherit="yes")]
+
+/**
  *  Style name for horizontal scrollbar.  This allows more control over
  *  the appearance of the scrollbar.
  *
@@ -60,6 +94,19 @@
  *  @productversion Flex 3
  */
 [Style(name="horizontalScrollBarStyleName", type="String", inherit="no")]
+
+/**
+ *  Color of any symbol of a component. Examples include the check mark of a CheckBox or
+ *  the arrow of a ScrollBar button.
+ *
+ *  @default 0x000000
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="symbolColor", type="uint", format="Color", inherit="yes")]

 /**
  *  Style name for vertical scrollbar.  This allows more control over


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/mx/src/mx/printing/PrintDataGrid.as
+++ frameworks/projects/mx/src/mx/printing/PrintDataGrid.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.printing
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 2033
Author:   aharui@adobe.com
Date:     2008-06-10T23:54:19.474932Z

Log Message:
-----------
First cut at getting RemoteObject to work.  Modified compiler to not register classes unless nobody else has registered.  Sanitized RemoteObject messages so they can go in a bootstrap.  Added generalized marshaling method to SystemManager.

Note that the compiler change could affect modules with RemoteClasses.

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/rpc/src/mx/utils/RPCObjectUtil.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/rpc/src/mx/utils/RPCStringUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/rpc/src/mx/messaging/messages/AbstractMessage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/managers/ISystemManager2.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/rpc/src/mx/messaging/messages/HTTPRequestMessage.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/rpc/src/mx/utils/RPCUIDUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/events/MarshalEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/rpc/src/mx/messaging/messages/AsyncMessage.as</path>

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

--- frameworks/projects/rpc/src/mx/utils/RPCObjectUtil.as
+++ frameworks/projects/rpc/src/mx/utils/RPCObjectUtil.as
@@ -0,0 +1,714 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.utils
+{
+
+import flash.utils.ByteArray;
+import flash.utils.Dictionary;
+import flash.utils.getQualifiedClassName;
+import flash.utils.describeType;
+import flash.xml.XMLNode;
+
+import mx.collections.IList;
+
+/**
+ *  The RPCObjectUtil class is a subset of ObjectUtil, removing methods
+ *  that create dependency issues when RPC messages are in a bootstrap loader.
+ */
+public class RPCObjectUtil
+{
+    include "../core/Version.as";
+
+    /**
+    *  Array of properties to exclude from debugging output.
+    */
+    private static var defaultToStringExcludes:Array = ["password", "credentials"];
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+
+    /**
+     *  Pretty-prints the specified Object into a String.
+     *  All properties will be in alpha ordering.
+     *  Each object will be assigned an id during printing;
+     *  this value will be displayed next to the object type token
+     *  preceded by a '#', for example:
+     *
+     *

+     *  (mx.messaging.messages::AsyncMessage)#2.

+     *
+     *
This id is used to indicate when a circular reference occurs.
+     *  Properties of an object that are of the Class type will
+     *  appear only as the assigned type.
+     *  For example a custom definition like the following:

+     *
+     *

+     *    public class MyCustomClass {
+     *      public var clazz:Class;
+     *    }

+     *
+     *
With the clazz property assigned to Date
+     *  will display as shown below:

+     *
+     *

+     *   (somepackage::MyCustomClass)#0
+     *      clazz = (Date)

+     *
+     *  @param obj Object to be pretty printed.
+     *
+     *  @param namespaceURIs Array of namespace URIs for properties
+     *  that should be included in the output.
+     *  By default only properties in the public namespace will be included in
+     *  the output.
+     *  To get all properties regardless of namespace pass an array with a
+     *  single element of "*".
+     *
+     *  @param exclude Array of the property names that should be
+     *  excluded from the output.
+     *  Use this to remove data from the formatted string.
+     *
+     *  @return String containing the formatted version
+     *  of the specified object.
+     *
+     *  @example
+     *

+     *  // example 1
+     *  var obj:AsyncMessage = new AsyncMessage();
+     *  obj.body = [];
+     *  obj.body.push(new AsyncMessage());
+     *  obj.headers["1"] = { name: "myName", num: 15.3};
+     *  obj.headers["2"] = { name: "myName", num: 15.3};
+     *  obj.headers["10"] = { name: "myName", num: 15.3};
+     *  obj.headers["11"] = { name: "myName", num: 15.3};
+     *  trace(ObjectUtil.toString(obj));
+     *
+     *  // will output to flashlog.txt
+     *  (mx.messaging.messages::AsyncMessage)#0
+     *    body = (Array)#1
+     *      [0] (mx.messaging.messages::AsyncMessage)#2
+     *        body = (Object)#3
+     *        clientId = (Null)
+     *        correlationId = ""
+     *        destination = ""
+     *        headers = (Object)#4
+     *        messageId = "378CE96A-68DB-BC1B-BCF7FFFFFFFFB525"
+     *        sequenceId = (Null)
+     *        sequencePosition = 0
+     *        sequenceSize = 0
+     *        timeToLive = 0
+     *        timestamp = 0
+     *    clientId = (Null)
+     *    correlationId = ""
+     *    destination = ""
+     *    headers = (Object)#5
+     *      1 = (Object)#6
+     *        name = "myName"
+     *        num = 15.3
+     *      10 = (Object)#7
+     *        name = "myName"
+     *        num = 15.3
+     *      11 = (Object)#8
+     *        name = "myName"
+     *        num = 15.3
+     *      2 = (Object)#9
+     *        name = "myName"
+     *        num = 15.3
+     *    messageId = "1D3E6E96-AC2D-BD11-6A39FFFFFFFF517E"
+     *    sequenceId = (Null)
+     *    sequencePosition = 0
+     *    sequenceSize = 0
+     *    timeToLive = 0
+     *    timestamp = 0
+     *
+     *  // example 2 with circular references
+     *  obj = {};
+     *  obj.prop1 = new Date();
+     *  obj.prop2 = [];
+     *  obj.prop2.push(15.2);
+     *  obj.prop2.push("testing");
+     *  obj.prop2.push(true);
+     *  obj.prop3 = {};
+     *  obj.prop3.circular = obj;
+     *  obj.prop3.deeper = new ErrorMessage();
+     *  obj.prop3.deeper.rootCause = obj.prop3.deeper;
+     *  obj.prop3.deeper2 = {};
+     *  obj.prop3.deeper2.deeperStill = {};
+     *  obj.prop3.deeper2.deeperStill.yetDeeper = obj;
+     *  trace(ObjectUtil.toString(obj));
+     *
+     *  // will output to flashlog.txt
+     *  (Object)#0
+     *    prop1 = Tue Apr 26 13:59:17 GMT-0700 2005
+     *    prop2 = (Array)#1
+     *      [0] 15.2
+     *      [1] "testing"
+     *      [2] true
+     *    prop3 = (Object)#2
+     *      circular = (Object)#0
+     *      deeper = (mx.messaging.messages::ErrorMessage)#3
+     *        body = (Object)#4
+     *        clientId = (Null)
+     *        code = (Null)
+     *        correlationId = ""
+     *        destination = ""
+     *        details = (Null)
+     *        headers = (Object)#5
+     *        level = (Null)
+     *        message = (Null)
+     *        messageId = "14039376-2BBA-0D0E-22A3FFFFFFFF140A"
+     *        rootCause = (mx.messaging.messages::ErrorMessage)#3
+     *        sequenceId = (Null)
+     *        sequencePosition = 0
+     *        sequenceSize = 0
+     *        timeToLive = 0
+     *        timestamp = 0
+     *      deeper2 = (Object)#6
+     *        deeperStill = (Object)#7
+     *          yetDeeper = (Object)#0
+     *

+     *
+     */
+    public static function toString(value:Object,
+                                    namespaceURIs:Array = null,
+                                    exclude:Array = null):String
+    {
+        if (exclude == null)
+        {
+            exclude = defaultToStringExcludes;
+        }
+
+        refCount = 0;
+        return internalToString(value, 0, null, namespaceURIs, exclude);
+    }
+
+    /**
+     *  This method cleans up all of the additional parameters that show up in AsDoc
+     *  code hinting tools that developers shouldn't ever see.
+     *  @private
+     */
+    private static function internalToString(value:Object,
+                                             indent:int = 0,
+                                             refs:Dictionary= null,
+                                             namespaceURIs:Array = null,
+                                             exclude:Array = null):String
+    {
+        var str:String;
+        var type:String = value == null ? "null" : typeof(value);
+        switch (type)
+        {
+            case "boolean":
+            case "number":
+            {
+                return value.toString();
+            }
+
+            case "string":
+            {
+                return "\"" + value.toString() + "\"";
+            }
+
+            case "object":
+            {
+                if (value is Date)
+                {
+                    return value.toString();
+                }
+                else if (value is XMLNode)
+                {
+                    return value.toString();
+                }
+                else if (value is Class)
+                {
+                    return "(" + getQualifiedClassName(value) + ")";
+                }
+                else
+                {
+                    var classInfo:Object = getClassInfo(value, exclude,
+                        { includeReadOnly: true, uris: namespaceURIs });
+
+                    var properties:Array = classInfo.properties;
+
+                    str = "(" + classInfo.name + ")";
+
+                    // refs help us avoid circular reference infinite recursion.
+                    // Each time an object is encoumtered it is pushed onto the
+                    // refs stack so that we can determine if we have visited
+                    // this object already.
+                    if (refs == null)
+                        refs = new Dictionary(true);
+
+                    // Check to be sure we haven't processed this object before
+                    var id:Object = refs[value];
+                    if (id != null)
+                    {
+                        str += "#" + int(id);
+                        return str;
+                    }
+
+                    if (value != null)
+                    {
+                        str += "#" + refCount.toString();
+                        refs[value] = refCount;
+                        refCount++;
+                    }
+
+                    var isArray:Boolean = value is Array;
+                    var prop:*;
+                    indent += 2;
+
+                    // Print all of the variable values.
+                    for (var j:int = 0; j < properties.length; j++)
+                    {
+                        str = newline(str, indent);
+                        prop = properties[j];
+                        if (isArray)
+                            str += "[";
+                        str += prop.toString();
+                        if (isArray)
+                            str += "] ";
+                        else
+                            str += " = ";
+                        try
+                        {
+                            str += internalToString(
+                                        value[prop], indent, refs, namespaceURIs,
+                                        exclude);
+                        }
+                        catch(e:Error)
+                        {
+                            // value[prop] can cause an RTE
+                            // for certain properties of certain objects.
+                            // For example, accessing the properties
+                            //   actionScriptVersion
+                            //   childAllowsParent
+                            //   frameRate
+                            //   height
+                            //   loader
+                            //   parentAllowsChild
+                            //   sameDomain
+                            //   swfVersion
+                            //   width
+                            // of a Stage's loaderInfo causes
+                            //   Error #2099: The loading object is not
+                            //   sufficiently loaded to provide this information
+                            // In this case, we simply output ? for the value.
+                            str += "?";
+                        }
+                    }
+                    indent -= 2;
+                    return str;
+                }
+                break;
+            }
+
+            case "xml":
+            {
+                return value.toString();
+            }
+
+            default:
+            {
+                return "(" + type + ")";
+            }
+        }
+
+        return "(unknown)";
+    }
+
+    /**
+     *  @private
+     *  This method will append a newline and the specified number of spaces
+     *  to the given string.
+     */
+    private static function newline(str:String, n:int = 0):String
+    {
+        var result:String = str;
+        result += "\n";
+
+        for (var i:int = 0; i < n; i++)
+        {
+            result += " ";
+        }
+        return result;
+    }
+
+
+    /**
+     *  Returns information about the class, and properties of the class, for
+     *  the specified Object.
+     *
+     *  @param obj The Object to inspect.
+     *
+     *  @param exclude Array of Strings specifying the property names that should be
+     *  excluded from the returned result. For example, you could specify
+     *  ["currentTarget", "target"] for an Event object since these properties
+     *  can cause the returned result to become large.
+     *
+     *  @param options An Object containing one or more properties
+     *  that control the information returned by this method.
+     *  The properties include the following:
+     *
+     *

+     *
includeReadOnly: If false,
+     *      exclude Object properties that are read-only.
+     *      The default value is true.

+     *
includeTransient: If false,
+     *      exclude Object properties and variables that have [Transient] metadata.
+     *      The default value is true.

+     *
uris: Array of Strings of all namespaces that should be included in the output.
+     *      It does allow for a wildcard of "~~".
+     *      By default, it is null, meaning no namespaces should be included.
+     *      For example, you could specify ["mx_internal", "mx_object"]
+     *      or ["~~"].

+     *

+     *
+     *  @return An Object containing the following properties:
+     *

+     *
name: String containing the name of the class;

+     *
properties: Sorted list of the property names of the specified object.

+     *

+    */
+    public static function getClassInfo(obj:Object,
+                                        excludes:Array = null,
+                                        options:Object = null):Object
+    {
+        var n:int;
+        var i:int;
+
+		// this version doesn't handle ObjectProxy
+
+        if (options == null)
+            options = { includeReadOnly: true, uris: null, includeTransient: true };
+
+        var result:Object;
+        var propertyNames:Array = [];
+        var cacheKey:String;
+
+        var className:String;
+        var classAlias:String;
+        var properties:XMLList;
+        var prop:XML;
+        var dynamic:Boolean = false;
+        var metadataInfo:Object;
+
+        if (typeof(obj) == "xml")
+        {
+            className = "XML";
+            properties = obj.text();
+            if (properties.length())
+                propertyNames.push("*");
+            properties = obj.attributes();
+        }
+        else
+        {
+			// don't cache describe type.  Makes it slower, but fewer dependencies
+            var classInfo:XML = describeType(obj).typeDescription;
+            className = classInfo.@name.toString();
+            classAlias = classInfo.@alias.toString();
+            dynamic = (classInfo.@isDynamic.toString() == "true");
+
+            if (options.includeReadOnly)
+                properties = classInfo..accessor.(@access != "writeonly") + classInfo..variable;
+            else
+                properties = classInfo..accessor.(@access == "readwrite") + classInfo..variable;
+
+            var numericIndex:Boolean = false;
+        }
+
+        // If type is not dynamic, check our cache for class info...
+        if (!dynamic)
+        {
+            cacheKey = getCacheKey(obj, excludes, options);
+            result = CLASS_INFO_CACHE[cacheKey];
+            if (result != null)
+                return result;
+        }
+
+        result = {};
+        result["name"] = className;
+        result["alias"] = classAlias;
+        result["properties"] = propertyNames;
+        result["dynamic"] = dynamic;
+        result["metadata"] = metadataInfo = recordMetadata(properties);
+
+        var excludeObject:Object = {};
+        if (excludes)
+        {
+            n = excludes.length;
+            for (i = 0; i < n; i++)
+            {
+                excludeObject[excludes[i]] = 1;
+            }
+        }
+
+        var isArray:Boolean = className == "Array";
+        if (dynamic)
+        {
+            for (var p:String in obj)
+            {
+                if (excludeObject[p] != 1)
+                {
+                    if (isArray)
+                    {
+                         var pi:Number = parseInt(p);
+                         if (isNaN(pi))
+                             propertyNames.push(new QName("", p));
+                         else
+                            propertyNames.push(pi);
+                    }
+                    else
+                    {
+                        propertyNames.push(new QName("", p));
+                    }
+                }
+            }
+            numericIndex = isArray && !isNaN(Number(p));
+        }
+
+        if (className == "Object" || isArray)
+        {
+            // Do nothing since we've already got the dynamic members
+        }
+        else if (className == "XML")
+        {
+            n = properties.length();
+            for (i = 0; i < n; i++)
+            {
+                p = properties[i].name();
+                if (excludeObject[p] != 1)
+                    propertyNames.push(new QName("", "@" + p));
+            }
+        }
+        else
+        {
+            n = properties.length();
+            var uris:Array = options.uris;
+            var uri:String;
+            var qName:QName;
+            for (i = 0; i < n; i++)
+            {
+                prop = properties[i];
+                p = prop.@name.toString();
+                uri = prop.@uri.toString();
+
+                if (excludeObject[p] == 1)
+                    continue;
+
+                if (!options.includeTransient && internalHasMetadata(metadataInfo, p, "Transient"))
+                    continue;
+
+                if (uris != null)
+                {
+                    if (uris.length == 1 && uris[0] == "*")
+                    {
+                        qName = new QName(uri, p);
+                        try
+                        {
+                            obj[qName]; // access the property to ensure it is supported
+                            propertyNames.push();
+                        }
+                        catch(e:Error)
+                        {
+                            // don't keep property name
+                        }
+                    }
+                    else
+                    {
+                        for (var j:int = 0; j < uris.length; j++)
+                        {
+                            uri = uris[j];
+                            if (prop.@uri.toString() == uri)
+                            {
+                                qName = new QName(uri, p);
+                                try
+                                {
+                                    obj[qName];
+                                    propertyNames.push(qName);
+                                }
+                                catch(e:Error)
+                                {
+                                    // don't keep property name
+                                }
+                            }
+                        }
+                    }
+                }
+                else if (uri.length == 0)
+                {
+                    qName = new QName(uri, p);
+                    try
+                    {
+                        obj[qName];
+                        propertyNames.push(qName);
+                    }
+                    catch(e:Error)
+                    {
+                        // don't keep property name
+                    }
+                }
+            }
+        }
+
+        propertyNames.sort(Array.CASEINSENSITIVE |
+                           (numericIndex ? Array.NUMERIC : 0));
+        // remove any duplicates, i.e. any items that can't be distingushed by toString()
+        for (i = 0; i < propertyNames.length - 1; i++)
+        {
+            // the list is sorted so any duplicates should be adjacent
+            // two properties are only equal if both the uri and local name are identical
+            if (propertyNames[i].toString() == propertyNames[i + 1].toString())
+            {
+                propertyNames.splice(i, 1);
+                i--; // back up
+            }
+        }
+
+        // For normal, non-dynamic classes we cache the class info
+        if (!dynamic)
+        {
+            cacheKey = getCacheKey(obj, excludes, options);
+            CLASS_INFO_CACHE[cacheKey] = result;
+        }
+
+        return result;
+    }
+
+    /**
+     *  @private
+     */
+    private static function internalHasMetadata(metadataInfo:Object, propName:String, metadataName:String):Boolean
+    {
+        if (metadataInfo != null)
+        {
+            var metadata:Object = metadataInfo[propName];
+            if (metadata != null)
+            {
+                if (metadata[metadataName] != null)
+                    return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     *  @private
+     */
+    private static function recordMetadata(properties:XMLList):Object
+    {
+        var result:Object = null;
+
+        try
+        {
+            for each (var prop:XML in properties)
+            {
+                var propName:String = prop.attribute("name").toString();
+                var metadataList:XMLList = prop.metadata;
+
+                if (metadataList.length() > 0)
+                {
+                    if (result == null)
+                        result = {};
+
+                    var metadata:Object = {};
+                    result[propName] = metadata;
+
+                    for each (var md:XML in metadataList)
+                    {
+                        var mdName:String = md.attribute("name").toString();
+
+                        var argsList:XMLList = md.arg;
+                        var value:Object = {};
+
+                        for each (var arg:XML in argsList)
+                        {
+                            var argKey:String = arg.attribute("key").toString();
+                            if (argKey != null)
+                            {
+                                var argValue:String = arg.attribute("value").toString();
+                                value[argKey] = argValue;
+                            }
+                        }
+
+                        var existing:Object = metadata[mdName];
+                        if (existing != null)
+                        {
+                            var existingArray:Array;
+                            if (existing is Array)
+                                existingArray = existing as Array;
+                            else
+                                existingArray = [];
+                            existingArray.push(value);
+                            existing = existingArray;
+                        }
+                        else
+                        {
+                            existing = value;
+                        }
+                        metadata[mdName] = existing;
+                    }
+                }
+            }
+        }
+        catch(e:Error)
+        {
+        }
+
+        return result;
+    }
+
+    /**
+     *  @private
+     */
+    private static function getCacheKey(o:Object, excludes:Array = null, options:Object = null):String
+    {
+        var key:String = getQualifiedClassName(o);
+
+        if (excludes != null)
+        {
+            for (var i:uint = 0; i < excludes.length; i++)
+            {
+                var excl:String = excludes[i] as String;
+                if (excl != null)
+                    key += excl;
+            }
+        }
+
+        if (options != null)
+        {
+            for (var flag:String in options)
+            {
+                key += flag;
+                var value:String = options[flag] as String;
+                if (value != null)
+                    key += value;
+            }
+        }
+        return key;
+    }
+
+
+    /**
+     * @private
+     */
+    private static var refCount:int = 0;
+
+    /**
+     * @private
+     */
+    private static var CLASS_INFO_CACHE:Object = {};
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 14629
Author:   cframpto@adobe.com
Date:     2010-03-08T20:10:20.106709Z

Log Message:
-----------
Merge changes for mirroring from 4.x to trunk. Rev 14623.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/LayoutDirection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/spark/src/mx/core/FTETextField.as
+++ frameworks/projects/spark/src/mx/core/FTETextField.as
@@ -2040,6 +2040,31 @@
 			   preservingHTMLImporter;
 	}

+    /**
+     *  @private
+     *  The start margin.  Used when using FTE to construct the individual
+     *  text lines and textLine alignment is done in this class.
+     */
+    private function get leftMargin():Number
+    {
+        return (direction == "ltr" ?
+            Number(_defaultTextFormat.leftMargin) :
+            Number(_defaultTextFormat.rightMargin));
+
+    }
+
+    /**
+     *  @private
+     *  The end margin.  Used when using FTE to construct the individual
+     *  text lines and textLine alignment is done in this class.
+     */
+    private function get rightMargin():Number
+    {
+        return (direction == "ltr" ?
+            Number(_defaultTextFormat.rightMargin) :
+            Number(_defaultTextFormat.leftMargin));
+    }
+
 	//--------------------------------------------------------------------------
 	//
 	//  Methods: TextField
@@ -2550,9 +2575,7 @@

                     var blockIndent:Number = Number(_defaultTextFormat.blockIndent);
                     var indent:Number = Number(_defaultTextFormat.indent);
-                    var leftMargin:Number = Number(_defaultTextFormat.leftMargin);
-                    var rightMargin:Number = Number(_defaultTextFormat.rightMargin);
-
+
                     // Factor in indents and margins if the combined total
                     // is positive.
                     if (blockIndent + indent + leftMargin > 0)
@@ -2856,8 +2879,6 @@

         var blockIndent:Number = Number(_defaultTextFormat.blockIndent);
         var indent:Number = Number(_defaultTextFormat.indent);
-        var leftMargin:Number = Number(_defaultTextFormat.leftMargin);
-        var rightMargin:Number = Number(_defaultTextFormat.rightMargin);

 		var maxLineWidthBeforeIndent:Number =
 			wordWrap ? innerWidth : TextLine.MAX_LINE_WIDTH;
@@ -2893,12 +2914,12 @@
                     totalIndent = 0;
                else if (totalIndent > _width - PADDING_LEFT - PADDING_RIGHT)
                     totalIndent = _width - PADDING_LEFT - PADDING_RIGHT;
+
+                maxLineWidth =
+                    maxLineWidthBeforeIndent - totalIndent;

-                if (!wordWrap)
-                    rightMargin = 0;
-
-                maxLineWidth =
-                    maxLineWidthBeforeIndent - totalIndent - rightMargin;
+                if (wordWrap)
+                    maxLineWidthBeforeIndent -= rightMargin;

                 // Stay within the bounds to avoid exception.  Since
                 // fitSomething is true it is okay if maxLineWidth is < 0.
@@ -2996,8 +3017,6 @@
         if (isNaN(innerWidth))
             innerWidth = 0;

-        var rightMargin:Number = Number(_defaultTextFormat.rightMargin);
-
 		var align:String = _defaultTextFormat.align;
 		var leftAligned:Boolean =
 			align == "left" ||


Transferred from the Adobe Open Source Subversion Repository

Revision: 20103
Author:   hmuller@adobe.com
Date:     2011-02-03T21:21:49.363448Z

Log Message:
-----------
Added Spark DataItem component class.

QE notes:
Doc notes:
Bugs: SDK-29327
Reviewer: Corey, PARB
Tests run: checkin, mustella
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/utils/DataItem.as</path>

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

--- frameworks/projects/spark/src/spark/utils/DataItem.as
+++ frameworks/projects/spark/src/spark/utils/DataItem.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.utils
+{
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import flash.utils.Proxy;
+import flash.utils.flash_proxy;
+
+import mx.binding.BindabilityInfo;
+import mx.core.mx_internal;
+import mx.utils.ObjectProxy;
+import mx.utils.DescribeTypeCache;
+
+use namespace mx_internal;
+use namespace flash_proxy;
+
+
+/**
+ *  A dynamic object with bindable properties.
+ *
+ *
This class is intended to be used in MXML to define object literals
+ *  whose properties must be bindable.   It's typically used to define List or
+ *  DataGrid dataProvider items within an MXML file for small applications or examples
+ *  with item renderers that bind to their data.  Non-trival applications or
+ *  any application for which performance is a concern, should define a
+ *  [Bindable] class with a fixed set of strongly typed properties
+ *  and define dataProvider items with that.

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public dynamic class DataItem extends ObjectProxy
+{
+    public function DataItem()
+    {
+        super();
+    }
+
+    /**
+     *  @private
+     */
+    override flash_proxy function setProperty(name:*, value:*):void
+    {
+        // The first time a property is set, update the BindableInfo metadata
+        // to indicate that it's bindable and that it dispatches a PropertyChangeEvent.
+
+        const info:BindabilityInfo = DescribeTypeCache.describeType(this).bindabilityInfo;
+        const events:Object = info.getChangeEvents(name);
+        if (events["propertyChange"] === undefined)
+            events["propertyChange"] = true;
+
+        super.setProperty(name, value);
+    }
+}
+}


added error for unsupported statements

added error for unsupported statements

Change-Id: I5a6ad4efb0632b9a160d2223a4a76689b2dc1af5

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -1510,8 +1510,8 @@
 				}

 				// found matching pattern
+				var originalTokens:Array = tokens.slice(startIndex, startIndex + pattern.length);
 				var params:Array = tokens.splice(startIndex + 1, pattern.length - 1);
-				var originalTokens:Array = [stmt].concat(params);

 				if (stmt == ST_IF) // if (cond) {stmt} else {stmt}
 				{
@@ -1566,6 +1566,11 @@
 				{
 					tokens[startIndex] = compileOperator(stmt, params);
 				}
+				else
+				{
+					throw new Error(stmt + " not supported yet");
+				}
+
 				// save original token list for correct decompiling
 				(tokens[startIndex] as CompiledFunctionCall).originalTokens = originalTokens;


fixed typo in constant string value

fixed typo in constant string value

--- WeaveJS/src/weavejs/core/WeaveArchive.as
+++ WeaveJS/src/weavejs/core/WeaveArchive.as
@@ -107,8 +107,9 @@
 //		public static const ARCHIVE_THUMBNAIL_PNG:String = "thumbnail.png";
 //		public static const ARCHIVE_SCREENSHOT_PNG:String = "screenshot.png";
 //		public static const ARCHIVE_URL_CACHE_AMF:String = "url-cache.amf";
+//		public static const ARCHIVE_URL_CACHE_JSON:String = "url-cache.json";
 		public static const ARCHIVE_HISTORY_AMF:String = "history.amf";
-		public static const ARCHIVE_HISTORY_JSON:String = "history.amf";
+		public static const ARCHIVE_HISTORY_JSON:String = "history.json";
 		public static const ARCHIVE_COLUMN_CACHE_AMF:String = "column-cache.amf";
 		public static const ARCHIVE_COLUMN_CACHE_JSON:String = "column-cache.json";


Fixed Flash runtime behavior for multiple_select=false and other simpleUpload usage cases: basically new FileReference has to be created for every select dialog.

--- src/flash/plupload/src/com/plupload/Plupload.as
+++ src/flash/plupload/src/com/plupload/Plupload.as
@@ -49,6 +49,7 @@
 		private var id:String;
 		private var fileFilters:Array;
 		private var multipleFiles:Boolean;
+		private var fileRefArray:Array = [];
 		private var fileRef:FileReference;

 		/**
@@ -80,9 +81,7 @@
 			this.fileRefList.addEventListener(Event.CANCEL, cancelEvent);
 			this.fileRefList.addEventListener(Event.SELECT, selectEvent);

-			this.fileRef = new FileReference();
-			this.fileRef.addEventListener(Event.CANCEL, cancelEvent);
-			this.fileRef.addEventListener(Event.SELECT, selectEvent);
+			initSingleFileReference();

 			this.files = new Dictionary();

@@ -121,6 +120,20 @@

 			this.fireEvent("Init");
 		}
+
+
+		/**
+		 * In case of multipleFiles=false FileReference needs to be reinitialized for every file select dialog
+		 */
+		private function initSingleFileReference() : void {
+			if (this.fileRef) {
+				this.fileRef = null;
+			}
+
+			this.fileRef = new FileReference();
+			this.fileRef.addEventListener(Event.CANCEL, cancelEvent);
+			this.fileRef.addEventListener(Event.SELECT, selectEvent);
+		}

 		/**
 		 * Event handler for selection cancelled. This simply fires the event out to the page level JS.
@@ -201,16 +214,20 @@
 			}

 			if (this.multipleFiles) {
-				for (var i:Number = 0; i < this.fileRefList.fileList.length; i++)
+				for (var i:Number = 0; i < this.fileRefList.fileList.length; i++) {
 					processFile(new File("file_" + (this.idCounter++), this.fileRefList.fileList[i]));
-			} else
+				}
+			} else {
 				processFile(new File("file_" + (this.idCounter++), this.fileRef));
+				this.fileRefArray.push(this.fileRef);
+				initSingleFileReference();
+			}

 			this.fireEvent("SelectFiles", selectedFiles);
 		}

 		/**
-		 * Send out all stage events to page level JS inorder to fake click, hover etc.
+		 * Sefnd out all stage events to page level JS inorder to fake click, hover etc.
 		 *
 		 * @param e Event object.
 		 */


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/mx/src/mx/controls/PopUpButton.as
+++ frameworks/projects/mx/src/mx/controls/PopUpButton.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.controls
 {