Transferred from the Adobe Open Source Subversion Repository

Revision: 20342
Author:   jszeto@adobe.com
Date:     2011-02-17T00:29:01.144705Z

Log Message:
-----------
TextArea Scroller bug fixes

http://bugs.adobe.com/jira/browse/SDK-29516 - TextArea does not autoscroll on edit if it's height is not specified
http://bugs.adobe.com/jira/browse/SDK-29517 - TextArea with default height unexpectedly scrolls to the top when SoftKeyboard predicted text appears

TextAreaSkin now sends events when the caret bounds have changed. Scroller listens for these events and adjusts the scroll position so that the caret is in view.

QE notes: yes, need mobile softkeyboard retesting
Doc notes: none
Bugs: SDK-29516, SDK-29517
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/mobiletheme/src/spark/skins/mobile/TextAreaSkin.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="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/CaretBoundsChangeEvent.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as
@@ -14,6 +14,8 @@

 import flash.events.Event;
 import flash.events.KeyboardEvent;
+import flash.events.SoftKeyboardEvent;
+import flash.geom.Point;
 import flash.geom.Rectangle;
 import flash.system.Capabilities;
 import flash.ui.Keyboard;
@@ -26,6 +28,7 @@
 import spark.components.Scroller;
 import spark.components.TextArea;
 import spark.components.supportClasses.StyleableTextField;
+import spark.events.CaretBoundsChangeEvent;
 import spark.skins.mobile.supportClasses.TextSkinBase;
 import spark.skins.mobile160.assets.TextInput_border;
 import spark.skins.mobile240.assets.TextInput_border;
@@ -135,17 +138,18 @@
      */
     mx_internal var oldUnscaledWidth:Number;

+    private var textDisplayGroup:Group;
+    private var _isIOS:Boolean;
+    private var invalidateCaretPosition:Boolean = true;
+    private var oldCaretBounds:Rectangle = new Rectangle(-1, -1, -1, -1);
+    private var lastTextHeight:Number;
+    private var lastTextWidth:Number;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
-
-    private var textDisplayGroup:Group;
-
-    private var _isIOS:Boolean;
-
-    private var invalidateCaretPosition:Boolean = true;

     /**
      *  @private
@@ -172,6 +176,7 @@
             textDisplay.addEventListener(Event.CHANGE, textDisplay_changeHandler);
             textDisplay.addEventListener(FlexEvent.VALUE_COMMIT, textDisplay_changeHandler);
             textDisplay.addEventListener(Event.SCROLL, textDisplay_scrollHandler);
+            textDisplay.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, textDisplay_softKeyboardActivateHandler);

 			textDisplay.left = getStyle("paddingLeft");
 			textDisplay.top = getStyle("paddingTop");
@@ -337,7 +342,7 @@
         // checking if text fits in TextArea
         // does not apply to iOS due to native text editing and scrolling
         // invalidateCaretPosition will never be true for iOS
-        if ((textHeight > unscaledTextHeight) && invalidateCaretPosition)
+        if (invalidateCaretPosition)
         {
             // if the caret is outside the viewport, update the Group verticalScrollPosition
             var charIndex:int = textDisplay.selectionBeginIndex;
@@ -347,73 +352,72 @@
             // getCharBoundaries() returns null for new lines
             if (!caretBounds)
             {
-				// Optimization: if the charIndex is the end of the text, set vsp to
-				// textHeight and let snapTextScrollPosition validate it
-
-				if (charIndex == textDisplay.text.length)
-				{
-					// Make sure textDisplayGroup is validated, otherwise the
-					// verticalScrollPosition may be out of bounds, which will
-					// cause a bounce effect.
-					textDisplayGroup.validateNow();
-					textDisplayGroup.verticalScrollPosition = textHeight;
-				}
-				else
-				{
-					// temporarily insert a character at the caretIndex
-					textDisplay.replaceText(charIndex, charIndex, "W");
-					caretBounds = textDisplay.getCharBoundaries(charIndex);
-					lineIndex = textDisplay.getLineIndexOfChar(charIndex);
-					textDisplay.replaceText(charIndex, charIndex + 1, "");
-				}
+				// temporarily insert a character at the caretIndex
+				textDisplay.replaceText(charIndex, charIndex, "W");
+				caretBounds = textDisplay.getCharBoundaries(charIndex);
+				lineIndex = textDisplay.getLineIndexOfChar(charIndex);
+				textDisplay.replaceText(charIndex, charIndex + 1, "");
             }

             if (caretBounds)
             {
-                // caretTopPositon and caretBottomPosition are TextField-relative positions
-                // the TextField is inset by padding styles of the TextArea (via the VGroup)
-
-                // adjust top position to 0 when on the first line
-                // caretTopPosition will be negative when off stage
-                var caretTopPosition:Number = ((caretBounds.y) < 0 || (lineIndex == 0))
-                    ? 0 : caretBounds.y;
-
-                // caretBottomPosition is the y coordinate of the bottom bounds of the caret
-                var caretBottomPosition:Number = caretBounds.y + caretBounds.height;
-
-                // note that verticalScrollPosition min/max do not account for padding
-                var vspTop:Number = textDisplayGroup.verticalScrollPosition;
-
-                // vspBottom should be the max visible Y in the TextField
-                // coordinate space.
-                // remove paddingBottom for some clearance between caret and border
-                var vspBottom:Number = vspTop + unscaledHeight - paddingTop - paddingBottom;
-
-                // is the caret in or below the padding and viewport?
-                if (caretBottomPosition > vspBottom)
+                // Scroll the internal Scroller to ensure the caret is visible
+                if (textHeight > unscaledTextHeight)
                 {
-                    // adjust caretBottomPosition to max scroll position when on the last line
-                    if (lineIndex + 1 == textDisplay.numLines)
+                    // caretTopPositon and caretBottomPosition are TextField-relative positions
+                    // the TextField is inset by padding styles of the TextArea (via the VGroup)
+
+                    // adjust top position to 0 when on the first line
+                    // caretTopPosition will be negative when off stage
+                    var caretTopPosition:Number = ((caretBounds.y) < 0 || (lineIndex == 0))
+                        ? 0 : caretBounds.y;
+
+                    // caretBottomPosition is the y coordinate of the bottom bounds of the caret
+                    var caretBottomPosition:Number = caretBounds.y + caretBounds.height;
+
+                    // note that verticalScrollPosition min/max do not account for padding
+                    var vspTop:Number = textDisplayGroup.verticalScrollPosition;
+
+                    // vspBottom should be the max visible Y in the TextField
+                    // coordinate space.
+                    // remove paddingBottom for some clearance between caret and border
+                    var vspBottom:Number = vspTop + unscaledHeight - paddingTop - paddingBottom;
+
+                    // is the caret in or below the padding and viewport?
+                    if (caretBottomPosition > vspBottom)
                     {
-                        // use textHeight+paddings instead of textDisplayGroup.contentHeight
-                        // Group has not been resized by this point
-                        textDisplayGroup.verticalScrollPosition = (textHeight + paddingTop + paddingBottom) - textDisplayGroup.height;
+                        // adjust caretBottomPosition to max scroll position when on the last line
+                        if (lineIndex + 1 == textDisplay.numLines)
+                        {
+                            // use textHeight+paddings instead of textDisplayGroup.contentHeight
+                            // Group has not been resized by this point
+                            textDisplayGroup.verticalScrollPosition = (textHeight + paddingTop + paddingBottom) - textDisplayGroup.height;
+                        }
+                        else
+                        {
+                            // bottom edge of the caret moves just inside the bottom edge of the scroller
+                            // add delta between caret and vspBottom
+                            textDisplayGroup.verticalScrollPosition = vspTop + (caretBottomPosition - vspBottom);
+                        }
                     }
-                    else
+                        // is the caret above the viewport?
+                    else if (caretTopPosition < vspTop)
                     {
-                        // bottom edge of the caret moves just inside the bottom edge of the scroller
-                        // add delta between caret and vspBottom
-                        textDisplayGroup.verticalScrollPosition = vspTop + (caretBottomPosition - vspBottom);
+                        // top edge of the caret moves inside the top edge of the scroller
+                        textDisplayGroup.verticalScrollPosition = caretTopPosition;
                     }
                 }
-                    // is the caret above the viewport?
-                else if (caretTopPosition < vspTop)
-                {
-                    // top edge of the caret moves inside the top edge of the scroller
-                    textDisplayGroup.verticalScrollPosition = caretTopPosition;
-                }
+
+                // Convert to local coordinates
+                // Dispatch an event for an ancestor Scroller
+                // It will scroll the TextArea so the caret is in view
+                convertBoundsToLocal(caretBounds);
+                if (caretBounds.bottom != oldCaretBounds.bottom || caretBounds.top != oldCaretBounds.top)
+                    dispatchEvent(new CaretBoundsChangeEvent(CaretBoundsChangeEvent.CARET_BOUNDS_CHANGE,true,true,oldCaretBounds,caretBounds));
+
+                oldCaretBounds = caretBounds;
             }
-
+
             invalidateCaretPosition = false;
         }

@@ -436,8 +440,43 @@
 			textDisplayGroup.contentHeight-textDisplayGroup.height : 0;
 		textDisplayGroup.verticalScrollPosition =
 			Math.min(Math.max(0,textDisplayGroup.verticalScrollPosition),maxVsp);
-	}
+ 	}

+    /**
+     *  @private
+     *  Get the bounds of the caret
+     */
+    private function getCaretBounds():Rectangle
+    {
+        var charIndex:int = textDisplay.selectionBeginIndex;
+        var caretBounds:Rectangle = textDisplay.getCharBoundaries(charIndex);
+
+        if (!caretBounds)
+        {
+            textDisplay.replaceText(charIndex, charIndex, "W");
+            caretBounds = textDisplay.getCharBoundaries(charIndex);
+            textDisplay.replaceText(charIndex, charIndex + 1, "");
+        }
+
+        return caretBounds;
+    }
+
+    /**
+     *  @private
+     *  Convert bounds from textDisplay to local coordinates
+     */
+    private function convertBoundsToLocal(bounds:Rectangle):void
+    {
+        if (bounds)
+        {
+            var position:Point = new Point(bounds.x, bounds.y);
+            position = textDisplay.localToGlobal(position);
+            position = globalToLocal(position);
+            bounds.x = position.x;
+            bounds.y = position.y;
+        }
+    }
+
 	/**
 	 *  @private
 	 */
@@ -457,16 +496,6 @@
 		}
 	}

-	/**
-	 *  @private
-	 *  Returns true if scroller can scroll.
-	 */
-	private function isScrollingActive():Boolean
-	{
-		return textDisplayGroup.height < textDisplayGroup.contentHeight ||
-			   textDisplayGroup.width < textDisplayGroup.contentWidth;
-	}
-
     /**
      *  @private
      *  Handle size and caret position changes that occur when text content
@@ -474,12 +503,21 @@
      */
     private function textDisplay_changeHandler(event:Event):void
     {
-		invalidateSize();
-		if (isScrollingActive())
-		{
+        var tH:Number = textDisplay.textHeight;
+        var tW:Number = textDisplay.textWidth;
+        var explicitLineBreak:Boolean = getStyle("lineBreak") == "explicit";
+
+        // Size and caret position have changed if the text height is different or
+        // the text width is different and we aren't word wrapping
+        if (tH != lastTextHeight || ( explicitLineBreak && tW != lastTextWidth))
+        {
+    		invalidateSize();
 	        invalidateDisplayList();
 	        invalidateCaretPosition = true;
-		}
+        }
+
+        lastTextHeight = tH;
+        lastTextWidth = tW;
     }

     /**
@@ -512,11 +550,8 @@
                 || event.keyCode == Keyboard.LEFT
                 || event.keyCode == Keyboard.RIGHT))
         {
-			if (isScrollingActive())
-			{
-	            invalidateDisplayList();
-	            invalidateCaretPosition = true;
-			}
+            invalidateDisplayList();
+            invalidateCaretPosition = true;
         }

 		// Change event is not always sent when delete key is pressed, so
@@ -525,6 +560,22 @@
 		{
 			invalidateSize();
 		}
+    }
+
+    /**
+     *  @private
+     *  Send a caret change event to an ancestor Scroller
+     */
+    private function textDisplay_softKeyboardActivateHandler(event:SoftKeyboardEvent):void
+    {
+        var newCaretBounds:Rectangle = getCaretBounds();
+        convertBoundsToLocal(newCaretBounds);
+
+        if (oldCaretBounds != newCaretBounds)
+        {
+            dispatchEvent(new CaretBoundsChangeEvent(CaretBoundsChangeEvent.CARET_BOUNDS_CHANGE,true,true,oldCaretBounds,newCaretBounds));
+            oldCaretBounds = newCaretBounds;
+        }
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 10464
Author:   rfrishbe@adobe.com
Date:     2009-09-21T17:40:30.663638Z

Log Message:
-----------
Removing support in Flex framework for compatibility version < 3.  We won't support compatibility-version 2 or 2.01 anymore.  We only keep compatibility-version for one full release, so for Flex 4, we only support compatibility-version = 3.x.

This should reduce our code-size some as we no longer need this old code.  I didn't clean up the compiler's support for compatibility-versioning as it didn't seem worth the effort.

QE notes: -
Doc notes: -
Bugs: SDK-15360
Reviewer: Kevin
Tests run: checkintests, Joan ran all mustella tests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/accordionClasses/AccordionHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/CanvasLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/AccordionHeaderSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Alert.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeaderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DateChooserYearArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuBarItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PanelSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.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/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</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/skins/halo/ScrollTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/Flex.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>

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

--- frameworks/projects/mx/src/mx/controls/listClasses/ListItemRenderer.as
+++ frameworks/projects/mx/src/mx/controls/listClasses/ListItemRenderer.as
@@ -15,7 +15,6 @@
 import flash.display.DisplayObject;
 import flash.geom.Point;
 import flash.geom.Rectangle;
-import mx.core.FlexVersion
 import mx.core.IDataRenderer;
 import mx.core.IFlexDisplayObject;
 import mx.core.IFlexModuleFactory;
@@ -154,14 +153,6 @@
      */
     override public function get baselinePosition():Number
     {
-        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-        {
-            if (!label)
-                return 0;
-
-            return label.baselinePosition;
-        }
-
         if (!validateBaselinePosition())
             return NaN;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/rpc/src/mx/messaging/messages/CommandMessageExt.as
+++ frameworks/projects/rpc/src/mx/messaging/messages/CommandMessageExt.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.messaging.messages
+{
+
+import flash.utils.IDataOutput;
+import flash.utils.IExternalizable;
+
+[RemoteClass(alias="DSC")]
+
+/**
+ * A special serialization wrapper for CommandMessage. This wrapper is used to
+ * enable the externalizable form of an CommandMessage for serialization. The
+ * wrapper must be applied just before the message is serialized as it does not
+ * proxy any information to the wrapped message.
+ *
+ * @private
+ */
+public class CommandMessageExt extends CommandMessage implements IExternalizable
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    public function CommandMessageExt(message:CommandMessage=null)
+    {
+        super();
+        _message = message;
+    }
+
+    override public function writeExternal(output:IDataOutput):void
+    {
+        if (_message != null)
+            _message.writeExternal(output);
+        else
+            super.writeExternal(output);
+    }
+
+    /**
+     *  The unique id for the message.
+     */
+    override public function get messageId():String
+    {
+        /* If we are wrapping another message, use its messageId */
+        if (_message != null)
+            return _message.messageId;
+
+        return super.messageId;
+    }
+
+    private var _message:CommandMessage;
+}
+
+}


OFC-486 Operating task bar for DB (Add,edit,delete) dissapear when bookmark tool bar is activated

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
@@ -188,11 +188,11 @@
 			column = getGridColumn(Message.get("list.modifiedDate"), "modifiedDate", 120, RecordSummaryDataGrid.dateTimeLabelFunction);
 			columns.addItem(column);
 			//entry completed column
-			column = getGridColumn(Message.get("list.entryComplete"), "entryComplete", 60,
+			column = getGridColumn(Message.get("list.entryComplete"), "entryComplete", 70,
 				null, true, new ClassFactory(CompleteColumnItemRenderer));
 			columns.addItem(column);
 			//cleansing completed column
-			column = getGridColumn(Message.get("list.cleansingComplete"), "cleansingComplete", 60,
+			column = getGridColumn(Message.get("list.cleansingComplete"), "cleansingComplete", 70,
 				null, true, new ClassFactory(CompleteColumnItemRenderer));
 			columns.addItem(column);
 			return columns;


read the shadow bias from the light data provider

--- src/aerys/minko/render/shader/part/phong/attenuation/MatrixShadowMapAttenuationShaderPart.as
+++ src/aerys/minko/render/shader/part/phong/attenuation/MatrixShadowMapAttenuationShaderPart.as
@@ -18,8 +18,6 @@
 	 */
 	public class MatrixShadowMapAttenuationShaderPart extends LightAwareShaderPart implements IAttenuationShaderPart
 	{
-		private static const DEFAULT_BIAS : Number = 1 / 256 / 256;
-
 		public function MatrixShadowMapAttenuationShaderPart(main : Shader)
 		{
 			super(main);
@@ -34,10 +32,8 @@
 			var shadowBias : SFloat;
 			if (meshBindings.propertyExists(PhongProperties.SHADOW_BIAS))
 				shadowBias = meshBindings.getParameter(PhongProperties.SHADOW_BIAS, 1);
-			else if (sceneBindings.propertyExists(PhongProperties.SHADOW_BIAS))
-				shadowBias = sceneBindings.getParameter(PhongProperties.SHADOW_BIAS, 1);
 			else
-				shadowBias = float(DEFAULT_BIAS);
+				shadowBias = getLightParameter(lightId, PhongProperties.SHADOW_BIAS, 1);

 			// retrieve depthmap and projection matrix
 			var worldToUV	: SFloat = getLightParameter(lightId, 'worldToUV', 16);


Add documentation for KeyframeMold.index

--- runtime/src/main/as/flump/mold/KeyframeMold.as
+++ runtime/src/main/as/flump/mold/KeyframeMold.as
@@ -5,6 +5,10 @@
 /** @private */
 public class KeyframeMold
 {
+    /**
+     * The index of the first frame in the keyframe.
+     * (Equivalent to prevKeyframe.index + prevKeyframe.duration)
+     */
     public var index :int;

     /** The length of this keyframe in frames. */


Transferred from the Adobe Open Source Subversion Repository

Revision: 7445
Author:   gruehle@adobe.com
Date:     2009-05-29T20:51:55.035384Z

Log Message:
-----------
Replace a bunch of event name literals with constants.

Bug: SDK-21271
QA Notes:
Doc Notes:
Reviewer: Chet

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/FocusSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/components/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SoundEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/components/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/ErrorSkin.as</path>

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

--- frameworks/projects/airspark/src/spark/components/WindowedApplication.as
+++ frameworks/projects/airspark/src/spark/components/WindowedApplication.as
@@ -40,6 +40,7 @@
 import mx.core.IWindow;
 import mx.core.mx_internal;
 import mx.events.AIREvent;
+import mx.events.EffectEvent;
 import mx.events.FlexEvent;
 import mx.events.FlexNativeWindowBoundsEvent;
 import mx.managers.DragManager;
@@ -847,7 +848,7 @@
                     e = new FlexEvent(FlexEvent.HIDE);
                     if (getStyle("hideEffect"))
                     {
-                        addEventListener("effectEnd", hideEffectEndHandler);
+                        addEventListener(EffectEvent.EFFECT_END, hideEffectEndHandler);
                     }
                     else
                     {
@@ -2327,7 +2328,7 @@
     {
         if (!nativeWindow.closed)
             stage.nativeWindow.minimize();
-        removeEventListener("effectEnd", windowMinimizeHandler);
+        removeEventListener(EffectEvent.EFFECT_END, windowMinimizeHandler);
     }

     /**
@@ -2335,7 +2336,7 @@
      */
     private function windowUnminimizeHandler(event:Event):void
     {
-        removeEventListener("effectEnd", windowUnminimizeHandler);
+        removeEventListener(EffectEvent.EFFECT_END, windowUnminimizeHandler);
     }

     /**
@@ -2374,7 +2375,7 @@
             if (getStyle("minimizeEffect"))
             {
                 event.preventDefault();
-                addEventListener("effectEnd", windowMinimizeHandler);
+                addEventListener(EffectEvent.EFFECT_END, windowMinimizeHandler);
                 dispatchEvent(new Event("windowMinimize"));
             }
         }
@@ -2382,7 +2383,7 @@
         // After here, afterState is normal
         else if (event.beforeDisplayState == NativeWindowDisplayState.MINIMIZED)
         {
-            addEventListener("effectEnd", windowUnminimizeHandler);
+            addEventListener(EffectEvent.EFFECT_END, windowUnminimizeHandler);
             dispatchEvent(new Event("windowUnminimize"));
         }
     }
@@ -2392,7 +2393,7 @@
      */
     private function windowMaximizeHandler(event:Event):void
     {
-        removeEventListener("effectEnd", windowMaximizeHandler);
+        removeEventListener(EffectEvent.EFFECT_END, windowMaximizeHandler);
         if (!nativeWindow.closed)
             stage.nativeWindow.maximize();
     }
@@ -2402,7 +2403,7 @@
      */
     private function windowUnmaximizeHandler(event:Event):void
     {
-        removeEventListener("effectEnd", windowUnmaximizeHandler);
+        removeEventListener(EffectEvent.EFFECT_END, windowUnmaximizeHandler);
         if (!nativeWindow.closed)
             stage.nativeWindow.restore();
     }
@@ -2587,7 +2588,7 @@
      */
     private function window_closeEffectEndHandler(event:Event):void
     {
-        removeEventListener("effectEnd", window_closeEffectEndHandler);
+        removeEventListener(EffectEvent.EFFECT_END, window_closeEffectEndHandler);
         if (!nativeWindow.closed)
             stage.nativeWindow.close();
     }
@@ -2606,7 +2607,7 @@
         else if (getStyle("closeEffect") &&
                  stage.nativeWindow.transparent == true)
         {
-            addEventListener("effectEnd", window_closeEffectEndHandler);
+            addEventListener(EffectEvent.EFFECT_END, window_closeEffectEndHandler);
             dispatchEvent(new Event("windowClose"));
             event.preventDefault();
         }


FLEX-34053 - MaskedTextInput - update separators comment

--- frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
+++ frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
@@ -58,7 +58,7 @@
      *      maskText            : The mask base string for the component logic
      *                            defaults to ""
      *      separators          : The characters specified to act as separators that must be present in the maskText
-     *                            defaults to "-+/|()[]{}."
+     *                            defaults to "- +/|()[]{}."
      *      textMaskPrompt      : User defined prompt to override default behaviour.
      *                            defaults to ""
      *      placeHolder         : A character to show instead internal mask template characters (#, @ and ?)


Transferred from the Adobe Open Source Subversion Repository

Revision: 18188
Author:   dloverin@adobe.com
Date:     2010-10-16T03:11:51.820813Z

Log Message:
-----------
DataGrid editor PARB changes and more.

Don't open a cell editor on double click.

QE notes: Ready for testing.
Doc notes: None.
Bugs:
Reviewer: Hans
Tests run: cyclone server
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/IGridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/GridItemEditorEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/TextGridItemEditor.mxml" copyfrom-rev="18150" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DefaultGridItemEditor.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/TextGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/ComboBoxGridItemEditor.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
@@ -25,7 +25,7 @@

 import spark.components.DataGrid;
 import spark.components.Grid;
-import spark.components.gridClasses.TextGridItemEditor;
+import spark.components.gridClasses.DefaultGridItemEditor;

 use namespace mx_internal;

@@ -56,7 +56,7 @@
     mx_internal static function get defaultItemEditorFactory():IFactory
     {
         if (!_defaultItemEditorFactory)
-            _defaultItemEditorFactory = new ClassFactory(TextGridItemEditor);
+            _defaultItemEditorFactory = new ClassFactory(DefaultGridItemEditor);
         return _defaultItemEditorFactory;
     }


Fixed syntax typo

Fixed syntax typo

--- src/org/openvv/OVVCheck.as
+++ src/org/openvv/OVVCheck.as
@@ -28,7 +28,7 @@
     }
     else
     {
-      _results { "error": "ExternalInterface not available" };
+      _results = { "error": "ExternalInterface not available" };
     }
 	}


make application a little more tolerant so it can be used in flexunit tests

--- frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
+++ frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
@@ -58,6 +58,17 @@
     [Event(name="viewChanged", type="org.apache.flex.events.Event")]

     /**
+     *  Dispatched at startup after the initial view has been
+     *  put on the display list.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="applicationComplete", type="org.apache.flex.events.Event")]
+
+    /**
      *  The Application class is the main class and entry point for a FlexJS
      *  application.  This Application class is different than the
      *  Flex SDK's mx:Application or spark:Application in that it does not contain
@@ -112,9 +123,12 @@

             dispatchEvent(new Event("initialize"));

-            initialView.applicationModel =  model;
-    	    this.addElement(initialView);
-    	    dispatchEvent(new Event("viewChanged"));
+            if (initialView)
+            {
+                initialView.applicationModel =  model;
+        	    this.addElement(initialView);
+                dispatchEvent(new Event("viewChanged"));
+            }
             dispatchEvent(new Event("applicationComplete"));
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 21352
Author:   deeptika@adobe.com
Date:     2011-06-08T06:04:22.205178Z

Log Message:
-----------
Creating new transform when series is added to Chart

QE notes:
Doc notes:
Bugs: FLEXDMV-2543 (removeElement/addElement invalidates Chart Series)
Reviewer:
Tests run: Checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/charts/src/mx/charts/chartClasses/ChartBase.as</path>

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

--- frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as
@@ -1060,7 +1060,9 @@
             g = displayedSeries[i] as IChartElement;
             if (!g)
                 continue;
-
+
+			Series(g).dataTransform = new CartesianTransform();
+
             Series(g).invalidateProperties();

             labelLayer = UIComponent(g.labelContainer);


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.charts.series.items
 {


Added 640 dpi values

Added 640 dpi values

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as
@@ -89,6 +89,18 @@

         switch (applicationDPI)
         {
+			case DPIClassification.DPI_640:
+			{
+				// Note provisional may need changes
+				borderSize = 2;
+				layoutShadowHeight = 12;
+				layoutContentGroupHeight = 172;
+				layoutTitleGroupHorizontalPadding = 52;
+
+				borderClass = spark.skins.mobile640.assets.ActionBarBackground;
+
+				break;
+			}
 			case DPIClassification.DPI_480:
 			{
 				// Note provisional may need changes


Transferred from the Adobe Open Source Subversion Repository

Revision: 17221
Author:   jasonsj@adobe.com
Date:     2010-08-06T22:57:04.234839Z

Log Message:
-----------
Implemented ActionBarSkin measure to provide default size.
Fixed ViewNavigatorSkin sizing in updateDisplayList.

QE notes: Test sizing in Application and MobileApplication
Doc notes:
Bugs:
SDK-27306 - ActionBar does not show up when used in a Mobile Application with <s:Application>
Reviewer: chiedoz, rfrishbe
Tests run: checkintests
Is noteworthy for integration: No

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

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as
@@ -3,9 +3,12 @@
 import flash.display.Graphics;
 import flash.display.Sprite;

+import mx.core.UIComponent;
+
 import spark.components.ActionBar;
 import spark.components.Group;
 import spark.components.Label;
+import spark.core.SpriteVisualElement;
 import spark.layouts.HorizontalAlign;
 import spark.layouts.HorizontalLayout;
 import spark.layouts.VerticalAlign;
@@ -20,7 +23,7 @@
     public var titleGroup:Group;
     public var actionGroup:Group;
     public var titleDisplay:Label;
-    private var highlight:Sprite;
+    private var highlight:SpriteVisualElement;

     public function ActionBarSkin()
     {
@@ -40,7 +43,7 @@
         hLayout.horizontalAlign = HorizontalAlign.LEFT;
         hLayout.verticalAlign = VerticalAlign.MIDDLE;
         hLayout.gap = 0;
-        hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight = hLayout.paddingBottom = 10;
+        hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight = hLayout.paddingBottom = 10; // TODO (jasonsj): 15 for 240dpi
         navigationGroup.layout = hLayout;
         addChild(navigationGroup);

@@ -49,7 +52,7 @@
         hLayout.horizontalAlign = HorizontalAlign.LEFT;
         hLayout.verticalAlign = VerticalAlign.MIDDLE;
         hLayout.gap = 0;
-        hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight = hLayout.paddingBottom = 10;
+        hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight = hLayout.paddingBottom = 10; // TODO (jasonsj): 15 for 240dpi
         titleGroup.layout = hLayout;
         addChild(titleGroup);

@@ -58,14 +61,14 @@
         hLayout.horizontalAlign = HorizontalAlign.RIGHT;
         hLayout.verticalAlign = VerticalAlign.MIDDLE;
         hLayout.gap = 0;
-        hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight = hLayout.paddingBottom = 10;
+        hLayout.paddingLeft = hLayout.paddingTop = hLayout.paddingRight = hLayout.paddingBottom = 10; // TODO (jasonsj): 15 for 240dpi
         actionGroup.layout = hLayout;
         addChild(actionGroup);

         titleDisplay = new Label();
 		titleDisplay.maxDisplayedLines = 1;
 		titleDisplay.percentWidth = 100;
-        titleDisplay.setStyle("fontSize", "18");
+        titleDisplay.setStyle("fontSize", "18"); // TODO (jasonsj): 27 for 240dpi
         titleDisplay.setStyle("verticalAlign", "middle");
         titleDisplay.setStyle("color", "0xFFFFFF");
         titleDisplay.setStyle("fontWeight", "bold");
@@ -73,42 +76,51 @@

     override protected function measure():void
     {
-        measuredHeight = Math.max(Math.max(navigationGroup.getExplicitOrMeasuredHeight(),
-            titleGroup.getExplicitOrMeasuredHeight()),
-            actionGroup.getExplicitOrMeasuredHeight());
+        var titleComponent:UIComponent = (titleGroup.numElements > 0) ? titleGroup : titleDisplay;
+
+        measuredMinWidth = measuredWidth =
+            navigationGroup.getPreferredBoundsWidth()
+            + titleComponent.getPreferredBoundsWidth()
+            + actionGroup.getPreferredBoundsWidth();
+
+        measuredMinHeight = measuredHeight =
+            Math.max(navigationGroup.getPreferredBoundsHeight(),
+                actionGroup.getPreferredBoundsHeight(),
+                titleComponent.getPreferredBoundsHeight());
     }

     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
-        highlight.width = unscaledWidth;
-        highlight.height = unscaledHeight;
+        highlight.setLayoutBoundsSize(unscaledWidth, unscaledHeight);
+        highlight.setLayoutBoundsPosition(0, 0);

         var left:Number = 0;
         var right:Number = unscaledWidth;

-        // Position groups
-        // FIXME (chiedozi): Prevent measurements from being negative.  Figure out
-        // minimums for each group.
-        // FIXME (jasonsj): Why are we checking includeInLayout
+        // position groups, overlap of navigation and action groups is allowed
+        // when overlap occurs, title group is not visible (width = 0)
         if (navigationGroup.numElements > 0 && navigationGroup.includeInLayout)
         {
-            left += navigationGroup.measuredWidth;
+            left += navigationGroup.getPreferredBoundsWidth();
             navigationGroup.setLayoutBoundsSize(left, unscaledHeight);
         }

         if (actionGroup.numElements > 0 && actionGroup.includeInLayout)
         {
-            right -= actionGroup.measuredWidth;
+            var actionGroupWidth:Number = actionGroup.getPreferredBoundsWidth();
+            right -= actionGroupWidth;
+            actionGroup.setLayoutBoundsSize(actionGroupWidth, unscaledHeight);
+
+            // actionGroup x position can be negative
             actionGroup.setLayoutBoundsPosition(right, 0);
-            actionGroup.setLayoutBoundsSize(unscaledWidth - right, unscaledHeight);
         }

         var titleGroupWidth:Number = right - left;
         if (titleGroupWidth < 0)
-        	titleGroupWidth = 0;
-
+            titleGroupWidth = 0;
+
+        titleGroup.setLayoutBoundsSize(titleGroupWidth, unscaledHeight);
         titleGroup.setLayoutBoundsPosition(left, 0);
-        titleGroup.setLayoutBoundsSize(titleGroupWidth, unscaledHeight);

         // Draw background
         var g:Graphics = backgroundFill.graphics;


Transferred from the Adobe Open Source Subversion Repository

Revision: 12466
Author:   aharui@adobe.com
Date:     2009-12-03T20:26:07.995232Z

Log Message:
-----------
Update ASDoc to match spec

QE Notes: None
Doc Notes: None
Bugs: SDK-24526
Reviewer: Me
API Change: No
Is noteworthy for integration: No
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/treeClasses/MXTreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as</path>

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

--- frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as
+++ frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as
@@ -114,7 +114,7 @@
     //----------------------------------

     /**
-     *  The ID of the component that receives focus as the item editor.
+     *  If supplied, the component that will receive focus as the editor.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 4205
Author:   clucier@adobe.com
Date:     2008-12-01T19:48:53.571431Z

Log Message:
-----------
Initial baselinePosition support for our new skinnable components.
QE Notes: Please wait until Evtim completes his baseline support in our new layouts to test.
Doc Notes: None
Reviewer: Glenn, Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDefaultItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as
@@ -12,9 +12,12 @@
 package mx.components
 {
 import flash.events.MouseEvent;
+import flash.geom.Point;

 import mx.components.DataGroup;
 import mx.components.MXMLComponent;
+import mx.core.mx_internal;
+import mx.graphics.graphicsClasses.TextGraphicElement;
 import mx.layout.HorizontalLayout;
 import mx.layout.VerticalLayout;

@@ -63,18 +66,52 @@
     	return _selected;
     }

-	public function set selected(value:Boolean):void
-	{
-		if (value != _selected)
-		{
-			_selected = value;
-			currentState = getCurrentSkinState();
-		}
-	}
+    public function set selected(value:Boolean):void
+    {
+        if (value != _selected)
+        {
+            _selected = value;
+            currentState = getCurrentSkinState();
+        }
+    }

+    //----------------------------------
+    //  labelField
+    //----------------------------------
+
+    /**
+     * Optional item renderer label component, used primarily for
+     * auto-computation of baseline.
+     */
+    public var labelField:TextGraphicElement;
+
     //--------------------------------------------------------------------------
     //
-    //  Properties
+    //  Overridden properties: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  baselinePosition
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function get baselinePosition():Number
+    {
+        if (!mx_internal::validateBaselinePosition() || !labelField)
+            return super.baselinePosition;
+
+        var labelPosition:Point = globalToLocal(labelField.parent.localToGlobal(
+            new Point(labelField.x, labelField.y)));
+
+        return labelPosition.y + labelField.baselinePosition;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handling
     //
     //--------------------------------------------------------------------------


Transferred from the Adobe Open Source Subversion Repository

Revision: 11287
Author:   gruehle@adobe.com
Date:     2009-10-30T00:01:12.176166Z

Log Message:
-----------
Fixed injection in 11208 that caused some pixels to be ignored when mousing over item renderers.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as
@@ -534,8 +534,7 @@
             }
         }

-        if (drawBackground)
-            graphics.beginFill(backgroundColor, 1);
+        graphics.beginFill(backgroundColor, drawBackground ? 1 : 0);

         if (showsCaret)
         {
@@ -548,8 +547,7 @@
             graphics.drawRect(0, 0, w, h);
         }

-        if (drawBackground)
-            graphics.endFill();
+        graphics.endFill();
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 3342
Author:   chaase@adobe.com
Date:     2008-09-24T23:47:01.007481Z

Log Message:
-----------
Added new Rotate effect. Also, minor API additions to Animation class and minor refactoring of AnimateFilterInstance.

Reviewed by Glenn
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimateInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/RotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/NewEffects.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimateFilterInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as
@@ -11,6 +11,9 @@

 package flex.effects.effectClasses
 {
+import flash.events.TimerEvent;
+import flash.utils.Timer;
+
 import flex.effects.Animation;
 import flex.effects.PropertyValuesHolder;
 import flex.effects.easing.IEaser;
@@ -20,6 +23,7 @@
 import mx.core.UIComponent;
 import mx.effects.EffectInstance;
 import mx.effects.EffectManager;
+import mx.styles.IStyleClient;

 /**
  * The AnimateInstance class implements the instance class for the
@@ -79,6 +83,16 @@
      */
     protected var roundValues:Boolean;

+    /**
+     * This flag indicates whether the effect changes properties which are
+     * potentially related to the various layout constraints that may act
+     * on the object. Setting this to true will cause the effect to disable
+     * all standard constraints (left, right, top, bottom, horizontalCenter,
+     * verticalCenter) for the duration of the animation, and re-enable them
+     * when the animation is complete.
+     */
+    protected var affectsConstraints:Boolean;
+
     private var _easer:IEaser;
     public function set easer(value:IEaser):void
     {
@@ -239,10 +253,20 @@
         super.play();

         if (!propertyValuesList || propertyValuesList.length == 0)
+        {
+            // nothing to do; at least schedule the effect to end after
+            // the specified duration
+            var timer:Timer = new Timer(duration, 1);
+            timer.addEventListener(TimerEvent.TIMER, noopAnimationHandler);
+            timer.start();
             return;
+        }

         isStyleMap = new Array(propertyValuesList.length);

+        if (affectsConstraints)
+            disableConstraints();
+
         // These two temporary arrays will hold the values passed into the
         // Animation to be interpolated between during the animation. The order
         // of the values in these arrays must match the order of the property
@@ -255,8 +279,8 @@
             var holder:PropertyValuesHolder = PropertyValuesHolder(propertyValuesList[i]);
             var property:String = holder.property;
             var propValues:Array = holder.values;
-            var fromValue:Number;
-            var toValue:Number;
+            var fromValue:Object;
+            var toValue:Object;

             if (!property || (property == ""))
                 throw new Error("Illegal property value: " + property);
@@ -301,7 +325,11 @@
                 toVals.push(toValue);
             }
         }
-
+
+        // TODO (chaase): avoid setting up animations on properties whose
+        // from/to values are the same. Not worth the cycles, but also want
+        // to avoid triggering any side effects when we're not actually changing
+        // values
         if (propertyValuesList.length > 1)
         {
             // Create the single Animation that will interpolate all properties
@@ -391,6 +419,11 @@
         dispatchEvent(event);
     }

+    private function noopAnimationHandler(event:TimerEvent):void
+    {
+        finishEffect();
+    }
+
     /**
      * Handles the end event from the animation. The value here is an Array of
      * values, one for each 'property' in our propertyValuesList.
@@ -400,8 +433,63 @@
     {
         dispatchEvent(event);
         finishEffect();
-    }
-
+        if (affectsConstraints)
+            reenableConstraints();
+    }
+
+    private var constraintsHolder:Object;
+
+    private function reenableConstraint(name:String):void
+    {
+        var value:* = constraintsHolder[name];
+        if (value !== undefined)
+        {
+            target.setStyle(name, value);
+            delete constraintsHolder[name];
+        }
+    }
+
+    private function reenableConstraints():void
+    {
+        // Only bother if constraintsHolder is non-null; otherwise
+        // there must have been no constraints to worry about
+        if (constraintsHolder)
+        {
+            reenableConstraint("left");
+            reenableConstraint("right");
+            reenableConstraint("top");
+            reenableConstraint("bottom");
+            reenableConstraint("horizontalCenter");
+            reenableConstraint("verticalCenter");
+            reenableConstraint("baseline");
+            constraintsHolder = null;
+        }
+    }
+
+    private function disableConstraint(name:String):void
+    {
+        var value:* = target.getStyle(name);
+        if (value !== undefined)
+        {
+            if (!constraintsHolder)
+                constraintsHolder = new Object();
+            constraintsHolder[name] = value;
+            target.setStyle(name, undefined);
+        }
+    }
+    private function disableConstraints():void
+    {
+        if (target is IStyleClient)
+        {
+            disableConstraint("left");
+            disableConstraint("right");
+            disableConstraint("top");
+            disableConstraint("bottom");
+            disableConstraint("verticalCenter");
+            disableConstraint("horizontalCenter");
+            disableConstraint("baseline");
+        }
+    }
     /**
      * Utility function to handle situation where values may be queried or
      * set on the target prior to completely setting up the effect's
@@ -458,7 +546,7 @@
      *  property or a style.
      *  @private
      */
-    protected function getCurrentValue(property:String):Number
+    protected function getCurrentValue(property:String):*
     {
         // TODO (chaase): Find a better way to set this up just once
         setupStyleMapEntry(property);


Added RTSPOverHTTP Authentication Errors

--- src/com/axis/rtspclient/RTSPoverHTTPHandle.as
+++ src/com/axis/rtspclient/RTSPoverHTTPHandle.as
@@ -120,6 +120,8 @@
     private function onGetChannelData(event:ProgressEvent):void {
       var parsed:* = request.readHeaders(getChannel, getChannelData);
       if (false === parsed) {
+        ErrorManager.dispatchError(807, [urlParsed.host]);
+        dispatchEvent(new ClientEvent(ClientEvent.ABORTED));
         return;
       }

@@ -129,8 +131,6 @@
         authOpts = parsed.headers['www-authenticate'];
         var newAuthState:String = auth.nextMethod(authState, authOpts);
         if (authState === newAuthState) {
-          trace('GET: Exhausted all authentication methods.');
-          trace('GET: Unable to authorize to ' + urlParsed.host);
           return;
         }

@@ -143,7 +143,7 @@
       }

       if (200 !== parsed.code) {
-        trace('Invalid HTTP code: ' + parsed.code);
+        ErrorManager.dispatchError(parsed.code);
         return;
       }


Develop

Develop

--- src/main/org/shypl/common/util/BitmapUtils.as
+++ src/main/org/shypl/common/util/BitmapUtils.as
@@ -116,7 +116,7 @@
 			var target:BitmapData = new BitmapData(width, height, true, 0);
 			var matrix:Matrix = new Matrix();

-			matrix.scale(source.width / width, source.height / height);
+			matrix.scale(width / source.width, height / source.height);
 			target.draw(source, matrix, null, null, null, true);

 			return target;


Naming

Naming

--- src/org/zozuar/volumetrics/EffectContainer.as
+++ src/org/zozuar/volumetrics/EffectContainer.as
@@ -31,11 +31,11 @@
 		protected var _blurFilter:BlurFilter = new BlurFilter(2, 2);
 		protected var _emission:DisplayObject;
 		protected var _occlusion:DisplayObject;
-		protected var _emissionBmd:BitmapData;
 		protected var _ct:ColorTransform = new ColorTransform;
 		protected var _halve:ColorTransform = new ColorTransform(0.5, 0.5, 0.5);
-		protected var _occlusionBmd:BitmapData;
-		protected var _occlusionBmp:Bitmap;
+		protected var _occlusionLoResBmd:BitmapData;
+		protected var _occlusionLoResBmp:Bitmap;
+		protected var _baseBmd:BitmapData;
 		protected var _bufferBmd:BitmapData;
 		protected var _lightBmp:Bitmap = new Bitmap;
 		protected var _bufferSize:uint = 0x8000;
@@ -75,10 +75,10 @@
 			_bufferHeight = Math.max(1, Math.sqrt(_bufferSize / aspect));
 			_bufferWidth  = Math.max(1, _bufferHeight * aspect);
 			dispose();
-			_emissionBmd  = new BitmapData(_bufferWidth, _bufferHeight, false, 0);
-			_bufferBmd    = new BitmapData(_bufferWidth, _bufferHeight, false, 0);
-			_occlusionBmd = new BitmapData(_bufferWidth, _bufferHeight, true, 0);
-			_occlusionBmp = new Bitmap(_occlusionBmd);
+			_baseBmd           = new BitmapData(_bufferWidth, _bufferHeight, false, 0);
+			_bufferBmd         = new BitmapData(_bufferWidth, _bufferHeight, false, 0);
+			_occlusionLoResBmd = new BitmapData(_bufferWidth, _bufferHeight, true, 0);
+			_occlusionLoResBmp = new Bitmap(_occlusionLoResBmd);
 		}

 		// Render a single frame.
@@ -89,14 +89,14 @@
 			m.scale(_bufferWidth / _viewportWidth, _bufferHeight / _viewportHeight);
 			var mul:Number = colorIntegrity ? intensity : intensity/(1<<passes);
 			_ct.redMultiplier = _ct.greenMultiplier = _ct.blueMultiplier = mul;
-			_emissionBmd.fillRect(_emissionBmd.rect, 0);
-			_emissionBmd.draw(_emission, m, colorIntegrity ? null : _ct);
+			_baseBmd.fillRect(_baseBmd.rect, 0);
+			_baseBmd.draw(_emission, m, colorIntegrity ? null : _ct);
 			if(_occlusion) {
-				_occlusionBmd.fillRect(_occlusionBmd.rect, 0);
+				_occlusionLoResBmd.fillRect(_occlusionLoResBmd.rect, 0);
 				m = _occlusion.transform.matrix.clone();
 				m.scale(_bufferWidth / _viewportWidth, _bufferHeight / _viewportHeight);
-				_occlusionBmd.draw(_occlusion, m);
-				_emissionBmd.draw(_occlusionBmp, null, null, BlendMode.ERASE);
+				_occlusionLoResBmd.draw(_occlusion, m);
+				_baseBmd.draw(_occlusionLoResBmp, null, null, BlendMode.ERASE);
 			}
 			if(rasterQuality) stage.quality = savedQuality;
 			var s:Number = 1 + (scale-1) / (1 << passes);
@@ -106,7 +106,7 @@
 			m.translate(-tx, -ty);
 			m.scale(s, s);
 			m.translate(tx, ty);
-			_lightBmp.bitmapData = _applyEffect(_emissionBmd, _bufferBmd, m, passes);
+			_lightBmp.bitmapData = _applyEffect(_baseBmd, _bufferBmd, m, passes);
 			_lightBmp.width = _viewportWidth;
 			_lightBmp.height = _viewportHeight;
 			_lightBmp.smoothing = smoothing;
@@ -141,10 +141,10 @@

 		// Dispose of all intermediate buffers. After calling this the EffectContainer object will be unusable.
 		public function dispose():void {
-			if(_emissionBmd) _emissionBmd.dispose();
-			if(_occlusionBmd) _occlusionBmd.dispose();
+			if(_baseBmd) _baseBmd.dispose();
+			if(_occlusionLoResBmd) _occlusionLoResBmd.dispose();
 			if(_bufferBmd) _bufferBmd.dispose();
-			_emissionBmd = _occlusionBmd = _bufferBmd = _lightBmp.bitmapData = null;
+			_baseBmd = _occlusionLoResBmd = _bufferBmd = _lightBmp.bitmapData = null;
 		}
     }
 }


Bar spacing no longer affects data bounds. Removed "Invalid tick mark value" error text.

--- WeaveUISpark/src/weave/visualization/plotters/CompoundBarChartPlotter.as
+++ WeaveUISpark/src/weave/visualization/plotters/CompoundBarChartPlotter.as
@@ -124,13 +124,9 @@

 			// get the sorted keys
 			var sortedKeys:Array = _sortedIndexColumn.keys;
-
-			// cast the input value from the axis to an int (not ideal at all, need to make this more robust)
-			var sortedKeyIndex:int = int(value);
-
-			// if this key is out of range, we have a problem
-			if (sortedKeyIndex < 0 || sortedKeyIndex > sortedKeys.length-1)
-				return "Invalid tick mark value: "+value.toString();
+			var sortedKeyIndex:int = Math.round(value);
+			if (sortedKeyIndex != value || sortedKeyIndex < 0 || sortedKeyIndex > sortedKeys.length - 1)
+				return '';

 			// if the labelColumn doesn't have any data, use default label
 			if (labelColumn.getInternalColumn() == null)
@@ -167,7 +163,7 @@
 		public const horizontalMode:LinkableBoolean = registerSpatialProperty(new LinkableBoolean(false));
 		public const zoomToSubset:LinkableBoolean = registerSpatialProperty(new LinkableBoolean(true));
 		public const zoomToSubsetBars:LinkableBoolean = registerSpatialProperty(new LinkableBoolean(false));
-		public const barSpacing:LinkableNumber = registerSpatialProperty(new LinkableNumber(0));
+		public const barSpacing:LinkableNumber = registerLinkableChild(this, new LinkableNumber(0));
 		public const groupingMode:LinkableString = registerSpatialProperty(new LinkableString(STACK, verifyGroupingMode));
 		public static const GROUP:String = 'group';
 		public static const STACK:String = 'stack';
@@ -704,7 +700,8 @@
 				sortedIndex = _binnedSortColumn.getValueFromKey(recordKey, Number);
 			else
 				sortedIndex = _sortedIndexColumn.getValueFromKey(recordKey, Number);
-			var spacing:Number = StandardLib.constrain(barSpacing.value, 0, 1) / 2; // max distance between bar groups is 0.5 in data coordinates
+			//var spacing:Number = StandardLib.constrain(barSpacing.value, 0, 1) / 2; // max distance between bar groups is 0.5 in data coordinates
+			var spacing:Number = 0;
 			var minPos:Number = sortedIndex - 0.5 + spacing / 2;
 			var maxPos:Number = sortedIndex + 0.5 - spacing / 2;
 			var recordWidth:Number = maxPos - minPos;


Transferred from the Adobe Open Source Subversion Repository

Revision: 10545
Author:   aharui@adobe.com
Date:     2009-09-23T20:33:21.208619Z

Log Message:
-----------
Make DataGrid smarter about when and how to calculate the modulefactory for its renderers when using embedded fonts

QE Notes: 2 Mustella tests fail:
components/DataGrid/DataGrid_HaloSkin/Properties/datagrid_properties_columns_halo datagrid_properties_columns_increase0to1_halo
components/DataGrid/DataGrid_SparkSkin/Properties/datagrid_properties_columns datagrid_properties_columns_increase0to1
These fixes get us to measure the embedded fonts correctly when going from 0 columns to a set of columns so rowHeight will be different (and better) in those scenarios

Doc Notes: None
Bugs: SDK-15241
Reviewer: Darrell
API Change: No
Is noteworthy for integration: No
tests: checkintests mustella/browser/DataGrid

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</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/controls/dataGridClasses/DataGridBase.as</path>

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

--- frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridColumn.as
+++ frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridColumn.as
@@ -298,21 +298,8 @@
      * Holds the last recorded value of the module factory used to create the font.
      */
     private var oldEmbeddedFontContext:IFlexModuleFactory = null;
-
-    /**
-     *  @private
-     *
-     *  true if font properties do not need to be set.
-     */
-    private var fontPropertiesSet:Boolean = false;
-
-    /**
-     *  @private
-     * True if createInFontContext has been called.
-     */
-    private var hasFontContextBeenSaved:Boolean = false;
-
-
+    private var oldHeaderEmbeddedFontContext:IFlexModuleFactory = null;
+
     /**
      *  @private
      *
@@ -368,6 +355,7 @@
      *  Storage for the itemRenderer property.
      */
     private var _itemRenderer:IFactory;
+    private var _contextItemRenderer:IFactory;

     [Bindable("itemRendererChanged")]
     [Inspectable(category="Other")]
@@ -404,6 +392,7 @@
         {
             owner.invalidateList();
             owner.columnRendererChanged(this);
+            _contextItemRenderer = null;
         }

         dispatchEvent(new Event("itemRendererChanged"));
@@ -853,6 +842,7 @@
      *  Storage for the headerRenderer property.
      */
     private var _headerRenderer:IFactory;
+    private var _contextHeaderRenderer:IFactory;

     [Bindable("headerRendererChanged")]
     [Inspectable(category="Other")]
@@ -889,6 +879,7 @@
         {
             owner.invalidateList();
             owner.columnRendererChanged(this);
+            _contextHeaderRenderer = null;
         }

         dispatchEvent(new Event("headerRendererChanged"));
@@ -1154,6 +1145,7 @@
      *  Storage for the nullItemRenderer property.
      */
     private var _nullItemRenderer:IFactory;
+    private var _contextNullItemRenderer:IFactory;

     [Bindable("nullItemRendererChanged")]
     [Inspectable(category="Other")]
@@ -1190,6 +1182,7 @@
         {
             owner.invalidateList();
             owner.columnRendererChanged(this);
+            _contextNullItemRenderer = null;
         }

         dispatchEvent(new Event("nullItemRendererChanged"));
@@ -1599,13 +1592,6 @@
             }
         }

-        // save the current font context
-        if (!fontPropertiesSet)
-        {
-            fontPropertiesSet = true;
-            saveFontContext(owner ? owner.moduleFactory : null);
-        }
-
         return chain;
     }

@@ -1614,8 +1600,16 @@
      */
     override public function setStyle(styleProp:String, value:*):void
     {
-        fontPropertiesSet = false;
-
+
+        if (styleProp == "fontFamily" || styleProp == "fontWeight" || styleProp == "fontStyle")
+        {
+            if (owner)
+            {
+                owner.fontContextChanged = true;
+                owner.invalidateProperties();
+            }
+        }
+
         var oldValue:Object = getStyle(styleProp);
         var regenerate:Boolean = false;

@@ -1653,11 +1647,6 @@
                 owner.regenerateStyleCache(true);
             }

-            if (hasFontContextChanged(owner.moduleFactory))
-            {
-                owner.columnRendererChanged(this);
-            }
-
             owner.invalidateList();
         }

@@ -1840,12 +1829,22 @@
     public function getItemRendererFactory(forHeader:Boolean, data:Object):IFactory
     {
         if (forHeader)
-            return replaceItemRendererFactory(headerRenderer);
+        {
+            if (!_contextHeaderRenderer)
+                _contextHeaderRenderer = replaceItemRendererFactory(headerRenderer, true);
+            return _contextHeaderRenderer;
+        }

         if (!data)
-            return replaceItemRendererFactory(nullItemRenderer);
-
-        return replaceItemRendererFactory(itemRenderer);
+        {
+            if (!_contextNullItemRenderer)
+                _contextNullItemRenderer = replaceItemRendererFactory(nullItemRenderer);
+            return _contextNullItemRenderer;
+        }
+
+        if (!_contextItemRenderer)
+            _contextItemRenderer = replaceItemRendererFactory(itemRenderer);
+        return _contextItemRenderer;
     }

     /**
@@ -1859,7 +1858,7 @@
      *    the existing class factory with a ContextualClassFactory so the item can
      *    be created in the correct context.
      */
-    private function replaceItemRendererFactory(rendererFactory:IFactory):IFactory
+    private function replaceItemRendererFactory(rendererFactory:IFactory, forHeader:Boolean = false):IFactory
     {
         // No use of embedded font so just return
         if (oldEmbeddedFontContext == null)
@@ -1872,7 +1871,8 @@
             rendererFactory = owner.itemRenderer;

         if (rendererFactory is ClassFactory)
-            return new ContextualClassFactory(ClassFactory(rendererFactory).generator, oldEmbeddedFontContext);
+            return new ContextualClassFactory(ClassFactory(rendererFactory).generator,
+                forHeader ? oldHeaderEmbeddedFontContext : oldEmbeddedFontContext);

         return rendererFactory;
     }
@@ -1903,50 +1903,98 @@
      *
      * Save the current font context to member fields.
      */
-    private function saveFontContext(flexModuleFactory:IFlexModuleFactory):void
-    {
+    mx_internal function determineFontContext():void
+    {
+        var embeddedFontContext:IFlexModuleFactory;
+
         // Save for hasFontContextChanged()
-        hasFontContextBeenSaved = true;
         var fontName:String = StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
         var fontWeight:String = getStyle("fontWeight");
         var fontStyle:String = getStyle("fontStyle");
+        if (fontName == null)
+            fontName = StringUtil.trimArrayElements(owner.getStyle("fontFamily"), ",");
+        if (fontWeight == null)
+            fontWeight = owner.getStyle("fontWeight");
+        if (fontStyle == null)
+            fontStyle = owner.getStyle("fontStyle");
         var bold:Boolean = fontWeight == "bold";
         var italic:Boolean = fontStyle == "italic";
-        oldEmbeddedFontContext = (noEmbeddedFonts || !embeddedFontRegistry) ?
+        embeddedFontContext = (noEmbeddedFonts || !embeddedFontRegistry) ?
 			null :
             embeddedFontRegistry.getAssociatedModuleFactory(
-                fontName, bold, italic, this, flexModuleFactory);
-    }
-
-    /**
-     *  @private
-     *  Test if the current font context has changed
-     *  since that last time saveFontContext() was called.
-     */
-    mx_internal function hasFontContextChanged(
-                            flexModuleFactory:IFlexModuleFactory):Boolean
-    {
-
-        // If the font has not been saved yet, then return false,
-        // the font context has not changed.
-        if (!hasFontContextBeenSaved)
-            return false;
-
-        var fontName:String =
-            StringUtil.trimArrayElements(getStyle("fontFamily"), ",");
-        var fontWeight:String = getStyle("fontWeight");
-        var fontStyle:String = getStyle("fontStyle");
-
-        // Check if the module factory has changed.
-        var bold:Boolean = fontWeight == "bold";
-        var italic:Boolean = fontStyle == "italic";
-        var fontContext:IFlexModuleFactory = (noEmbeddedFonts || !embeddedFontRegistry) ?
+                fontName, bold, italic, this, owner.moduleFactory);
+
+        if (embeddedFontContext != oldEmbeddedFontContext)
+        {
+            oldEmbeddedFontContext = embeddedFontContext;
+            owner.invalidateList();
+            owner.columnRendererChanged(this);
+            _contextItemRenderer = null;
+            _contextNullItemRenderer = null;
+        }
+
+        var headerStyleName:Object =
+            owner.getStyle("headerStyleName");
+        if (headerStyleName)
+        {
+            if (headerStyleName is String)
+            {
+                headerStyleName = StyleManager.getStyleDeclaration(String(headerStyleName));
+            }
+        }
+        if (headerStyleName)
+        {
+            var headerFontName:String = StringUtil.trimArrayElements(headerStyleName.getStyle("fontFamily"), ",");
+            if (headerFontName)
+                fontName = headerFontName;
+            var headerFontWeight:String = headerStyleName.getStyle("fontWeight");
+            if (headerFontWeight)
+                fontWeight = headerFontWeight;
+            var headerFontStyle:String = headerStyleName.getStyle("fontStyle");
+            if (headerFontStyle)
+                fontStyle = headerFontStyle;
+            bold = fontWeight == "bold";
+            italic = fontStyle == "italic";
+        }
+
+        headerStyleName = getStyle("headerStyleName");
+        if (headerStyleName)
+        {
+            if (headerStyleName is String)
+            {
+                headerStyleName = StyleManager.getStyleDeclaration(String(headerStyleName));
+            }
+        }
+
+        if (headerStyleName)
+        {
+            headerFontName = StringUtil.trimArrayElements(headerStyleName.getStyle("fontFamily"), ",");
+            if (headerFontName)
+                fontName = headerFontName;
+            headerFontWeight = headerStyleName.getStyle("fontWeight");
+            if (headerFontWeight)
+                fontWeight = headerFontWeight;
+            headerFontStyle = headerStyleName.getStyle("fontStyle");
+            if (headerFontStyle)
+                fontStyle = headerFontStyle;
+            bold = fontWeight == "bold";
+            italic = fontStyle == "italic";
+        }
+
+        embeddedFontContext = (noEmbeddedFonts || !embeddedFontRegistry) ?
 			null :
             embeddedFontRegistry.getAssociatedModuleFactory(
-                fontName, bold, italic, this, flexModuleFactory)
-        return fontContext != oldEmbeddedFontContext;
-    }
-
+                fontName, bold, italic, this, owner.moduleFactory);
+
+        if (embeddedFontContext != oldHeaderEmbeddedFontContext)
+        {
+            oldHeaderEmbeddedFontContext = embeddedFontContext;
+            cachedHeaderRenderer = null;
+            owner.dataGridHeader.headerItemsChanged = true;
+            _contextHeaderRenderer = null;
+        }
+    }
+
     /**
      *  @private
      */


Transferred from the Adobe Open Source Subversion Repository

Revision: 13035
Author:   hneelu@adobe.com
Date:     2009-12-17T07:35:16.160630Z

Log Message:
-----------
Updating automation project to latest p4 changes.

Modified Paths:
--------------
228 paths were modified

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

--- frameworks/projects/automation/src/mx/automation/delegates/DragManagerAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/DragManagerAutomationImpl.as
@@ -191,8 +191,7 @@
 			var p:Point;

 			// code modified to avoid the usage of getAutomationChildAt in a loop.
-			//var childList:Array = delegate.getAutomationChildren();
-			var childList:Array =  Automation.automationManager2.getAutomationChildrenArray(delegate);
+			var childList:Array = delegate.getAutomationChildren();
 			var n:int = childList ? childList.length:0;
 			for (var i:int = 0; i < n; ++i)
 			{
@@ -505,8 +504,7 @@
 				var maxY:int = 0;
 				// code modified below to avoid the usage of numAutomationChildren and
 				// getAutomationChildAt in a loop
-				//var childList:Array = delegate.getAutomationChildren();
-				var childList:Array =  Automation.automationManager2.getAutomationChildrenArray(delegate);
+				var childList:Array = delegate.getAutomationChildren();
 				var numAChildCount:int =  childList ? childList.length :0 ;

 				// if (realTarget is DisplayObjectContainer &&delegate.numAutomationChildren != 0)


support playback even after playbak finished

--- src/org/mangui/osmf/plugins/traits/HLSPlayTrait.as
+++ src/org/mangui/osmf/plugins/traits/HLSPlayTrait.as
@@ -39,24 +39,6 @@
             super.dispose();
         }

-		/** state changed handler **/
-		private function _stateChangedHandler(event:HLSEvent):void
-		{
-			switch (event.state)
-			{
-				case HLSPlayStates.PLAYING:
-					CONFIG::LOGGING
-				{
-					Log.debug("HLSPlayTrait:_stateChangedHandler:setBuffering(true)");
-				}
-					if (!streamStarted)
-					{
-                        streamStarted = true;
-						play();
-					}
-				default:
-            }
-        }

         override protected function playStateChangeStart(newPlayState:String):void
         {
@@ -88,6 +70,25 @@
             }
         }

+        /** state changed handler **/
+        private function _stateChangedHandler(event:HLSEvent):void
+        {
+            switch (event.state)
+            {
+                case HLSPlayStates.PLAYING:
+                CONFIG::LOGGING
+                {
+                    Log.debug("HLSPlayTrait:_stateChangedHandler:setBuffering(true)");
+                }
+                    if (!streamStarted)
+                    {
+                        streamStarted = true;
+                        play();
+                    }
+                default:
+            }
+        }
+
         /** playback complete handler **/
         private function _playbackComplete(event : HLSEvent) : void {
             stop();


Transferred from the Adobe Open Source Subversion Repository

Revision: 7753
Author:   clucier@adobe.com
Date:     2009-06-11T19:29:44.202472Z

Log Message:
-----------
Adding backgroundFrameRate property to WindowedApplication, to by default reduce the CPU usage in cases where an app is not 'active'.

Bugs: SDK-21135
Reviewer: Ryan, Darrell
QE Notes: Test needs to be written for this new API. PARB has tentatively approved, will update spec here: http://opensource.adobe.com/wiki/display/flexsdk/Spark+WindowedApplication
Doc Notes: Needs to be documented and ASDoc scrubbed.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/components/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>

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

--- frameworks/projects/airspark/src/spark/components/WindowedApplication.as
+++ frameworks/projects/airspark/src/spark/components/WindowedApplication.as
@@ -491,6 +491,11 @@
      *  @private
      */
     private var windowBoundsChanged:Boolean = true;
+
+    /**
+     *  @private
+     */
+    private var prevActiveFrameRate:Number = -1;

     /**
      *  @private
@@ -986,6 +991,39 @@
     public function set autoExit(value:Boolean):void
     {
         nativeApplication.autoExit = value;
+    }
+
+    //----------------------------------
+    //  backgroundFrameRate
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the backgroundFrameRate property.
+     */
+    private var _backgroundFrameRate:Number = 1;
+
+    /**
+     *  Specifies framerate to use when the application is inactive.
+     *  When set to -1 no background framerate throttling will occur.
+     *
+     *  @default 1
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get backgroundFrameRate():Number
+    {
+        return _backgroundFrameRate;
+    }
+
+    /**
+     *  @private
+     */
+    public function set backgroundFrameRate(frameRate:Number):void
+    {
+        _backgroundFrameRate = frameRate;
     }

     //----------------------------------
@@ -2655,6 +2693,13 @@
     private function nativeApplication_activateHandler(event:Event):void
     {
         dispatchEvent(new AIREvent(AIREvent.APPLICATION_ACTIVATE));
+
+        // Restore throttled framerate if appropriate when application is activated.
+        if (prevActiveFrameRate >= 0 && stage)
+        {
+            stage.frameRate = prevActiveFrameRate;
+            prevActiveFrameRate = -1;
+        }
     }

     /**
@@ -2663,6 +2708,16 @@
     private function nativeApplication_deactivateHandler(event:Event):void
     {
         dispatchEvent(new AIREvent(AIREvent.APPLICATION_DEACTIVATE));
+
+        // Throttle framerate if appropriate when application is deactivated.
+        // Ensure we've received an updateComplete on the chance our layout
+        // manager is using phased instantiation (we don't wish to store a
+        // maxed out (1000fps) framerate).
+        if ((_backgroundFrameRate >= 0) && (ucCount > 0) && stage)
+        {
+            prevActiveFrameRate = stage.frameRate;
+            stage.frameRate = _backgroundFrameRate;
+        }
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/airspark/src/spark/components/WindowedApplication.as
+++ frameworks/projects/airspark/src/spark/components/WindowedApplication.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.core
+package spark.components.windowClasses
 {

 import flash.desktop.DockIcon;
@@ -36,24 +36,27 @@
 import flash.geom.Rectangle;
 import flash.system.Capabilities;

-import mx.components.FxApplication;
-import mx.components.FxButton;
-import mx.components.Group;
+import spark.components.Application;
+import mx.controls.Button;
+import spark.components.Group;
 import mx.controls.Alert;
 import mx.controls.Button;
 import mx.controls.FlexNativeMenu;
 import mx.controls.HTML;
-import mx.core.windowClasses.FxTitleBar;
+import mx.core.IWindow;
+import mx.core.Window;
+import spark.components.windowClasses.TitleBar;
 import mx.core.windowClasses.StatusBar;
 import mx.events.AIREvent;
 import mx.events.FlexEvent;
 import mx.events.FlexNativeWindowBoundsEvent;
-import mx.graphics.TextBox;
+import spark.primitives.SimpleText;
 import mx.managers.DragManager;
 import mx.managers.NativeDragManagerImpl;
 import mx.styles.CSSStyleDeclaration;
 import mx.styles.StyleManager;
 import mx.styles.StyleProxy;
+import mx.core.mx_internal;

 use namespace mx_internal;

@@ -302,19 +305,19 @@
 [ResourceBundle("core")]

 /**
- *  The FxWindowedApplication defines the application container
+ *  The WindowedApplication defines the application container
  *  that you use to create Flex applications for AIR applications.
  *
- *
The FxWindowedApplication serves two roles. It is a replacement for the <mx:FxApplication>
+ *
The WindowedApplication serves two roles. It is a replacement for the <mx:FxApplication>
  *  tag, functioning as the entry point to a Flex-based AIR application. In addition,
- *  as a container the FxWindowedApplication defines the layout of the initial window
- *  of a Flex AIR application -- any visual controls defined in the FxWindowedApplication
+ *  as a container the WindowedApplication defines the layout of the initial window
+ *  of a Flex AIR application -- any visual controls defined in the WindowedApplication
  *  become the content of the initial window loaded by the AIR application.

  *
  *
Note that because
- *  the FxWindowedApplication only represents the visual content of a single window, and not
- *  all the windows in a multi-window application, a FxWindowedApplication instance only dispatches
- *  display-related events (events that the FxWindowedApplication class inherits from display object base
+ *  the WindowedApplication only represents the visual content of a single window, and not
+ *  all the windows in a multi-window application, a WindowedApplication instance only dispatches
+ *  display-related events (events that the WindowedApplication class inherits from display object base
  *  classes such as InteractiveObject or UIComponent) for its own stage and window, and not for
  *  events that occur on other windows in the application. This differs from a browser-based application,
  *  where an FxApplication container dispatches events for all the windows in the application (because
@@ -322,11 +325,11 @@
  *
  *  @mxml
  *
- *
The <mx:FxWindowedApplication> tag inherits all of the tag
+ *
The <mx:WindowedApplication> tag inherits all of the tag
  *  attributes of its superclass and adds the following tag attributes:

  *
  *

- *  <mx:FxWindowedApplication
+ *  <mx:WindowedApplication
  *    Properties
  *    alwaysInFront="false"
  *    autoExit="true"
@@ -370,9 +373,9 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class FxWindowedApplication extends FxApplication implements IWindow
+public class WindowedApplication extends Application implements IWindow
 {
-    include "../core/Version.as";
+    include "../../../mx/core/Version.as";

     //--------------------------------------------------------------------------
     //
@@ -410,7 +413,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function FxWindowedApplication()
+    public function WindowedApplication()
     {
         super();

@@ -533,7 +536,7 @@
      *  @productversion Flex 4
      */
     [SkinPart (required="false")]
-    public var gripper:FxButton;
+    public var gripper:Button;

     /**
      *  The SkinPart that displays the status bar.
@@ -557,7 +560,7 @@
      *  @productversion Flex 3
      */
     [SkinPart (required="false")]
-    public var statusText:TextBox;
+    public var statusText:SimpleText;

     /**
      *  The UIComponent that displays the title bar.
@@ -567,7 +570,7 @@
      *  @productversion Flex 4
      */
     [SkinPart (required="false")]
-    public var titleBar:FxTitleBar;
+    public var titleBar:TitleBar;

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 6006
Author:   dsubrama@adobe.com
Date:     2009-04-07T23:13:52.682149Z

Log Message:
-----------
-new property, labelText, added to IItemRenderer interface
-owning components always push the right text down to the renderer (ie: setting the labelText property)
-DataGroup, SkinnableDataContainer now implement IItemRendererOwner
-labelField/labelFunction work for ButtonBar

QA: Yes
Checkintests: Pass
Reviewer: Ryan

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/DefaultItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/ButtonBarButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/IItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>

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

--- frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as
+++ frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as
@@ -13,16 +13,20 @@
 {

 import mx.collections.IList;
-import spark.components.DataGroup;
-import spark.components.supportClasses.SkinnableContainerBase;
 import mx.core.IFactory;
-import spark.core.IViewport;
+import mx.core.IVisualElement;
 import mx.events.FlexEvent;
 import mx.events.PropertyChangeEvent;
+import mx.managers.IFocusManagerContainer;
+import mx.utils.BitFlagUtil;
+
+import spark.components.DataGroup;
+import spark.components.IItemRendererOwner;
+import spark.components.supportClasses.ItemRenderer;
+import spark.components.supportClasses.SkinnableContainerBase;
+import spark.core.IViewport;
 import spark.events.RendererExistenceEvent;
 import spark.layout.supportClasses.LayoutBase;
-import mx.managers.IFocusManagerContainer;
-import mx.utils.BitFlagUtil;

 /**
  *  Dispatched when a renderer is added to the content holder.
@@ -77,7 +81,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class SkinnableDataContainer extends SkinnableContainerBase implements IViewport
+public class SkinnableDataContainer extends SkinnableContainerBase implements IViewport, IItemRendererOwner
 {
     include "../core/Version.as";

@@ -595,6 +599,33 @@
         return (dataGroup) ?
             dataGroup.getVerticalScrollPositionDelta(scrollUnit) : 0;
     }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Given a data item, return the correct text representation
+     *  a renderer should display.
+     *
+     *  @param item A data item
+     *
+     *  @return String representing the text to display for the
+     *  passed in item's renderer.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function itemToLabel(item:Object):String
+    {
+    	if (item)
+            return item.toString();
+        else return " ";
+    }

     //--------------------------------------------------------------------------
     //
@@ -691,7 +722,7 @@
                 // the only reason we have this listener is to re-dispatch events.  So only add it here
                 // if someone's listening on us.
                 dataGroup.addEventListener(
-                    RendererExistenceEvent.RENDERER_ADD, dispatchEvent);
+                    RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddChangeHandler);
             }

             if (hasEventListener(RendererExistenceEvent.RENDERER_REMOVE))
@@ -714,7 +745,7 @@
             dataGroup.removeEventListener(
                 PropertyChangeEvent.PROPERTY_CHANGE, dataGroup_propertyChangeHandler);
             dataGroup.removeEventListener(
-                RendererExistenceEvent.RENDERER_ADD, dispatchEvent);
+                RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddChangeHandler);
             dataGroup.removeEventListener(
                 RendererExistenceEvent.RENDERER_REMOVE, dispatchEvent);

@@ -783,7 +814,7 @@
         if (type == RendererExistenceEvent.RENDERER_ADD && dataGroup)
         {
             dataGroup.addEventListener(
-                RendererExistenceEvent.RENDERER_ADD, dispatchEvent);
+                RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddChangeHandler);
         }

         if (type == RendererExistenceEvent.RENDERER_REMOVE && dataGroup)
@@ -820,7 +851,7 @@
             if (!hasEventListener(RendererExistenceEvent.RENDERER_ADD))
             {
                 dataGroup.removeEventListener(
-                    RendererExistenceEvent.RENDERER_ADD, dispatchEvent);
+                    RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddChangeHandler);
             }
         }

@@ -857,6 +888,22 @@
             }
         }
     }
+
+    /**
+     * @private
+     */
+    private function dataGroup_rendererAddChangeHandler(event:RendererExistenceEvent):void
+    {
+    	var renderer:Object = event.renderer;
+
+        if (renderer is IVisualElement)
+            IVisualElement(renderer).owner = this;
+
+        if (renderer is IItemRenderer)
+            IItemRenderer(renderer).labelText = itemToLabel(renderer.data);
+
+        dispatchEvent(event);
+    }
 }

 }