Transferred from the Adobe Open Source Subversion Repository

Revision: 17336
Author:   rfrishbe@adobe.com
Date:     2010-08-16T21:43:38.459173Z

Log Message:
-----------
Checking in MobileIconItemRenderer.  Had to change a few things in MobileItemRenderer and MobileTextField to get this to work.

The spec will be updated shortly to reflect some API changes from this.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
@@ -26,14 +26,19 @@
 import mx.core.IFlexModuleFactory;
 import mx.core.IVisualElement;
 import mx.core.UIComponent;
+import mx.core.UITextField;
+import mx.core.UITextFormat;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.IStyleClient;
 import mx.utils.StringUtil;

 import spark.components.Group;
 import spark.components.IItemRenderer;
 import spark.components.Image;
 import spark.components.Label;
+import spark.components.supportClasses.MobileTextField;
 import spark.components.supportClasses.TextBase;
 import spark.core.ContentCache;
 import spark.primitives.BitmapImage;
@@ -59,20 +64,20 @@

 /**
  *  Name of the CSS Style declaration to use for the styles for the
- *  subText component.
+ *  message component.
  *
  *  @langversion 3.0
  *  @playerversion Flash 9
  *  @playerversion AIR 1.1
  *  @productversion Flex 3
  */
-[Style(name="subTextStyleName", type="String", inherit="no")]
+[Style(name="messageStyleName", type="String", inherit="no")]

 /**
  *  The MobileIconItemRenderer class is a performant item
  *  renderer optimized for mobile devices.  It contains
- *  four optional parts: 1) an icon on the left, 2) headerText
- *  on top next to the icon, 3) subText below headerText and
+ *  four optional parts: 1) an icon on the left, 2) header
+ *  on top next to the icon, 3) message below header and
  *  next to the icon, and 4) a decorator on the right.
  *
  *  @see spark.components.List
@@ -122,6 +127,60 @@

     //--------------------------------------------------------------------------
     //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Holds the styles specific to the header object based on headerStyleName
+     */
+    private var headerStyles:CSSStyleDeclaration;
+
+    /**
+     *  @private
+     *  Cached UITextFormat object used for measurement purposes for header
+     */
+    private var cachedHeaderFormat:UITextFormat;
+
+    /**
+     *  @private
+     *  Stores the text of the header component.  This is calculated in
+     *  commitProperties() based on headerField and headerFunction.
+     *
+     *
We can't just use labelDisplay.text because it may contain
+     *  a truncated value.

+     */
+    private var headerText:String = "";
+
+    /**
+     *  @private
+     *  Holds the styles specific to the message object based on messageStyleName
+     */
+    private var messageStyles:CSSStyleDeclaration;
+
+    /**
+     *  @private
+     *  Cached UITextFormat object used for measurement purposes for message
+     */
+    private var cachedSubTextFormat:UITextFormat;
+
+    /**
+     *  @private
+     *  Stores the text of the message component.  This is calculated in
+     *  commitProperties() based on messageField and messageFunction.
+     *
+     *
We can't just use messageDisplay.text because it may contain
+     *  a truncated value (Technically we don't truncate message's text
+     *  at the moment because it's multi-line text, but in the future
+     *  we may not do that, and this feels more consistent with
+     *  how we deal with headers, so we still keep this "extra"
+     *  variable around even though technically it's not needed.

+     */
+    private var messageText:String = "";
+
+    //--------------------------------------------------------------------------
+    //
     //  Public Properties
     //
     //--------------------------------------------------------------------------
@@ -137,6 +196,17 @@
     override public function set data(value:Object):void
     {
         super.data = value;
+
+        dataChanged = true;
+        invalidateProperties();
+    }
+
+    /**
+     *  @private
+     */
+    override public function set label(value:String):void
+    {
+        super.label = value;

         dataChanged = true;
         invalidateProperties();
@@ -232,6 +302,8 @@

         _headerField = value;
         headerFieldOrFunctionChanged = true;
+        dataChanged = true;
+
         invalidateProperties();
     }

@@ -281,6 +353,8 @@

         _headerFunction = value;
         headerFieldOrFunctionChanged = true;
+        dataChanged = true;
+
         invalidateProperties();
     }

@@ -479,23 +553,28 @@
     }

     //----------------------------------
-    //  subTextField
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _subTextField:String;
-
-    /**
-     *  @private
-     */
-    private var subTextFieldOrFunctionChanged:Boolean;
+    //  messageField
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _messageField:String;
+
+    /**
+     *  @private
+     */
+    private var messageDisplay:MobileTextField;
+
+    /**
+     *  @private
+     */
+    private var messageFieldOrFunctionChanged:Boolean;

     /**
      *  The name of the field in the data provider items to display
-     *  as the subText.
-     *  The subTextFunction property overrides this property.
+     *  as the message.
+     *  The messageFunction property overrides this property.
      *
      *  @default null
      *
@@ -504,45 +583,47 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public function get subTextField():String
+    public function get messageField():String
     {
         // FIXME (rfrishbe): PARB this property name b/c confusing with "TextField" the component
-        return _subTextField;
-    }
-
-    /**
-     *  @private
-     */
-    public function set subTextField(value:String):void
-    {
-        if (value == _subTextField)
+        return _messageField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set messageField(value:String):void
+    {
+        if (value == _messageField)
             return;

-        _subTextField = value;
-        subTextFieldOrFunctionChanged = true;
+        _messageField = value;
+        messageFieldOrFunctionChanged = true;
+        dataChanged = true;
+
         invalidateProperties();
     }

     //----------------------------------
-    //  subTextFunction
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _subTextFunction:Function;
-
-    /**
-     *  A user-supplied function to run on each item to determine its subText.
-     *  The subTextFunction property overrides
-     *  the subTextField property.
-     *
-     *
You can supply a subTextFunction that finds the
+    //  messageFunction
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _messageFunction:Function;
+
+    /**
+     *  A user-supplied function to run on each item to determine its message.
+     *  The messageFunction property overrides
+     *  the messageField property.
+     *
+     *
You can supply a messageFunction that finds the
      *  appropriate fields and returns a displayable string. The
-     *  subTextFunction is also good for handling formatting and
+     *  messageFunction is also good for handling formatting and
      *  localization.

      *
-     *
The subText function takes a single argument which is the item in
+     *
The message function takes a single argument which is the item in
      *  the data provider and returns a String.

      *

      *  mySubTextFunction(item:Object):String

@@ -554,21 +635,23 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public function get subTextFunction():Function
-    {
-        return _subTextFunction;
-    }
-
-    /**
-     *  @private
-     */
-    public function set subTextFunction(value:Function):void
-    {
-        if (value == _subTextFunction)
+    public function get messageFunction():Function
+    {
+        return _messageFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set messageFunction(value:Function):void
+    {
+        if (value == _messageFunction)
             return;

-        _subTextFunction = value;
-        subTextFieldOrFunctionChanged = true;
+        _messageFunction = value;
+        messageFieldOrFunctionChanged = true;
+        dataChanged = true;
+
         invalidateProperties();
     }

@@ -587,7 +670,13 @@

         // create any children you need in here

-        // iconDisplay, subTextDisplay, and decoratorDisplay are created in
+        // since labelDisplay gets created in super.createChildren(), lets make
+        // sure it's using the right styles
+        labelDisplay.getStyleFunction = headerGetStyleFunction;
+        headerFieldOrFunctionChanged = true;
+        invalidateProperties();
+
+        // iconDisplay, messageDisplay, and decoratorDisplay are created in
         // commitProperties() since they are dependent on
         // other properties and we don't always create them
         // headerText just uses labelElement to display its data
@@ -596,6 +685,52 @@
     /**
      *  @private
      */
+    override public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void
+    {
+        super.notifyStyleChangeInChildren(styleProp, recursive);
+
+        cachedHeaderFormat = null;
+        cachedSubTextFormat = null;
+    }
+
+    /**
+     *  @private
+     */
+    override public function styleChanged(styleName:String):void
+    {
+        var allStyles:Boolean = !styleName || styleName == "styleName";
+
+        super.styleChanged(styleName);
+
+        // if header styles may have changed, let's null out the old
+        // value and notify labelDisplay
+        if (allStyles || styleName == "headerStyleName")
+        {
+            headerStyles = null;
+            if (labelDisplay)
+                labelDisplay.styleChanged("styleName");
+        }
+
+        // if message styles may have changed, let's null out the old
+        // value and notify messageDisplay
+        if (allStyles || styleName == "messageStyleName")
+        {
+            messageStyles = null;
+            if (messageDisplay)
+                messageDisplay.styleChanged("styleName");
+        }
+
+        // pass all style changes to labelTextField and messageField
+        // It will deal with them appropriatley and in a performant manner
+        if (labelDisplay)
+            labelDisplay.styleChanged(styleName);
+        if (messageDisplay)
+            messageDisplay.styleChanged(styleName);
+    }
+
+    /**
+     *  @private
+     */
     override protected function commitProperties():void
     {
         super.commitProperties();
@@ -621,13 +756,12 @@
             invalidateDisplayList();
         }

-        // FIXME (rfrishbe): handle iconFunction in here as well
         if (iconFieldOrFunctionChanged)
         {
             iconFieldOrFunctionChanged = false;

             // let's see if we need to create or remove it
-            if (iconField && !iconDisplay)
+            if ((iconField || (iconFunction != null)) && !iconDisplay)
             {
                 // need to create it
                 iconDisplayHolder = new Group();
@@ -649,7 +783,7 @@
                 addChild(iconDisplayHolder);
                 iconDisplayHolder.addElement(iconDisplay);
             }
-            else if (!iconField && iconDisplay)
+            else if (!(iconField || (iconFunction != null)) && iconDisplay)
             {
                 // need to remove it
                 removeChild(iconDisplayHolder);
@@ -662,12 +796,76 @@
             invalidateDisplayList();
         }

+        if (messageFieldOrFunctionChanged)
+        {
+            messageFieldOrFunctionChanged = false;
+
+            // let's see if we need to create or remove it
+            if ((messageField || (messageFunction != null)) && !messageDisplay)
+            {
+                // get styles for this text component
+
+                // need to create it
+                messageDisplay = MobileTextField(createInFontContext(MobileTextField));
+                messageDisplay.getStyleFunction = messageGetStyleFunction;
+                messageDisplay.editable = false;
+                messageDisplay.selectable = false;
+                messageDisplay.multiline = true;
+                messageDisplay.wordWrap = true;
+
+                addChild(messageDisplay);
+            }
+            else if (!(messageField || (messageFunction != null)) && messageDisplay)
+            {
+                // need to remove it
+                removeChild(messageDisplay);
+                messageDisplay = null;
+            }
+
+            invalidateSize();
+            invalidateDisplayList();
+        }
+
+        if (headerFieldOrFunctionChanged)
+        {
+            headerFieldOrFunctionChanged = false;
+
+            // let's see if we need to create or remove it
+            if ((headerField || (headerFunction != null)) && !labelDisplay)
+            {
+                // get styles for this text component
+
+                // need to create it
+                labelDisplay = MobileTextField(createInFontContext(MobileTextField));
+                labelDisplay.getStyleFunction = headerGetStyleFunction;
+                labelDisplay.editable = false;
+                labelDisplay.selectable = false;
+                labelDisplay.multiline = false;
+                labelDisplay.wordWrap = true;
+
+                addChild(labelDisplay);
+            }
+            else if (!(headerField || (headerFunction != null)) && labelDisplay)
+            {
+                // need to remove it
+                removeChild(labelDisplay);
+                labelDisplay = null;
+            }
+
+            invalidateSize();
+            invalidateDisplayList();
+        }
+
         if (dataChanged)
         {
             dataChanged = false;

-            // if an iconField, try setting that
-            if (iconField)
+            // if icon, try setting that
+            if (iconFunction != null)
+            {
+                iconDisplay.source = iconFunction(data);
+            }
+            else if (iconField)
             {
                 try
                 {
@@ -681,6 +879,48 @@
                 }
             }

+            // if message, try setting that
+            if (messageFunction != null)
+            {
+                messageText = messageFunction(data);
+                messageDisplay.text = messageText;
+            }
+            else if (messageField)
+            {
+                try
+                {
+                    if (messageField in data && data[messageField] != null)
+                    {
+                        messageText = data[messageField];
+                        messageDisplay.text = messageText;
+                    }
+                }
+                catch(e:Error)
+                {
+                }
+            }
+
+            // if header, try setting that
+            if (headerFunction != null)
+            {
+                headerText = headerFunction(data)
+                labelDisplay.text = headerText;
+            }
+            else if (headerField)
+            {
+                try
+                {
+                    if (headerField in data && data[headerField] != null)
+                    {
+                        headerText = data[headerField];
+                        labelDisplay.text = headerText;
+                    }
+                }
+                catch(e:Error)
+                {
+                }
+            }
+
             invalidateSize();
             invalidateDisplayList();
         }
@@ -700,55 +940,123 @@
         var myMeasuredMinWidth:Number = 0;
         var myMeasuredMinHeight:Number = 0;

-        // FIXME (rfrishbe): use padding and gaps
         // Icon is on left
         if (iconDisplay)
         {
-            // padding of 5 on the right...left will be accounted for in the label
-            // padding of 10 for height (5 & 5)
-            myMeasuredWidth += (isNaN(iconWidth) ? iconDisplay.getPreferredBoundsWidth() : iconWidth) + 5;
-            myMeasuredHeight = Math.max(myMeasuredHeight, (isNaN(iconHeight) ? iconDisplay.getPreferredBoundsHeight() : iconHeight) + 10);
-            myMeasuredMinWidth += (isNaN(iconWidth) ? iconDisplay.getMinBoundsWidth() : iconWidth) + 5;
-            myMeasuredMinHeight = Math.max(myMeasuredMinHeight, (isNaN(iconHeight) ? iconDisplay.getMinBoundsHeight() : iconHeight) + 10);
+            var myIconWidth:Number = (isNaN(iconWidth) ? iconDisplay.getPreferredBoundsWidth() : iconWidth);
+            var myIconHeight:Number = (isNaN(iconHeight) ? iconDisplay.getPreferredBoundsHeight() : iconHeight);
+
+            myMeasuredWidth += iconWidth;
+            myMeasuredHeight = Math.max(myMeasuredHeight, myIconHeight);
+            myMeasuredMinWidth += iconWidth;
+            myMeasuredMinHeight = Math.max(myMeasuredMinHeight, myIconHeight);
         }

         // Text is aligned next to icon
-
-        // FIXME (rfrishbe): will need to change this calculation
-        // don't allow text to contribute to width for now
-        myMeasuredWidth += labelDisplay.textWidth + 5 + 20; // 5 is the extra padding for text field, 20 is normal padding (10 & 10)
-        myMeasuredHeight = Math.max(myMeasuredHeight, labelDisplay.textHeight + 4 + 10); // 4 is the extra padding for text field, 10 is normal padding (5 & 5)
-
-        // don't do anything with regards to minimum for the textField
+        var labelLineMetrics:TextLineMetrics;
+        var labelWidth:Number;
+        var labelHeight:Number;
+        var messageLineMetrics:TextLineMetrics;
+        var messageWidth:Number;
+        var messageHeight:Number;
+        if (labelDisplay && messageDisplay)
+        {
+            labelLineMetrics = measureHeaderText(headerText);
+
+            labelWidth = labelLineMetrics.width + UITextField.TEXT_WIDTH_PADDING;
+            labelHeight = labelLineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+
+            messageLineMetrics = measureSubTextText(messageText);
+
+            messageWidth = messageLineMetrics.width + UITextField.TEXT_WIDTH_PADDING;
+            messageHeight = messageLineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+
+            myMeasuredWidth += Math.max(labelWidth, messageWidth);
+            myMeasuredHeight = Math.max(myMeasuredHeight, labelHeight + messageHeight);
+        }
+        else if (labelDisplay && !messageDisplay)
+        {
+            labelLineMetrics = measureHeaderText(headerText);
+
+            labelWidth = labelLineMetrics.width + UITextField.TEXT_WIDTH_PADDING;
+            labelHeight = labelLineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+
+            myMeasuredWidth += labelWidth;
+            myMeasuredHeight = Math.max(myMeasuredHeight, labelHeight);
+        }
+        else if (!labelDisplay && messageDisplay)
+        {
+            messageLineMetrics = measureSubTextText(messageText);
+
+            messageWidth = messageLineMetrics.width + UITextField.TEXT_WIDTH_PADDING;
+            messageHeight = messageLineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+
+            myMeasuredWidth += messageWidth;
+            myMeasuredHeight = Math.max(myMeasuredHeight, messageHeight);
+        }

         // Decorator is up next
         if (decoratorDisplay)
         {
-            // padding of 5 on the left...the right is already accounted for in the label
-            // padding of 10 for height (5 on top, 5 on bottom)
             if (decoratorDisplay is IVisualElement)
             {
-                myMeasuredWidth += IVisualElement(decoratorDisplay).getPreferredBoundsWidth() + 5;
-                myMeasuredHeight = Math.max(myMeasuredHeight, IVisualElement(decoratorDisplay).getPreferredBoundsHeight() + 10);
-                myMeasuredMinWidth += IVisualElement(decoratorDisplay).getMinBoundsWidth() + 5;
-                myMeasuredMinHeight = Math.max(myMeasuredMinHeight, IVisualElement(decoratorDisplay).getMinBoundsHeight() + 10);
+                myMeasuredWidth += IVisualElement(decoratorDisplay).getPreferredBoundsWidth();
+                myMeasuredHeight = Math.max(myMeasuredHeight, IVisualElement(decoratorDisplay).getPreferredBoundsHeight());
+                myMeasuredMinWidth += IVisualElement(decoratorDisplay).getMinBoundsWidth();
+                myMeasuredMinHeight = Math.max(myMeasuredMinHeight, IVisualElement(decoratorDisplay).getMinBoundsHeight());
             }
             else if (decoratorDisplay is IFlexDisplayObject)
             {
-                myMeasuredWidth += IFlexDisplayObject(decoratorDisplay).measuredWidth + 5;
-                myMeasuredHeight = Math.max(myMeasuredHeight, IFlexDisplayObject(decoratorDisplay).measuredHeight + 10);
-                myMeasuredMinWidth += IFlexDisplayObject(decoratorDisplay).measuredWidth + 5;
-                myMeasuredMinHeight = Math.max(myMeasuredMinHeight, IFlexDisplayObject(decoratorDisplay).measuredHeight + 10);
-            }
-        }
+                myMeasuredWidth += IFlexDisplayObject(decoratorDisplay).measuredWidth;
+                myMeasuredHeight = Math.max(myMeasuredHeight, IFlexDisplayObject(decoratorDisplay).measuredHeight);
+                myMeasuredMinWidth += IFlexDisplayObject(decoratorDisplay).measuredWidth;
+                myMeasuredMinHeight = Math.max(myMeasuredMinHeight, IFlexDisplayObject(decoratorDisplay).measuredHeight);
+            }
+        }
+
+        // now to add on padding and horizontal gap
+        var numHorizontalSections:int = 0;
+        var numVerticalSections:int = 0;
+        if (iconDisplay)
+            numHorizontalSections++;
+
+        if (decoratorDisplay)
+            numHorizontalSections++;
+
+        if (labelDisplay && messageDisplay)
+        {
+            numHorizontalSections++;
+            numVerticalSections = 2;
+        }
+        else if (labelDisplay || messageDisplay)
+        {
+            numHorizontalSections++;
+            numVerticalSections = 1;
+        }
+        else if (!labelDisplay && !messageDisplay)
+        {
+            numVerticalSections = 1;
+        }
+
+        var extraWidth:Number = getStyle("paddingLeft") + getStyle("paddingRight");
+        if (numHorizontalSections > 0)
+            extraWidth += (getStyle("horizontalGap") * (numHorizontalSections - 1));
+        var extraHeight:Number = getStyle("paddingTop") + getStyle("paddingBottom");
+        if (numVerticalSections == 2)
+            extraHeight += getStyle("verticalGap");
+
+        myMeasuredWidth += extraWidth;
+        myMeasuredMinWidth += extraWidth;
+        myMeasuredHeight += extraHeight;
+        myMeasuredMinHeight += extraHeight;

         // now set the local variables to the member variables.  Make sure it means our
         // minimum height of 80
         measuredWidth = myMeasuredWidth
-        measuredHeight = Math.max(80, myMeasuredHeight);
+        measuredHeight = Math.max(120, myMeasuredHeight);

         measuredMinWidth = myMeasuredMinWidth;
-        measuredMinHeight = Math.max(80, myMeasuredMinHeight);
+        measuredMinHeight = Math.max(120, myMeasuredMinHeight);
     }

     /**
@@ -765,6 +1073,14 @@
         var decoratorWidth:Number = 0;
         var decoratorHeight:Number = 0;

+        var paddingLeft:Number = getStyle("paddingLeft");
+        var paddingRight:Number = getStyle("paddingRight");
+        var paddingTop:Number = getStyle("paddingTop");
+        var paddingBottom:Number = getStyle("paddingBottom");
+
+        var viewWidth:Number = unscaledWidth - paddingLeft - paddingRight;
+        var viewHeight:Number = unscaledHeight - paddingTop - paddingBottom;
+
         // icon is on the left
         if (iconDisplay)
         {
@@ -774,8 +1090,8 @@
             iconWidth = iconDisplay.getLayoutBoundsWidth();
             iconHeight = iconDisplay.getLayoutBoundsHeight();

-            // three from the left and center vertically
-            iconDisplayHolder.setLayoutBoundsPosition(10, (unscaledHeight - iconHeight)/2);
+            // paddingLeft for x, paddingTop for y
+            iconDisplayHolder.setLayoutBoundsPosition(paddingLeft, paddingTop);
         }

         // decorator is aligned next to icon
@@ -789,8 +1105,8 @@
                 decoratorWidth = decoratorVisualElement.getLayoutBoundsWidth();
                 decoratorHeight = decoratorVisualElement.getLayoutBoundsHeight();

-                // three from right and center vertically
-                decoratorVisualElement.setLayoutBoundsPosition(unscaledWidth - 10 - decoratorWidth, (unscaledHeight - decoratorHeight)/2);
+                // paddingRight from right and center vertically
+                decoratorVisualElement.setLayoutBoundsPosition(unscaledWidth - paddingRight - decoratorWidth, (viewHeight - decoratorHeight)/2 + paddingTop);
             }
             else if (decoratorDisplay is IFlexDisplayObject)
             {
@@ -799,33 +1115,238 @@

                 IFlexDisplayObject(decoratorDisplay).setActualSize(decoratorWidth, decoratorHeight);

-                // three from right and center vertically
-                IFlexDisplayObject(decoratorDisplay).move(unscaledWidth - 10 - decoratorWidth, (unscaledHeight - decoratorHeight)/2);
+                // paddingRight from right and center vertically
+                IFlexDisplayObject(decoratorDisplay).move(unscaledWidth - paddingRight - decoratorWidth, (viewHeight - decoratorHeight)/2 + paddingTop);
             }
         }

-        // FIXME (rfrishbe): update for subText and header and use padding and gaps
-
-        // text should take up the rest of the space
-        var labelWidth:Number = unscaledWidth - iconWidth - decoratorWidth;
-        labelWidth -= (getStyle("paddingLeft") + getStyle("paddingRight"));
-
-        // don't forget the extra padding of 5 if these elements exist
+        // Figure out how much space we have for header and message as well as the
+        // starting left position
+        var labelComponentsViewWidth:Number = viewWidth - iconWidth - decoratorWidth;
+
+        // don't forget the extra gap padding if these elements exist
         if (iconDisplay)
-            labelWidth -= getStyle("horizontalGap");
+            labelComponentsViewWidth -= getStyle("horizontalGap");
         if (decoratorDisplay)
-            labelWidth -= getStyle("horizontalGap");
-
-        // padding of 5 from the left
-        var labelX:Number = getStyle("paddingLeft");
+            labelComponentsViewWidth -= getStyle("horizontalGap");
+
+        var labelComponentsX:Number = getStyle("paddingLeft");
         if (iconDisplay)
-            labelX += iconWidth + getStyle("horizontalGap");
-
-        labelDisplay.width = labelWidth;
-        labelDisplay.height = labelDisplay.textHeight + 4; // 4 is text field padding
-
-        labelDisplay.x = labelX;
-        labelDisplay.y = (unscaledHeight - labelDisplay.height)/2;
+            labelComponentsX += iconWidth + getStyle("horizontalGap");
+
+        // calculte the natural sizes for header and message (if present)
+        var headerTextWidth:Number = 0;
+        var headerTextHeight:Number = 0;
+        var headerLineMetrics:TextLineMetrics;
+
+        if (labelDisplay && labelDisplay.text != "")
+        {
+            labelDisplay.commitStyles();
+            headerLineMetrics = measureHeaderText(headerText);
+            headerTextWidth = headerLineMetrics.width + UITextField.TEXT_WIDTH_PADDING;
+            headerTextHeight = headerLineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+        }
+
+        if (messageDisplay && messageDisplay.text != "")
+        {
+            messageDisplay.commitStyles();
+            // no need to measure the text width and height since the measure function only
+            // take in to account the first line.
+        }
+
+        // now size and position the elements, 3 different configurations we care about:
+        // 1) header and message
+        // 2) header only
+        // 3) message only
+
+        // label display goes on top
+        // subtext display goes below
+
+        var headerWidth:Number = 0;
+        var headerHeight:Number = 0;
+        var messageWidth:Number = 0;
+        var messageHeight:Number = 0;
+        var verticalGap:Number = 0;
+
+        if (labelDisplay)
+        {
+            verticalGap = 0;
+
+            // handle labelDisplay.  it can only be 1 line
+
+            headerWidth = Math.max(Math.min(labelComponentsViewWidth, headerTextWidth), 0);
+            headerHeight = Math.max(Math.min(viewHeight, headerTextHeight), 0);
+
+            labelDisplay.width = headerWidth;
+            labelDisplay.height = headerHeight;
+
+            labelDisplay.x = Math.round(labelComponentsX);
+            labelDisplay.y = Math.round(paddingTop);
+
+            // reset text if it was truncated before.  then attempt to truncate it
+            if (labelDisplay.isTruncated)
+                labelDisplay.text = headerText;
+            labelDisplay.truncateToFit();
+        }
+
+        if (messageDisplay)
+        {
+            // handle message
+            // don't use the measured text width or height because that only takes the first line in to account
+            messageWidth = Math.max(labelComponentsViewWidth, 0);
+            messageHeight = Math.max(viewHeight - headerHeight - verticalGap, 0);
+
+            messageDisplay.width = messageWidth;
+            messageDisplay.height = messageHeight;
+
+            messageDisplay.x = Math.round(labelComponentsX);
+            messageDisplay.y = Math.round(paddingTop + headerHeight + verticalGap);
+
+            // since it's multi-line, no need to truncate
+            //if (messageDisplay.isTruncated)
+            //    messageDisplay.text = messageText;
+            //messageDisplay.truncateToFit();
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods: Helper functions for determining styles for header and message
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Function we pass in to header for it to grab the styles and push
+     *  them in to the TextFormat object used by that MobileTextField.
+     */
+    private function headerGetStyleFunction(styleProp:String):*
+    {
+        // grab the header specific styles
+        if (!headerStyles)
+            headerStyles = styleManager.getStyleDeclaration("." + getStyle("headerStyleName"));
+
+        // see if they are in the header styles
+        var styleValue:*;
+        if (headerStyles)
+            styleValue = headerStyles.getStyle(styleProp);
+
+        // if they are not there, try grabbing it from this component directly
+        if (styleValue === undefined)
+            styleValue = getStyle(styleProp);
+
+        return styleValue;
+    }
+
+    /**
+     *  @private
+     *  Function we pass in to message for it to grab the styles and push
+     *  them in to the TextFormat object used by that MobileTextField.
+     */
+    private function messageGetStyleFunction(styleProp:String):*
+    {
+        // grab the message specific styles
+        if (!messageStyles)
+            messageStyles = styleManager.getStyleDeclaration("." + getStyle("messageStyleName"));
+
+        // see if they are in the message styles
+        var styleValue:*;
+        if (messageStyles)
+            styleValue = messageStyles.getStyle(styleProp);
+
+        // if they are not there, try grabbing it from this component directly
+        if (styleValue === undefined)
+            styleValue = getStyle(styleProp);
+
+        return styleValue;
+    }
+
+    /**
+     *  @private
+     *  Function to help figure out the sizes of the header and message.  We cannot use
+     *  UIComponent.measureText() because we are adding a few additional styles
+     *  to it based on headerStyleName and messageStyleName.
+     */
+    private function measureHeaderText(text:String):TextLineMetrics
+    {
+        // Copied from UIComponent.measureText()
+        cachedHeaderFormat = determineTextFormatWithGetStyleFunction(headerGetStyleFunction, cachedHeaderFormat);
+        return cachedHeaderFormat.measureText(text);
+    }
+
+    /**
+     *  @private
+     *  Function to help figure out the sizes of the header and message.  We cannot use
+     *  UIComponent.measureText() because we are adding a few additional styles
+     *  to it based on headerStyleName and messageStyleName.
+     */
+    private function measureSubTextText(text:String):TextLineMetrics
+    {
+        // Copied from UIComponent.measureText()
+        cachedSubTextFormat = determineTextFormatWithGetStyleFunction(messageGetStyleFunction, cachedSubTextFormat);
+        return cachedSubTextFormat.measureText(text);
+    }
+
+    /**
+     *  @private
+     *  Function to help figure out the sizes of the header and message.  We cannot use
+     *  UIComponent.measureText() because we are adding a few additional styles
+     *  to it based on headerStyleName and messageStyleName.
+     */
+    private function determineTextFormatWithGetStyleFunction(getStyleFunction:Function, cachedTextFormat:UITextFormat):UITextFormat
+    {
+        // copied and adapted from UIComponent.determineTextFormatFromStyles
+        var textFormat:UITextFormat = cachedTextFormat;
+
+        if (!textFormat)
+        {
+            var font:String =
+                StringUtil.trimArrayElements(getStyleFunction("fontFamily"), ",");
+            textFormat = new UITextFormat(getNonNullSystemManager(), font);
+            textFormat.moduleFactory = moduleFactory;
+
+            // Not all flex4 textAlign values are valid so convert to a valid one.
+            var align:String = getStyleFunction("textAlign");
+            if (align == "start")
+                align = TextFormatAlign.LEFT;
+            else if (align == "end")
+                align = TextFormatAlign.RIGHT;
+            textFormat.align = align;
+            textFormat.bold = getStyleFunction("fontWeight") == "bold";
+            textFormat.color = enabled ?
+                getStyleFunction("color") :
+                getStyleFunction("disabledColor");
+            textFormat.font = font;
+            textFormat.indent = getStyleFunction("textIndex");
+            textFormat.italic = getStyleFunction("fontStyle") == "italic";
+            textFormat.kerning = getStyleFunction("kerning");
+            textFormat.leading = getStyleFunction("leading");
+            textFormat.leftMargin = getStyleFunction("paddingLeft"); // FIXME (rfrishbe): should these be in here...?
+            textFormat.letterSpacing = getStyleFunction("letterSpacing")
+            textFormat.rightMargin = getStyleFunction("paddingRight");
+            textFormat.size = getStyleFunction("fontSize");
+            textFormat.underline =
+                getStyleFunction("textDecoration") == "underline";
+
+            textFormat.antiAliasType = getStyleFunction("fontAntiAliasType");
+            textFormat.gridFitType = getStyleFunction("fontGridFitType");
+            textFormat.sharpness = getStyleFunction("fontSharpness");
+            textFormat.thickness = getStyleFunction("fontThickness");
+
+            //textFormat.useFTE =
+            //    getTextFieldClassName() == "mx.core::UIFTETextField" ||
+            //    getTextInputClassName() == "mx.controls::MXFTETextInput";
+
+            //if (textFormat.useFTE)
+            //{
+            //    textFormat.direction = getStyleFunction("direction");
+            //    textFormat.locale = getStyleFunction("locale");
+            //}
+
+            cachedTextFormat = textFormat;
+        }
+
+        return textFormat;
     }

 }


remove spaces from pipes to consolidate HTML and Flash

--- plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
+++ plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
@@ -321,12 +321,12 @@
 			if(_plugin.sendRefId && entry.referenceId){
 				refIdStr = entry.referenceId;
 				if (refIdStr)
-					refIdStr = refIdStr + " | ";
+					refIdStr = refIdStr + "|";
 			}
-			gaLabel = customObject["Label"] || ( refIdStr + (entry.name || _mediaTitle)+" | "+entry.id+" | "+kw.id );
+			gaLabel = customObject["Label"] || ( refIdStr + (entry.name || _mediaTitle)+"|"+entry.id+"|"+kw.id );
 			var	gaAction:String		= customObject["Action"] || note;
 			var	gaValue:Number		= customObject["Value"] || value;
-			log("SENDING ::: "+notification.getName() +" | "+shouldPublish);
+			log("SENDING ::: "+notification.getName() +"|"+shouldPublish);
 			if(shouldPublish){
 				publishGa(gaCategory, gaAction, gaLabel, gaValue);
 			}
@@ -372,8 +372,7 @@
 						{
 							if(currPosition )
 							{
-								publishGa (defaultCategory, _percentages[s][1]+"_pct_watched",  entry.name +" | "+entry.id+" | "+kw.id, Math.round(_currentTime))
-								trace("PERCENTAGE REACHED!!!!!!			"+_percentages[s][1]);
+								publishGa (defaultCategory, _percentages[s][1]+"_pct_watched",  entry.name +"|"+entry.id+"|"+kw.id, Math.round(_currentTime))
 								if(_percentages.length == s+1)
 								{
 									_percentages.splice(s,1);
@@ -484,7 +483,7 @@
 			}

 			log ("GA tracking************************: "+_ga+" : "+value);
-			log ("GA tracking************************: "+category+" | "+ action+" | "+ label+" | "+ value);
+			log ("GA tracking************************: "+category+"|"+ action+"|"+ label+"|"+ value);
 		}

 		private function log(str:String):void{


Simplistic ordering of nodes in requirements implemented

--- flexEditor/src/org/arisgames/editor/components/RequirementsEditorObjectComboBoxView.as
+++ flexEditor/src/org/arisgames/editor/components/RequirementsEditorObjectComboBoxView.as
@@ -310,7 +310,8 @@
                 var to:Object = new Object();
                 to.label = obj.result.data[j].title;
 				if(obj.result.data[j].title != "")
-					to.label += ": " + obj.result.data[j].text;
+					if(obj.result.data[j].npc_id != "0") to.label = obj.result.data[j].name + "::" + to.label + ": " + obj.result.data[j].text;
+					else to.label += ": " + obj.result.data[j].text;
                 to.data = obj.result.data[j].node_id;
                 possibleObjects.addItem(to);
             }


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@1251260 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/automation/src/mx/automation/codec/KeyCodePropertyCodec.as
+++ frameworks/projects/automation/src/mx/automation/codec/KeyCodePropertyCodec.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 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.automation.codec
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 10597
Author:   jimurphy@adobe.com
Date:     2009-09-25T18:49:20.077385Z

Log Message:
-----------
Merged gumbo_beta2 revisions 10484-10485,10547 -> trunk

Modified Paths:
--------------
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/CompositeEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/halo/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>

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

--- frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as
+++ frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as
@@ -12,8 +12,10 @@
 package mx.effects.effectClasses
 {
 import flash.events.TimerEvent;
+import flash.system.ApplicationDomain;
 import flash.utils.Timer;

+import mx.core.FlexVersion;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.effects.EffectInstance;
@@ -187,6 +189,8 @@
 	//
 	//--------------------------------------------------------------------------

+    private static var resizeEffectType:Class;
+    private static var resizeEffectLoaded:Boolean = false;
 	/**
 	 *  @private
 	 */
@@ -200,11 +204,26 @@
 		{
 			var compChild:CompositeEffectInstance = childSet[0] as CompositeEffectInstance;

+            // Resize effects must run before Move effects for autoCenterTransform to
+            // work correctly
+            if (!resizeEffectLoaded)
+            {
+                resizeEffectLoaded = true;
+                if (ApplicationDomain.currentDomain.hasDefinition("spark.effects.supportClasses.ResizeInstance"))
+                    resizeEffectType = Class(ApplicationDomain.currentDomain.
+                        getDefinition("spark.effects.supportClasses.ResizeInstance"));
+            }
+            if (resizeEffectType && (childSet[0] is resizeEffectType ||
+                (compChild != null && compChild.hasResizeInstance())))
+            {
+                // Remove item we just added to the end and place it at the beginning
+                childSets.unshift(childSets.pop());
+            }
 			// Check if the child is a Rotate and also check if it is a composite effect that has a Rotate
-			if (childSet[0] is RotateInstance || (compChild != null && compChild.hasRotateInstance()))
-			{
-				childSets.pop();
-				childSets.unshift(childSet);
+            else if (childSet[0] is RotateInstance || (compChild != null && compChild.hasRotateInstance()))
+			{
+                // Remove item we just added to the end and place it at the beginning
+                childSets.unshift(childSets.pop());
 			}
 		}
 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17156
Author:   hmuller@adobe.com
Date:     2010-08-02T20:56:24.600999Z

Log Message:
-----------
Added [Event(name="dataChange", ...)] metadata to GridItemRenderer and DefaultGridItemRenderer.

QE notes: DataGrid
Doc notes:
Bugs: SDK-27212
Reviewer: Kevin
Tests run: DataGrid cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as
@@ -15,12 +15,29 @@
 import flash.geom.Point;

 import mx.core.mx_internal;
+import mx.events.FlexEvent;

 import spark.components.Group;
 import spark.components.IGridItemRenderer;
 import spark.components.supportClasses.ItemRenderer;

 use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the bindable data property changes.
+ *
+ *  @eventType mx.events.FlexEvent.DATA_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Event(name="dataChange", type="mx.events.FlexEvent")]

 /**
  *  A convenient base class for custom grid item renderers.   Grid item renderers
@@ -129,7 +146,10 @@
             return;

         _data = value;
-        dispatchChangeEvent("dataChange");
+
+        const eventType:String = "dataChange";
+        if (hasEventListener(eventType))
+            dispatchEvent(new FlexEvent(eventType));
     }

     //----------------------------------


Transferred from the Adobe Open Source Subversion Repository

Revision: 4693
Author:   gruehle@adobe.com
Date:     2009-01-27T22:25:29.968307Z

Log Message:
-----------
FxScrollBar min size is now 35 pixels. The thumb is hidden if there isn't enough room to show at its minimum size.

QE Notes: The new min size for scroll thumbs may require new mustella bitmap baselines.
Doc Notes: None
Bugs: SDK-17126, SDK-18039
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxVScrollBarSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxVScrollBarThumbSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxHScrollBarSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxHScrollBarThumbSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
@@ -273,6 +273,17 @@

     /**
      *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // Hide the thumb if there is no room to display it
+        if (thumb)
+            thumb.visible = thumbSize < trackSize;
+    }
+    /**
+     *  @private
      */
     override protected function partAdded(partName:String, instance:Object):void
     {


fixed null pointer error

fixed null pointer error

--- WeaveData/src/weave/radviz/IncrementalLayoutAlgorithm.as
+++ WeaveData/src/weave/radviz/IncrementalLayoutAlgorithm.as
@@ -87,7 +87,7 @@
 					}
 					temp.splice(i,1); // remove inserted dimension in each iteration
 				}
-				orderedLayout = stored; //save best so far
+				orderedLayout = stored || []; //save best so far
 			}

 			trace( "incremental ", min);


asconfigc: delete module SWFs separately, similar to worker SWFs because they may not be in the main output directory

--- src/ASConfigC.as
+++ src/ASConfigC.as
@@ -180,6 +180,7 @@
 		private var _allWorkerCompilerArgs:Array;
 		private var _airDescriptors:Vector.<String> = null;
 		private var _outputPath:String = null;
+		private var _moduleOutputPaths:Array;
 		private var _workerOutputPaths:Array;
 		private var _mainFile:String = null;
 		private var _forceDebug:* = undefined;
@@ -660,6 +661,7 @@
 			}
 			if(TopLevelFields.MODULES in configData)
 			{
+				this._moduleOutputPaths = [];
 				var modules:Array = configData[TopLevelFields.MODULES];
 				var templateModuleCompilerArgs:Array = this.duplicateCompilerOptionsForModuleOrWorker(this._compilerArgs);
 				tmp.setGracefulCleanup();
@@ -671,6 +673,7 @@
 					var output:String = "";
 					if (ModuleFields.OUTPUT in module) {
 						output = module[ModuleFields.OUTPUT];
+						this._moduleOutputPaths.push(output);
 					}
 					if (output.length > 0) {
 						moduleCompilerArgs.push("--" + CompilerOptions.OUTPUT + "=" + output);
@@ -1261,6 +1264,30 @@
 				this.cleanOutputDirectory(outputDirectory);
 			}

+			if(this._moduleOutputPaths != null) {
+				var moduleCount:int = this._moduleOutputPaths.length;
+				for(var i:int = 0; i < moduleCount; i++)
+				{
+					var moduleOutputPath:String = this._moduleOutputPaths[i];
+					if(fs.existsSync(moduleOutputPath))
+					{
+						try
+						{
+							fs.unlinkSync(moduleOutputPath);
+						}
+						catch(e:Error)
+						{
+							var errorText:String = "Failed to clean project because an I/O exception occurred while deleting file: " + moduleOutputPath;
+							if(this._verbose)
+							{
+								errorText += "\n" + String(e);
+							}
+							throw new Error(errorText);
+						}
+					}
+				}
+			}
+
 			if(this._workerOutputPaths != null) {
 				var workerCount:int = this._workerOutputPaths.length;
 				for(var i:int = 0; i < workerCount; i++)


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

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

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

--- frameworks/projects/automation/src/mx/automation/delegates/core/RepeaterAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/core/RepeaterAutomationImpl.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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.automation.delegates.core
 {
 	import flash.display.DisplayObject;


Fix typo

Fix typo

--- frameworks/projects/apache/src/org/apache/flex/collections/VectorCollection.as
+++ frameworks/projects/apache/src/org/apache/flex/collections/VectorCollection.as
@@ -35,7 +35,7 @@
 /**
  *  The VectorCollection class is a wrapper class that exposes a Vector as a collection
  *  that can be accessed and manipulated using the methods and properties of the
- *  ICollectionView or IList interfaces. Operations on a ArrayCollection instance modify
+ *  ICollectionView or IList interfaces. Operations on a VectorCollection instance modify
  *  the data source; for example, if you use the removeItemAt() method on
  *  VectorCollection, you remove the item from the underlying Vector.
  */


Transferred from the Adobe Open Source Subversion Repository

Revision: 18699
Author:   smgilson@adobe.com
Date:     2010-11-18T15:27:25.899689Z

Log Message:
-----------
ASDoc updates for DataGrid

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as
@@ -33,22 +33,37 @@
 //--------------------------------------

 /**
- *  Dispatched when the bindable data property changes.
+ *  Dispatched when the data property changes.
  *
  *  @eventType mx.events.FlexEvent.DATA_CHANGE
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
- *  @playerversion AIR 2.0
+ *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
 [Event(name="dataChange", type="mx.events.FlexEvent")]

 /**
- *  A convenient base class for custom grid item renderers.   Grid item renderers
- *  are only required to display some column-specific aspect of their data.  They're
- *  not responsible for displaying the selection or hover indicators, the alternating
- *  background color (if any), or row/column separators.
+ *  The GridItemRenderer class defines the base class for custom item renderers
+ *  for the Spark grid controls, such as DataGrid and Grid.
+ *  Item renderers are only required to display column-specific aspects of their data.
+ *  They are not responsible for displaying the selection or hover indicators,
+ *  the alternating background color (if any), or row or column separators.
+ *
+ *
Item renderers are associated with each column of a grid.
+ *  Set the item renderer for a column by using
+ *  the GridColumn.itemRenderer property.

+ *
+ *  @see spark.components.DataGrid
+ *  @see spark.components.Grid
+ *  @see spark.components.gridClasses.GridColumn
+ *  @see spark.components.gridClasses.GridColumn#itemRenderer
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 public class GridItemRenderer extends Group implements IGridItemRenderer
 {
@@ -65,7 +80,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function GridItemRenderer()
@@ -148,7 +163,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get column():GridColumn
@@ -173,11 +188,13 @@
     //----------------------------------

     /**
-     *  Returns column.columnIndex.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  Returns the zero-based index of the column being rendered.
+     *  That means that values are 0, 1, 2, ... , n - 1,
+     *  where n is the total number of columns.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get columnIndex():int
@@ -194,15 +211,19 @@
     [Bindable("dataChange")]  // compatible with FlexEvent.DATA_CHANGE

     /**
-     *  The value of the dataProvider "item" for this row, i.e. dataProvider.getItemAt(rowIndex).
-     *  Item renderers often bind visual element attributes to data properties.  Note
-     *  that, despite its name, this property does not depend on the column's "dataField".
+     *  The value of the data provider item for the grid row
+     *  corresponding to the item renderer.
+     *  This value corresponds to the object returned by a call to the
+     *  dataProvider.getItemAt(rowIndex) method.
+     *
+     *
Item renderers can override this property definition to access
+     *  the data for the entire row of the grid.

      *
      *  @default null
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get data():Object
@@ -242,7 +263,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get down():Boolean
@@ -267,11 +288,12 @@
     //----------------------------------

     /**
-     *  Returns the Grid associated with this item renderer (same value as column.grid).
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  Returns the Grid associated with this item renderer.
+     *  This is the same value as column.grid.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get grid():Grid
@@ -286,13 +308,13 @@
     private var _hovered:Boolean = false;

     /**
-     *  Set to true when the mouse is hovered over the item renderer.
+     *  @inheritDoc
      *
      *  @default false
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get hovered():Boolean
@@ -321,7 +343,7 @@
     [Bindable("rowIndexChanged")]

     /**
-     *  The index of the dataProvider item for this item renderer's row.
+     *  @inheritDoc
      *
      *
The Grid's updateDisplayList() method sets this property
      *  before calling prepare()
.
@@ -330,7 +352,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get rowIndex():int
@@ -359,9 +381,7 @@
     [Bindable("showsCaretChanged")]

     /**
-     *  True if the item renderer's cell is contained within the caret indicator.
-     *  As with the selected property,  grid item renderers do not have exclusive
-     *  responsibility for displaying the caret indicator.
+     *  @inheritDoc
      *
      *
The Grid's updateDisplayList() method sets this property
      *  before calling preprare()
.
@@ -370,7 +390,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get showsCaret():Boolean
@@ -400,10 +420,7 @@
     [Bindable("selectedChanged")]

     /**
-     *  True if the item renderer's cell is part of the current selection.  Unlike a list item renderer,
-     *  grid item renderers do not have exclusive responsibility for displaying the selection indicator.
-     *  The Grid itself renders the selection indicator for the selected row or cell.  The item renderer
-     *  can also change its visual properties to emphasize that it's part of the selection.
+     *  @inheritDoc
      *
      *
The Grid's updateDisplayList() method sets this property
      *  before calling preprare()
.
@@ -412,7 +429,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get selected():Boolean
@@ -442,7 +459,12 @@
     [Bindable("draggingChanged")]

     /**
-     *  TBD
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get dragging():Boolean
     {
@@ -471,17 +493,13 @@
     [Bindable("labelChanged")]

     /**
-     *  The string to display in the item renderer's cell.  This method copies
-     *  the (non null) value to the text property of labelDisplay.
-     *
-     *
The Grid sets this property to the value of the column's itemToLabel() method, before
-     *  calling preprare().

+     *  @iheritDoc
      *
      *  @default ""
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get label():String
@@ -514,14 +532,17 @@
     [Bindable("labelDisplayChanged")]

     /**
-     *  An optional component for displaying the label property.   If specified, this component's
-     *  text will be kept in sync with this renderer's label.
+     *  An optional visual component in the item renderer
+     *  for displaying the label property.
+     *  If you use this property to specify a visual component,
+     *  the component's text property is kept synchronized
+     *  with the item renderer's label property.
      *
      *  @default null
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     public function get labelDisplay():TextBase
@@ -548,11 +569,11 @@
     //--------------------------------------------------------------------------

     /**
-     *  Returns the name of the state to be applied to the renderer. For example, a
-     *  very basic Grid item renderer would return the String "normal", "hovered",
+     *  Returns the name of the state to be applied to the renderer.
+     *  For example, a basic item renderer returns the String "normal", "hovered",
      *  or "selected" to specify the renderer's state.
      *  If dealing with touch interactions (or mouse interactions where selection
-     *  is ignored), "down" and "downAndSelected" are also important states.
+     *  is ignored), "down" and "downAndSelected" can also be returned.
      *
      *
A subclass of GridItemRenderer must override this method to return a value
      *  if the behavior desired differs from the default behavior.

@@ -578,7 +599,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.0
+     *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     protected function getCurrentRendererState():String
@@ -662,6 +683,11 @@

     /**
      *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function prepare(hasBeenRecycled:Boolean):void
     {
@@ -669,6 +695,11 @@

     /**
      *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function discard(willBeRecycled:Boolean):void
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12368
Author:   dsubrama@adobe.com
Date:     2009-12-02T16:37:28.078960Z

Log Message:
-----------
Rename spark.components.supportClasses.Slider to spark.components.supportClasses.SliderBase as well as spark.components.supportClasses.ScrollBar to spark.components.supportClasses.ScrollBarBase. This means the spark manifest entries have also changed (for CSS styling purposes, not for use as mxml tags) (Slider -> SliderBase, ScrollBar -> ScrollBarBase).

Change is PARB approved.

QE notes: Please check-in the updated tests
Doc notes: ASDoc has been updated. If any updates need to happen in livedocs, please do so.
Bugs: SDK-24401
Reviewer: Ryan/Jason
Tests run: Jacob ran a cyclone
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as" copyfrom-rev="12283" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/SliderAccImpl.as" copyfrom-rev="12283" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/SliderBaseAccImpl.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as" copyfrom-rev="12283" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/SliderAccImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/sparkTest/src/components/CircularScrollBar.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
@@ -138,10 +138,10 @@
 [Exclude(name="focusThickness", kind="style")]

 /**
- *  The ScrollBar class helps to position
+ *  The ScrollBarBase class helps to position
  *  the portion of data that is displayed when there is too much data
  *  to fit in a display area.
- *  The ScrollBar class displays a pair of scrollbars and a viewport.
+ *  The ScrollBarBase class displays a pair of scrollbars and a viewport.
  *  A viewport is a UIComponent that implements IViewport, such as Group.
  *
  *
This control extends the TrackBase class and
@@ -149,7 +149,7 @@
  *  controls.

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

  *
  *

@@ -167,11 +167,11 @@
  *
  *  @mxml
  *
- *
The <s:ScrollBar> tag inherits all of the tag
+ *
The <s:ScrollBarBase> tag inherits all of the tag
  *  attributes of its superclass and adds the following tag attributes:

  *
  *

- *  <s:ScrollBar
+ *  <s:ScrollBarBase
  *    Properties
  *    pageSize="20"
  *    snapInterval=""
@@ -198,7 +198,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class ScrollBar extends TrackBase
+public class ScrollBarBase extends TrackBase
 {
     include "../../core/Version.as";

@@ -222,7 +222,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function ScrollBar():void
+    public function ScrollBarBase():void
     {
         super();
     }
@@ -296,7 +296,7 @@

     /**
      * @private
-     * This variable tracks whether we are currently stepping the ScrollBar
+     * This variable tracks whether we are currently stepping the ScrollBarBase
      */
     private var isStepping:Boolean;

@@ -438,7 +438,7 @@
      *  The viewport controlled by this scrollbar.
      *
      *  If a viewport is specified, then changes to its actual size, content
-     *  size, and scroll position cause the corresponding ScrollBar methods to
+     *  size, and scroll position cause the corresponding ScrollBarBase methods to
      *  run:
      *

      *
viewportResizeHandler()

@@ -1038,7 +1038,7 @@
             easer = new Linear(500/duration);
         else
             easer = easyInLinearEaser;
-        // FIXME (chaase): we're using ScrollBar's repeatInterval for animated
+        // FIXME (chaase): we're using ScrollBarBase's repeatInterval for animated
         // stepping, but Button's repeatInterval for non-animated stepping
         // FIXME (chaase): think about the total duration for the animation.
         // FIXME (chaase): hard-coding easing behavior, how to style it?


Command has notificationObject() helper method

--- src/ru/whitered/kote/Command.as
+++ src/ru/whitered/kote/Command.as
@@ -10,6 +10,10 @@
 	 */
 	public class Command extends Notifier
 	{
+		private var _notificationObject:NotificationObject;
+
+
+
 		/**
 		 * Invokes when the command is executed
 		 *
@@ -24,13 +28,25 @@
 		 *
 		 * @return true to resume notification flow
 		 */
-		public function execute(notification:NotificationObject):Boolean
+		public function execute(notificationObject:NotificationObject):Boolean
 		{
 			if(hasOwnProperty("run") && this["run"] is Function)
 			{
-				this["run"].apply(this, notification.parameters);
+				_notificationObject = notificationObject;
+				this["run"].apply(this, notificationObject.parameters);
+				_notificationObject = null;
 			}
 			return true;
 		}
+
+
+
+		/**
+		 * notificationObject is only accessible in run() method
+		 */
+		public function get notificationObject():NotificationObject
+		{
+			return _notificationObject;
+		}
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18441
Author:   dloverin@adobe.com
Date:     2010-11-04T03:31:10.364223Z

Log Message:
-----------
Fix mustella Font tests on AIR

QE notes: None.
Doc notes: None.
Bugs: SDK-28436
Reviewer:
Tests run: checkintests
Is noteworthy for integration: No.

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/utils/LoaderUtil.as

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

--- frameworks/projects/framework/src/mx/utils/LoaderUtil.as
+++ frameworks/projects/framework/src/mx/utils/LoaderUtil.as
@@ -308,6 +308,15 @@
                     var request:Request = new Request(Request.GET_PARENT_FLEX_MODULE_FACTORY_REQUEST);
                     DisplayObject(currentModuleFactory).dispatchEvent(request);
                     currentModuleFactory = request.value as IFlexModuleFactory;
+
+                    // If we couldn't get the parent module factory, then we
+                    // will have to load into the highest application domain
+                    // that is available. We won't be able to get a parent
+                    // if a module was loaded without specifying a parent
+                    // module factory.
+                    if (!currentModuleFactory)
+                        break;
+
                     if (currentModuleFactory != topLevelModuleFactory)
                         moduleFactories.push(currentModuleFactory);


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

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

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

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

 package mx.managers.marshalClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19255
Author:   jasonsj@adobe.com
Date:     2010-12-10T01:09:55.925106Z

Log Message:
-----------
Missing invalidateSize and invalidateDisplay list when CheckBox or RadioButton label changes. Fixes regression from rev 19253.

QE notes:
Bugs:
SDK-28583 	textShadowAlpha should have a common global value, should only apply to ActionBar and Button
Reviewer: jszeto
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1265871 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
@@ -13,34 +13,19 @@
 {

 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;

@@ -157,6 +142,9 @@
         labelDisplay = StyleableTextField(createInFontContext(StyleableTextField));
         labelDisplay.styleName = this;

+        // update shadow when labelDisplay changes
+        labelDisplay.addEventListener(FlexEvent.VALUE_COMMIT, labelDisplay_valueCommitHandler);
+
         addChild(labelDisplay);
     }

@@ -540,5 +528,18 @@
         invalidateSize();
         invalidateDisplayList();
     }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event Handlers
+    //
+    //--------------------------------------------------------------------------
+
+    protected function labelDisplay_valueCommitHandler(event:FlexEvent):void
+    {
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
 }
 }


Line wrapping and line ending cleanup

Line wrapping and line ending cleanup

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@800 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flash/Vector2.as
+++ src/as/com/threerings/flash/Vector2.as
@@ -51,7 +51,7 @@
     {
         return new Vector2(t.x - s.x, t.y - s.y);
     }
-
+
     /**
      * Creates a Vector2 of magnitude 'len' that has been rotated about the origin by 'radians'.
      */
@@ -64,17 +64,17 @@
             Math.sin(radians) * len);  // == len * (sin(theta)*x + cos(theta)*y)
     }

-    /**
-     * Constructs a Vector2 from the given values.
+    /**
+     * Constructs a Vector2 from the given values.
      */
     public function Vector2 (x :Number = 0, y :Number = 0)
     {
         this.x = x;
         this.y = y;
     }
-
-    /**
-     * Sets the vector's components to the given values.
+
+    /**
+     * Sets the vector's components to the given values.
      */
     public function set (x :Number, y :Number) :void
     {
@@ -82,8 +82,8 @@
         this.y = y;
     }

-    /**
-     * Returns the dot product of this vector with vector v.
+    /**
+     * Returns the dot product of this vector with vector v.
      */
     public function dot (v :Vector2) :Number
     {
@@ -98,16 +98,16 @@
         return new Point(x, y);
     }

-    /**
-     * Returns a copy of this Vector2.
+    /**
+     * Returns a copy of this Vector2.
      */
     public function clone () :Vector2
     {
         return new Vector2(x, y);
     }
-
-    /**
-     * Returns the angle represented by this Vector2, in radians.
+
+    /**
+     * Returns the angle represented by this Vector2, in radians.
      */
     public function get angle () :Number
     {
@@ -115,34 +115,34 @@
         return (angle >= 0 ? angle : angle + (2 * Math.PI));
     }

-    /**
-     * Returns this vector's length.
+    /**
+     * Returns this vector's length.
      */
     public function get length () :Number
     {
         return Math.sqrt(x * x + y * y);
     }

-    /**
-     * Sets this vector's length.
+    /**
+     * Sets this vector's length.
      */
     public function set length (newLen :Number) :void
     {
         var scale :Number = newLen / this.length;
-
+
         x *= scale;
         y *= scale;
     }

-    /**
-     * Returns the square of this vector's length.
+    /**
+     * Returns the square of this vector's length.
      */
     public function get lengthSquared () :Number
     {
         return (x * x + y * y);
     }

-    /**
+    /**
      * Rotates the vector in place by 'radians'.
      * Returns a reference to 'this', for chaining.
      */
@@ -154,34 +154,34 @@
         var oldX :Number = x;
         x = (cosTheta * oldX) - (sinTheta * y);
         y = (sinTheta * oldX) + (cosTheta * y);
-
-        return this;
-    }
-
-    /**
+
+        return this;
+    }
+
+    /**
      * Returns a rotated copy of this vector.
      */
     public function rotate (radians :Number) :Vector2
     {
         return this.clone().rotateLocal(radians);
     }
-
-    /**
-     * Normalizes the vector in place and returns its original length.
+
+    /**
+     * Normalizes the vector in place and returns its original length.
      */
     public function normalizeLocalAndGetLength () :Number
     {
         var length :Number = this.length;
-
+
         x /= length;
         y /= length;
-
+
         return length;
     }

-    /**
+    /**
      * Normalizes this vector in place.
-     * Returns a reference to 'this', for chaining.
+     * Returns a reference to 'this', for chaining.
      */
     public function normalizeLocal () :Vector2
     {
@@ -189,19 +189,19 @@

         x *= lengthInverse;
         y *= lengthInverse;
-
-        return this;
-    }
-
-    /**
-     * Returns a normalized copy of the vector.
+
+        return this;
+    }
+
+    /**
+     * Returns a normalized copy of the vector.
      */
     public function normalize () :Vector2
     {
         return this.clone().normalizeLocal();
     }

-    /**
+    /**
      * Adds another Vector2 to this, in place.
      * Returns a reference to 'this', for chaining.
      */
@@ -209,11 +209,11 @@
     {
         x += v.x;
         y += v.y;
-
-        return this;
-    }
-
-    /**
+
+        return this;
+    }
+
+    /**
      * Returns a copy of this vector added to 'v'.
      */
     public function add (v :Vector2) :Vector2
@@ -221,7 +221,7 @@
         return this.clone().addLocal(v);
     }

-    /**
+    /**
      * Subtracts another vector from this one, in place.
      * Returns a reference to 'this', for chaining.
      */
@@ -229,12 +229,12 @@
     {
         x -= v.x;
         y -= v.y;
-
-        return this;
-    }
-
-    /**
-     * Returns (this - v).
+
+        return this;
+    }
+
+    /**
+     * Returns (this - v).
      */
     public function subtract (v :Vector2) :Vector2
     {
@@ -242,9 +242,9 @@
     }

     /**
-     * Returns a vector that is perpendicular to this.
-     * If ccw = true, the perpendicular vector is rotated 90 degrees counter-clockwise from this vector,
-     * otherwise it's rotated 90 degrees clockwise.
+     * Returns a vector that is perpendicular to this one.
+     * If ccw = true, the perpendicular vector is rotated 90 degrees counter-clockwise from this
+     * vector, otherwise it's rotated 90 degrees clockwise.
      */
     public function getPerp (ccw :Boolean = true) :Vector2
     {
@@ -262,7 +262,7 @@
     {
         x *= value;
         y *= value;
-
+
         return this;
     }

@@ -279,29 +279,29 @@
     {
         x = -x;
         y = -y;
-
-        return this;
-    }
-
-    /**
-     * Returns a copy of the vector, inverted.
+
+        return this;
+    }
+
+    /**
+     * Returns a copy of the vector, inverted.
      */
     public function invert () :Vector2
     {
        return this.clone().invertLocal();
     }
-
-    /**
+
+    /**
      * Returns true if this vector is equal to v.
      */
     public function equals (v :Vector2) :Boolean
     {
         return (x == v.x && y == v.y);
     }
-
-    /**
-     * Returns true if the components of v are equal to the components of this Vector2,
-     * within the given epsilon.
+
+    /**
+     * Returns true if the components of v are equal to the components of this Vector2,
+     * within the given epsilon.
      */
     public function similar (v :Vector2, epsilon :Number) :Boolean
     {


write samples multiple times when playing it back if sampleRate is < 44.1

--- flash/Recorder.as
+++ flash/Recorder.as
@@ -245,13 +245,26 @@
 		}

 		protected function playSampleDataHandler(event:SampleDataEvent):void
-		{
-			for (var i:int = 0; i < 8192 && buffer.bytesAvailable; i++)
+		{
+			var expectedSampleRate = 44.1;
+			var writtenSamples = 0;
+			var channels = 2;
+			var maxSamples = 8192 * channels;
+			// if the sampleRate doesn't match the expectedSampleRate of flash.media.Sound (44.1) write the sample multiple times
+			// this will result in a little down pitchshift.
+			// also write 2 times for stereo channels
+			while(writtenSamples < maxSamples && buffer.bytesAvailable)
 			{
 				var sample:Number = buffer.readFloat();
-				event.data.writeFloat(sample);
-				event.data.writeFloat(sample);
-			}
+			  for (var j:int = 0; j < channels * (expectedSampleRate / sampleRate); j++){
+					event.data.writeFloat(sample);
+					writtenSamples++;
+					if(writtenSamples >= maxSamples){
+						break;
+					}
+				}
+			}
+			logger.log("Wrote " + writtenSamples + " samples");
 		}

 		/* ExternalInterface Communication */


check for size change

check for size change

--- frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -130,6 +130,7 @@

 			IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
 			IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+            IEventDispatcher(_strand).addEventListener("sizeChanged",sizeChangeHandler);
 		}

         protected function setupSkins():void


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@1281791 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/gridClasses/GridSelectionMode.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridSelectionMode.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.components.gridClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8452
Author:   cframpto@adobe.com
Date:     2009-07-08T15:38:32.261224Z

Log Message:
-----------
- Fix flicker problem with constraint bound text that is being autoSized.  If the remeasure is done in a 2nd pass you will see a flicker as all the objects are moved to accommodate the reflowed text.
- Fix data binding issue with text setter.
- Rework measure() to accommodate implicit autoSize.

If explicitWidth or widthInChars specified and explicitHeight or heightInLines specified, or for now, blockProgression != "tb", the text has fixed dimensions and is not auto-sized.

If no text and width specified, but no height, start at specified width and one line high and grow taller.
If no text and height specified, start at 1 char wide with the specified height and grow wider.
If neither width nor height specified, and toFit lineBreaks, start at explicitMaxWidth, or default maxWidth of 160, and grow taller.
If neither width nor height specified, and explicit lineBreaks width is unlimited and can grow taller.

These are further constrained by min/max Width and Height except in the case that explicitWidth or explicitHeight are specified.

- Change default maxWidth for RichText and SimpleText to 160 to match RET.  Previously it was 10000.  This is used for
text with toFit lineBreaks if a width isn't specified.

QA Notes: 12 or so TextGraphic tests fail because of the new default maxWidth.
Doc Notes:SDK-22014, SDK-21837
Reviewers: Gordon

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/RichEditableTextEditManager.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -1098,7 +1098,7 @@
      *  @private
      *  Storage for the maxHeight property.
      */
-    private var _maxWidth:Number;
+    mx_internal var _maxWidth:Number;

     [Inspectable(category="General")]


fix incorrect audio PID value reported in debug logs

--- src/org/mangui/HLS/muxing/TS.as
+++ src/org/mangui/HLS/muxing/TS.as
@@ -487,7 +487,7 @@
             if (audioTrack) {
                 audioPID = audioTrack.id;
                 _audioIsAAC = (audioTrack.title.indexOf("AAC") > -1);
-                Log.debug("TS: selected audio PID: " + _audioId + " isAAC:" + _audioIsAAC);
+                Log.debug("TS: selected audio PID: " + audioPID + " isAAC:" + _audioIsAAC);
             } else {
                 audioPID = -1;
                 Log.debug("TS: no audio selected");


Added streamStarted event

Added streamStarted event

--- src/Player.as
+++ src/Player.as
@@ -29,6 +29,7 @@
   [SWF(backgroundColor="#efefef")]

   public class Player extends Sprite {
+    private static const EVENT_STREAM_STARTED:String  = "streamStarted";
     private static const EVENT_FULLSCREEN_ENTERED:String  = "fullscreenEntered";
     private static const EVENT_FULLSCREEN_EXITED:String  = "fullscreenExited";

@@ -186,7 +187,6 @@
       case 'rtsp':
         /* RTSP over TCP */
         client = new RTSPClient(this.video, urlParsed, new RTSPoverTCPHandle(urlParsed));
-        this.callAPI('streamStarted');
         break;

       case 'http':
@@ -350,6 +350,7 @@

     private function onStartPlay(ev:ClientEvent):void {
       this.currentState = "playing";
+      this.callAPI(EVENT_STREAM_STARTED);
     }

     public function onPlayStatus(ev:Object):void {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11946
Author:   gosmith@adobe.com
Date:     2009-11-18T19:25:26.539128Z

Log Message:
-----------
A new enum class, mx.accessibility.AccConst, now centralizes, makes public, and documents all the ROLE_XXX, STATE_XXX, and EVENT_XXX constants defined by Microsoft's Active Accessibility (MSAA) specification.

These constants are for use in writing AccessibilityImplementation subclasses. With this checkin, only the AccImpl base class has been converted to use them, but soon all of its subclasses will be converted as well.

QE notes: None
Doc notes: We need to get ALL accessibility classes showing up in ASDoc, both in the Player and in Flex.
Bugs: None
Reviewer: Ryan
Tests run: ant checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccImpl.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccConst.as</path>

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

--- frameworks/projects/framework/src/mx/accessibility/AccImpl.as
+++ frameworks/projects/framework/src/mx/accessibility/AccImpl.as
@@ -18,6 +18,7 @@
 import flash.display.DisplayObjectContainer;
 import flash.events.Event;

+import mx.accessibility.AccConst;
 import mx.containers.Form;
 import mx.containers.FormHeading;
 import mx.containers.FormItem;
@@ -45,47 +46,6 @@

     //--------------------------------------------------------------------------
     //
-    //  Class constants
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    private static const STATE_SYSTEM_NORMAL:uint = 0x00000000;
-
-    /**
-     *  @private
-     */
-    private static const STATE_SYSTEM_FOCUSABLE:uint = 0x00100000;
-
-    /**
-     *  @private
-     */
-    private static const STATE_SYSTEM_FOCUSED:uint = 0x00000004;
-
-    /**
-     *  @private
-     */
-    private static const STATE_SYSTEM_UNAVAILABLE:uint = 0x00000001;
-
-    /**
-     *  @private
-     */
-    private static const EVENT_OBJECT_NAMECHANGE:uint = 0x800C;
-
-    /**
-     *  @private
-     */
-    private static const EVENT_OBJECT_SHOW:uint = 0x8002;
-
-    /**
-     *  @private
-     */
-    private static const EVENT_OBJECT_HIDE:uint = 0x8003;
-
-    //--------------------------------------------------------------------------
-    //
     //  Class methods
     //
     //--------------------------------------------------------------------------
@@ -363,18 +323,18 @@
      */
     protected function getState(childID:uint):uint
     {
-        var accState:uint = STATE_SYSTEM_NORMAL;
+        var accState:uint = AccConst.STATE_SYSTEM_NORMAL;

         if (!UIComponent(master).enabled)
         {
-            accState |= STATE_SYSTEM_UNAVAILABLE;
+            accState |= AccConst.STATE_SYSTEM_UNAVAILABLE;
         }
         else
         {
-            accState |= STATE_SYSTEM_FOCUSABLE
+            accState |= AccConst.STATE_SYSTEM_FOCUSABLE

             if (UIComponent(master) == UIComponent(master).getFocus())
-                accState |= STATE_SYSTEM_FOCUSED;
+                accState |= AccConst.STATE_SYSTEM_FOCUSED;
         }

         return accState;
@@ -443,19 +403,22 @@
             case "errorStringChanged":
             case "toolTipChanged":
             {
-                Accessibility.sendEvent(master, 0, EVENT_OBJECT_NAMECHANGE);
+                Accessibility.sendEvent(master, 0,
+										AccConst.EVENT_OBJECT_NAMECHANGE);
                 Accessibility.updateProperties();
                 break;
             }
+
             case "show":
             {
-                Accessibility.sendEvent(master, 0, EVENT_OBJECT_SHOW);
+                Accessibility.sendEvent(master, 0, AccConst.EVENT_OBJECT_SHOW);
                 Accessibility.updateProperties();
                 break;
             }
+
             case "hide":
             {
-                Accessibility.sendEvent(master, 0, EVENT_OBJECT_HIDE);
+                Accessibility.sendEvent(master, 0, AccConst.EVENT_OBJECT_HIDE);
                 Accessibility.updateProperties();
                 break;
             }


Transferred from the Adobe Open Source Subversion Repository

Revision: 11436
Author:   dloverin@adobe.com
Date:     2009-11-04T18:27:10.565800Z

Log Message:
-----------
Unload style fix.

projects/framework/src/mx/managers/IPopUpManager.as
projects/framework/src/mx/managers/PopUpManager.as
projects/framework/src/mx/managers/PopUpManagerImpl.as
    Add moduleFactory parameter to PopUpManager.addPopUp() so the moduleFactory can be controlled separately from the parent.

projects/framework/src/mx/styles/CSSStyleDeclaration.as
    Test if overrides[styleProp] is undefined instead of non-zero.

QE notes: None.
Doc notes: None.
Bugs: SDK-23030
Reviewer: Alex
Tests run: checkintests, Managers/StyleManager, Managers/PopUpManager
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IPopUpManager.as</path>

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

--- frameworks/projects/framework/src/mx/managers/PopUpManager.as
+++ frameworks/projects/framework/src/mx/managers/PopUpManager.as
@@ -14,6 +14,7 @@

 import flash.display.DisplayObject;
 import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModuleFactory;
 import mx.core.Singleton;

 /**
@@ -169,6 +170,9 @@
      *  PopUpManagerChildList.POPUP,
      *  or PopUpManagerChildList.PARENT (default).
      *
+     *  @param moduleFactory The moduleFactory where this pop-up should look for
+     *  its embedded fonts and style manager.
+     *
      *  @see PopUpManagerChildList
      *
      *  @langversion 3.0
@@ -179,9 +183,10 @@
     public static function addPopUp(window:IFlexDisplayObject,
                     parent:DisplayObject,
                     modal:Boolean = false,
-                    childList:String = null):void
-    {
-		impl.addPopUp(window, parent, modal, childList);
+                    childList:String = null,
+                    moduleFactory:IFlexModuleFactory = null):void
+    {
+		impl.addPopUp(window, parent, modal, childList, moduleFactory);
     }

     /**