Transferred from the Adobe Open Source Subversion Repository

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

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

UIComponent: remove keepControlOfMouseDown, which was checked in accidentally

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

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

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

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

Scroller: clean up a lot of the touch scrolling code

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

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package spark.skins.mobile
+package spark.components
 {
 import flash.display.DisplayObject;
 import flash.events.MouseEvent;
@@ -41,132 +41,65 @@
 use namespace mx_internal;

 //--------------------------------------
-//  Events
+//  Styles
 //--------------------------------------

+include "../styles/metadata/GapStyles.as"
+
 /**
- *  Dispatched when the data property changes.
- *
- *
When you use a component as an item renderer,
- *  the data property contains the data to display.
- *  You can listen for this event and update the component
- *  when the data property changes.

- *
- *  @eventType mx.events.FlexEvent.DATA_CHANGE
+ *  Name of the CSS Style declaration to use for the styles for the
+ *  header component.
  *
  *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
-[Event(name="dataChange", type="mx.events.FlexEvent")]
-
-//--------------------------------------
-//  Styles
-//--------------------------------------
-
-// FIXME(rfrishbe): get these styles somehow
-//include "../../styles/metadata/BasicInheritingTextStyles.as"
-//include "../../styles/metadata/AdvancedInheritingTextStyles.as"
-//include "../../styles/metadata/SelectionFormatTextStyles.as"
+[Style(name="headerStyleName", type="String", inherit="no")]

 /**
- *  The colors to use for the backgrounds of the items in the list.
- *  The value is an array of two or more colors.
- *  The backgrounds of the list items alternate among the colors in the array.
- *
- *  @default undefined
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes", theme="spark, mobile")]
-
-/**
- *  Color of focus ring when the component is in focus
- *
- *  @default 0x70B2EE
+ *  Name of the CSS Style declaration to use for the styles for the
+ *  subText component.
  *
  *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="subTextStyleName", type="String", inherit="no")]

 /**
- *  Color of the highlights when the mouse is over the component
- *
- *  @default 0xCEDBEF
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Style(name="rollOverColor", type="uint", format="Color", inherit="yes")]
-// FIXME (rfrishbe): should be theme="" above
-
-/**
- *  Color of the highlights when the item is selected
- *
- *  @default 0xCEDBEF
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Style(name="selectionColor", type="uint", format="Color", inherit="yes")]
-// FIXME (rfrishbe): figure out why this isn't on defaultitemrenderer or itemrenderer
-
-/**
- *  Color of any symbol of a component. Examples include the check mark of a CheckBox or
- *  the arrow of a scroll button
- *
- *  @default 0x000000
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
-
-//--------------------------------------
-//  Excluded APIs
-//--------------------------------------
-
-[Exclude(name="focusBlendMode", kind="style")]
-[Exclude(name="focusThickness", kind="style")]
-
-/**
- *  The IconItemRenderer class is a performant item
+ *  The MobileIconItemRenderer class is a performant item
  *  renderer optimized for mobile devices.  It contains
- *  an optional icon on the left, text in the middle, and
- *  an optional decorator icon on the right.
- *
- *
You can override the default item renderer
- *  by creating a custom item renderer.

+ *  four optional parts: 1) an icon on the left, 2) headerText
+ *  on top next to the icon, 3) subText below headerText and
+ *  next to the icon, and 4) a decorator on the right.
  *
  *  @see spark.components.List
  *  @see mx.core.IDataRenderer
  *  @see spark.components.IItemRenderer
  *  @see spark.components.supportClasses.ItemRenderer
+ *  @see spark.components.MobileItemRenderer
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
-public class IconItemRenderer extends UIComponent
-    implements IDataRenderer, IItemRenderer
+public class MobileIconItemRenderer extends MobileItemRenderer
 {

-    // Image cache for all instances of this item renderer.
-    static private var _imageCache: ContentCache;
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Icon image cache
+     */
+    static private var _imageCache:ContentCache;

     //--------------------------------------------------------------------------
     //
@@ -179,68 +112,12 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function IconItemRenderer()
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function MobileIconItemRenderer()
     {
         super();
-        addHandlers();
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Variables
-    //
-    //--------------------------------------------------------------------------
-
-    //--------------------------------------------------------------------------
-    //
-    //  Private Properties
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Flag that is set when the mouse is hovered over the item renderer.
-     */
-    private var hovered:Boolean = false;
-
-    //--------------------------------------------------------------------------
-    //
-    //  Overridden properties: UIComponent
-    //
-    //--------------------------------------------------------------------------
-
-    //----------------------------------
-    //  baselinePosition
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    override public function get baselinePosition():Number
-    {
-        // Copied from UITextField.baselinePosition
-        var tlm:TextLineMetrics;
-
-        // The text styles aren't known until there is a parent.
-        if (!parent)
-            return NaN;
-
-        // getLineMetrics() returns strange numbers for an empty string,
-        // so instead we get the metrics for a non-empty string.
-        var isEmpty:Boolean = (labelTextField.text == "");
-        if (isEmpty)
-            labelTextField.text = "Wj";
-
-        tlm = labelTextField.getLineMetrics(0);
-
-        if (isEmpty)
-            labelTextField.text = "";
-
-        // TextFields have 2 pixels of padding all around.
-        return 2 + tlm.ascent;
     }

     //--------------------------------------------------------------------------
@@ -249,51 +126,20 @@
     //
     //--------------------------------------------------------------------------

-    //----------------------------------
-    //  data
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _data:Object;
-
     /**
      *  @private
      */
     private var dataChanged:Boolean;

-    [Bindable("dataChange")]
-
-    /**
-     *  The implementation of the data property
-     *  as defined by the IDataRenderer interface.
-     *  When set, it stores the value and invalidates the component
-     *  to trigger a relayout of the component.
-     *
-     *  @see mx.core.IDataRenderer
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get data():Object
-    {
-        return _data;
-    }
-
-    /**
-     *  @private
-     */
-    public function set data(value:Object):void
-    {
-        _data = value;
+    /**
+     *  @private
+     */
+    override public function set data(value:Object):void
+    {
+        super.data = value;

         dataChanged = true;
         invalidateProperties();
-
-        dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
     }

     //----------------------------------
@@ -319,7 +165,12 @@
      *  Decorator that appears on the right side
      *  of this item renderer
      *
-     *  @default ""
+     *  @default ""
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get decoratorClass():Class
     {
@@ -341,6 +192,99 @@
     }

     //----------------------------------
+    //  headerField
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _headerField:String;
+
+    /**
+     *  @private
+     */
+    private var headerFieldOrFunctionChanged:Boolean;
+
+    /**
+     *  The name of the field in the data provider items to display
+     *  as the header.
+     *  The headerFunction property overrides this property.
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get headerField():String
+    {
+        return _headerField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set headerField(value:String):void
+    {
+        if (value == _headerField)
+            return;
+
+        _headerField = value;
+        headerFieldOrFunctionChanged = true;
+        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  headerFunction
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _headerFunction:Function;
+
+    /**
+     *  A user-supplied function to run on each item to determine its header.
+     *  The headerFunction property overrides
+     *  the headerField property.
+     *
+     *
You can supply a headerFunction that finds the
+     *  appropriate fields and returns a displayable string. The
+     *  headerFunction is also good for handling formatting and
+     *  localization.

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

+     *

+     *  myHeaderFunction(item:Object):String

+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get headerFunction():Function
+    {
+        return _headerFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set headerFunction(value:Function):void
+    {
+        if (value == _headerFunction)
+            return;
+
+        _headerFunction = value;
+        headerFieldOrFunctionChanged = true;
+        invalidateProperties();
+    }
+
+    //----------------------------------
     //  iconField
     //----------------------------------

@@ -352,7 +296,7 @@
     /**
      *  @private
      */
-    private var iconFieldChanged:Boolean;
+    private var iconFieldOrFunctionChanged:Boolean;

     /**
      *  @private
@@ -373,6 +317,11 @@
      *  doesn't look for an icon.
      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get iconField():String
     {
@@ -388,7 +337,64 @@
             return;

         _iconField = value;
-        iconFieldChanged = true;
+        iconFieldOrFunctionChanged = true;
+        dataChanged = true;
+
+        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  iconFunction
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _iconFunction:Function;
+
+    /**
+     *  A user-supplied function to run on each item to determine its icon.
+     *  The iconFunction property overrides
+     *  the iconField property.
+     *
+     *
You can supply an iconFunction that finds the
+     *  appropriate fields and returns a valid URL or object to be used as
+     *  the icon.

+     *
+     *
The icon function takes a single argument which is the item in
+     *  the data provider and returns an Object that gets passed to a
+     *  spark.primitives.BitmapImage object as the source
+     *  property.  Icon function can return a valid URL pointing to an image
+     *  or a Class file that represents an image.  To see what other types
+     *  of objects can be returned from the icon
+     *  function, check out BitmapImage's documentation

+     *

+     *  myIconFunction(item:Object):Object

+     *
+     *  @default null
+     *
+     *  @see spark.primitives.BitmapImage#source
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get iconFunction():Function
+    {
+        return _iconFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set iconFunction(value:Function):void
+    {
+        if (value == _iconFunction)
+            return;
+
+        _iconFunction = value;
+        iconFieldOrFunctionChanged = true;
         dataChanged = true;

         invalidateProperties();
@@ -408,6 +414,11 @@
      *  intrinsic height of the image will be used.
      *
      *  @default NaN
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get iconHeight():Number
     {
@@ -442,6 +453,11 @@
      *  intrinsic width of the image will be used.
      *
      *  @default NaN
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get iconWidth():Number
     {
@@ -463,173 +479,97 @@
     }

     //----------------------------------
-    //  itemIndex
-    //----------------------------------
-
-    /**
-     *  @private
-     *  storage for the itemIndex property
-     */
-    private var _itemIndex:int;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @default 0
-     */
-    public function get itemIndex():int
-    {
-        return _itemIndex;
-    }
-
-    /**
-     *  @private
-     */
-    public function set itemIndex(value:int):void
-    {
-        if (value == _itemIndex)
+    //  subTextField
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _subTextField:String;
+
+    /**
+     *  @private
+     */
+    private var subTextFieldOrFunctionChanged:Boolean;
+
+    /**
+     *  The name of the field in the data provider items to display
+     *  as the subText.
+     *  The subTextFunction property overrides this property.
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get subTextField():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;

-        _itemIndex = value;
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  label
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage var for label
-     */
-    private var _label:String = "";
-
-    /**
-     *  @private
-     */
-    private var labelTextField:TextField;
-
-    /**
-     *  @private
-     */
-    private var recreateLabelTextFieldStyles:Boolean;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @default ""
-     */
-    public function get label():String
-    {
-        return _label;
-    }
-
-    /**
-     *  @private
-     */
-    public function set label(value:String):void
-    {
-        if (value == _label)
+        _subTextField = value;
+        subTextFieldOrFunctionChanged = 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
+     *  appropriate fields and returns a displayable string. The
+     *  subTextFunction is also good for handling formatting and
+     *  localization.

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

+     *

+     *  mySubTextFunction(item:Object):String

+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @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)
             return;

-        _label = value;
-
-        // Push the label down into the labelTextField,
-        // if it exists
-        if (labelTextField)
-            labelTextField.text = _label;
-    }
-
-    //----------------------------------
-    //  showsCaret
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the showsCaret property
-     */
-    private var _showsCaret:Boolean = false;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @default false
-     */
-    public function get showsCaret():Boolean
-    {
-        return _showsCaret;
-    }
-
-    /**
-     *  @private
-     */
-    public function set showsCaret(value:Boolean):void
-    {
-        if (value == _showsCaret)
-            return;
-
-        _showsCaret = value;
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  selected
-    //----------------------------------
-    /**
-     *  @private
-     *  storage for the selected property
-     */
-    private var _selected:Boolean = false;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @default false
-     */
-    public function get selected():Boolean
-    {
-        return _selected;
-    }
-
-    /**
-     *  @private
-     */
-    public function set selected(value:Boolean):void
-    {
-        if (value == _selected)
-            return;
-
-        _selected = value;
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  dragging
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the dragging property.
-     */
-    private var _dragging:Boolean = false;
-
-    /**
-     *  @inheritDoc
-     */
-    public function get dragging():Boolean
-    {
-        return _dragging;
-    }
-
-    /**
-     *  @private
-     */
-    public function set dragging(value:Boolean):void
-    {
-        if (value == _dragging)
-            return;
-
-        _dragging = value;
+        _subTextFunction = value;
+        subTextFieldOrFunctionChanged = true;
+        invalidateProperties();
     }

     //--------------------------------------------------------------------------
@@ -645,23 +585,12 @@
     {
         super.createChildren();

-        if (!labelTextField)
-        {
-            labelTextField = new TextField();
-            labelTextField.multiline = false;
-            labelTextField.wordWrap = false;
-            labelTextField.selectable = false;
-
-            addChild(DisplayObject(labelTextField));
-            if (_label != "")
-                labelTextField.text = _label;
-
-            recreateLabelTextFieldStyles = true;
-            invalidateProperties();
-        }
-
-        // iconDisplay and decoratorClass are created in
-        // commitProperties()
+        // create any children you need in here
+
+        // iconDisplay, subTextDisplay, 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
     }

     /**
@@ -692,9 +621,10 @@
             invalidateDisplayList();
         }

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

             // let's see if we need to create or remove it
             if (iconField && !iconDisplay)
@@ -707,7 +637,6 @@
                 iconDisplay.right = 0;
                 iconDisplay.top = 0;
                 iconDisplay.bottom = 0;
-                //				iconDisplay.setStyle("backgroundColor", 0xC0C0C0);

                 if (_imageCache == null) {
                     _imageCache = new ContentCache();
@@ -755,112 +684,6 @@
             invalidateSize();
             invalidateDisplayList();
         }
-
-        if (recreateLabelTextFieldStyles)
-        {
-            recreateLabelTextFieldStyles = false;
-
-            var textFormat:TextFormat = getTextStyles();
-
-            // FIXME (rfrishbe): should deal with embedded fonts better
-
-            labelTextField.defaultTextFormat = textFormat;
-
-            // need to set text here for the defaultTextFormat to take effect
-            labelTextField.text = labelTextField.text;
-
-            invalidateSize();
-            invalidateDisplayList();
-        }
-    }
-
-    /**
-     *  @private
-     *  Defined by what we use in getTextStyles();
-     */
-    private static const TEXT_CSS_STYLES:Object =
-        {textAlign: true,
-            fontWeight: true,
-            color: true,
-            disabledColor: true,
-            fontFamily: true,
-            textIndent: true,
-            fontStyle: true,
-            kerning: true,
-            leading: true,
-            letterSpacing: true,
-            fontSize: true,
-            textDecoration: true};
-
-    /**
-     *  Returns the TextFormat object that represents
-     *  character formatting information for this UITextField object.
-     *
-     *  @return A TextFormat object.
-     *
-     *  @see flash.text.TextFormat
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function getTextStyles():TextFormat
-    {
-        // Adapted from UITextField.getTextStyles()
-        var textFormat:TextFormat = new TextFormat();
-
-        var textAlign:String = getStyle("textAlign");
-
-        if (textAlign == "start")
-            textAlign = TextFormatAlign.LEFT;
-        else if (textAlign == "end")
-            textAlign = TextFormatAlign.RIGHT;
-        textFormat.align = textAlign;
-        textFormat.bold = getStyle("fontWeight") == "bold";
-        if (enabled)
-            textFormat.color = getStyle("color");
-        else
-            textFormat.color = getStyle("disabledColor");
-        textFormat.font = StringUtil.trimArrayElements(getStyle("fontFamily"),",");
-        textFormat.indent = getStyle("textIndent");
-        textFormat.italic = getStyle("fontStyle") == "italic";
-        var kerning:* = getStyle("kerning");
-        // In Halo components based on TextField,
-        // kerning is supposed to be true or false.
-        // The default in TextField and Flex 3 is false
-        // because kerning doesn't work for device fonts
-        // and is slow for embedded fonts.
-        // In Spark components based on TLF and FTE,
-        // kerning is "auto", "on", or, "off".
-        // The default in TLF and FTE is "auto"
-        // (which means kern non-Asian characters)
-        // because kerning works even on device fonts
-        // and has miminal performance impact.
-        // Since a CSS selector or parent container
-        // can affect both Halo and Spark components,
-        // we need to map "auto" and "on" to true
-        // and "off" to false for Halo components
-        // here and in UIFTETextField.
-        // For Spark components, Label and CSSTextLayoutFormat,
-        // do the opposite mapping of true to "on" and false to "off".
-        // We also support a value of "default"
-        // (which we set in the global selector)
-        // to mean false for Halo and "auto" for Spark,
-        // to get the recommended behavior in both sets of components.
-        if (kerning == "auto" || kerning == "on")
-            kerning = true;
-        else if (kerning == "default" || kerning == "off")
-            kerning = false;
-        textFormat.kerning = kerning;
-        textFormat.leading = getStyle("leading");
-        //textFormat.leftMargin = ignorePadding ? 0 : getStyle("paddingLeft");
-        textFormat.letterSpacing = getStyle("letterSpacing");
-        //textFormat.rightMargin = ignorePadding ? 0 : getStyle("paddingRight");
-        textFormat.size = getStyle("fontSize");
-        textFormat.underline = getStyle("textDecoration") == "underline";
-
-        return textFormat;
     }

     /**
@@ -877,6 +700,7 @@
         var myMeasuredMinWidth:Number = 0;
         var myMeasuredMinHeight:Number = 0;

+        // FIXME (rfrishbe): use padding and gaps
         // Icon is on left
         if (iconDisplay)
         {
@@ -885,7 +709,7 @@
             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);
+            myMeasuredMinHeight = Math.max(myMeasuredMinHeight, (isNaN(iconHeight) ? iconDisplay.getMinBoundsHeight() : iconHeight) + 10);
         }

         // Text is aligned next to icon
@@ -919,76 +743,21 @@
         }

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

         measuredMinWidth = myMeasuredMinWidth;
-        measuredMinHeight = Math.max(42, myMeasuredMinHeight);
-    }
-
-    /**
-     *  @private
-     */
-    override protected function updateDisplayList(unscaledWidth:Number,
-                                                  unscaledHeight:Number):void
-    {
-        super.updateDisplayList(unscaledWidth, unscaledHeight);
-
-        graphics.clear();
-
-        // figure out backgroundColor
-        var backgroundColor:uint;
-        var drawBackground:Boolean = true;
-        if (selected)
-            backgroundColor = getStyle("selectionColor");
-        else if (hovered)
-            backgroundColor = getStyle("rollOverColor");
-        else
-        {
-            var alternatingColors:Array = getStyle("alternatingItemColors");
-
-            if (alternatingColors && alternatingColors.length > 0)
-            {
-                // translate these colors into uints
-                styleManager.getColorNames(alternatingColors);
-
-                backgroundColor = alternatingColors[itemIndex % alternatingColors.length];
-            }
-            else
-            {
-                // don't draw background if it is the contentBackgroundColor. The
-                // list skin handles the background drawing for us.
-                drawBackground = false;
-            }
-        }
-
-        // draw cackgroundColor
-        graphics.beginFill(backgroundColor, drawBackground ? 1 : 0);
-
-        if (showsCaret)
-        {
-            graphics.lineStyle(1, getStyle("selectionColor"));
-            graphics.drawRect(0.5, 0.5, unscaledWidth-1, unscaledHeight-1);
-        }
-        else
-        {
-            graphics.lineStyle();
-            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
-        }
-
-        graphics.endFill();
-
-        // draw seperators: two lines
-        // 1 pixel from bottom
-        graphics.lineStyle(1, 0x1C1C1C);
-        graphics.moveTo(0, unscaledHeight-1);
-        graphics.lineTo(unscaledWidth, unscaledHeight-1);
-
-        // line on the bottom
-        graphics.lineStyle(1, 0x606060);
-        graphics.moveTo(0, unscaledHeight);
-        graphics.lineTo(unscaledWidth, unscaledHeight);
+        measuredMinHeight = Math.max(80, myMeasuredMinHeight);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function layoutContents(unscaledWidth:Number,
+                                               unscaledHeight:Number):void
+    {
+        // no need to call super.layoutContents() since we're changing how it happens here

         // start laying out our children now
         var iconWidth:Number = 0;
@@ -1034,124 +803,31 @@
                 IFlexDisplayObject(decoratorDisplay).move(unscaledWidth - 10 - decoratorWidth, (unscaledHeight - decoratorHeight)/2);
             }
         }
+
+        // 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 -= 20; // padding of 10 always on left and right
+        labelWidth -= (getStyle("paddingLeft") + getStyle("paddingRight"));

         // don't forget the extra padding of 5 if these elements exist
         if (iconDisplay)
-            labelWidth -= 5;
+            labelWidth -= getStyle("horizontalGap");
         if (decoratorDisplay)
-            labelWidth -= 5;
+            labelWidth -= getStyle("horizontalGap");

         // padding of 5 from the left
-        var labelX:Number = 10;
+        var labelX:Number = getStyle("paddingLeft");
         if (iconDisplay)
-            labelX += iconWidth + 5;
+            labelX += iconWidth + getStyle("horizontalGap");

         labelTextField.width = labelWidth;
-        labelTextField.height = labelTextField.textHeight + 4;
+        labelTextField.height = labelTextField.textHeight + 4; // 4 is text field padding

         labelTextField.x = labelX;
         labelTextField.y = (unscaledHeight - labelTextField.height)/2;
     }

-    /**
-     *  @private
-     */
-    override public function styleChanged(styleName:String):void
-    {
-        var allStyles:Boolean = !styleName || styleName == "styleName";
-
-        super.styleChanged(styleName);
-
-        if (allStyles || styleName == "inputMode")
-        {
-            addHandlers();
-        }
-
-        if (allStyles || styleName in TEXT_CSS_STYLES)
-        {
-            recreateLabelTextFieldStyles = true;
-            invalidateProperties();
-        }
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Event handling
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Keeps track of whether rollover/rollout events were added
-     *
-     *  We need to be careful about calling add/remove event listener because
-     *  of the reference counting going on in
-     *  super.addEventListener/removeEventListener.
-     */
-    private var rolloverEventsAdded:Boolean = false;
-
-    /**
-     *  @private
-     *  Attach the mouse events.
-     */
-    private function addHandlers():void
-    {
-        if (getStyle("inputMode") == "mouse")
-        {
-            if (!rolloverEventsAdded)
-            {
-                rolloverEventsAdded = true;
-                addEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
-                addEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
-            }
-        }
-        else
-        {
-            if (rolloverEventsAdded)
-            {
-                rolloverEventsAdded = false;
-                removeEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
-                removeEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
-            }
-        }
-    }
-
-    /**
-     *  @private
-     */
-    private function anyButtonDown(event:MouseEvent):Boolean
-    {
-        var type:String = event.type;
-        return event.buttonDown || (type == "middleMouseDown") || (type == "rightMouseDown");
-    }
-
-    /**
-     *  @private
-     *  Mouse rollOver event handler.
-     */
-    protected function itemRenderer_rollOverHandler(event:MouseEvent):void
-    {
-        if (!anyButtonDown(event))
-        {
-            hovered = true;
-            invalidateDisplayList();
-        }
-    }
-
-    /**
-     *  @private
-     *  Mouse rollOut event handler.
-     */
-    protected function itemRenderer_rollOutHandler(event:MouseEvent):void
-    {
-        hovered = false;
-        invalidateDisplayList();
-    }
-
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 22238
Author:   chiedozi@adobe.com
Date:     2011-08-26T04:35:39.980148Z

Log Message:
-----------
The messageDisplay of IconItemRenderer is now sized to 0,0 when no message is supplied

QE notes:
Doc notes:
Bugs: SDK-30350
Reviewer: Evtim
Tests run:
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as

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

--- frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
@@ -2196,7 +2196,12 @@
             //    messageDisplay.text = messageText;
             //messageDisplay.truncateToFit();
         }
-
+        else
+        {
+            if (messageDisplay)
+                setElementSize(messageDisplay, 0, 0);
+        }
+
         // Position the text components now that we know all heights so we can respect verticalAlign style
         var totalHeight:Number = 0;
         var labelComponentsY:Number = 0;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


try to fix these tests

try to fix these tests

--- frameworks/projects/spark/tests/spark/components/DataGrid_FLEX_34837_Tests.as
+++ frameworks/projects/spark/tests/spark/components/DataGrid_FLEX_34837_Tests.as
@@ -57,7 +57,7 @@
             const dataProvider:ListCollectionView = new ListCollectionView(tenObjects);

             //when
-            UIImpersonator.addChild(_sut);
+            UIImpersonator.addElement(_sut);
             assertNotNull("UIImpersonator doesn't work correctly!", _sut.grid);
             _sut.dataProvider = dataProvider;
             _sut.sortByColumns(new <int>[0]); //sort by address.street
@@ -84,7 +84,7 @@
             const dataProvider:ListCollectionView = new ListCollectionView(tenObjects);

             //when
-            UIImpersonator.addChild(_sut);
+            UIImpersonator.addElement(_sut);
             assertNotNull("UIImpersonator doesn't work correctly!", _sut.grid);
             _sut.dataProvider = dataProvider;
             _sut.sortByColumns(new <int>[0]); //sort by address.dateMovedIn, in effect by month name
@@ -117,7 +117,7 @@
             const dataProvider:ListCollectionView = new ListCollectionView(tenObjects);

             //when
-            UIImpersonator.addChild(_sut);
+            UIImpersonator.addElement(_sut);
             assertNotNull("UIImpersonator doesn't work correctly!", _sut.grid);
             _sut.dataProvider = dataProvider;


Fixed bug where macro code would check state of LinkableFunction before validating it.

--- WeaveCore/src/weave/core/LinkableFunction.as
+++ WeaveCore/src/weave/core/LinkableFunction.as
@@ -1,281 +1,283 @@
-/*
-    Weave (Web-based Analysis and Visualization Environment)
-    Copyright (C) 2008-2011 University of Massachusetts Lowell
-
-    This file is a part of Weave.
-
-    Weave is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License, Version 3,
-    as published by the Free Software Foundation.
-
-    Weave is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with Weave.  If not, see <http://www.gnu.org/licenses/>.
+/*
+    Weave (Web-based Analysis and Visualization Environment)
+    Copyright (C) 2008-2011 University of Massachusetts Lowell
+
+    This file is a part of Weave.
+
+    Weave is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License, Version 3,
+    as published by the Free Software Foundation.
+
+    Weave is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Weave.  If not, see <http://www.gnu.org/licenses/>.
 */

-package weave.core
+package weave.core
 {
-	import flash.utils.Dictionary;
-	import flash.utils.getQualifiedClassName;
-
-	import weave.api.WeaveAPI;
-	import weave.api.core.ILinkableHashMap;
-	import weave.api.detectLinkableObjectChange;
-	import weave.api.registerLinkableChild;
-	import weave.api.reportError;
-	import weave.compiler.Compiler;
-	import weave.compiler.ICompiledObject;
-	import weave.compiler.ProxyObject;
-	import weave.compiler.StandardLib;
-
-	/**
-	 * LinkableFunction allows a function to be defined by a String that can use macros defined in the static macros hash map.
-	 * Libraries listed in macroLibraries variable will be included when compiling the function.
-	 *
+	import flash.utils.Dictionary;
+	import flash.utils.getQualifiedClassName;
+
+	import weave.api.WeaveAPI;
+	import weave.api.core.ILinkableHashMap;
+	import weave.api.detectLinkableObjectChange;
+	import weave.api.registerLinkableChild;
+	import weave.api.reportError;
+	import weave.compiler.Compiler;
+	import weave.compiler.ICompiledObject;
+	import weave.compiler.ProxyObject;
+	import weave.compiler.StandardLib;
+
+	/**
+	 * LinkableFunction allows a function to be defined by a String that can use macros defined in the static macros hash map.
+	 * Libraries listed in macroLibraries variable will be included when compiling the function.
+	 *
 	 * @author adufilie
-	 */
-	public class LinkableFunction extends LinkableString
-	{
-		/**
-		 * Debug mode.
-		 */
-		public static var debug:Boolean = false;
-
-		/**
-		 * @param defaultValue The default function definition.
-		 * @param ignoreRuntimeErrors If this is true, errors thrown during evaluation of the function will be caught and values of undefined will be returned.
-		 * @param useThisScope When true, variable lookups will be evaluated as if the function were in the scope of the thisArg passed to the apply() function.
-		 * @param paramNames An Array of parameter names that can be used in the function definition.
-		 */
-		public function LinkableFunction(defaultValue:String = null, ignoreRuntimeErrors:Boolean = false, useThisScope:Boolean = false, paramNames:Array = null)
-		{
-			super(StandardLib.unIndent(defaultValue));
-			macroLibraries.addImmediateCallback(this, triggerCallbacks, false, true);
-			_ignoreRuntimeErrors = ignoreRuntimeErrors;
-			_useThisScope = useThisScope;
-			_paramNames = paramNames && paramNames.concat();
-		}
-
-		private var _catchErrors:Boolean = false;
-		private var _ignoreRuntimeErrors:Boolean = false;
-		private var _useThisScope:Boolean = false;
-		private var _compiledMethod:Function = null;
-		private var _paramNames:Array = null;
-		private var _isFunctionDefinition:Boolean = false;
-		private var _triggerCount:uint = 0;
-
-		/**
-		 * This is used as a placeholder to prevent re-compiling erroneous code.
-		 */
-		private static function RETURN_UNDEFINED(..._):* { return undefined; }
-
-		/**
-		 * This will attempt to compile the function.  An Error will be thrown if this fails.
-		 */
-		public function validate():void
-		{
-			if (_triggerCount != triggerCounter)
-			{
-				// if this LinkableFunction is in the macros list, errors should be caught and reported.
-				if (macros.getName(this))
-					_catchErrors = true;
-
-				_triggerCount = triggerCounter;
-				// in case compile fails, prevent re-compiling erroneous code
-				_compiledMethod = RETURN_UNDEFINED;
-				_isFunctionDefinition = false;
-
-				if (_macroProxy == null)
-					_macroProxy = new ProxyObject(_hasMacro, evaluateMacro, null, callMacro); // allows evaluating macros but not setting them
-
-				if (detectLinkableObjectChange(_getNewCompiler, macroLibraries))
-					_compiler = _getNewCompiler(true);
-
-				var object:ICompiledObject = _compiler.compileToObject(value);
-				_isFunctionDefinition = _compiler.compiledObjectIsFunctionDefinition(object);
-				_compiledMethod = _compiler.compileObjectToFunction(object, _macroProxy, errorHandler, _useThisScope, _paramNames);
-			}
-		}
-
-		private function errorHandler(e:*):Boolean
-		{
-			if (debug)
-				reportError(e);
-
-			if (_ignoreRuntimeErrors || debug)
-				return true;
-
-			if (_catchErrors)
-			{
-				reportError(e);
-				return false;
-			}
-
-			throw e;
-		}
-
-		/**
-		 * This gets the length property of the generated Function.
-		 */
-		public function get length():int
-		{
-			if (_triggerCount != triggerCounter)
-				validate();
-			return _compiledMethod.length;
-		}
-
-		/**
-		 * This will evaluate the function with the specified parameters.
-		 * @param thisArg The value of 'this' to be used when evaluating the function.
-		 * @param argArray An Array of arguments to be passed to the compiled function.
-		 * @return The result of evaluating the function.
-		 */
-		public function apply(thisArg:* = null, argArray:Array = null):*
-		{
-			if (_triggerCount != triggerCounter)
-				validate();
-			return _compiledMethod.apply(thisArg, argArray);
-		}
-
-		/**
-		 * This will evaluate the function with the specified parameters.
-		 * @param thisArg The value of 'this' to be used when evaluating the function.
-		 * @param args Arguments to be passed to the compiled function.
-		 * @return The result of evaluating the function.
-		 */
-		public function call(thisArg:* = null, ...args):*
-		{
-			if (_triggerCount != triggerCounter)
-				validate();
-			return _compiledMethod.apply(thisArg, args);
-		}
-
-		/////////////////////////////////////////////////////////////////////////////////////////////
-		// static section
-
-		/**
-		 * This is a proxy object for use as a symbol table for the compiler.
-		 */
-		private static var _macroProxy:ProxyObject = null;
-
-		/**
-		 * This function checks if a macro exists.
-		 * @param macroName The name of a macro to check.
-		 * @return A value of true if the specified macro exists, or false if it does not.
-		 */
-		private static function _hasMacro(macroName:String):Boolean
-		{
-			return macros.getObject(macroName) != null;
-		}
-
-		/**
-		 * This function evaluates a macro specified in the macros hash map,
-		 * catching and reporting any errors that are thrown.
-		 * @param macroName The name of the macro to evaluate.
-		 * @return The result of evaluating the macro.
-		 */
-		public static function evaluateMacro(macroName:String):*
-		{
-			var lf:LinkableFunction = macros.getObject(macroName) as LinkableFunction;
-			if (!lf)
-				return undefined;
-			if (lf._isFunctionDefinition)
-				return lf;
-			return lf.apply();
-		}
-		public static function callMacro(macroName:String, ...params):*
-		{
-			// error catching/reporting is handled automatically for LinkableFunctions in the macros list.
-			var lf:LinkableFunction = macros.getObject(macroName) as LinkableFunction;
-			return lf ? lf.apply(null, params) : undefined;
-		}
-		public static function applyMacro(macroName:String, params:Array = null):*
-		{
-			// error catching/reporting is handled automatically for LinkableFunctions in the macros list.
-			var lf:LinkableFunction = macros.getObject(macroName) as LinkableFunction;
-			return lf ? lf.apply(null, params) : undefined;
-		}
-
-		/**
-		 * This is a list of macros that can be used in any LinkableFunction expression.
-		 */
-		public static const macros:ILinkableHashMap = new LinkableHashMap(LinkableFunction);
-
-		/**
-		 * This is a list of libraries to include in the static compiler for macros.
-		 */
-		public static const macroLibraries:LinkableVariable = registerLinkableChild(WeaveAPI.globalHashMap, new LinkableVariable(null, verifyLibraries, [getQualifiedClassName(WeaveAPI)]));
-
-		private static function verifyLibraries(state:Object):Boolean
-		{
-			// hack to convert old session state String
-			if (state is String)
-				macroLibraries.setSessionState(WeaveAPI.CSVParser.parseCSVRow(state as String));
-
-			return StandardLib.getArrayType(state as Array) == String;
-		}
-
-		/**
-		 * This function will add a library to the static list of macro libraries if it is not already added.
-		 * @param libraryQName A library to add to the list of static libraries.
-		 */
-		public static function includeMacroLibrary(libraryQName:String):void
-		{
-			var array:Array = macroLibraries.getSessionState() as Array || [];
-			if (array.indexOf(libraryQName) < 0)
-			{
-				array.push(libraryQName);
-				macroLibraries.setSessionState(array);
-			}
-		}
-
-		/**
-		 * This is the static compiler to be used by every LinkableFunction.
-		 */
-		private static var _compiler:Compiler = null;
-		private static var _allLinkableFunctions:Dictionary = new Dictionary(true); // the keys in this are LinkableFunction instances
-
-		/**
-		 * This function returns a new compiler initialized with the libraries specified by the public static libraries variable.
-		 * @param reportErrors If this is true, errors will be reported through WeaveAPI.ErrorManager.
-		 * @return A new initialized compiler.
-		 */
-		private static function _getNewCompiler(reportErrors:Boolean):Compiler
-		{
-			var compiler:Compiler = new Compiler();
-			try
-			{
-				compiler.includeLibraries.apply(null, macroLibraries.getSessionState() as Array);
-			}
-			catch (e:Error)
-			{
-				if (reportErrors)
-					reportError(e);
-			}
-			return compiler;
-		}
-
-		/**
-		 * Tests if an expression is a single, valid symbol name.
-		 */
-		public static function isValidSymbolName(expression:String):Boolean
-		{
-			if (!_compiler)
-				_compiler = _getNewCompiler(true);
-			return _compiler.isValidSymbolName(expression);
-		}
-
-//		/**
-//		 * This function returns a new compiler initialized with the libraries specified by the public static libraries variable.
-//		 * @return A new initialized compiler.
-//		 */
-//		public static function getNewCompiler():Compiler
-//		{
-//			return _getNewCompiler(false);
-//		}
+	 */
+	public class LinkableFunction extends LinkableString
+	{
+		/**
+		 * Debug mode.
+		 */
+		public static var debug:Boolean = false;
+
+		/**
+		 * @param defaultValue The default function definition.
+		 * @param ignoreRuntimeErrors If this is true, errors thrown during evaluation of the function will be caught and values of undefined will be returned.
+		 * @param useThisScope When true, variable lookups will be evaluated as if the function were in the scope of the thisArg passed to the apply() function.
+		 * @param paramNames An Array of parameter names that can be used in the function definition.
+		 */
+		public function LinkableFunction(defaultValue:String = null, ignoreRuntimeErrors:Boolean = false, useThisScope:Boolean = false, paramNames:Array = null)
+		{
+			super(StandardLib.unIndent(defaultValue));
+			macroLibraries.addImmediateCallback(this, triggerCallbacks, false, true);
+			_ignoreRuntimeErrors = ignoreRuntimeErrors;
+			_useThisScope = useThisScope;
+			_paramNames = paramNames && paramNames.concat();
+		}
+
+		private var _catchErrors:Boolean = false;
+		private var _ignoreRuntimeErrors:Boolean = false;
+		private var _useThisScope:Boolean = false;
+		private var _compiledMethod:Function = null;
+		private var _paramNames:Array = null;
+		private var _isFunctionDefinition:Boolean = false;
+		private var _triggerCount:uint = 0;
+
+		/**
+		 * This is used as a placeholder to prevent re-compiling erroneous code.
+		 */
+		private static function RETURN_UNDEFINED(..._):* { return undefined; }
+
+		/**
+		 * This will attempt to compile the function.  An Error will be thrown if this fails.
+		 */
+		public function validate():void
+		{
+			if (_triggerCount != triggerCounter)
+			{
+				// if this LinkableFunction is in the macros list, errors should be caught and reported.
+				if (macros.getName(this))
+					_catchErrors = true;
+
+				_triggerCount = triggerCounter;
+				// in case compile fails, prevent re-compiling erroneous code
+				_compiledMethod = RETURN_UNDEFINED;
+				_isFunctionDefinition = false;
+
+				if (_macroProxy == null)
+					_macroProxy = new ProxyObject(_hasMacro, evaluateMacro, null, callMacro); // allows evaluating macros but not setting them
+
+				if (detectLinkableObjectChange(_getNewCompiler, macroLibraries))
+					_compiler = _getNewCompiler(true);
+
+				var object:ICompiledObject = _compiler.compileToObject(value);
+				_isFunctionDefinition = _compiler.compiledObjectIsFunctionDefinition(object);
+				_compiledMethod = _compiler.compileObjectToFunction(object, _macroProxy, errorHandler, _useThisScope, _paramNames);
+			}
+		}
+
+		private function errorHandler(e:*):Boolean
+		{
+			if (debug)
+				reportError(e);
+
+			if (_ignoreRuntimeErrors || debug)
+				return true;
+
+			if (_catchErrors)
+			{
+				reportError(e);
+				return false;
+			}
+
+			throw e;
+		}
+
+		/**
+		 * This gets the length property of the generated Function.
+		 */
+		public function get length():int
+		{
+			if (_triggerCount != triggerCounter)
+				validate();
+			return _compiledMethod.length;
+		}
+
+		/**
+		 * This will evaluate the function with the specified parameters.
+		 * @param thisArg The value of 'this' to be used when evaluating the function.
+		 * @param argArray An Array of arguments to be passed to the compiled function.
+		 * @return The result of evaluating the function.
+		 */
+		public function apply(thisArg:* = null, argArray:Array = null):*
+		{
+			if (_triggerCount != triggerCounter)
+				validate();
+			return _compiledMethod.apply(thisArg, argArray);
+		}
+
+		/**
+		 * This will evaluate the function with the specified parameters.
+		 * @param thisArg The value of 'this' to be used when evaluating the function.
+		 * @param args Arguments to be passed to the compiled function.
+		 * @return The result of evaluating the function.
+		 */
+		public function call(thisArg:* = null, ...args):*
+		{
+			if (_triggerCount != triggerCounter)
+				validate();
+			return _compiledMethod.apply(thisArg, args);
+		}
+
+		/////////////////////////////////////////////////////////////////////////////////////////////
+		// static section
+
+		/**
+		 * This is a proxy object for use as a symbol table for the compiler.
+		 */
+		private static var _macroProxy:ProxyObject = null;
+
+		/**
+		 * This function checks if a macro exists.
+		 * @param macroName The name of a macro to check.
+		 * @return A value of true if the specified macro exists, or false if it does not.
+		 */
+		private static function _hasMacro(macroName:String):Boolean
+		{
+			return macros.getObject(macroName) != null;
+		}
+
+		/**
+		 * This function evaluates a macro specified in the macros hash map,
+		 * catching and reporting any errors that are thrown.
+		 * @param macroName The name of the macro to evaluate.
+		 * @return The result of evaluating the macro.
+		 */
+		public static function evaluateMacro(macroName:String):*
+		{
+			var lf:LinkableFunction = macros.getObject(macroName) as LinkableFunction;
+			if (!lf)
+				return undefined;
+			if (lf._triggerCount != lf.triggerCounter)
+				lf.validate();
+			if (lf._isFunctionDefinition)
+				return lf;
+			return lf.apply();
+		}
+		public static function callMacro(macroName:String, ...params):*
+		{
+			// error catching/reporting is handled automatically for LinkableFunctions in the macros list.
+			var lf:LinkableFunction = macros.getObject(macroName) as LinkableFunction;
+			return lf ? lf.apply(null, params) : undefined;
+		}
+		public static function applyMacro(macroName:String, params:Array = null):*
+		{
+			// error catching/reporting is handled automatically for LinkableFunctions in the macros list.
+			var lf:LinkableFunction = macros.getObject(macroName) as LinkableFunction;
+			return lf ? lf.apply(null, params) : undefined;
+		}
+
+		/**
+		 * This is a list of macros that can be used in any LinkableFunction expression.
+		 */
+		public static const macros:ILinkableHashMap = new LinkableHashMap(LinkableFunction);
+
+		/**
+		 * This is a list of libraries to include in the static compiler for macros.
+		 */
+		public static const macroLibraries:LinkableVariable = registerLinkableChild(WeaveAPI.globalHashMap, new LinkableVariable(null, verifyLibraries, [getQualifiedClassName(WeaveAPI)]));
+
+		private static function verifyLibraries(state:Object):Boolean
+		{
+			// hack to convert old session state String
+			if (state is String)
+				macroLibraries.setSessionState(WeaveAPI.CSVParser.parseCSVRow(state as String));
+
+			return StandardLib.getArrayType(state as Array) == String;
+		}
+
+		/**
+		 * This function will add a library to the static list of macro libraries if it is not already added.
+		 * @param libraryQName A library to add to the list of static libraries.
+		 */
+		public static function includeMacroLibrary(libraryQName:String):void
+		{
+			var array:Array = macroLibraries.getSessionState() as Array || [];
+			if (array.indexOf(libraryQName) < 0)
+			{
+				array.push(libraryQName);
+				macroLibraries.setSessionState(array);
+			}
+		}
+
+		/**
+		 * This is the static compiler to be used by every LinkableFunction.
+		 */
+		private static var _compiler:Compiler = null;
+		private static var _allLinkableFunctions:Dictionary = new Dictionary(true); // the keys in this are LinkableFunction instances
+
+		/**
+		 * This function returns a new compiler initialized with the libraries specified by the public static libraries variable.
+		 * @param reportErrors If this is true, errors will be reported through WeaveAPI.ErrorManager.
+		 * @return A new initialized compiler.
+		 */
+		private static function _getNewCompiler(reportErrors:Boolean):Compiler
+		{
+			var compiler:Compiler = new Compiler();
+			try
+			{
+				compiler.includeLibraries.apply(null, macroLibraries.getSessionState() as Array);
+			}
+			catch (e:Error)
+			{
+				if (reportErrors)
+					reportError(e);
+			}
+			return compiler;
+		}
+
+		/**
+		 * Tests if an expression is a single, valid symbol name.
+		 */
+		public static function isValidSymbolName(expression:String):Boolean
+		{
+			if (!_compiler)
+				_compiler = _getNewCompiler(true);
+			return _compiler.isValidSymbolName(expression);
+		}
+
+//		/**
+//		 * This function returns a new compiler initialized with the libraries specified by the public static libraries variable.
+//		 * @return A new initialized compiler.
+//		 */
+//		public static function getNewCompiler():Compiler
+//		{
+//			return _getNewCompiler(false);
+//		}
 	}
 }


more explicit error message when data type is not supported in Serializer.serialize* methods

--- src/aerys/minko/render/shader/compiler/Serializer.as
+++ src/aerys/minko/render/shader/compiler/Serializer.as
@@ -3,6 +3,8 @@
 	import aerys.minko.ns.minko_math;
 	import aerys.minko.type.math.Matrix4x4;
 	import aerys.minko.type.math.Vector4;
+
+	import avmplus.getQualifiedClassName;

 	import flash.geom.Point;
 	import flash.geom.Vector3D;
@@ -98,7 +100,7 @@
 			}
 			else
 			{
-				throw new Error('Unsupported type.');
+				throw new Error('Unsupported type:' + getQualifiedClassName(data));
 			}
 		}

@@ -144,7 +146,7 @@
 			}
 			else
 			{
-				throw new Error('Unsupported type.');
+				throw new Error('Unsupported type:' + getQualifiedClassName(data));
 			}
 		}
 	}


Issue #73: Prevent duplicate startup Portal load requests.

--- src/com/esri/builder/controllers/PortalController.as
+++ src/com/esri/builder/controllers/PortalController.as
@@ -44,9 +44,6 @@
     public function PortalController()
     {
         AppEvent.addListener(AppEvent.SETTINGS_SAVED, settingsChangeHandler);
-        AppEvent.addListener(AppEvent.PORTAL_SIGN_IN, portalSignInHandler);
-        AppEvent.addListener(AppEvent.PORTAL_SIGN_OUT, portalSignOutHandler);
-        IdentityManager.instance.addEventListener(IdentityManagerEvent.SIGN_IN, identityManager_signInHandler);
     }

     private function identityManager_signInHandler(event:IdentityManagerEvent):void
@@ -54,7 +51,7 @@
         if (PortalModel.getInstance().hasSameOrigin(event.credential.server)
             && !PortalModel.getInstance().portal.signedIn)
         {
-            AppEvent.dispatch(AppEvent.PORTAL_SIGN_IN);
+            signIntoPortalInternally();
         }
     }

@@ -65,6 +62,7 @@
             LOG.info("Portal sign out requested");
         }

+        IdentityManager.instance.removeEventListener(IdentityManagerEvent.SIGN_IN, identityManager_signInHandler);
         portal.addEventListener(PortalEvent.LOAD, portal_loadHandler);
         portal.addEventListener(FaultEvent.FAULT, portal_faultHandler);
         portal.signOut();
@@ -77,6 +75,12 @@
             LOG.info("Portal sign in requested");
         }

+        signIntoPortalInternally();
+    }
+
+    private function signIntoPortalInternally():void
+    {
+        IdentityManager.instance.removeEventListener(IdentityManagerEvent.SIGN_IN, identityManager_signInHandler);
         portal.addEventListener(PortalEvent.LOAD, portal_loadHandler);
         portal.addEventListener(FaultEvent.FAULT, portal_faultHandler);
         portal.signIn();
@@ -122,6 +126,7 @@
                 portal.culture = cultureCode;
                 portal.url = URLUtil.removeToken(url);

+                IdentityManager.instance.removeEventListener(IdentityManagerEvent.SIGN_IN, identityManager_signInHandler);
                 portal.addEventListener(PortalEvent.LOAD, portal_loadHandler);
                 portal.addEventListener(FaultEvent.FAULT, portal_faultHandler);
                 portal.load();
@@ -130,7 +135,7 @@
         else
         {
             unloadPortal();
-            AppEvent.dispatch(AppEvent.PORTAL_STATUS_UPDATED);
+            dispatchPortalStatusUpdate();
         }
     }

@@ -143,6 +148,28 @@

         portal.url = null;
         portal.unload();
+    }
+
+    private function dispatchPortalStatusUpdate():void
+    {
+        updatePortalHandlersBasedOnStatus();
+        AppEvent.dispatch(AppEvent.PORTAL_STATUS_UPDATED);
+    }
+
+    private function updatePortalHandlersBasedOnStatus():void
+    {
+        if (portal.signedIn)
+        {
+            AppEvent.addListener(AppEvent.PORTAL_SIGN_OUT, portalSignOutHandler);
+            AppEvent.removeListener(AppEvent.PORTAL_SIGN_IN, portalSignInHandler);
+            IdentityManager.instance.removeEventListener(IdentityManagerEvent.SIGN_IN, identityManager_signInHandler);
+        }
+        else
+        {
+            AppEvent.addListener(AppEvent.PORTAL_SIGN_IN, portalSignInHandler);
+            IdentityManager.instance.addEventListener(IdentityManagerEvent.SIGN_IN, identityManager_signInHandler);
+            AppEvent.removeListener(AppEvent.PORTAL_SIGN_OUT, portalSignOutHandler);
+        }
     }

     private function portal_loadHandler(event:PortalEvent):void
@@ -156,7 +183,7 @@
         portal.removeEventListener(PortalEvent.LOAD, portal_loadHandler);
         portal.removeEventListener(FaultEvent.FAULT, portal_faultHandler);

-        AppEvent.dispatch(AppEvent.PORTAL_STATUS_UPDATED);
+        dispatchPortalStatusUpdate();
     }

     private function portal_faultHandler(event:FaultEvent):void
@@ -184,7 +211,7 @@
         }
         else
         {
-            AppEvent.dispatch(AppEvent.PORTAL_STATUS_UPDATED);
+            dispatchPortalStatusUpdate();
         }
     }
 }


KeyActionBinder returns the platform information along with the device type

--- src/com/zehfernando/input/binding/KeyActionBinder.as
+++ src/com/zehfernando/input/binding/KeyActionBinder.as
@@ -102,6 +102,7 @@

 						gamepadInfo = new AutoGamepadInfo();
 						gamepadInfo.id          = jjs;
+						gamepadInfo.platformId  = iis;
 						gamepadInfo.nameFilter  = arrayToStringVector(gamepadObj["filters"]["name"]);

 						platformInfo.gamepads.push(gamepadInfo);
@@ -752,7 +753,7 @@
 		}

 		public function getDeviceTypeAt(__index:uint):String {
-			return gameInputDeviceDefinitions.length > __index && gameInputDeviceDefinitions[__index] != null ? gameInputDeviceDefinitions[__index].id : null;
+			return gameInputDeviceDefinitions.length > __index && gameInputDeviceDefinitions[__index] != null ? gameInputDeviceDefinitions[__index].getType() : null;
 		}
 	}
 }
@@ -966,6 +967,7 @@

 	// Properties
 	public var id:String;
+	public var platformId:String;

 	public var nameFilter:Vector.<String>;									// Filter for device.name

@@ -981,6 +983,10 @@
 		controls = {};
 		controlsSplit = {};
 		keys = new Vector.<AutoGamepadControlKeyInfo>();
+	}
+
+	public function getType():String {
+		return platformId + "/" + id;
 	}
 }


Fix timestamp sign respect in HLSHTTPNetStream.

--- HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
+++ HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
@@ -1838,6 +1838,8 @@
 				_seekTarget = _enhancedSeekTarget;
 			}*/

+			var realTimestamp:int = tag.timestamp as int;
+
 			// Apply bump if present.
 			if(indexHandler && indexHandler.bumpedTime
 				&& (_enhancedSeekTarget > indexHandler.bumpedSeek
@@ -1864,11 +1866,11 @@
 			if(indexHandler)
 				indexHandler.bumpedTime = false;

-			var currentTime:Number = (tag.timestamp / 1000.0) + _fileTimeAdjustment;
+			var currentTime:Number = (realTimestamp / 1000.0) + _fileTimeAdjustment;

 			CONFIG::LOGGING
 			{
-				logger.debug("Saw tag @ " + tag.timestamp + " currentTime=" + currentTime + " _seekTime=" + _seekTime + " _enhancedSeekTarget="+ _enhancedSeekTarget);
+				logger.debug("Saw tag @ " + realTimestamp + " currentTime=" + currentTime + " _seekTime=" + _seekTime + " _enhancedSeekTarget="+ _enhancedSeekTarget);
 			}

 			// Fix for http://bugs.adobe.com/jira/browse/FM-1544


Transferred from the Adobe Open Source Subversion Repository

Revision: 21319
Author:   build@adobe.com
Date:     2011-06-01T17:45:41.136089Z

Log Message:
-----------
Version update to 4.5.2

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/airspark/src/spark/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/automation_air/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/automation_spark/src/spark/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/flex-config.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/automation_spark/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/automation/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark_dmv/src/spark/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/rpc/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mx/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/automation_flashflexkit/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/automation_dmv/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/build.properties</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/modules/compiler/src/java/flex2/tools/VersionInfo.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/airframework/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/Version.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/advancedgrids/src/mx/core/Version.as</path>

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

--- frameworks/projects/automation/src/mx/core/Version.as
+++ frameworks/projects/automation/src/mx/core/Version.as
@@ -15,4 +15,4 @@
  *  @private
  *  Version string for this class.
  */
-mx_internal static const VERSION:String = "4.5.1.0";
+mx_internal static const VERSION:String = "4.5.2.0";


Transferred from the Adobe Open Source Subversion Repository

Revision: 10322
Author:   aharui@adobe.com
Date:     2009-09-16T21:04:29.926526Z

Log Message:
-----------
Fix a few Container dependencies that should be INavigatorContent

QE Notes: None
Doc Notes: None
Bugs: SDK-23202
Reviewer: Glenn
API Change: No
Is noteworthy for integration: No
tests: checkintests mustella/Accordion

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as

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

--- frameworks/projects/mx/src/mx/containers/Accordion.as
+++ frameworks/projects/mx/src/mx/containers/Accordion.as
@@ -2472,7 +2472,7 @@
         var child:DisplayObject = DisplayObject(event.target);
         var childIndex:int = getChildIndex(child);
         var header:Button = getHeaderAt(childIndex);
-        header.label = Container(event.target).label;
+        header.label = INavigatorContent(event.target).label;
     }

     /**
@@ -2484,7 +2484,7 @@
         var child:DisplayObject = DisplayObject(event.target);
         var childIndex:int = getChildIndex(child);
         var header:Button = getHeaderAt(childIndex);
-        header.setStyle("icon", Container(event.target).icon);
+        header.setStyle("icon", INavigatorContent(event.target).icon);
         //header.icon = Container(event.target).icon;
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 2106
Author:   jimurphy@adobe.com
Date:     2008-06-17T15:08:59.757217Z

Log Message:
-----------
Merge 3.0.x revisions [2073,2075-2077,2079,2093,2095,2103] -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ButtonBarButtonSkin.as</path>
<path kind="dir" action="M">/flex/sdk/trunk/modules/asc</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicConsumer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/air-config.xml</path>

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

--- frameworks/projects/mx/src/mx/containers/Accordion.as
+++ frameworks/projects/mx/src/mx/containers/Accordion.as
@@ -1061,13 +1061,11 @@
         {
             firstTime = false;

-            // Add "added" and "removed" listeners to the system manager so we can
-            // register/un-register from the history manager when this component is
-            // added or removed from the display list.
-            systemManager.addEventListener(Event.ADDED, systemManager_addedHandler,
-                    false, 0, true);
-            systemManager.addEventListener(Event.REMOVED, systemManager_removedHandler,
-                    false, 0, true);
+            // Add "addedToStage" and "removedFromStage" listeners so we can
+            // register/un-register from the history manager when this component
+            // is added or removed from the display list.
+            addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler, false, 0, true);
+            addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler, false, 0, true);
         }
     }

@@ -2145,24 +2143,21 @@

     /**
      *  @private
-     *  Handles "added" event from system manager
-     */
-    private function systemManager_addedHandler(event:Event):void
-    {
-        if (event.target is DisplayObjectContainer &&
-                DisplayObjectContainer(event.target).contains(this))
-            HistoryManager.register(this);
+     *  Handles "addedToStage" event
+     */
+    private function addedToStageHandler(event:Event):void
+    {
+        if (historyManagementEnabled)
+                HistoryManager.register(this);
     }

     /**
      *  @private
-     *  Handles "removed" event from system manager
-     */
-    private function systemManager_removedHandler(event:Event):void
-    {
-        if (event.target is DisplayObjectContainer &&
-                DisplayObjectContainer(event.target).contains(this))
-            HistoryManager.unregister(this);
+     *  Handles "removedFromStage" event
+     */
+    private function removedFromStageHandler(event:Event):void
+    {
+        HistoryManager.unregister(this);
     }

     /**


FLEX-26325 Added a way to override the toString method to stop excessive slow logging.

--- frameworks/projects/rpc/src/mx/utils/RPCObjectUtil.as
+++ frameworks/projects/rpc/src/mx/utils/RPCObjectUtil.as
@@ -60,14 +60,40 @@
 	/**
 	 *  Change deault set of strings to exclude.
 	 *
+	 *  @param excludes The array of strings to exclude.
+	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 9
 	 *  @playerversion AIR 1.1
 	 *  @productversion ApacheFlex 4.10
 	 */
-    public static function setToStringExcludes(excludes:Array):void
+	public static function setToStringExcludes(excludes:Array):void
 	{
 		defaultToStringExcludes = excludes;
+	}
+
+	private static var _externalToString:Function = null;
+
+	/**
+	 *  Assign an static external toString method rather than use the internal one.
+	 *
+	 *
The function passed in needs to have the same signature as toString.
+	 *
+	 *     public static function externalToString(value:Object,
+     *                              namespaceURIs:Array = null,
+     *                              exclude:Array = null):String
+	 *

+	 *
+	 *  @param externalToString The function to call instead of internalToString.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion ApacheFlex 4.10
+	 */
+	public static function externalToString(value:Function):void
+	{
+		_externalToString = value;
 	}

     /**
@@ -226,7 +252,11 @@
         }

         refCount = 0;
-        return internalToString(value, 0, null, namespaceURIs, exclude);
+
+		if (_externalToString != null)
+			return _externalToString(value, namespaceURIs, exclude);
+		else
+        	return internalToString(value, 0, null, namespaceURIs, exclude);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/spark/src/spark/effects/Rotate.as
+++ frameworks/projects/spark/src/spark/effects/Rotate.as
@@ -13,6 +13,7 @@
 {
 import mx.effects.IEffectInstance;

+import spark.effects.animation.MotionPath;
 import spark.effects.supportClasses.AnimateTransformInstance;

 /**
@@ -176,7 +177,7 @@
      */
     override public function createInstance(target:Object = null):IEffectInstance
     {
-        motionPaths = [];
+        motionPaths = new Vector.<MotionPath>();
         return super.createInstance(target);
     }


Remove the concept of 'me' from the Roster

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

--- src/org/jivesoftware/xiff/im/Roster.as
+++ src/org/jivesoftware/xiff/im/Roster.as
@@ -115,8 +115,6 @@
 		private var pendingSubscriptionRequestJID:JID;
 		//FIXME: maps should not be arrays
 		private var _presenceMap:Array = new Array();
-
-		private var _me:RosterItemVO;

 		[Bindable]
 		public var groups:ArrayCollection = new ArrayCollection();
@@ -618,17 +616,6 @@
 			return _presenceMap[jid.toString()];
 		}

-		public function changePresence(show:String, status:String, priority:Number):void
-		{
-			var presence:Presence = new Presence();
-			presence.type = Presence.AVAILABLE_TYPE;
-			presence.show = show;
-			presence.priority = priority;
-			presence.status = status;
-			connection.send(presence);
-			updateRosterItemPresence(me, presence);
-		}
-
 		/**
 		 * The instance of the XMPPConnection class to use for the roster to use for
 		 * sending and receiving data.
@@ -647,18 +634,6 @@
 			myConnection.addEventListener(PresenceEvent.PRESENCE, handleEvent);
 			myConnection.addEventListener(LoginEvent.LOGIN, handleEvent);
 			myConnection.addEventListener( RosterExtension.NS, handleEvent );
-			me = RosterItemVO.get(aConnection.jid, true, myConnection);
-		}
-
-		[Bindable]
-		public function get me():RosterItemVO
-		{
-			return _me;
-		}
-
-		public function set me(item:RosterItemVO):void
-		{
-			_me = item;
 		}

 		public function getGroup(name:String):RosterGroup


Split method "testWithClassLevelCloneable" to a few.

--- dolly-framework/src/test/actionscript/dolly/ClonerTest.as
+++ dolly-framework/src/test/actionscript/dolly/ClonerTest.as
@@ -102,28 +102,31 @@
 	}

 	[Test]
-	public function testWithClassLevelCloneable():void {
-		const clone1:ClassLevelCloneable = Cloner.clone(classLevelCloneable);
-		assertNotNull(clone1);
-		assertNotNull(clone1.property1);
-		assertEquals(clone1.property1, classLevelCloneable.property1);
-		assertNotNull(clone1.property2);
-		assertEquals(clone1.property2, classLevelCloneable.property2);
-		assertNotNull(clone1.property3);
-		assertEquals(clone1.property3, classLevelCloneable.property3);
-		assertNotNull(clone1.writableField);
-		assertEquals(clone1.writableField, classLevelCloneable.writableField);
+	public function testCloneClassLevelCloneable():void {
+		const clone:ClassLevelCloneable = Cloner.clone(classLevelCloneable);
+		assertNotNull(clone);
+		assertNotNull(clone.property1);
+		assertEquals(clone.property1, classLevelCloneable.property1);
+		assertNotNull(clone.property2);
+		assertEquals(clone.property2, classLevelCloneable.property2);
+		assertNotNull(clone.property3);
+		assertEquals(clone.property3, classLevelCloneable.property3);
+		assertNotNull(clone.writableField);
+		assertEquals(clone.writableField, classLevelCloneable.writableField);
+	}

-		const clone2:ClassLevelCopyableCloneable = Cloner.clone(classLevelCopyableCloneable);
-		assertNotNull(clone2);
-		assertNotNull(clone2.property1);
-		assertEquals(clone2.property1, classLevelCloneable.property1);
-		assertNotNull(clone2.property2);
-		assertEquals(clone2.property2, classLevelCloneable.property2);
-		assertNotNull(clone2.property3);
-		assertEquals(clone2.property3, classLevelCloneable.property3);
-		assertNotNull(clone2.writableField);
-		assertEquals(clone2.writableField, classLevelCloneable.writableField);
+	[Test]
+	public function testCloneClassLevelCopyableCloneable():void {
+		const clone:ClassLevelCopyableCloneable = Cloner.clone(classLevelCopyableCloneable);
+		assertNotNull(clone);
+		assertNotNull(clone.property1);
+		assertEquals(clone.property1, classLevelCloneable.property1);
+		assertNotNull(clone.property2);
+		assertEquals(clone.property2, classLevelCloneable.property2);
+		assertNotNull(clone.property3);
+		assertEquals(clone.property3, classLevelCloneable.property3);
+		assertNotNull(clone.writableField);
+		assertEquals(clone.writableField, classLevelCloneable.writableField);
 	}

 	[Test]


Transferred from the Adobe Open Source Subversion Repository

Revision: 17435
Author:   rfrishbe@adobe.com
Date:     2010-08-20T21:38:52.068340Z

Log Message:
-----------
A few MobileItemRenderer/MobileIconItemRenderer changes at NJ's request. Added verticalAlign style. Changed defaults for paddings. Exposed content cache for MobileIconItemRenderer.  Fixed bug with MobileIconItemRenderer around default height (should be 80, not 120).

QE notes: None
Doc notes: None
Bugs: SDK-27504, SDK-27401
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/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -149,6 +149,21 @@
  */
 [Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark,mobile")]
 // FIXME (rfrishbe): should we add chromeColor and other inheriting styles?
+
+/**
+ *  The vertical alignment of the content when it does not have
+ *  a one-to-one aspect ratio.
+ *  Possible values are "top", "middle",
+ *  and "bottom".
+ *
+ *  @default "center"
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="verticalAlign", type="String", enumeration="bottom,middle,top", inherit="no")]

 //--------------------------------------
 //  Excluded APIs
@@ -733,9 +748,18 @@
             var viewHeight:Number =  unscaledHeight - getStyle("paddingTop") - getStyle("paddingBottom");
             var labelHeight:Number = Math.max(Math.min(viewHeight, textHeight), 0);

-            // label is positioned after the padding on the left.  vertically aligned center
+            // label is positioned after the padding on the left.  look at verticalAlign to see
+            // what to do vertically.
             var labelX:Number = getStyle("paddingLeft");
-            var labelY:Number = getStyle("paddingTop") + (viewHeight - labelHeight)/2;
+            var labelY:Number;
+            if (getStyle("verticalAlign") == "top")
+                labelY = getStyle("paddingTop");
+            else if (getStyle("verticalAlign") == "bottom")
+                labelY = getStyle("paddingTop") + viewHeight - labelHeight;
+            else //if (getStyle("verticalAlign") == "middle")
+                labelY = getStyle("paddingTop") + Math.round((viewHeight - labelHeight)/2);
+            // made "middle" last even though it's most likely so it is the default and if someone
+            // types "center", then it will still vertically center itself.

             labelDisplay.commitStyles();