Transferred from the Adobe Open Source Subversion Repository

Revision: 5917
Author:   jszeto@adobe.com
Date:     2009-04-03T21:28:26.428083Z

Log Message:
-----------
Re-implementation of DropDownList

DropDownList now subclasses List instead of DropDownBase (thanks to Iwo Banas!).
Dropdown base functionality has been moved up to DropDownList. The skin now contains the the same elements as the ListSkin.
The component is in a usable and stable state. The one major issue is that the selectedIndex changes immediately in response to user interaction. The correct behavior is for selectedIndex to change when the dropdown closes.

QE Notes: DropDownList has a new base class
Doc Notes: DropDownList has a new base class. DropDownBase is removed.
Bugs: n/a
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</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/skins/default/DropDownListSkin.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/DropDownBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/DropDownList.as
+++ frameworks/projects/spark/src/spark/components/DropDownList.as
@@ -11,42 +11,26 @@

 /*  NOTES

-- value property is removed since it is legecy and using selectedItem is preferable
-
-- Do we include these proxy properties (dataRenderer, labelField, labelFunction, rowCount)
-- Do we need selectedLabel and itemToLabel (which uses labelField and labelFunction)
-- Don't need restrict since we don't support editing
-- Don't need dropDownWidth since that is controlled by skin?
-- Do we need inline-renderer properties (data, listData)?
-
 Keyboard Interaction
 - List current dispatches selectionChanged on arrowUp/Down. Should we subclass List
 and change behavior to commit value only on ENTER, SPACE, or CTRL-UP?

 TODO List

-- finish collection_changeHandler
-- event dispatching
-- prompt
 - implicitSelectedIndex
-- expose List.layout?
-- pass styles to dropDown
-- propagate List events
 - Handle stage resize, focus in/out
-- add baseline support
 - add enabled/disabled
 - Add type assist
 - Add typicalItem support for measuredSize (lower priority)
 - Change button to be a ToggleButton so we stay down when dropdown is open
-
-*
+- No prompt should set selectedIndex = 0?
+
+BUGS
+- Setting selectedItem to undefined doesn't set selectedIndex to -1

 *  @langversion 3.0
-
 *  @playerversion Flash 10
-
 *  @playerversion AIR 1.5
-
 *  @productversion Flex 4

 */
@@ -56,39 +40,71 @@

 import flash.events.Event;
 import flash.events.KeyboardEvent;
+import flash.events.MouseEvent;
 import flash.ui.Keyboard;

 import mx.collections.IList;
-import spark.components.supportClasses.DropDownBase;
+import mx.events.CollectionEvent;
+import mx.events.DropdownEvent;
+import mx.events.FlexEvent;
+
+import spark.components.Button;
 import spark.components.supportClasses.ListBase;
-import mx.core.IFactory;
-import mx.core.mx_internal;
-import mx.events.IndexChangedEvent;
 import spark.primitives.supportClasses.TextGraphicElement;
-import mx.events.CollectionEvent;
-import mx.collections.ListCollectionView;
-import mx.collections.CursorBookmark;
-import mx.events.FlexEvent;
-import mx.collections.ICollectionView;
-import mx.events.CollectionEventKind;
-import mx.collections.IViewCursor;
 import spark.utils.LabelUtil;

 /**
- *  Dispatched when the FxComboBox contents changes as a result of user
- *  interaction, when the selectedIndex or
- *  selectedItem property changes.
+ *  Dispatched when the dropDown is dismissed for any reason such when
+ *  the user:
+ *

+ *
selects an item in the dropDown

+ *
clicks outside of the dropDown

+ *
clicks the dropDown button while the dropDown is
+ *  displayed

+ *

  *
- *  @eventType mx.events.ListEvent.CHANGE
+ *  @eventType mx.events.DropdownEvent.CLOSE
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
- */
-[Event(name="change", type="flash.events.Event")]
-
-[DefaultProperty("dataProvider")]
+ */
+[Event(name="close", type="mx.events.DropdownEvent")]
+
+/**
+ *  Dispatched when the user clicks the dropDown button
+ *  to display the dropDown.  It is also dispatched if the user
+ *  uses the keyboard and types Ctrl-Down to open the dropDown.
+ *
+ *  @eventType mx.events.DropdownEvent.OPEN
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Event(name="open", type="mx.events.DropdownEvent")]
+
+/**
+ *  Open State of the DropDown component
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[SkinState("open")]
+
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="allowMultipleSelection", kind="property")]
+[Exclude(name="selectedIndices", kind="property")]
+[Exclude(name="selectedItems", kind="property")]
+

 /**
  *  DropDownList control contains a drop-down list
@@ -102,9 +118,14 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class DropDownList extends DropDownBase
+public class DropDownList extends List
 {
-
+
+    //--------------------------------------------------------------------------
+    //
+    //  Skin Parts
+    //
+    //--------------------------------------------------------------------------
     /**
      *  An optional skin part that holds the prompt or the text of the selectedItem
      *
@@ -117,18 +138,16 @@
     public var labelElement:TextGraphicElement;

 	/**
-     *  A skin part that is the instance of the dropDown list
+     *  A skin part that defines the anchor button.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-
-     // TODO (jszeto) We want this to be required. But when the skin part is in a state,
-     // it hasn't been created yet and we get an RTE.
-	[SkinPart(required="false")]
-	public var dropDown:ListBase;
+    // TODO!!! (jszeto) Replace with a toggle button
+    [SkinPart(required="true")]
+    public var button:Button;

 	/**
      *  Constructor.
@@ -141,6 +160,7 @@
 	public function DropDownList()
 	{
 		super();
+		super.allowMultipleSelection = false;
 	}

 	//--------------------------------------------------------------------------
@@ -148,13 +168,8 @@
     //  Variables
     //
     //--------------------------------------------------------------------------
-	 /**
-     *  @private
-     *  A flag indicating that selection has changed
-     */
-    private var selectionChanged:Boolean = false;
+
     private var labelChanged:Boolean = false;
-	private const PAGE_SIZE:int = 5;

 	//--------------------------------------------------------------------------
     //
@@ -163,233 +178,39 @@
     //--------------------------------------------------------------------------

 	//----------------------------------
-    //  collection
-    //----------------------------------
-
-	/**
-     *  The ICollectionView of items this component displays.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    protected var collection:ICollectionView;
-
-	//----------------------------------
-    //  dataProvider
-    //----------------------------------
-
-	// TODO (jszeto) Add logic to handle the IList changed events
-
-	private var dataProviderChanged:Boolean = false;
-	private var _dataProvider:IList;
-
-	/**
-	 *  The set of items this component displays.
-	 *
-	 *
Setting this property will adjust the selectedIndex
-     *  property (and therefore the selectedItem property) if
-     *  the selectedIndex property has not otherwise been set.
-     *  If there is no prompt property, the selectedIndex
-     *  property will be set to 0; otherwise it will remain at -1,
-     *  the index used for the prompt string.
-     *  If the selectedIndex property has been set and
-     *  it is out of range of the new data provider, unexpected behavior is
-     *  likely to occur.

+    //  isOpen
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _isOpen:Boolean = false;
+
+    /**
+     *  Whether the dropDown is open or not.
      *
-     *  @default null
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-	public function get dataProvider():IList
-	{
-		return _dataProvider;
-	}
-
-	public function set dataProvider(value:IList):void
-	{
-		if (_dataProvider != value)
-		{
-			_dataProvider = value;
-
-			if (_dataProvider)
-			{
-				// TODO (jszeto) Change to match List implementation
-				collection = new ListCollectionView(IList(value));
-				collection.addEventListener(CollectionEvent.COLLECTION_CHANGE, collection_changeHandler, false, 0, true);
-				iterator = collection.createCursor();
-				dataProviderChanged = true;
-
-				var event:CollectionEvent =
-			            new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
-		        event.kind = CollectionEventKind.RESET;
-		        collection_changeHandler(event);
-		  	}
-
-		  	invalidateProperties();
-		}
-	}
-
-    //----------------------------------
-    //  itemRenderer
-    //----------------------------------
-
-    private var _itemRenderer:IFactory;
-
-    /**
-     *  @copy spark.components.DataGroup#itemRenderer
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get itemRenderer():IFactory
-    {
-        return _itemRenderer;
-    }
-
-    /**
-     *  @private
-     */
-    public function set itemRenderer(value:IFactory):void
-    {
-        if (value != _itemRenderer)
-        {
-        	_itemRenderer = value;
-        }
-    }
-
-    //----------------------------------
-    //  itemRendererFunction
-    //----------------------------------
-
-    private var _itemRendererFunction:Function;
-
-    /**
-     *  @copy spark.components.DataGroup#itemRendererFunction
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get itemRendererFunction():Function
-    {
-        return _itemRendererFunction;
-    }
-
-    /**
-     *  @private
-     */
-    public function set itemRendererFunction(value:Function):void
-    {
-        if (value != _itemRendererFunction)
-        {
-        	_itemRendererFunction = value;
-        }
-    }
-
-    //----------------------------------
-    //  iterator
-    //----------------------------------
-
-    /**
-     *  The main IViewCursor used to fetch items from the
-     *  dataProvider and pass the items to the renderers.
-     *  At the end of any sequence of code, it must always be positioned
-     *  at the topmost visible item on screen.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    protected var iterator:IViewCursor;
-
-    //----------------------------------
-    //  labelField
-    //----------------------------------
-	private var _labelField:String = "label";
-
-    /**
-     *  The name of the field in the data provider items to display as the label.
-
-     * @default "label"
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get labelField():String
-    {
-    	return _labelField;
-    }
-
-    public function set labelField(value:String):void
-    {
-    	if (value != _labelField)
-    	{
-    		_labelField = value;
-    		labelChanged = true;
-    		invalidateProperties();
-    	}
-    }
-
-    //----------------------------------
-    //  labelField
-    //----------------------------------
-    private var _labelFunction:Function;
-
-    /**
-     *  A user-supplied function to run on each item to determine its label.
-     *
-     *  The method signature for labelFunction should be:
-     *
myLabelFunction(item:Object):String

-     *
-     *  @default null
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get labelFunction():Function
-    {
-    	return _labelFunction;
-    }
-
-    /**
-     *  @private
-     */
-    public function set labelFunction(value:Function):void
-    {
-    	if (value != _labelFunction)
-    	{
-    		_labelFunction = value;
-    		labelChanged = true;
-    		invalidateProperties();
-    	}
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get isOpen():Boolean
+    {
+    	return _isOpen;
     }

 	//----------------------------------
     //  prompt
     //----------------------------------

-    private var promptChanged:Boolean = false;
-    private var _prompt:String;
-
-    /**
-     *  The prompt for the FxComboBox control. A prompt is
+    private var _prompt:String = "";
+
+    /**
+     *  The prompt for the DropDownList control. A prompt is
      *  a String that is displayed in the TextInput portion of the
-     *  FxComboBox when selectedIndex = -1.  It is usually
+     *  DropDownList when selectedIndex = -1.  It is usually
      *  a String like "Select one...".  If there is no
-     *  prompt, the FxComboBox control sets selectedIndex to 0
+     *  prompt, the DropDownList control sets selectedIndex to 0
      *  and displays the first item in the dataProvider.
      *
      *  @langversion 3.0
@@ -408,181 +229,190 @@
     public function set prompt(value:String):void
     {
         _prompt = value;
-        promptChanged = true;
+        labelChanged = true;
         invalidateProperties();
     }

-    //----------------------------------
-    //  selectedIndex
-    //----------------------------------
-
-    private var _selectedIndex:int = -1;
-    private var selectedIndexChanged:Boolean = false;
-
-    [Bindable("change")]
-    [Bindable("collectionChange")]
-    [Bindable("valueCommit")]
-     /**
-     *  The index in the data provider of the selected item.
-     *  If there is a prompt property, the selectedIndex
-     *  value can be set to -1 to show the prompt.
-     *  If there is no prompt, property then selectedIndex
-     *  will be set to 0 once a dataProvider is set.
-     *
-     *
Unlike many other Flex properties that are invalidating (setting
-     *  them does not have an immediate effect), the selectedIndex and
-     *  selectedItem properties are synchronous; setting one immediately
-     *  affects the other.

-     *
-     *  @default -1
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  allowMultipleSelection
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set allowMultipleSelection(value:Boolean):void
+    {
+    	// Don't allow this value to be set
+        return;
+    }
+
+    //----------------------------------
+    //  baselinePosition
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function get baselinePosition():Number
+    {
+    	if (button)
+    		return button.baselinePosition;
+    	else
+    		return NaN;
+    }
+
+    //----------------------------------
+    //  dataProvider
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+     // TODO (jszeto) Check if we really need this
+    override public function set dataProvider(value:IList):void
+    {
+    	super.dataProvider = value;
+    	labelChanged = true;
+    	invalidateProperties();
+    }
+
+    //----------------------------------
+    //  selectedIndices
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set selectedIndices(value:Array):void
+    {
+    	// TODO (jszeto) This needs to be localized
+    	throw new Error("The selectedIndices property is not supported in DropDownList");
+    }
+
+    //----------------------------------
+    //  selectedItems
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set selectedItems(value:Array):void
+    {
+    	// TODO (jszeto) This needs to be localized
+    	throw new Error("The selectedItems property is not supported in DropDownList");
+    }
+
+
+ 	//--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+     *  Initializes the dropDown and changes the skin state to open.
+     *
+     *  It should not be necessary to override this function. Instead, override the
+     *  initializeDropDown function.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
-     */
-    public function get selectedIndex():int
-    {
-        return _selectedIndex;
-    }
-
-    /**
-     *  @private
-     */
-    public function set selectedIndex(value:int):void
-    {
-    	// TODO (jszeto) Change selectedIndex/Item to match ListBase implementation
-    	// We want the selectedIndex to be committed as soon as possible.
-    	// If we have a collection, then update the selectedIndex
-
-    	_selectedIndex = value;
-    	if (value == -1)
-        {
-            _selectedItem = null;
-        }
-
-    	//2 code paths: one for before collection, one after
-        if (!collection || collection.length == 0)
-        {
-            selectedIndexChanged = true;
-            invalidateProperties();
-        }
-        else
-        {
-            if (value != -1)
-            {
-                value = Math.min(value, collection.length - 1);
-                var bookmark:CursorBookmark = iterator.bookmark;
-                var len:int = value;
-                iterator.seek(CursorBookmark.FIRST, len);
-                var data:Object = iterator.current;
-                iterator.seek(bookmark, 0);
-                _selectedIndex = value;
-                _selectedItem = data;
-                labelChanged = true;
-                invalidateProperties();
-            }
-        }
-
-        dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
-    }
-
-    //----------------------------------
-    //  selectedItem
-    //----------------------------------
-
-	private var selectedItemChanged:Boolean = false;
-
-    private var _selectedItem:Object;
-
-	[Bindable("change")]
-    [Bindable("collectionChange")]
-    [Bindable("valueCommit")]
-    /**
-     *  The item in the data provider at the selectedIndex.
-     *
-     *
If the data is an object or class instance, modifying
-     *  properties in the object or instance modifies the
-     *  dataProvider object but may not update the views
-     *  unless the instance is Bindable or implements IPropertyChangeNotifier
-     *  or a call to dataProvider.itemUpdated() occurs.

-     *
-     *  Setting the selectedItem property causes the
-     *  FxComboBox control to select that item (display it in the text field and
-     *  set the selectedIndex) if it exists in the data provider.
-     *
-     *
Unlike many other Flex properties that are invalidating (setting
-     *  them does not have an immediate effect), selectedIndex and
-     *  selectedItem are synchronous; setting one immediately
-     *  affects the other.

-     *
-     *  @default null;
+     */
+    public function openDropDown():void
+    {
+		//trace("DropDownBase.openDropDown isOpen",isOpen);
+    	if (!isOpen)
+    	{
+    		// TODO (jszeto) Change this to be marshall plan compliant
+    		systemManager.addEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
+
+    		_isOpen = true;
+    		skin.currentState = getCurrentSkinState();
+
+    		// TODO (jszeto) How to handle animations in the skin?
+    		dispatchEvent(new DropdownEvent(DropdownEvent.OPEN));
+
+	    	// Save the original selectedIndex
+			//previousSelectedIndex = selectedIndex;
+    	}
+    }
+
+	 /**
+     *  Changes the skin state to normal, commits the data from the dropDown and
+     *  performs some cleanup.
+     *
+     *  The user can close the dropDown either in a committing or non-committing manner
+     *  based on their interaction gesture. If the user has performed a committing
+     *  gesture, then set commitData to true.
+     *
+     *  @param commitData Flag indicating if the component should commit the selected
+     *  data from the dropDown.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function get selectedItem():Object
-    {
-    	// TODO (jszeto) Return _selectedItem first if it hasn't been committed yet
-        return _selectedItem;
-    }
-
-    /**
-     *  @private
-     */
-    public function set selectedItem(data:Object):void
-    {
-        //2 code paths: one for before collection, one after
-        if (!collection || collection.length == 0)
-        {
-          	_selectedItem = data;
-            selectedItemChanged = true;
-            invalidateProperties();
-        }
-		else
-		{
-	        var found:Boolean = false;
-	        var listCursor:IViewCursor = collection.createCursor();
-	        var i:int = 0;
-	        do
-	        {
-	            if (data == listCursor.current)
-	            {
-	                _selectedIndex = i;
-	                _selectedItem = data;
-	                selectionChanged = true;
-	                found = true;
-	                break;
-	            }
-	            i++;
-	        }
-	        while (listCursor.moveNext());
-
-	        if (!found)
-	        {
-	            selectedIndex = -1;
-	            _selectedItem = null;
-	        }
-
-	        labelChanged = true;
-	        invalidateProperties();
-		}
-    }
-
- 	//--------------------------------------------------------------------------
-    //
-    //  Methods
-    //
-    //--------------------------------------------------------------------------
-
+    public function closeDropDown(commitData:Boolean):void
+    {
+    	//trace("DropDownBase.closeDropDown isOpen",isOpen,"inKey",inKeyNavigation);
+    	if (isOpen)
+    	{
+    		// TODO (jszeto) Add logic to check for commitData
+    		/*if (commitData)
+        		commitDropDownData();*/
+
+			_isOpen = false;
+	       	skin.currentState = getCurrentSkinState();
+
+        	// TODO (jszeto) How to handle animations in the skin?
+        	dispatchEvent(new DropdownEvent(DropdownEvent.CLOSE));
+
+        	// TODO (jszeto) Change this to be marshall plan compliant
+        	systemManager.removeEventListener(MouseEvent.MOUSE_DOWN, systemManager_mouseDownHandler);
+    	}
+    }
+
+	/**
+     *  @private
+     *  Called whenever we need to update the text passed to the labelElement skin part
+     */
+    // TODO (jszeto) Make this protected and make the name more generic (passing data to skin)
+	private function updateLabelElement():void
+	{
+		if (labelElement)
+    	{
+    		if (selectedItem)
+    			labelElement.text = LabelUtil.itemToLabel(selectedItem, labelField, labelFunction);
+	    	else
+	    		labelElement.text = prompt;
+    	}
+	}

     //--------------------------------------------------------------------------
     //
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override protected function commitSelectedIndex():Boolean
+    {
+    	var result:Boolean = super.commitSelectedIndex();
+       	updateLabelElement();
+
+    	return result;
+    }

 	// TODO (jszeto) Add measure implementation that uses the longest string in the data provider as
     // the label and calls super.measure().
@@ -593,77 +423,34 @@
     {
         super.commitProperties();

-		if (selectedItemChanged)
-        {
-        	// Retry applying the value in case the dataProvider is set
-            selectedItem = selectedItem;
-            selectedItemChanged = false;
-            selectedIndexChanged = false;
-        }
-
-        if (selectedIndexChanged)
-        {
-        	// Retry applying the value in case the dataProvider is set
-            selectedIndex = selectedIndex;
-            selectedIndexChanged = false;
-        }
-
         if (labelChanged)
 		{
 			labelChanged = false;
-			if (labelElement)
-	    	{
-	    		if (selectedItem)
-	    			labelElement.text = LabelUtil.itemToLabel(selectedItem, labelField, labelFunction);
-	    		else
-	    			labelElement.text = "";
-	    	}
-		}
-
-        // TODO (jszeto) Add call to valueCommit after selection changed
-
-    }
-
-
-    /**
-	 *  @private
-	 */
-    override protected function initializeDropDown():void
-    {
-    	super.initializeDropDown();
+        	updateLabelElement();
+  		}
+    }
+
+    /**
+ 	 *  @private
+ 	 */
+    override protected function dataProvider_collectionChangeHandler(event:Event):void
+    {
+    	super.dataProvider_collectionChangeHandler(event);

-    	// TODO (jszeto) Look at SkinnableDataContainer to see pattern for passing
-    	// these values
-		dropDown.dataProvider = dataProvider;
-		dropDown.selectedIndex = selectedIndex;
-		dropDown.labelField = labelField;
-		dropDown.labelFunction = labelFunction;
-
-		if (itemRenderer != null)
-			dropDown.itemRenderer = itemRenderer;
-
-		if (itemRendererFunction != null)
-			dropDown.itemRendererFunction = itemRendererFunction;
-
-		// TODO!! We force validation because when we set the selectedIndex,
-		// the list doesn't commit the value until it calls commitProperties.
-		// By this time, we are already listening for selection changed events.
-		//dropDown.validateNow();
-		/*dropDown.validateProperties();
-		dropDown.validateSize();*/
-
-		// Wait for creationComplete before listening to selectionChanged events from the dropDown.
-		//dropDown.addEventListener("creationComplete", dropDown_creationCompleteHandler);
-		//dropDown.addEventListener(IndexChangedEvent.SELECTION_CHANGED, dropDown_selectionChangedHandler);
-    }
-
-    /**
-     *  @private
-     */
-    override protected function addListenersToDropDown():void
-    {
-    	dropDown.addEventListener(IndexChangedEvent.SELECTION_CHANGED, dropDown_selectionChangedHandler);
-    }
+    	if (event is CollectionEvent)
+        {
+			labelChanged = true;
+			invalidateProperties();
+        }
+    }
+
+    /**
+ 	 *  @private
+ 	 */
+    override protected function getCurrentSkinState():String
+    {
+		return !enabled ? "disabled" : isOpen ? "open" : "normal";
+    }

     /**
 	 *  @private
@@ -672,8 +459,10 @@
     {
     	super.partAdded(partName, instance);

- 		if (instance == dropDown)
- 			dropDownInstance = dropDown;
+ 		if (instance == button)
+    	{
+    		instance.addEventListener(FlexEvent.BUTTON_DOWN, buttonDownHandler);
+    	}
     }

     /**
@@ -681,47 +470,42 @@
      */
     override protected function partRemoved(partName:String, instance:Object):void
     {
-        if (instance == dropDown)
+    	if (instance == button)
     	{
-    		dropDownInstance = null;
+    		instance.removeEventListener(FlexEvent.BUTTON_DOWN, buttonDownHandler);
     	}

         super.partRemoved(partName, instance);
     }

     /**
-	 *  @private
-	 */
-    override protected function destroyDropDown():void
-    {
-    	super.destroyDropDown();
-
-    	dropDown.removeEventListener(IndexChangedEvent.SELECTION_CHANGED, dropDown_selectionChangedHandler);
-    }
-
+     *  @private
+     */
+    override protected function item_clickHandler(event:MouseEvent):void
+	{
+		super.item_clickHandler(event);
+		closeDropDown(true);
+	}
+
+    /**
+     *  @private
+     */
+    // TODO (jszeto) Workaround for now until we can fix List so that it
+    // doesn't listen for keyDown events in the capture phase
+    override protected function keyDownHandler(event:KeyboardEvent) : void
+	{
+		//trace("DropDownList.keyDownHandler key",event.keyCode);
+		list_keyDownHandler(event);
+	}
+
     /**
 	 *  @private
 	 */
-    override protected function commitDropDownData():void
-    {
-    	if (dropDown.selectedIndex != selectedIndex)
-    	{
-    		selectedIndex = dropDown.selectedIndex;
-    		dispatchEvent(new Event(Event.CHANGE));
-    	}
-    }
-
-    /**
-	 *  @private
-	 */
-	override protected function keyDownHandler(event:KeyboardEvent) : void
+	override protected function list_keyDownHandler(event:KeyboardEvent) : void
 	{
-
-		//trace("DropDownList.keyDownHandler key",event.keyCode);
+		//trace("DropDownList.list_keyDownHandler key",event.keyCode);
 		if(!enabled)
             return;
-
-		super.keyDownHandler(event);

         if (event.ctrlKey && event.keyCode == Keyboard.DOWN)
         {
@@ -751,15 +535,21 @@
                 event.stopPropagation();
             }
         }
-        else if (event.keyCode == Keyboard.UP ||
+        else
+        {
+        	//trace("DropDownList.keyDownHandler arrow key isOpen",isOpen);
+        	// TODO (jszeto) Check if we need dataGroup skin during this event
+        	super.list_keyDownHandler(event);
+        }
+
+        /*
+        if (event.keyCode == Keyboard.UP ||
                 event.keyCode == Keyboard.DOWN ||
                 event.keyCode == Keyboard.LEFT ||
                 event.keyCode == Keyboard.RIGHT ||
                 event.keyCode == Keyboard.PAGE_UP ||
                 event.keyCode == Keyboard.PAGE_DOWN)
-        {
-        	//trace("DropDownList.keyDownHandler arrow key isOpen",isOpen);
-
+        {
         	if (isOpen)
         	{
         		// TODO (jszeto) Clean this up once we have List support for
@@ -797,7 +587,7 @@

         			dispatchEvent(new Event(Event.CHANGE));
         		}
-        	}
+        	}*/

@@ -830,7 +620,7 @@
             event.stopPropagation();
             bInKeyDown = false;*/

-        }
+
 	}

     //--------------------------------------------------------------------------
@@ -839,108 +629,44 @@
     //
     //--------------------------------------------------------------------------

-    /**
-	 *  Called when the dropDown dispatches a selectionChanged event.
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-    protected function dropDown_selectionChangedHandler(event:IndexChangedEvent):void
-    {
-    	//trace("DropDownList.dropDown_selectionChangedHandler [CLOSE]");
-
-        closeDropDown(true);
-    }
-
-    /**
-	 *  Called when the dataProvider changes
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-    protected function collection_changeHandler(event:CollectionEvent):void
-    {
-    	// TODO (jszeto) Change this to use ListBase implementation
-
-        var requiresValueCommit:Boolean = false;
-
-        if (event.kind == CollectionEventKind.ADD)
+	 /**
+ 	 *  Called when the buttonDown event is dispatched. This function opens or closes
+ 	 *  the dropDown depending upon the dropDown state.
+ 	 *
+ 	 *  @langversion 3.0
+ 	 *  @playerversion Flash 10
+ 	 *  @playerversion AIR 1.5
+ 	 *  @productversion Flex 4
+ 	 */
+    protected function buttonDownHandler(event:Event):void
+    {
+    	//trace("DropDownBase.buttonDownHandler ", isOpen ? "[CLOSE]" : "[OPEN]");
+        if (isOpen)
+            closeDropDown(true);
+        else
+            openDropDown();
+    }
+
+    /**
+     *  Called when the systemManager receives a mouseDown event. In the base class
+     *  implementation, this closes the dropDown.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function systemManager_mouseDownHandler(event:MouseEvent):void
+    {
+    	// TODO (jszeto) Make marshall plan compliant
+    	// TODO (jszeto) Figure a better way to handle this
+     	if ((dataGroup && !dataGroup.hitTestPoint(event.stageX, event.stageY)) &&
+     	    (button && !button.hitTestPoint(event.stageX, event.stageY)))
         {
-        	// Don't send a value commit. selectedItem remains the same
-            if (selectedIndex >= event.location)
-                _selectedIndex++;
+        	//trace("DropDownBase.systemManager_mouseDownHandler  [CLOSE]");
+            closeDropDown(true);
         }
-        else if (event.kind == CollectionEventKind.REMOVE)
-        {
-            for (var i:int = 0; i < event.items.length; i++)
-            {
-            	// TODO (jszeto) Do we need to use UID instead?
-                //var uid:String = itemToUID(ce.items[i]);
-                if (selectedItem == event.items[i])
-                {
-                    selectionChanged = true;
-                }
-            }
-            if (selectionChanged)
-            {
-                if (_selectedIndex >= collection.length)
-                    _selectedIndex = collection.length - 1;
-
-                selectedIndexChanged = true;
-                requiresValueCommit = true;
-                invalidateProperties();
-            }
-            else if (selectedIndex >= event.location)
-            {
-                _selectedIndex--;
-                selectedIndexChanged = true;
-                requiresValueCommit = true;
-                invalidateProperties();
-            }
-
-        }
-        else if (event.kind == CollectionEventKind.REFRESH)
-        {
-            selectedItemChanged = true;
-            // Sorting always changes the selection array
-            requiresValueCommit = true;
-            invalidateProperties();
-        }
-        else if (event.kind == CollectionEventKind.UPDATE)
-        {
-            if (event.location == selectedIndex ||
-                event.items[0].source == selectedItem)
-            {
-            	selectedItem = event.items[0].source;
-            }
-        }
-        else if (event.kind == CollectionEventKind.RESET)
-        {
-           /* collectionChanged = true;
-            if (!selectedIndexChanged && !selectedItemChanged)
-                selectedIndex = prompt ? -1 : 0;
-            invalidateProperties();*/
-            if (!selectedIndexChanged && !selectedItemChanged)
-            	selectedIndex = 0;
-        }
-
-        if (requiresValueCommit)
-            dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
-    }
-
-    /**
-     *  @private
-     */
-    /*private function dropDown_creationCompleteHandler(event:FlexEvent):void
-    {
-    	trace("DropDownList.dropDown_creationCompleteHandler called");
-		dropDown.removeEventListener("creationComplete", dropDown_creationCompleteHandler);
-    	dropDown.addEventListener(IndexChangedEvent.SELECTION_CHANGED, dropDown_selectionChangedHandler);
-    }*/
-
+    }
+
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 16249
Author:   smgilson@adobe.com
Date:     2010-05-20T14:22:32.280725Z

Log Message:
-----------
merge 16248: Update ASDoc on seek() to use currentTime, not playheadTime.

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

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

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

--- frameworks/projects/spark/src/spark/components/VideoDisplay.as
+++ frameworks/projects/spark/src/spark/components/VideoDisplay.as
@@ -1319,7 +1319,7 @@
      *  is past the end of the stream, or past the amount of file
      *  downloaded so far, then attempts to seek and, if it fails, it then recovers.

      *
-     *
The playheadTime property might not have the expected value
+     *
The currentTime property might not have the expected value
      *  immediately after you call seek().
      *  For a progressive download,
      *  you can seek only to a keyframe; therefore, a seek takes you to the
@@ -1328,8 +1328,8 @@
      *
Note: When streaming, a seek always goes to the precise specified
      *  time even if the source FLV file doesn't have a keyframe there.

      *
-     *
Seeking is asynchronous, so if you call the seek() method or set the
-     *  playheadTime property, playheadTime does not update immediately.

+     *
Seeking is asynchronous, so if you call the seek() method,
+     *  currentTime does not update immediately.

      *
      *  @param time The seek time, in seconds.
      *


Added optimization on PickingController for raycasting picking with numerous targets

--- src/aerys/minko/scene/controller/PickingController.as
+++ src/aerys/minko/scene/controller/PickingController.as
@@ -290,9 +290,12 @@
                 // raycast
                 if (_technique & PickingTechnique.RAYCASTING)
                 {
-                    var ray : Ray       = null;
-                    var hit : Boolean   = false;
-
+                    var ray					: Ray       = null;
+                    var hit					: Boolean   = false;
+                    var minDistance			: Number	= Number.POSITIVE_INFINITY;
+
+					var currentMouseOver	: Mesh		= _currentMouseOver;
+
                     for (var targetId : uint = 0; targetId < numTargets && !hit; ++targetId)
                     {
                         var target  : ISceneNode    = getTarget(targetId);
@@ -310,11 +313,13 @@
                             if (target is Mesh)
                             {
 								var mesh : Mesh = target as Mesh;
-                                if (mesh.cast(ray, Number.POSITIVE_INFINITY, _tag) > 0.)
+								var distance : Number = mesh.cast(ray, Number.POSITIVE_INFINITY, _tag);
+                                if (distance > 0.)
                                 {
-									if (!(_technique & PickingTechnique.PIXEL_PICKING))
+									if (!(_technique & PickingTechnique.PIXEL_PICKING) && distance < minDistance)
 									{
-										_lastMouseOver = _currentMouseOver;
+										minDistance = distance;
+										_lastMouseOver = currentMouseOver;
 										_currentMouseOver = mesh;
 									}
                                     hit = true;
@@ -329,8 +334,12 @@
                                 {
 									if (!(_technique & PickingTechnique.PIXEL_PICKING))
 									{
-										_lastMouseOver = _currentMouseOver;
-										_currentMouseOver = hits[0] as Mesh;
+										_lastMouseOver = currentMouseOver;
+										if (Mesh(hits[0]).cast(ray, Number.POSITIVE_INFINITY, _tag) < minDistance)
+										{
+											minDistance = distance
+											_currentMouseOver = hits[0] as Mesh;
+										}
 									}
                                     hit = true;
                                 }
@@ -389,7 +398,7 @@
 												context		: Context3DResource,
 												backBuffer	: RenderTarget) : void
 		{
-			if (_disableAntiAliasing && backBuffer.antiAliasing != 0)
+			if (_disableAntiAliasing)
 				context.configureBackBuffer(backBuffer.width, backBuffer.height, 0, true);

 			context.clear(0, 0, 0, 0);
@@ -409,7 +418,7 @@
 				(color & 0xff) / 255.
 			);

-			if (_disableAntiAliasing && backBuffer.antiAliasing != _previousAntiAliasing)
+			if (_disableAntiAliasing)
 			{
 				context.configureBackBuffer(backBuffer.width, backBuffer.height, _previousAntiAliasing, true);
 				context.clear(0, 0, 0, 0);
@@ -436,7 +445,7 @@
 			{
 				var mesh	: Mesh	= _pickingIdToMesh[pixelColor & 0xFFFFFF];

-				_currentMouseOver	= mesh && (mesh.tag & _tag) != 0 ? mesh : null;
+				_currentMouseOver = mesh && (mesh.tag & _tag) != 0 ? mesh : null;
 			}
 			else
 				_currentMouseOver = null; // wrong antialiasing color or nothing got picked


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

--- frameworks/projects/framework/src/mx/managers/ILayoutManager.as
+++ frameworks/projects/framework/src/mx/managers/ILayoutManager.as
@@ -0,0 +1,276 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-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.managers
+{
+
+import flash.display.Stage;
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import mx.core.Application;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+import mx.managers.layoutClasses.PriorityQueue;
+
+use namespace mx_internal;
+
+/**
+ *  The LayoutManager is the engine behind
+ *  Flex's measurement and layout strategy.
+ *  Layout is performed in three phases; commit, measurement, and layout.
+ *
+ *
Each phase is distinct from the others and all UIComponents of
+ *  one phase are processed prior to moving on to the next phase.
+ *  During the processing of UIComponents in a phase, requests for
+ *  UIComponents to get re-processed by some phase may occur.
+ *  These requests are queued and are only processed
+ *  during the next run of the phase.

+ *
+ *
The commit phase begins with a call to
+ *  validateProperties(), which walks through a list
+ *  (reverse sorted by nesting level) of objects calling each object's
+ *
+ *  validateProperties()method.

+ *
+ *
The objects in the list are processed in reversed nesting order,
+ *  with the least deeply nested object accessed first.
+ *  This can also be referred to as top-down or outside-in ordering.

+ *
+ *
This phase allows components whose contents depend on property
+ *  settings to configure themselves prior to the measurement
+ *  and the layout phases.
+ *  For the sake of performance, sometimes a component's property setter
+ *  method does not do all the work to update to the new property value.
+ *  Instead, the property setter calls the invalidateProperties()
+ *  method, deferring the work until this phase runs.
+ *  This prevents unnecessary work if the property is set multiple times.

+ *
+ *
The measurement phase begins with a call to
+ *  validateSize(), which walks through a list
+ *  (sorted by nesting level) of objects calling each object's
+ *  validateSize()
+ *  method to determine if the object has changed in size.

+ *
+ *
If an object's
+ *  invalidateSize() method was previously called,
+ *  then the validateSize() method is called.
+ *  If the size or position of the object was changed as a result of the
+ *  validateSize() call, then the object's
+ *
+ *  invalidateDisplayList() method is called, thus adding
+ *  the object to the processing queue for the next run of the layout phase.
+ *  Additionally, the object's parent is marked for both measurement
+ *  and layout phases, by calling
+ *
+ *  invalidateSize() and
+ *
+ *  invalidateDisplayList() respectively.

+ *
+ *
The objects in the list are processed by nesting order,
+ *  with the most deeply nested object accessed first.
+ *  This can also be referred to as bottom-up inside-out ordering.

+ *
+ *
The layout phase begins with a call to the
+ *  validateDisplayList() method, which walks through a list
+ *  (reverse sorted by nesting level) of objects calling each object's
+ *
+ *  validateDisplayList() method to request the object to size
+ *  and position all components contained within it (i.e. its children).

+ *
+ *
If an object's
+ *  invalidateDisplayList() method was previously called,
+ *  then validateDisplayList() method for the object is called.

+ *
+ *
The objects in the list are processed in reversed nesting order,
+ *  with the least deeply nested object accessed first.
+ *  This can also be referred to as top-down or outside-in ordering.

+ *
+ *
In general, components do not override the validateProperties(),
+ *  validateSize(), or validateDisplayList() methods.
+ *  In the case of UIComponents, most components override the
+ *  commitProperties(), measure(), or
+ *  updateDisplayList() methods, which are called
+ *  by the validateProperties(),
+ *  validateSize(), or
+ *  validateDisplayList() methods, respectively.

+ *
+ *
At application startup, a single instance of the LayoutManager is created
+ *  and stored in the UIComponent.layoutManager property.
+ *  All components are expected to use that instance.
+ *  If you do not have access to the UIComponent object,
+ *  you can also access the LayoutManager using the static
+ *  LayoutManager.getInstance() method.

+ */
+public interface ILayoutManager extends IEventDispatcher
+{
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  usePhasedInstantiation
+	//----------------------------------
+
+	/**
+	 *  A flag that indicates whether the LayoutManager allows screen updates
+	 *  between phases.
+	 *  If true, measurement and layout are done in phases, one phase
+	 *  per screen update.
+	 *  All components have their validateProperties()
+	 *  and commitProperties() methods
+	 *  called until all their properties are validated.
+	 *  The screen will then be updated.
+	 *
+	 *
Then all components will have their validateSize()
+	 *  and measure()
+	 *  methods called until all components have been measured, then the screen
+	 *  will be updated again.

+	 *
+	 *
Finally, all components will have their
+	 *  validateDisplayList() and
+	 *  updateDisplayList() methods called until all components
+	 *  have been validated, and the screen will be updated again.
+	 *  If in the validation of one phase, an earlier phase gets invalidated,
+	 *  the LayoutManager starts over.
+	 *  This is more efficient when large numbers of components
+	 *  are being created an initialized.  The framework is responsible for setting
+	 *  this property.

+	 *
+	 *
If false, all three phases are completed before the screen is updated.

+	 */
+	function get usePhasedInstantiation():Boolean;
+
+	/**
+	 *  @private
+	 */
+	function set usePhasedInstantiation(value:Boolean):void;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods: Invalidation
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Adds an object to the list of components that want their
+	 *  validateProperties() method called.
+	 *  A component should call this method when a property changes.
+	 *  Typically, a property setter method
+	 *  stores a the new value in a temporary variable and calls
+	 *  the invalidateProperties() method
+	 *  so that its validateProperties()
+	 *  and commitProperties() methods are called
+	 *  later, when the new value will actually be applied to the component and/or
+	 *  its children.  The advantage of this strategy is that often, more than one
+	 *  property is changed at a time and the properties may interact with each
+	 *  other, or repeat some code as they are applied, or need to be applied in
+	 *  a specific order.  This strategy allows the most efficient method of
+	 *  applying new property values.
+	 *
+	 *  @param obj The object whose property changed.
+	 */
+	function invalidateProperties(obj:ILayoutManagerClient ):void;
+
+	/**
+	 *  Adds an object to the list of components that want their
+	 *  validateSize() method called.
+	 *  Called when an object's size changes.
+	 *
+	 *
An object's size can change for two reasons:

+	 *
+	 *

+	 *
The content of the object changes. For example, the size of a
+	 *    button changes when its label is changed.

+	 *
A script explicitly changes one of the following properties:
+	 *    minWidth, minHeight,
+	 *    explicitWidth, explicitHeight,
+	 *    maxWidth, or maxHeight.

+	 *

+	 *
+	 *
When the first condition occurs, it's necessary to recalculate
+	 *  the measurements for the object.
+	 *  When the second occurs, it's not necessary to recalculate the
+	 *  measurements because the new size of the object is known.
+	 *  However, it's necessary to remeasure and relayout the object's
+	 *  parent.

+	 *
+	 *  @param obj The object whose size changed.
+	 */
+	function invalidateSize(obj:ILayoutManagerClient ):void;
+
+	/**
+	 *  Called when a component changes in some way that its layout and/or visuals
+	 *  need to be changed.
+	 *  In that case, it is necessary to run the component's layout algorithm,
+	 *  even if the component's size hasn't changed.  For example, when a new child component
+	 *  is added, or a style property changes or the component has been given
+	 *  a new size by its parent.
+	 *
+	 *  @param obj The object that changed.
+	 */
+	function invalidateDisplayList(obj:ILayoutManagerClient ):void;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods: Commitment, measurement, layout, and drawing
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  When properties are changed, components generally do not apply those changes immediately.
+	 *  Instead the components usually call one of the LayoutManager's invalidate methods and
+	 *  apply the properties at a later time.  The actual property you set can be read back
+	 *  immediately, but if the property affects other properties in the component or its
+	 *  children or parents, those other properties may not be immediately updated.  To
+	 *  guarantee that the values are updated, you can call the validateNow() method.
+	 *  It updates all properties in all components before returning.
+	 *  Call this method only when necessary as it is a computationally intensive call.
+	 */
+	function validateNow():void;
+
+	/**
+	 *  When properties are changed, components generally do not apply those changes immediately.
+	 *  Instead the components usually call one of the LayoutManager's invalidate methods and
+	 *  apply the properties at a later time.  The actual property you set can be read back
+	 *  immediately, but if the property affects other properties in the component or its
+	 *  children or parents, those other properties may not be immediately updated.
+	 *
+	 *
To guarantee that the values are updated,
+	 *  you can call the validateClient() method.
+	 *  It updates all properties in all components whose nest level is greater than or equal
+	 *  to the target component before returning.
+	 *  Call this method only when necessary as it is a computationally intensive call.

+	 *
+	 *  @param target The component passed in is used to test which components
+	 *  should be validated.  All components contained by this component will have their
+	 *  validateProperties(), commitProperties(),
+	 *  validateSize(), measure(),
+	 *  validateDisplayList(),
+	 *  and updateDisplayList() methods called.
+	 *
+	 *	@param skipDisplayList If true,
+	 *  does not call the validateDisplayList()
+	 *  and updateDisplayList() methods.
+	 */
+	function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean = false):void;
+
+	/**
+	 *  Returns true if there are components that need validating;
+	 *  false if all components have been validated.
+	 */
+	function isInvalid():Boolean;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 16262
Author:   dloverin@adobe.com
Date:     2010-05-20T18:44:39.210129Z

Log Message:
-----------
Move mx components out of framework.swc into mx.swc

The new mx.swc library lives in the libs/mx directory.

QE notes: Of the 5 failures I saw: 1 was intermittent and 4 are not a bug.
Managers/StyleManager/AdvancedCSS/descendantSelectors/AdvancedCSS_descendantSelectors_Style descendantSelector_combining_nested_style
    This failure was intermittent.

mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ApplicationControlBar_FromTo
mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ApplicationControlBar_By
mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ControlBar_FromTo
mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ControlBar_By
    These failures are due to my code changes but I believe the old behavior was incorrect. When a control bar is the last child in a Panel it should appear at the bottom of the Panel. In the test case an ApplicationControlBar/ContorlBar is added to an empty Panel, making it the last child in the Panel. So it should appear at the bottom of the Panel instead of inside the Panel.

Doc notes: new library, mx.swc
Bugs:
Reviewer: Alex
Tests run:
Is noteworthy for integration: Yes

Modified Paths:
--------------
740 paths were modified

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

--- frameworks/projects/framework/src/mx/managers/ILayoutManager.as
+++ frameworks/projects/framework/src/mx/managers/ILayoutManager.as
@@ -16,7 +16,6 @@
 import flash.events.Event;
 import flash.events.EventDispatcher;
 import flash.events.IEventDispatcher;
-import mx.core.Application;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;


Transferred from the Adobe Open Source Subversion Repository

Revision: 3147
Author:   gosmith@adobe.com
Date:     2008-09-08T20:42:17.471267Z

Log Message:
-----------
You can now use CSS styles to set the text format for TextBox and the default text format for TextGraphic. These components no longer have any formatting properties.

Metadata for the styles that affect Gumbo text formatting is in six new include files in styles/metadata:

    BasicCharacterFormatTextStyles.as
    AdvancedContainerFormatTextStyles.as
    BasicParagraphFormatTextStyles.as
    AdvancedParagraphFormatTextStyles.as
    BasicContainerFormatTextStyles.as
    AdvancedContainerFormatTextStyles.as

TextBox supports the "basic" subset. TextGraphic supports all of them.

The 'global' selector now has the defaults for all of these styles. Five of them -- color, fontFamily, fontSize, kerning, and textAlign -- have default values which are, for now, the same as in Halo, but which may change later.

Reviewer: Glenn
Bugs: -
QA: Lots of new stuff to test!
Doc: No

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles/metadata/BasicParagraphFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextBox.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles/metadata/AdvancedContainerFormatTextStyles.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles/metadata/AdvancedParagraphFormatTextStyles.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles/metadata</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/flex4/src/flex/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles/metadata/BasicCharacterFormatTextStyles.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles/metadata/AdvancedCharacterFormatTextStyles.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/styles/metadata/BasicContainerFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>

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

--- frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as
+++ frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as
@@ -77,11 +77,24 @@
      */
     private static var sizeInvalidatingStyles:Object =
     {
+        alignmentBaseline: true,
+        baselineShift: true,
+        blockProgression: true,
         borderStyle: true,
         borderThickness: true,
+        cffHinting: true,
+        columnCount: true,
+        columnGap: true,
+        columnWidth: true,
+        digitCase: true,
+        digitWidth: true,
+        direction: true,
+        dominantBaseline: true,
+        firstBaselineOffset: true,
         fontAntiAliasType: true,
         fontFamily: true,
         fontGridFitType: true,
+        fontLookup: true,
         fontSharpness: true,
         fontSize: true,
         fontStyle: true,
@@ -90,18 +103,38 @@
         headerHeight: true,
         horizontalAlign: true,
         horizontalGap: true,
+        justificationRule: true,
+        justificationStyle: true,
         kerning: true,
         leading: true,
         letterSpacing: true,
+        ligatureLevel: true,
+        lineBreak: true,
+        lineHeight: true,
+        lineThrough: true,
+        locale: true,
+        marginBottom: true,
+        marginLeft: true,
+        marginRight: true,
+        marginTop: true,
         paddingBottom: true,
         paddingLeft: true,
         paddingRight: true,
         paddingTop: true,
+        renderingMode: true,
         strokeWidth: true,
         tabHeight: true,
         tabWidth: true,
+        textAlign: true,
+        textAlignLast: true,
+        textRotation: true,
+        tracking: true,
+        trackingLeft: true,
+        trackingRight: true,
+        typographicCase: true,
         verticalAlign: true,
-        verticalGap: true
+        verticalGap: true,
+        whitespaceCollapse: true
     }

     /**
@@ -113,13 +146,13 @@
      */
     private static var parentSizeInvalidatingStyles:Object =
     {
+        baseline: true,
         bottom: true,
         horizontalCenter: true,
         left: true,
         right: true,
         top: true,
-        verticalCenter: true,
-        baseline: true
+        verticalCenter: true
     }

     /**
@@ -131,13 +164,13 @@
      */
     private static var parentDisplayListInvalidatingStyles:Object =
     {
+        baseline: true,
         bottom: true,
         horizontalCenter: true,
         left: true,
         right: true,
         top: true,
-        verticalCenter: true,
-        baseline: true
+        verticalCenter: true
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 7198
Author:   hmuller@adobe.com
Date:     2009-05-21T22:27:07.016124Z

Log Message:
-----------
If a DataGroup changes its itemRenderer or dataProvider it needs to ensure that the
state cached for the sake of virtual layout is cleared.  Added
LayoutBase::clearVirtualLayoutState() for this.

BasicLayout.useVirtualLayout=false is now ignored (generates a warning).

QE Notes: API Change: added LayoutBase::clearVirtualLayoutState()
Doc Notes:
Bugs: sdk-19397, sdk-20443, sdk-20930
Reviewer: Evtim

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/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -88,6 +88,14 @@
 {
     include "../core/Version.as";

+    /**
+     *  @private
+     *  Cached column widths, max row height for virtual layout.   Not used unless
+     *  useVirtualLayout=true.   See updateLLV(), resetCachedVirtualLayoutState(),
+     *  etc.
+     */
+    private var llv:LinearLayoutVector = new LinearLayoutVector(LinearLayoutVector.HORIZONTAL);
+
     //--------------------------------------------------------------------------
     //
     //  Class methods
@@ -654,6 +662,14 @@
     //  Methods
     //
     //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     */
+    override public function clearCachedVirtualLayoutState():void
+    {
+        llv.clear();
+    }

     /**
      *  @private
@@ -1020,8 +1036,6 @@
         layoutTarget.measuredMinWidth  = minWidth + hPadding;
     }

-    private var llv:LinearLayoutVector = new LinearLayoutVector(LinearLayoutVector.HORIZONTAL);
-
     /**
      *  @private
      *


CSVDataSource no longer generates XML hierarchy, and it now has a way to specify column metadata as an Array of objects.

--- WeaveData/src/weave/data/DataSources/CSVDataSource.as
+++ WeaveData/src/weave/data/DataSources/CSVDataSource.as
@@ -30,6 +30,7 @@
 	import mx.utils.ObjectUtil;

 	import weave.api.WeaveAPI;
+	import weave.api.core.ILinkableDynamicObject;
 	import weave.api.core.ILinkableHashMap;
 	import weave.api.data.ColumnMetadata;
 	import weave.api.data.DataTypes;
@@ -37,6 +38,7 @@
 	import weave.api.data.IColumnReference;
 	import weave.api.data.IDataSource;
 	import weave.api.data.IQualifiedKey;
+	import weave.api.data.IWeaveTreeNode;
 	import weave.api.detectLinkableObjectChange;
 	import weave.api.disposeObject;
 	import weave.api.getCallbackCollection;
@@ -77,10 +79,14 @@
 		{
 		}

+		public const metadata:LinkableVariable = registerLinkableChild(this, new LinkableVariable(null, typeofIsObject));
 		public const url:LinkableString = newLinkableChild(this, LinkableString);
 		public const csvData:LinkableVariable = registerLinkableChild(this, new LinkableVariable(Array), handleCSVDataChange);
 		public const keyType:LinkableString = newLinkableChild(this, LinkableString);
 		public const keyColName:LinkableString = newLinkableChild(this, LinkableString);
+
+		private function typeofIsObject(value:Object):Boolean { return typeof value == 'object'; }
+
 		/**
 		 * Session state of servletParams must be an object with two properties: 'method' and 'params'
 		 * If this is set, it assumes that url.value points to a Weave AMF3Servlet and the servlet method returns a table of data.
@@ -134,7 +140,7 @@
 		 * Contains the csv data that should be used elsewhere in the code
 		 */
 		private var parsedRows:Array;
-		private var columnIds:Array;
+		private var columnIds:Array = [];

 		private function handleParsedRows(rows:Array):void
 		{
@@ -188,24 +194,52 @@
 		 */
 		public function getColumnIds():Array
 		{
-			return columnIds ? columnIds.concat() : [];
+			return columnIds.concat();
+		}
+
+		/**
+		 * Gets whatever is stored in the "metadata" session state for the specified id.
+		 */
+		private function getColumnMetadata(id:Object):Object
+		{
+			var meta:Object = metadata.getSessionState();
+			if (id is String && meta is Array)
+				return meta[columnIds.indexOf(id)];
+			else if (meta)
+				return meta[id];
+			return null;
+		}
+
+		public function getColumnTitle(id:Object):String
+		{
+			var meta:Object = getColumnMetadata(id);
+			var title:String = meta ? meta[ColumnMetadata.TITLE] : null;
+			if (!title && typeof id == 'number' && parsedRows && parsedRows.length)
+				title = parsedRows[0][id];
+			if (!title)
+				title = String(id);
+			return title;
 		}

 		private function getAttrTagFromColumnId(id:Object):XML
 		{
 			if (!parsedRows)
 				return null;
-			var attr:XML = <attribute keyType={ keyType.value || DataTypes.STRING }/>;
+			var attr:XML = <attribute/>;
+			attr['@'+ColumnMetadata.TITLE] = getColumnTitle(id);
+			attr['@'+ColumnMetadata.KEY_TYPE] = keyType.value || DataTypes.STRING;
+
+			// get column metadata from session state
+			var meta:Object = getColumnMetadata(id);
+			for (var key:String in meta)
+				attr['@'+key] = meta[key];
+
+			// overwrite identifying property
 			if (typeof id == 'number')
-			{
-				attr['@title'] = parsedRows[0] ? parsedRows[0][id] : '';
-				attr['@csvColumnIndex'] = id;
-			}
+				attr['@'+METADATA_COLUMN_INDEX] = id;
 			else
-			{
-				attr['@title'] = id;
-				attr['@csvColumn'] = id;
-			}
+				attr['@'+METADATA_COLUMN_NAME] = id;
+
 			return attr;
 		}

@@ -224,42 +258,6 @@
 			_reusableReference.hierarchyPath.value = getAttrTagFromColumnId(columnNameOrIndex);
 			return WeaveAPI.AttributeColumnCache.getColumn(_reusableReference);
 		}
-
-		/**
-		 * Sets the metadata for a column
-		 * @param csvColumnName the name of the column
-		 * @param metaDataName the name of the metadata. Use ColumnMetadata to get property name
-		 * @value value the value to set for the metadata property
-		 **/
-//		public function setColumnMetaData(csvColumnName:String,metaDataName:String,value:String):void
-//		{
-//			var hierarchy:XML = _attributeHierarchy.value;
-//			if (hierarchy)
-//			{
-//				for each (var tag:XML in hierarchy.descendants('attribute'))
-//				{
-//					if (String(tag.@csvColumn) == csvColumnName)
-//					{
-//						if(metaDataName == ColumnMetadata.DATA_TYPE)
-//							tag.@dataType = value;
-//						else if(metaDataName == ColumnMetadata.KEY_TYPE)
-//							tag.@keyType = value;
-//						else if(metaDataName == ColumnMetadata.MAX)
-//							tag.@max = value;
-//						else if(metaDataName == ColumnMetadata.MIN)
-//							tag.@min = value;
-//						else if(metaDataName == ColumnMetadata.NUMBER)
-//							tag.@number = value;
-//						else if (metaDataName == ColumnMetadata.PROJECTION)
-//							tag.@projection = value;
-//						else if (metaDataName == ColumnMetadata.STRING)
-//							tag.@string = value;
-//						else if (metaDataName == ColumnMetadata.TITLE)
-//							tag.@title = value;
-//					}
-//				}
-//			}
-//		}

 		// used by getColumnByName
 		private const _reusableReference:HierarchyColumnReference = newDisposableChild(this, HierarchyColumnReference);
@@ -403,14 +401,6 @@
 		{
 			handleURLChange();

-			if (_attributeHierarchy.value == null && parsedRows)
-			{
-				// loop through column names, adding indicators to hierarchy
-				var root:XML = <hierarchy title={ WeaveAPI.globalHashMap.getName(this) }/>;
-				for each (var id:Object in columnIds)
-					root.appendChild(getAttrTagFromColumnId(id));
-				_attributeHierarchy.value = root;
-			}
 			// recalculate all columns previously requested because CSV data may have changed.
 			for (var proxyColumn:* in _columnToReferenceMap)
 				requestColumnFromSource(_columnToReferenceMap[proxyColumn] as IColumnReference, proxyColumn);
@@ -418,10 +408,49 @@
 			super.initialize();
 		}

+		/**
+		 * Gets the root node of the attribute hierarchy.
+		 */
+		override public function getHierarchyRoot():IWeaveTreeNode
+		{
+			if (_attributeHierarchy.value === null)
+			{
+				if (!(_rootNode is CSVColumnNode))
+					_rootNode = new CSVColumnNode(this);
+				return _rootNode;
+			}
+			else
+			{
+				return super.getHierarchyRoot();
+			}
+		}
+
+		/**
+		 * Populates a LinkableDynamicObject with an IColumnReference corresponding to a node in the attribute hierarchy.
+		 */
+		override public function getColumnReference(node:IWeaveTreeNode, output:ILinkableDynamicObject):Boolean
+		{
+			if (node.getSource() != this || node.isBranch())
+				return false;
+
+			var csvNode:CSVColumnNode = node as CSVColumnNode;
+			if (csvNode)
+			{
+				getCallbackCollection(output).delayCallbacks();
+				var hcr:HierarchyColumnReference = output.requestLocalObject(HierarchyColumnReference, false);
+				hcr.dataSourceName.value = WeaveAPI.globalHashMap.getName(this);
+				hcr.hierarchyPath.value = getAttrTagFromColumnId(csvNode.columnIndex);
+				getCallbackCollection(output).resumeCallbacks();
+				return true;
+			}
+
+			return super.getColumnReference(node, output);
+		}
+
 		override protected function handleHierarchyChange():void
 		{
 			super.handleHierarchyChange();
-			convertOldHierarchyFormat(_attributeHierarchy.value, "attribute", {name: "csvColumn"});
+			convertOldHierarchyFormat(_attributeHierarchy.value, "attribute", {"name": METADATA_COLUMN_NAME});
 			if (_attributeHierarchy.value)
 			{
 				for each (var tag:XML in _attributeHierarchy.value.descendants('attribute'))
@@ -475,6 +504,9 @@
 		{
 			// do nothing
 		}
+
+		public static const METADATA_COLUMN_INDEX:String = 'csvColumnIndex';
+		public static const METADATA_COLUMN_NAME:String = 'csvColumn';

 		/**
 		 * This function must be implemented by classes by extend AbstractDataSource.
@@ -492,14 +524,14 @@
 			var leafNode:XML = HierarchyUtils.getLeafNodeFromPath(pathInHierarchy) || <empty/>;
 			proxyColumn.setMetadata(leafNode.copy());

-			var columnId:Object = proxyColumn.getMetadata("csvColumnIndex");
+			var columnId:Object = proxyColumn.getMetadata(METADATA_COLUMN_INDEX);
 			if (columnId)
 			{
 				columnId = int(columnId);
 			}
 			else
 			{
-				columnId = proxyColumn.getMetadata("csvColumn");
+				columnId = proxyColumn.getMetadata(METADATA_COLUMN_NAME);

 				// backwards compatibility
 				if (!columnId)
@@ -646,3 +678,46 @@
 		[Deprecated(replacement="getColumnById")] public function getColumnByName(name:String):IAttributeColumn { return getColumnById(name); }
 	}
 }
+
+import weave.api.WeaveAPI;
+import weave.api.data.ColumnMetadata;
+import weave.api.data.IWeaveTreeNode;
+import weave.data.DataSources.CSVDataSource;
+
+internal class CSVColumnNode implements IWeaveTreeNode
+{
+	private var source:CSVDataSource;
+	public var columnIndex:int;
+	internal var children:Array;
+	public function CSVColumnNode(source:CSVDataSource = null, columnIndex:int = -1)
+	{
+		this.source = source;
+		this.columnIndex = columnIndex;
+		if (columnIndex < 0)
+			children = [];
+	}
+	public function getSource():Object { return source; }
+	public function equals(other:IWeaveTreeNode):Boolean { return other == this; }
+	public function getLabel():String
+	{
+		if (columnIndex < 0)
+			return WeaveAPI.globalHashMap.getName(source);
+		return source.getColumnTitle(columnIndex);
+	}
+	public function isBranch():Boolean { return columnIndex < 0; }
+	public function hasChildBranches():Boolean { return false; }
+	public function getChildren():Array
+	{
+		if (!children)
+			return null;
+
+		var ids:Array = source.getColumnIds();
+		children.length = ids.length;
+		for (var i:int = 0; i < ids.length; i++)
+			if (!children[i])
+				children[i] = new CSVColumnNode(source, i);
+		return children;
+	}
+	public function addChildAt(newChild:IWeaveTreeNode, index:int):Boolean { throw new Error("Not implemented"); }
+	public function removeChild(child:IWeaveTreeNode):Boolean { throw new Error("Not implemented"); }
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.events
 {


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

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

 package mx.controls
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8483
Author:   smgilson@adobe.com
Date:     2009-07-09T17:52:48.367800Z

Log Message:
-----------
Second checkin to update the namespace in ASDoc MXML syntax descriptions for Spark components

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/EaseInOutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ColorMatrixFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BlurFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DisplacementMapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ShaderFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DropShadowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/CallAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientBevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ConvolutionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Keyframe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientGlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/SetAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientFilter.as</path>

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

--- frameworks/projects/spark/src/spark/filters/BlurFilter.as
+++ frameworks/projects/spark/src/spark/filters/BlurFilter.as
@@ -48,7 +48,7 @@
  *  attributes of its superclass and adds the following tag attributes:

  *
  *

- *  <BlurFilter
+ *  <s:BlurFilter
  *    Properties
  *    blurX="4.0"
  *    blurY="4.0"


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/core/FontAsset.as
+++ frameworks/projects/framework/src/mx/core/FontAsset.as
@@ -67,6 +67,11 @@
  *  </pre>
  *
  *  @see flash.text.Font
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class FontAsset extends Font implements IFlexAsset
 {
@@ -80,6 +85,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function FontAsset()
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 6380
Author:   dsubrama@adobe.com
Date:     2009-04-29T15:12:22.332814Z

Log Message:
-----------
SDK-20832 & SDK-20831

Fixup the selectedItems setter.

Reviewer: Pete/Me
Checkintests: Pass
QA: Yes

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -186,7 +186,7 @@
      */
     override public function get selectedIndex():int
     {
-        if (!allowMultipleSelection)
+        if (!allowMultipleSelection || !_selectedIndices)
             return super.selectedIndex;

         if (_selectedIndices && _selectedIndices.length > 0)
@@ -335,7 +335,7 @@
                 indices[i] = dataProvider.getItemIndex(value[i]);
         }

-        selectedIndices = value;
+        selectedIndices = indices;
     }

     //--------------------------------------------------------------------------
@@ -526,7 +526,6 @@
                     //and that item was de-selected
                     if (selectedIndices.length == 1 && (selectedIndices[0] == index))
                     {
-                        //selectedIndex = NO_SELECTION;
                         return [NO_SELECTION];
                     }
                     else


Transferred from the Adobe Open Source Subversion Repository

Revision: 10941
Author:   egeorgie@adobe.com
Date:     2009-10-08T20:53:10.927001Z

Log Message:
-----------
Drag and Drop - add drag-scrolling support to Spark List. Smooth ans slick!

- Add protected drag-scrolling APIs to LayoutBase.
- Add default implementation for drag-scrolling.

QE notes: Drag-scrolling for VerticalLayout ready for testing.
Doc notes: None
Bugs: None
Reviewer: Deepa
Tests run: checkintests
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -1321,9 +1321,9 @@
         mouseDownPoint = null;
         mouseDownIndex = -1;

-        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
-        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, true);
-        systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, mouseUpHandler, true);
+        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, false);
+        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, false);
+        systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, mouseUpHandler, false);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 5220
Author:   chaase@adobe.com
Date:     2009-03-10T15:55:06.496289Z

Log Message:
-----------
New Transform effects to handle correctly doing Move, Rotate, and Scale operations simultaneously. Also, added keyframe capabilities to new effects system (necessary for the transform effects, shouldn't affect operation of other effects). Fixed various issues with effects/transition infrastructure as necessary. Added transform utility functions to UIComponent, AdvancedLayoutFeatures, and GraphicElement.

QE Notes: This will break existing new effects tests due to changes in core Animation and AnimationEvent classes, QE is disabling them for now and will add them back in as changes are made.
Doc Notes: None
Bugs:
Reviewer: Ely (transform utilities) and Jason (the rest)
tests: checkintests, Mustella tests/Effects, tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/CompositeEffect.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/PropertyChanges.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate3D.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.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/mx/effects/effectClasses/FxAnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/baseClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/AnimationEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AnimationProperty.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Animate.as
+++ frameworks/projects/spark/src/spark/effects/Animate.as
@@ -164,6 +164,7 @@
     //
     //--------------------------------------------------------------------------

+    [Inspectable(category="General", arrayType="spark.effects.MotionPath")]
     /**
      * An array of AnimationProperty objects, each of which holds the
      * name of the property being animated and the values that the property
@@ -336,17 +337,11 @@
         animateInstance.adjustConstraints = adjustConstraints;
         animateInstance.disableLayout = disableLayout;

-        // Deep-copy the animationProperties into the instance
-        if (animationProperties != null)
+        if (animationProperties)
         {
-            animateInstance.animationProperties = new Array(animationProperties.length);
-            var i:int, j:int;
-            for (i = 0; i < animationProperties.length; ++i)
-            {
-                var prop:AnimationProperty = AnimationProperty(animationProperties[i]);
-                animateInstance.animationProperties[i] = new AnimationProperty(
-                    prop.property, prop.valueFrom, prop.valueTo, prop.valueBy);
-            }
+            animateInstance.animationProperties = [];
+            for (var i:int = 0; i < animationProperties.length; ++i)
+                animateInstance.animationProperties[i] = animationProperties[i].clone();
         }
     }


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

--- frameworks/projects/spark/src/spark/primitives/Path.as
+++ frameworks/projects/spark/src/spark/primitives/Path.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.graphics
+package spark.primitives
 {

 import flash.display.Graphics;
@@ -22,6 +22,15 @@

 import mx.utils.MatrixUtil;
 import mx.core.mx_internal;
+import spark.primitives.pathSegments.LineSegment;
+import spark.primitives.supportClasses.FilledElement;
+import spark.primitives.pathSegments.CloseSegment;
+import spark.primitives.pathSegments.CubicBezierSegment;
+import spark.primitives.pathSegments.MoveSegment;
+import spark.primitives.pathSegments.PathSegment;
+import spark.primitives.pathSegments.QuadraticBezierSegment;
+
+

 use namespace mx_internal;

@@ -47,10 +56,10 @@
  *
  *  @includeExample examples/ArrowExample.mxml
  *
- *  @see mx.graphics.MoveSegment
- *  @see mx.graphics.LineSegment
- *  @see mx.graphics.CubicBezierSegment
- *  @see mx.graphics.QuadraticBezierSegment
+ *  @see spark.primitives.pathSegments.MoveSegment
+ *  @see spark.primitives.pathSegments.LineSegment
+ *  @see spark.primitives.pathSegments.CubicBezierSegment
+ *  @see spark.primitives.pathSegments.QuadraticBezierSegment
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -400,7 +409,7 @@

     private var _segments:Array = [];

-    [ArrayElementType("mx.graphics.PathSegment")]
+    [ArrayElementType("spark.primitives.pathSegments.PathSegment")]
     [Inspectable(category="General")]
     /**
      *  The segments for the path. Each segment must be a subclass of PathSegment.


Support passing in any kind of display object into image source

git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4741 3e7533ad-8678-4d30-8e38-00a379d3f0d0

--- src/laml/display/Image.as
+++ src/laml/display/Image.as
@@ -1,5 +1,6 @@
 package laml.display {
 	import flash.display.Bitmap;
+	import flash.display.DisplayObject;
 	import flash.display.Loader;
 	import flash.events.Event;
 	import flash.events.IOErrorEvent;
@@ -10,7 +11,7 @@
 	import laml.events.PayloadEvent;

 	public class Image extends Component {
-		private var bitmap:Bitmap;
+		private var bitmap:DisplayObject;
 		private var originalWidth:Number;
 		private var originalHeight:Number;

@@ -57,15 +58,15 @@
 			newValue = createImageFromValue(newValue);
 			if(newValue) {
 				bitmap = newValue;
-				bitmap.smoothing = true;
+				if (bitmap is Bitmap) Bitmap(bitmap).smoothing = true;
 				view.addChild(bitmap);
 				preferredWidth = originalWidth = bitmap.width;
 				preferredHeight = originalHeight = bitmap.height;
 			}
 		}

-		private function createImageFromValue(value:*):Bitmap {
-			if(value is Bitmap) {
+		private function createImageFromValue(value:*):DisplayObject {
+			if(value is DisplayObject) {
 				return value;
 			}
 			else if(value is Class) {


Transferred from the Adobe Open Source Subversion Repository

Revision: 17032
Author:   sameer@adobe.com
Date:     2010-07-23T05:59:21.293639Z

Log Message:
-----------
Adding the strong typing back in the Spark AdvancedDataGrid classes
QE notes: Test MX and FTE Item Renderer with spark_dmv.swc
Doc notes:
Bugs: FLEXDMV-2294 - create spark_dmv.swc for spark dmv classes
Reviewer: Sreeni
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark_dmv/src/mx/controls/advancedDataGridClasses/FTEAdvancedDataGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark_dmv/src/mx/controls/advancedDataGridClasses/MXAdvancedDataGridItemRenderer.as</path>

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

--- frameworks/projects/spark_dmv/src/mx/controls/advancedDataGridClasses/FTEAdvancedDataGridItemRenderer.as
+++ frameworks/projects/spark_dmv/src/mx/controls/advancedDataGridClasses/FTEAdvancedDataGridItemRenderer.as
@@ -18,6 +18,7 @@
 import flash.utils.getQualifiedClassName;
 import flash.utils.getQualifiedSuperclassName;

+import mx.controls.AdvancedDataGrid;
 import mx.controls.listClasses.BaseListData;
 import mx.controls.listClasses.IDropInListItemRenderer;
 import mx.controls.listClasses.IListItemRenderer;
@@ -128,11 +129,6 @@
      */
     private var invalidateSizeFlag:Boolean = false;

-	/**
-	 *  @private
-	 */
-	private var dataIsColumn:Boolean = false;
-
     //--------------------------------------------------------------------------
     //
     //  Overridden properties: UIComponent
@@ -198,14 +194,6 @@
     {
         _data = value;

-		if (value != null)
-		{
-			// set it to false here as item renderers are re-used
-			dataIsColumn = false;
-			if (getQualifiedClassName(value) == "mx.controls.advancedDataGridClasses::AdvancedDataGridColumn")
-				dataIsColumn = true;
-		}
-
         dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
     }

@@ -216,7 +204,7 @@
     /**
      *  @private
      */
-    private var _listData:BaseListData;
+    private var _listData:AdvancedDataGridListData;

     [Bindable("dataChange")]

@@ -243,7 +231,7 @@
      */
     public function set listData(value:BaseListData):void
     {
-        _listData = value;
+        _listData = AdvancedDataGridListData(value);
         if (nestLevel && !invalidatePropertiesFlag)
         {
             UIComponentGlobals.layoutManager.invalidateProperties(this);
@@ -308,7 +296,7 @@
     {
         if (data && parent)
         {
-			var adg:Object = _listData.owner;
+			var adg:AdvancedDataGrid = AdvancedDataGrid(_listData.owner);
             var newColor:Number;

             if (adg.isItemHighlighted(_listData.uid))
@@ -457,14 +445,14 @@
         invalidatePropertiesFlag = false;
         if (_listData)
         {
-            var dg:Object = _listData.owner;
-
-            var column:Object =
+            var dg:AdvancedDataGrid = AdvancedDataGrid(_listData.owner);
+
+            var column:AdvancedDataGridColumn =
                 dg.columns[_listData.columnIndex];

             text = _listData.label;

-            if (dataIsColumn)
+            if (_data is AdvancedDataGridColumn)
                 wordWrap = dg.columnHeaderWordWrap(column);
             else
                 wordWrap = dg.columnWordWrap(column);
@@ -479,7 +467,7 @@
                 dataTips = false;
             if (dataTips)
             {
-                if (!dataIsColumn && (textWidth > width
+                if (!(_data is AdvancedDataGridColumn) && (textWidth > width
                     || column.dataTipFunction || column.dataTipField
                     || dg.dataTipFunction || dg.dataTipField))
                 {