Transferred from the Adobe Open Source Subversion Repository

Revision: 4357
Author:   egreenfi@adobe.com
Date:     2008-12-18T23:52:27.017290Z

Log Message:
-----------
UIComponent now implements ILayoutElement directly

ILayoutElement was moved to mx.core.ILayoutElement, as it is now a core interface required by UIComponent.

Further phases to follow:
1) IVlisualElement to extend ILayoutElement, pending resolution of a compiler bug.
2) remove LayoutElementUIC, pending UIMovieclip implementing ILayoutElement
3) remove LayoutElementFactory, once all IVisualElements implement ILayoutElement directly.
4) remove ITransformable, moving transform properties onto IVisualElement.

Reviewer: Evtim
QA: yes.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/layout/layout_tester.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/MatrixUtil.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/ILayoutElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</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/flex4/src/mx/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxScrollerSkin.mxml</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/components/FxVSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutElementFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVScrollBar.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/LayoutElementUIComponentUtils.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/utils/MatrixUtil.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/ILayoutElement.as" copyfrom-rev="4249" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutElementUIC.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/framework/src/mx/core/ILayoutElement.as
+++ frameworks/projects/framework/src/mx/core/ILayoutElement.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.layout
+package mx.core
 {

 import flash.geom.Matrix;
@@ -66,13 +66,7 @@
      * @copy mx.core.IVisualElement#percentHeight
      */
     function get percentHeight():Number;
-
-    /**
-     *  A reference to the object in the layout tree
-     *  represented by this interface.
-     */
-    function get target():Object;
-
+
     /**
      *  Indicates whether the layout should ignore this element or not.
      */
@@ -92,7 +86,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getPreferredWidth(postTransform:Boolean=true):Number;
+    function getPreferredBoundsWidth(postTransform:Boolean=true):Number;

     /**
      *  @return Returns the element's preferred height.  Preferred height is
@@ -108,7 +102,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getPreferredHeight(postTransform:Boolean=true):Number;
+    function getPreferredBoundsHeight(postTransform:Boolean=true):Number;

     /**
      *  Returns the element's minimum width.
@@ -122,7 +116,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getMinWidth(postTransform:Boolean=true):Number;
+    function getMinBoundsWidth(postTransform:Boolean=true):Number;

     /**
      *  Returns the element's minimum height.
@@ -136,7 +130,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getMinHeight(postTransform:Boolean=true):Number;
+    function getMinBoundsHeight(postTransform:Boolean=true):Number;

     /**
      *  Returns the element's maximum width.
@@ -150,7 +144,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getMaxWidth(postTransform:Boolean=true):Number;
+    function getMaxBoundsWidth(postTransform:Boolean=true):Number;

     /**
      *  Returns the element's maximum height.
@@ -164,7 +158,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getMaxHeight(postTransform:Boolean=true):Number;
+    function getMaxBoundsHeight(postTransform:Boolean=true):Number;

     /**
      *  Returns the element's layout width. This is the size that the element uses
@@ -179,7 +173,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getLayoutWidth(postTransform:Boolean=true):Number;
+    function getLayoutBoundsWidth(postTransform:Boolean=true):Number;

     /**
      *  Returns the element's layout height. This is the size that the element uses
@@ -194,7 +188,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getLayoutHeight(postTransform:Boolean=true):Number;
+    function getLayoutBoundsHeight(postTransform:Boolean=true):Number;

     /**
      *  Returns the x coordinate that the element uses to draw on screen.
@@ -208,7 +202,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getLayoutPositionX(postTransform:Boolean=true):Number;
+    function getLayoutBoundsX(postTransform:Boolean=true):Number;

     /**
      *  Returns the y coordinate that the element uses to draw on screen.
@@ -222,7 +216,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function getLayoutPositionY(postTransform:Boolean=true):Number;
+    function getLayoutBoundsY(postTransform:Boolean=true):Number;

     /**
      *  Sets the coordinates that the element uses to draw on screen.
@@ -239,7 +233,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function setLayoutPosition(x:Number, y:Number, postTransform:Boolean=true):void;
+    function setLayoutBoundsPosition(x:Number, y:Number, postTransform:Boolean=true):void;

     /**
      *  Sets the layout size to the specified dimensions.  This is the size that
@@ -271,7 +265,7 @@
      *  @see mx.core.UIComponent#layoutMatrix
      *  @see mx.core.UIComponent#layoutMatrix3D
      */
-    function setLayoutSize(width:Number = Number.NaN,
+    function setLayoutBoundsSize(width:Number = Number.NaN,
                            height:Number = Number.NaN,
                            postTransform:Boolean=true):void;


Transferred from the Adobe Open Source Subversion Repository

Revision: 3084
Author:   gosmith@adobe.com
Date:     2008-09-03T21:36:10.316853Z

Log Message:
-----------
The Gumbo TextArea now supports scrolling.

When the Scroller component is ready for use, TextAreaSkin will use it, but for now I've made TextArea have optional skin parts named horizontalScrollBar and verticalScrollBar. Their presence or absence is determined by new properties, horizontalScrollPolicy and verticalScrollPolicy, which can be "on" or "off". (An "auto" setting is not yet supported, but will be for Scroller.) By default the vertical scroll bar is on and the horizontal scroll bar is off.

Also, TextArea no longer extends TextInput. Instead both extend a new TextBase class.

Reviewer: Deepa and Glenn
Bugs: -
QA: No
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/TextAreaSkin.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextInput.as</path>

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

--- frameworks/projects/spark/src/spark/components/TextInput.as
+++ frameworks/projects/spark/src/spark/components/TextInput.as
@@ -22,37 +22,20 @@
 import text.formats.LineBreak;

 //--------------------------------------
-//  Events
+//  Other metadata
 //--------------------------------------

-/**
- *  Dispached after the selectionAnchorPosition and/or
- *  selectionActivePosition properties have changed
- *  due to a user interaction.
- */
-[Event(name="selectionChange", type="flash.events.Event")]
+[DefaultProperty("text")]

 /**
- *  Dispatched before a user editing operation occurs.
- *  You can alter the operation, or cancel the event
- *  to prevent the operation from being processed.
+ *  The built-in set of states for the TextInput component.
  */
-[Event(name="changing", type="flex.events.TextOperationEvent")]
-
-/**
- *  Dispatched after a user editing operation is complete.
- */
-[Event(name="change", type="flex.events.TextOperationEvent")]
-
-/**
- *  Dispatched when the user presses the Enter key.
- */
-[Event(name="enter", type="flash.events.Event")]
+[SkinStates("enabled", "disabled")]

 /**
  *  Documentation is not currently available.
  */
-public class TextInput extends SkinnableComponent
+public class TextInput extends TextBase
 {
     include "../core/Version.as";

@@ -70,180 +53,6 @@
 		super();
 	}

-    //--------------------------------------------------------------------------
-    //
-    //  Overridden properties: UIComponent
-    //
-    //--------------------------------------------------------------------------
-
-	//----------------------------------
-	//  enabled
-    //----------------------------------
-
-	/**
-	 *  @private
-	 */
-	override public function set enabled(value:Boolean):void
-	{
-		if (value == enabled)
-			return;
-
-		super.enabled = value;
-
-		invalidateSkinState();
-	}
-
-    //--------------------------------------------------------------------------
-    //
-    //  Properties
-    //
-    //--------------------------------------------------------------------------
-
-	//----------------------------------
-	//  selectionActivePosition
-    //----------------------------------
-
-	/**
-	 *  @private
-	 */
-	private var _selectionActivePosition:int = -1;
-
-	/**
-	 *  @private
-	 */
-	private var selectionActivePositionChanged:Boolean = false;
-
-	[Bindable("selectionChange")]
-
-	/**
-	 *  The active position of the selection.
-	 *  The "active" point is the end of the selection
-	 *  which is changed when the selection is extended.
-	 *  The active position may be either the start
-	 *  or the end of the selection.
-	 *
-	 *  @default -1
-	 */
-	public function get selectionActivePosition():int
-	{
-		return _selectionActivePosition;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set selectionActivePosition(value:int):void
-	{
-		if (value == _selectionActivePosition)
-			return;
-
-		_selectionActivePosition = value;
-		selectionActivePositionChanged = true;
-
-		invalidateProperties();
-
-		dispatchEvent(new Event("selectionChange"));
-	}
-
-	//----------------------------------
-	//  selectionAnchorPosition
-    //----------------------------------
-
-	/**
-	 *  @private
-	 */
-	private var _selectionAnchorPosition:int = -1;
-
-	/**
-	 *  @private
-	 */
-	private var selectionAnchorPositionChanged:Boolean = false;
-
-	[Bindable("selectionChange")]
-
-	/**
-	 *  The anchor position of the selection.
-	 *  The "anchor" point is the stable end of the selection
-	 *  when the selection is extended.
-	 *  The anchor position may be either the start
-	 *  or the end of the selection.
-	 *
-	 *  @default -1
-	 */
-	public function get selectionAnchorPosition():int
-	{
-		return _selectionAnchorPosition;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set selectionAnchorPosition(value:int):void
-	{
-		if (value == _selectionAnchorPosition)
-			return;
-
-		_selectionAnchorPosition = value;
-		selectionAnchorPositionChanged = true;
-
-		invalidateProperties();
-
-		dispatchEvent(new Event("selectionChange"));
-	}
-
-    //----------------------------------
-	//  text
-    //----------------------------------
-
-	/**
-	 *  @private
-	 */
-	private var _text:String = "";
-
-	/**
-	 *  @private
-	 */
-	private var textChanged:Boolean = false;
-
-	[Bindable("change")]
-	[Bindable("textChanged")]
-
-	/**
-	 *  The text String displayed by this TextInput.
-	 */
-	public function get text():String
-	{
-		return _text;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set text(value:String):void
-	{
-		if (value == _text)
-			return;
-
-		_text = value;
-		textChanged = true;
-
-		invalidateProperties();
-
-		dispatchEvent(new Event("textChanged"));
-	}
-
-    //----------------------------------
-	//  textView
-    //----------------------------------
-
-    [SkinPart]
-
-	/**
-	 *  The TextView that must be present
-	 *  in any skin assigned to this TextInput.
-	 */
-	public var textView:TextView;
-
 	//----------------------------------
 	//  widthInChars
     //----------------------------------
@@ -305,24 +114,6 @@
 			textView.widthInChars = _widthInChars;
 			widthInCharsChanged = false;
 		}
-
-		if (textChanged)
-		{
-			textView.text = _text;
-			textChanged = false;
-		}
-
-		if (selectionAnchorPositionChanged)
-		{
-			textView.selectionAnchorPosition = _selectionAnchorPosition;
-			selectionAnchorPositionChanged = false
-		}
-
-		if (selectionActivePositionChanged)
-		{
-			textView.selectionActivePosition = _selectionActivePosition;
-			selectionActivePositionChanged = false
-		}
 	}

 	/**
@@ -338,34 +129,9 @@
             textView.heightInLines = 1;
             textView.lineBreak = LineBreak.EXPLICIT;
 			textView.multiline = false;
-
-			// Start listening for various events from the TextView.
-			textView.addEventListener("selectionChange",
-									  textView_selectionChangeHandler);
-			textView.addEventListener("changing", textView_changingHandler);
-			textView.addEventListener("change", textView_changeHandler);
-			textView.addEventListener("enter", textView_enterHandler);
 		}
 	}

-	/**
-	 *  @private
-	 */
-	override protected function partRemoved(partName:String, instance:*):void
-	{
-		super.partRemoved(partName, instance);
-
-		if (instance == textView)
-		{
-			// Stop listening for various events from the TextView.
-			textView.removeEventListener("selectionChange",
-										 textView_selectionChangeHandler);
-			textView.removeEventListener("changing", textView_changingHandler);
-			textView.removeEventListener("change", textView_changeHandler);
-			textView.removeEventListener("enter", textView_enterHandler);
-		}
-	}
-
 	/**
 	 *  @private
 	 */
@@ -373,69 +139,6 @@
 	{
 		return enabled ? "enabled" : "disabled";
 	}
-
-	//--------------------------------------------------------------------------
-    //
-    //  Event handlers
-    //
-    //--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  Called when the TextView dispatches a 'selectionChange' event.
-	 */
-	private function textView_selectionChangeHandler(event:Event):void
-	{
-		// Update our storage variables for the selection indices.
-		_selectionAnchorPosition = textView.selectionAnchorPosition;
-		_selectionActivePosition = textView.selectionActivePosition;
-
-		// Redispatch the event that came from the TextView.
-		dispatchEvent(event);
-	}
-
-	/**
-	 *  @private
-	 *  Called when the TextView dispatches a 'change' event
-	 *  after an editing operation.
-	 */
-	private function textView_changeHandler(event:TextOperationEvent):void
-	{
-		// Update our storage variable for the text string.
-		_text = textView.text;
-
-		// Redispatch the event that came from the TextView.
-		dispatchEvent(event);
-	}
-
-	/**
-	 *  @private
-	 *  Called when the TextView dispatches a 'changing' event
-	 *  before an editing operation.
-	 */
-	private function textView_changingHandler(event:TextOperationEvent):void
-	{
-		// Redispatch the event that came from the TextView.
-		var newEvent:Event = event.clone();
-		dispatchEvent(newEvent);
-
-		// If the event dispatched from this TextInput is canceled,
-		// cancel the one from the TextView, which will prevent
-		// the editing operation from being processed.
-		if (newEvent.isDefaultPrevented())
-			event.preventDefault();
-	}
-
-	/**
-	 *  @private
-	 *  Called when the TextView dispatches an 'enter' event
-	 *  in response to the Enter key.
-	 */
-	private function textView_enterHandler(event:Event):void
-	{
-		// Redispatch the event that came from the TextView.
-		dispatchEvent(event);
-	}
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 12431
Author:   cframpto@adobe.com
Date:     2009-12-03T14:54:39.738694Z

Log Message:
-----------
TextInput always has lineBreak set to explicit after the skin is loaded.  For interactive input, this implies the control will be one line because multiline=false means the ENTER will commit the input.  If the text is set to a string containing newlines there can be more than one line in the component.

QE notes:
Doc notes:
Bugs: SDK-24362
Reviewer: Gordon
Tests run: checkintests, TextInput, NumericStepper
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/TextInput.as
+++ frameworks/projects/spark/src/spark/components/TextInput.as
@@ -123,7 +123,7 @@
  *
This control dispatches a FlexEvent.ENTER event
  *  when the user pressed the Enter key rather than inserting a line
  *  break, because this control does not support entering multiple
- *  lines of text.

+ *  lines of text. By default, this control has explicit line breaks.

  *
  *
This control is a skinnable control whose skin contains a
  *  RichEditableText instance that handles displaying and editing the text.
@@ -352,6 +352,10 @@
         if (instance == textDisplay)
         {
             textDisplay.multiline = false;
+
+            // Single line for interactive input.  Multi-line text can be
+            // set.
+            textDisplay.setStyle("lineBreak", "explicit");

             // TextInput should always be 1 line.
             textDisplay.heightInLines = 1;


fixed bug where flattening a function lost the bindThis value.

Change-Id: Idf652591f62b9b8b93e6a27952bf0bafeeba5c18

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -2720,7 +2720,7 @@
 								funcParams[FUNCTION_PARAM_NAMES],
 								funcParams[FUNCTION_PARAM_VALUES],
 								false,
-								method == operators['=>'] ? builtInSymbolTable['this'] : null
+								method == operators['=>'] || cascadeThisScope ? builtInSymbolTable['this'] : null
 							);
 						}
 						else if (call.evaluatedHost is Proxy)


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/automation/src/mx/automation/delegates/core/ContainerAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/core/ContainerAutomationImpl.as
@@ -0,0 +1,360 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.automation.delegates.core
+{
+
+	import flash.display.DisplayObject;
+	import flash.events.Event;
+	import flash.events.MouseEvent;
+
+	import mx.automation.Automation;
+	import mx.automation.IAutomationObject;
+	import mx.automation.IAutomationObjectHelper;
+	import mx.automation.tabularData.ContainerTabularData;
+	import mx.core.Application;
+	import mx.core.Container;
+	import mx.core.EventPriority;
+	import mx.events.ScrollEvent;
+	import mx.events.ScrollEventDetail;
+	import mx.events.ScrollEventDirection;
+	import mx.core.mx_internal;
+	use namespace mx_internal;
+
+
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines the methods and properties required to perform instrumentation for the
+	 *  Container class.
+	 *
+	 *  @see mx.core.Container
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class ContainerAutomationImpl extends UIComponentAutomationImpl
+	{
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(Container, ContainerAutomationImpl);
+		}
+
+		/**
+		 *  Constructor.
+		 * @param obj Container object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function ContainerAutomationImpl(obj:Container)
+		{
+			super(obj);
+
+			obj.addEventListener(ScrollEvent.SCROLL, scroll_eventHandler, false, 0, true);
+			//obj.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler,
+			//       false, EventPriority.DEFAULT+1, true );
+			addMouseEvent(obj, MouseEvent.MOUSE_WHEEL, mouseWheelHandler,false, EventPriority.DEFAULT+1, true );
+
+		}
+
+		/**
+		 *  @private
+		 */
+		private function get container():Container
+		{
+			return uiComponent as Container;
+		}
+
+		/**
+		 *  @private
+		 *  Holds the previous scroll event object. This is used to prevent recording
+		 *  multiple scroll events.
+		 */
+		private var previousEvent:ScrollEvent;
+
+		/**
+		 *  @private
+		 *  Flag used to control recording of scroll events.
+		 *  MouseWheel events are recorded as they are handled specially by the containers.
+		 *  The scrollEvent generated doesnot contain proper information for playback. Hence
+		 *  we record and playback mouseWheel events.
+		 */
+		private var skipScrollEvent:Boolean = false;
+
+		//----------------------------------
+		//  automationName
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationName():String
+		{
+			return container.label || super.automationName;
+		}
+
+		//----------------------------------
+		//  automationValue
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationValue():Array
+		{
+			if (container.label && container.label.length != 0)
+				return [ container.label ];
+
+			var result:Array = [];
+			/*
+			var n:int = numAutomationChildren;
+			for (var i:int = 0; i < n; i++)
+			{
+			var child:IAutomationObject = getAutomationChildAt(i);
+			var x:Array = child.automationValue;
+			if (x && x.length != 0)
+			result.push(x);
+			}
+			*/
+
+			// the above code is replaced as below to avoid the usage of getAutomationChildAt in a loop
+			var childList:Array = getAutomationChildren();
+			if(childList)
+			{
+				var n:int = childList.length;
+				for (var i:int = 0; i < n; i++)
+				{
+					var child:IAutomationObject = childList[i];
+					var x:Array = child.automationValue;
+					if (x && x.length != 0)
+						result.push(x);
+				}
+			}
+			return result;
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function replayAutomatableEvent(event:Event):Boolean
+		{
+			if (event is ScrollEvent)
+			{
+				var scrollEvent:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
+
+				var se:ScrollEvent = ScrollEvent(event);
+
+				var vReplayer:IAutomationObject = (container.verticalScrollBar as IAutomationObject);
+				var hReplayer:IAutomationObject = (container.horizontalScrollBar as IAutomationObject);
+
+				if (se.direction == ScrollEventDirection.VERTICAL && vReplayer)
+					vReplayer.replayAutomatableEvent(se);
+
+				else if (se.direction == ScrollEventDirection.HORIZONTAL && hReplayer)
+					hReplayer.replayAutomatableEvent(se);
+
+				return true;
+			}
+			else if (event is MouseEvent && event.type == MouseEvent.MOUSE_WHEEL)
+			{
+				var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+				help.replayMouseEvent(uiComponent, event as MouseEvent);
+				return true;
+			}
+
+			return super.replayAutomatableEvent(event);
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function createAutomationIDPart(child:IAutomationObject):Object
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help.helpCreateIDPart(uiAutomationObject, child);
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function createAutomationIDPartWithRequiredProperties(child:IAutomationObject, properties:Array):Object
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help.helpCreateIDPartWithRequiredProperties(uiAutomationObject, child,properties);
+		}
+
+
+		/**
+		 *  @private
+		 */
+		override public function resolveAutomationIDPart(part:Object):Array
+		{
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			return help.helpResolveIDPart(uiAutomationObject, part);
+		}
+
+
+
+
+		/**
+		 *  @private
+		 */
+
+		override public function get numAutomationChildren():int
+		{
+			return container.numChildren + container.numRepeaters ;
+		}
+
+		/**
+		 *  @private
+		 */
+
+		override public function getAutomationChildAt(index:int):IAutomationObject
+		{
+			if (index < container.numChildren)
+			{
+				var d:Object = container.getChildAt(index);
+				return d as IAutomationObject;
+			}
+
+			var r:Object = container.childRepeaters[index - container.numChildren];
+			return r as IAutomationObject;
+		}
+
+
+
+		/**
+		 * @private
+		 */
+		override public function getAutomationChildren():Array
+		{
+			var childList:Array = new Array();
+			var tempArray1:Array = container.getChildren();
+			var n:int = 0;
+			var i:int = 0;
+			if (tempArray1)
+			{
+				n = tempArray1.length;
+				for(i = 0; i < n ; i++)
+				{
+					childList.push(tempArray1[i]);
+				}
+			}
+
+
+
+			// get repeaters
+			var tempArray:Array = container.childRepeaters;
+			if(tempArray)
+			{
+				n = tempArray.length;
+				for(i = 0; i < n ; i++)
+				{
+					childList.push(tempArray[i] as IAutomationObject);
+
+				}
+			}
+
+
+			return childList;
+		}
+
+		//----------------------------------
+		//  automationTabularData
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationTabularData():Object
+		{
+			return new ContainerTabularData(uiAutomationObject);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Event handlers
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		public function scroll_eventHandler(event:ScrollEvent):void
+		{
+			// we skip recording a scroll event if a mouse wheel
+			// event has been recorded
+			if (skipScrollEvent)
+			{
+				skipScrollEvent = false;
+				return;
+			}
+			if (event.detail == ScrollEventDetail.THUMB_TRACK)
+				return;
+			// the checks have been added to prevent multiple recording
+			// of the same scroll event
+			if (!previousEvent || (event.delta && previousEvent.delta != event.delta) ||
+				previousEvent.detail != event.detail ||
+				previousEvent.direction != event.direction ||
+				previousEvent.position != event.position ||
+				previousEvent.type != event.type)
+			{
+				recordAutomatableEvent(event);
+				previousEvent = event.clone() as ScrollEvent;
+			}
+		}
+
+		/**
+		 *  @private
+		 */
+		private function mouseWheelHandler(event:MouseEvent):void
+		{
+			skipScrollEvent = true;
+			if (event.target == uiComponent)
+			{
+				recordAutomatableEvent(event, true);
+			}
+		}
+
+	}
+
+}


added template typing to getValueFromKey(), disabled

--- WeaveJS/src/weavejs/api/data/IAttributeColumn.as
+++ WeaveJS/src/weavejs/api/data/IAttributeColumn.as
@@ -44,6 +44,6 @@
 		 * @param dataType The desired value type (Examples: Number, String, Date, Array, IQualifiedKey)
 		 * @return The value associated with the given record key.
 		 */
-		function getValueFromKey(key:IQualifiedKey, dataType:Class = null):*;
+		function getValueFromKey/* /<T>/ */(key:IQualifiedKey, dataType:/* /new(..._:any[])=>T/ */Class = null):/* /T/ */*;
 	}
 }


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

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

 package mx.automation.delegates.controls
 {


Ignore unknown properties on decode to improve robustness

--- as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
@@ -760,32 +760,39 @@

                         if (seenProperties[propertyName])
                         {
-                            if (!((result[propertyName] is Array) || (result[propertyName] is ListCollectionView)))
+                            try
                             {
-                                if (shouldMakeBindable)
+                                if (!((result[propertyName] is Array) || (result[propertyName] is ListCollectionView)))
                                 {
-                                    result[propertyName] = objectFactory.newCollectionFrom(result[propertyName]);
-                                }
-                                else
-                                {
-                                    try
+                                    if (shouldMakeBindable)
                                     {
-                                        result[propertyName] = [result[propertyName]];
+                                        result[propertyName] = objectFactory.newCollectionFrom(result[propertyName]);
                                     }
-                                    catch (e:TypeError)
+                                    else
                                     {
-                                        if (e.errorID == 1034)
-                                        {// must be a non-array thingy. IGNORE
-                                            //trace("Ignoring TypeError on promote to Array on" + propertyName);
+                                        try
+                                        {
+                                            result[propertyName] = [result[propertyName]];
                                         }
-                                        else
-                                            throw e;
-
+                                        catch (e:TypeError)
+                                        {
+                                            if (e.errorID == 1034)
+                                            {// must be a non-array thingy. IGNORE
+                                                //trace("Ignoring TypeError on promote to Array on" + propertyName);
+                                            }
+                                            else
+                                                throw e;
+
+                                        }
                                     }
                                 }
+                                partObj = null; // we need a fresh object next element
+                                propertyIsArray = true;
                             }
-                            partObj = null; // we need a fresh object next element
-                            propertyIsArray = true;
+                            catch (e:ReferenceError)
+                            {
+                                trace("Property "+propertyName+" not found on "+ XObjUtils.getClassName(result) +". Check dynamic or missing prop");
+                            }
                         }
                     }


Added 'loginWithAccessToken' API (ref #14)

--- actionscript/src/com/marpies/ane/twitter/AIRTwitter.as
+++ actionscript/src/com/marpies/ane/twitter/AIRTwitter.as
@@ -176,6 +176,25 @@
             mLoginCallback = callback;

             mContext.call( "loginWithAccount", dialogTitle, cancelButtonLabel );
+        }
+
+        /**
+         * Initiates login process by providing existing access token and secret.
+         * @param token Access token to be used in the login request.
+         * @param secret Access token secret to be used in the login request.
+         * @param callback Function with signature callback(errorMessage:String, wasCancelled:Boolean):void.
+         */
+        public static function loginWithAccessToken( token:String, secret:String, callback:Function ):void {
+            if( !isSupported ) return;
+            validateExtensionContext();
+
+            if( token == null ) throw new ArgumentError( "Parameter token cannot be null." );
+            if( secret == null ) throw new ArgumentError( "Parameter secret cannot be null." );
+
+            mLoginInProgress = true;
+            mLoginCallback = callback;
+
+            mContext.call( "loginWithAccessToken", token, secret );
         }

         /**


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

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

 package mx.automation.delegates.controls
 {


Added small workaround to help avoid loss of connected devices in between runs (AIR bug as of 3.8.0.1240)

--- com/zehfernando/input/binding/KeyActionBinder.as
+++ com/zehfernando/input/binding/KeyActionBinder.as
@@ -19,9 +19,11 @@
 		// TODO:
 		// * isActionActivated() must properly support time tolerance
 		// * Allow sensitive controls to be treated as normal controls
+		// * think of a way to avoid axis injecting button pressed
 		// * Add gamepad index to return signals
 		// * Use caching samples?
 		// * Some missing asdocs
+		// * Error on initialization, devices missing - try workaround with static initializer: http://forums.adobe.com/message/5618821#5618821

 		// Properties
 		private var _isRunning:Boolean;
@@ -36,9 +38,16 @@
 		private var _onSensitiveActionChanged:SimpleSignal;				// Receives: action:String, value:Number (0-1)

 		private var stage:Stage;
-		private var gameInput:GameInput;
-
 		private var gameInputDevices:Vector.<GameInputDevice>;
+
+		private static var gameInput:GameInput;
+
+		// ================================================================================================================
+		// STATIC CONSTRUCTOR ---------------------------------------------------------------------------------------------
+
+		{
+			if (GameInput.isSupported) gameInput = new GameInput();
+		}

 		// ================================================================================================================
 		// CONSTRUCTOR ----------------------------------------------------------------------------------------------------
@@ -48,8 +57,6 @@
 			alwaysPreventDefault = true;
 			bindings = new Vector.<BindingInfo>();
 			actionsActivations = {};
-
-			if (GameInput.isSupported) gameInput = new GameInput();

 			_onActionActivated = new SimpleSignal();
 			_onActionDeactivated = new SimpleSignal();


Use external API to get current folder, better charset handling

--- core/flex/components/ApplicationClass.as
+++ core/flex/components/ApplicationClass.as
@@ -257,6 +257,7 @@
 		private function OnSelect(event:Event):void{
 			// get the page to upload to, set in flashvars
 			var uploadPage:String = Application.application.parameters.uploadPage;
+			uploadPage += "&dir="+ triggerJSEvent("currentFolder");

 			var tempSize:Number = _totalSize;


Updated CIListener to send ms instead of rounded sec.

--- FlexUnit4CIListener/src/org/flexunit/listeners/CIListener.as
+++ FlexUnit4CIListener/src/org/flexunit/listeners/CIListener.as
@@ -147,7 +147,7 @@
 			// called after each test
 			if(!lastFailedTest || description.displayName != lastFailedTest.displayName){
 				var desc:Descriptor = getDescriptorFromDescription(description);
-				sendResults("<testcase classname=\""+desc.suite+"\" name=\""+desc.method+"\" time=\"0.000\" status=\""+SUCCESS+"\" />");
+				sendResults("<testcase classname=\""+desc.suite+"\" name=\""+desc.method+"\" time=\"0\" status=\""+SUCCESS+"\" />");
 			}
 		}

@@ -162,7 +162,7 @@
 			var descriptor:Descriptor = getDescriptorFromDescription(description);

 			var xml:String =
-				"<testcase classname=\""+descriptor.suite+"\" name=\""+descriptor.method+"\" time=\"0.000\" status=\""+IGNORE+"\">"
+				"<testcase classname=\""+descriptor.suite+"\" name=\""+descriptor.method+"\" time=\"0\" status=\""+IGNORE+"\">"
 				+ "<skipped />"
 				+ "</testcase>";

@@ -191,7 +191,7 @@
 			if(FailureFormatter.isError(failure.exception))
 			{
 				xml =
-					"<testcase classname=\""+descriptor.suite+"\" name=\""+descriptor.method+"\" time=\"0.000\" status=\""+ERROR+"\">"
+					"<testcase classname=\""+descriptor.suite+"\" name=\""+descriptor.method+"\" time=\"0\" status=\""+ERROR+"\">"
 					+ "<error message=\"" + message + "\" type=\""+ type +"\" >"
 					+ "<![CDATA[" + stackTrace + "]]>"
 					+ "</error>"
@@ -200,7 +200,7 @@
 			else
 			{
 				xml =
-					"<testcase classname=\""+descriptor.suite+"\" name=\""+descriptor.method+"\" time=\"0.000\" status=\""+FAILURE+"\">"
+					"<testcase classname=\""+descriptor.suite+"\" name=\""+descriptor.method+"\" time=\"0\" status=\""+FAILURE+"\">"
 					+ "<failure message=\"" + message + "\" type=\""+ type +"\" >"
 					+ "<![CDATA[" + stackTrace + "]]>"
 					+ "</failure>"


[AssemblyTablePlayground] fixed context menu issue for column header; now copy/cut/paste menu items are enabled

git-svn-id: adbdea8fc1759bd16b0eaf24a244a7e5f870a654@183 fe3f0490-d73e-11de-a956-c71e7d3a9d2f

--- AssemblyTablePlayground/src/org/jbei/registry/components/assemblyTableClasses/ColumnHeader.as
+++ AssemblyTablePlayground/src/org/jbei/registry/components/assemblyTableClasses/ColumnHeader.as
@@ -122,6 +122,7 @@
                 label.width = column.metrics.width;

                 drawBackground();
+                drawLabel();

                 dropDownMenuButton.x = column.metrics.width - 20;
             }
@@ -276,6 +277,8 @@
                 label.x = 4;
                 label.y = 4;
                 label.height = 23;
+                label.includeInLayout = false;
+                label.visible = false;

                 label.text = column.title;

@@ -359,6 +362,25 @@
                 deleteColumnContextMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onDeleteColumnContextMenuItemClick);
                 contextMenu.customItems.push(deleteColumnContextMenuItem);
             }
+        }
+
+        private function drawLabel():void
+        {
+            label.validateNow();
+
+            var bitmapData:BitmapData = new BitmapData(label.width, label.height, true, 0x00FFFFFF);
+
+            var matrix:Matrix = new Matrix();
+            matrix.tx = 4;
+            matrix.ty = 4;
+
+            bitmapData.draw(label, matrix, null, null, new Rectangle(0, 0, label.width, label.height));
+
+            var g:Graphics = graphics;
+            g.lineStyle(0, 0xffffff, 0);
+            g.beginBitmapFill(bitmapData);
+            g.drawRect(0, 0, label.width, label.height);
+            g.endFill();
         }

         private function drawBackground():void


Temporarily turned of icomp in-place config

--- src/Modules/InstructionComparator.as
+++ src/Modules/InstructionComparator.as
@@ -23,6 +23,7 @@

 			setByConfig();
 			delay = 1;
+			configurableInPlace = false; //TODO: FIXME
 		}

 		override public function getConfiguration():Configuration {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/collections/Grouping.as
+++ frameworks/projects/advancedgrids/src/mx/collections/Grouping.as
@@ -0,0 +1,324 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.collections
+{
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[DefaultProperty("fields")]
+
+/**
+ *  The Grouping class defines the fields in the data provider of
+ *  the AdvancedDataGrid control used to group data. You use this
+ *  class to create groups when the input data to the AdvancedDataGrid control
+ *  has a flat structure.
+ *
+ *
To populate the AdvancedDataGrid control with grouped data,
+ *  you create an instance of the GroupingCollection class from your flat data,
+ *  and then pass that GroupingCollection instance to the data provider
+ *  of the AdvancedDataGrid control.
+ *  To specify the grouping fields of your flat data,
+ *  you pass a Grouping instance to
+ *  the GroupingCollection.grouping property.
+ *  The Grouping instance contains an Array of GroupingField instances,
+ *  one per grouping field.

+ *
+ *
The following example uses the Grouping class to define
+ *  two grouping fields: Region and Territory.

+ *
+ *

+ *  <mx:AdvancedDataGrid id="myADG"
+ *    <mx:dataProvider>
+ *      <mx:GroupingCollection id="gc" source="{dpFlat}">
+ *        <mx:grouping>
+ *          <mx:Grouping>
+ *            <mx:GroupingField name="Region"/>
+ *            <mx:GroupingField name="Territory"/>
+ *          </mx:Grouping>
+ *        </mx:grouping>
+ *      </mx:GroupingCollection>
+ *    </mx:dataProvider>
+ *
+ *    <mx:columns>
+ *      <mx:AdvancedDataGridColumn dataField="Region"/>
+ *      <mx:AdvancedDataGridColumn dataField="Territory"/>
+ *      <mx:AdvancedDataGridColumn dataField="Territory_Rep"/>
+ *      <mx:AdvancedDataGridColumn dataField="Actual"/>
+ *      <mx:AdvancedDataGridColumn dataField="Estimate"/>
+ *    </mx:columns>
+ *  </mx:AdvancedDataGrid>
+ *

+ *
+ *  @mxml
+ *
+ *  The <mx.Grouping> tag defines the following tag attributes:

+ *
+ *

+ *  <mx:Grouping
+ *  Properties
+ *    compareFunction="No default"
+ *    fields="null"
+ *    groupingObjectFunction="No default"
+ *    label="GroupLabel"
+ *  />
+ *

+ *
+ *  @see mx.controls.AdvancedDataGrid
+ *  @see mx.collections.GroupingCollection
+ *  @see mx.collections.GroupingField
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class Grouping
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function Grouping():void
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //  label
+    //---------------------------------
+
+    /**
+     *  The name of the field added to the flat data
+     *  to create the hierarchy.
+     *  The value of the top nodes (nodes representing the group fields)
+     *  in every group will be represented
+     *  by this property.
+     *  Use this property to specify a different name.
+     *
+     *  @default GroupLabel
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var label:String = "GroupLabel";
+
+    //---------------------------------
+    //  compareFunction
+    //---------------------------------
+
+    /**
+     *  @private
+     *  Storage for the compareFunction property.
+     */
+    private var _compareFunction:Function;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  The method used to compare items when sorting.
+     *  If you specify this property, Flex ignores any compareFunction
+     *  properties that you specify in the SortField objects that you
+     *  use in this class.
+     *
+     *
The compare function must have the following signature:

+     *

+     *     function [name](a:Object, b:Object, fields:Array=null):int

+     *
+     *
This function must return the following:

+     *

+     *
-1, if a should appear before b in
+     *        the sorted sequence.

+     *
0, if a equals b.

+     *
1, if a should appear after b in the
+     *        sorted sequence.

+     *

+     *
+     *
To return to the internal comparison function, set this value to
+     *  null.

+     *
+     *
The fields Array specifies the object fields
+     *  to compare.
+     *  Typically, the algorithm will compare properties until the field list is
+     *  exhausted or a non-zero value can be returned.
+     *  For example:

+     *
+     *

+     *    function myCompare(a:Object, b:Object, fields:Array=null):int
+     *    {
+     *        var result:int = 0;
+     *        var i:int = 0;
+     *        var propList:Array = fields ? fields : internalPropList;
+     *        var len:int = propList.length;
+     *        var propName:String;
+     *        while (result == 0 && (i < len))
+     *        {
+     *            propName = propList[i];
+     *            result = compareValues(a[propName], b[propName]);
+     *            i++;
+     *        }
+     *        return result;
+     *    }
+     *
+     *    function compareValues(a:Object, b:Object):int
+     *    {
+     *        if (a == null && b == null)
+     *            return 0;
+     *
+     *        if (a == null)
+     *          return 1;
+     *
+     *        if (b == null)
+     *           return -1;
+     *
+     *        if (a < b)
+     *            return -1;
+     *
+     *        if (a > b)
+     *            return 1;
+     *
+     *        return 0;
+     *    }

+     *
+     *
The default value is an internal compare function that can perform
+     *  a string, numeric, or date comparison in ascending or descending order,
+     *  with case-sensitive or case-insensitive string comparisons.
+     *  Specify your own function only if you need a custom comparison algorithm.
+     *  This is normally only the case if a calculated field is used in a display.

+     *
+     *
Alternatively, you can specify separate compare functions for each sort
+     *  field by using the SortField class compare property.
+     *  This way you can use the default comparison for some fields and a custom
+     *  comparison for others.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get compareFunction():Function
+    {
+        return _compareFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set compareFunction(value:Function):void
+    {
+        _compareFunction = value;
+    }
+
+    //----------------------------------
+    //  fields
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the fields property.
+     */
+    private var _fields:Array;
+
+    [Inspectable(category="General", arrayType="mx.collections.GroupingField")]
+
+    /**
+     *  An Array of GroupingField objects that specifies the fields
+     *  used to group the data.
+     *  The order of the GroupingField objects in the Array determines
+     *  field priority order when sorting.
+     *
+     *  @default null
+     *
+     *  @see GroupingField
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get fields():Array
+    {
+        return _fields;
+    }
+
+    /**
+     *  @private
+     */
+    public function set fields(value:Array):void
+    {
+        _fields = value;
+    }
+
+    //---------------------------------
+    //  groupingObjectFunction
+    //---------------------------------
+
+    /**
+     *  A callback function to run on each group node to determine the
+     *  grouping object.
+     *  By default, a new Object will be created for group nodes.
+     *
+     *
You can supply a groupingObjectFunction that provides the
+     *  appropriate Object for group nodes.

+     *
+     *
The method signature is:

+     *

+     *  myGroupObjectFunction(label:String):Object

+     *
+     *
Where label contains the value that will be
+     *  shown for that group node.
+     *  The function returns an Object which will be used for group nodes.

+     *
+     *  For example, a groupingObjectFunction which returns an Object
+     *  containing a "name" property with value as "Bob" can be written as -
+     *

+     *  private function groupObjFunction(label:String):Object
+     *  {
+     *      var obj:Object = {};
+     *      obj.name = "Bob";
+     *
+     *      return obj;
+     *  }
+     *

+     *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var groupingObjectFunction:Function;
+}
+
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/olap/DefaultCubeImpl.as
+++ frameworks/projects/advancedgrids/src/mx/olap/DefaultCubeImpl.as
@@ -0,0 +1,1353 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+package mx.olap
+{
+
+import flash.utils.getTimer;
+
+import mx.collections.ArrayCollection;
+import mx.collections.CursorBookmark;
+import mx.collections.IList;
+import mx.collections.IViewCursor;
+import mx.collections.Sort;
+import mx.collections.SortField;
+import mx.core.mx_internal;
+import mx.events.CubeEvent;
+
+use namespace mx_internal;
+
+/**
+ * @private
+ */
+public class DefaultCubeImpl implements IOLAPCubeImpl
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 * @private
+	 * Arrays holding indices of valid rows and columns.
+	 * They are used to eliminate rows and columns which do not
+	 * contain even a single valid value.
+	 */
+    private var validRows:Array;
+    private var validColumns:Array;
+
+	/**
+	 * @private
+	 * Index of row currently being processed.
+	 */
+    private var queryCubeRowIndex:int;
+
+	/**
+	 * @private
+	 * Index of column currently being processed.
+	 */
+    private var queryCubeColIndex:int;
+
+	/**
+	 * @private
+	 * Indicates whether the query results cube has been built or not.
+	 */
+    private var queryCubeBuilt:Boolean;
+
+	/**
+	 * @private
+	 * Indicates whether the tuples for the query has been built or not.
+	 */
+	private var queryTuplesBuilt:Boolean;
+
+	/**
+	 * @private
+	 * progress and total values to be processed in the query
+	 */
+	private var _queryProgress:int = 0;
+	private var _queryTotal:int = 0;
+
+	/**
+	 *  @private
+	 *  A single query tuple.
+	 */
+	private var queryTuple:OLAPTuple;
+
+	private var queryAxisPositions:Array;
+
+    // the column positions on the result's column axis
+	private var colPositions:Array; // array of OLAPAxisPositions
+
+    // the row positions on the result's row axis
+	private var rowPositions:Array; // array of OLAPAxisPositions
+
+    // the slicer positions on the result's slicer axis
+	private var slicerPositions:Array;
+
+	// the result object containing the query result
+	private var newResult:OLAPResult;
+
+	// the column axis of the result
+	private var colAxis:OLAPResultAxis;
+
+	// the row axis of the result
+	private var rowAxis:OLAPResultAxis;
+
+	// the slicer axis of the result
+	private var slicerAxis:OLAPResultAxis;
+
+	// container for all the tuples in the query
+	private var queryTuples:Array;
+
+	//same as rowPositions/columnPositions/slierPositions
+	private var colPos:IList;
+	private var rowPos:IList;
+
+	//the members on the slicer axis which need to be removed
+	//from the tuple to read aggregation result from the query cube
+	private var removableSlicerMembers:IList;
+
+	//if user has specified a measure on the slicer axis
+	//this one would point to it
+	private var measureInSlice:IOLAPMember;
+
+    //private var tupleCubeMembers:Array = [];
+
+	//array of all levels from all dimensions
+    private var levels:Array; //of IOLAPLevels;
+
+    //flag to indicate whether we are done with preparing
+    //for building the cube
+    private var prepared:Boolean = false;
+
+    //the bookmark to keep track of the data row we are processing
+    private var currentPosition:CursorBookmark = CursorBookmark.FIRST;
+
+    //the dataProvider cursor
+    private var iterator:IViewCursor = null;
+
+	//saved sort value
+    private var oldSort:Sort;
+
+    //sort object used to gather members of dimensions
+    private var newSort:Sort;
+
+	//Cube builder instance
+    private var nodeBuilder:CubeNodeBuilder;
+
+    //query cube builder instance
+    private var queryCubeBuilder:QueryCubeBuilder;
+
+	/**
+	 *  @private
+	 *  The function which should be invoked next, to build the query result.
+	 *  Each action function has the following signature.
+	 *      function action_fn_name(query:IOLAPQuery):Boolean
+	 *  Each action function performs its work and after completion switches
+	 *  the pointer to the next function that should be called.
+	 *  The last function to get called should set the pointer back to the
+	 *  'prepareForNewQuery' function.
+	 */
+	private var actionFunction:Function = prepareForNewQuery;
+
+	//flag indicates whether the query has a row axis or not
+	private var validRowPositions:Boolean = true;
+
+	//query row count can be zero when user has specified only column axis
+	private var queryRowCount:int;
+
+	//result row count is always > 0
+	private var resultRowCount:int;
+
+	//number of elements in the first query axis
+	private var queryColCount:int;
+
+	// a container to keep track of latest indices of query axis
+	// positions while tuples are being generated
+	private var tupleIndexObject:Object = {};
+
+	//if true signals that we have finished generating
+	//all the tuples.
+	private var reachedEnd:Boolean = false;
+
+	/*private var tempStartTime:int;
+	private var tOnce:Boolean;
+	private var cOnce:Boolean;
+	private var rOnce:Boolean;
+
+	private var totalRunCount:int = 0;
+	private var totalTupleTime:Number = 0;
+	private var totalCubeTime:Number = 0;
+	private var totalResultTime:Number= 0;
+	*/
+
+	protected var queryProgressEventThreashold:int = 1000;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 * @private
+	 * The cube on which the query is being run.
+	 */
+    private var _cube:OLAPCube;
+
+    public function set cube(c:IOLAPCube):void
+    {
+        _cube = c as OLAPCube;
+    }
+
+	/**
+	 * Returns the number of query tuples which have been processed
+	 * in the current iteration.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function get queryProgress():int
+	{
+		return _queryProgress;
+	}
+
+	/**
+	 * Returns the total number of query tuples being processed.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function get queryTotal():int
+	{
+		return _queryTotal;
+	}
+
+	//--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+	 *  Populates the result object with axis and data values computed based
+	 *  on the query. The computation happens in steps/stages.
+	 *  Returns true when the result is completely computed. A return value of
+	 *  false indicates that the function needs to be called again to continue
+	 *  the operation.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+    public function execute(query:IOLAPQuery, result:OLAPResult):Boolean
+    {
+        newResult = result;
+
+        var startTime:int = getTimer();
+        var actionResult:Boolean;
+        var timeTaken:int;
+
+        // if total time taken for a action is less than 10 ms
+        // call the action function again
+        do
+        {
+            actionResult = actionFunction(query);
+            timeTaken = getTimer() - startTime;
+        }
+        while (!actionResult && timeTaken < 10);
+
+
+        return actionResult;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	public function cancelQuery(q:IOLAPQuery):void
+	{
+        actionFunction = prepareForNewQuery;
+
+        //let us release all references
+        queryCubeBuilder = null;
+        validRows = validColumns = null;
+        queryTuples = null;
+	}
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	public function cancelRefresh():void
+	{
+        prepared = false;
+        currentPosition = CursorBookmark.FIRST;
+        iterator = null;
+
+        if (newSort)
+        {
+            _cube.dataProvider.sort = oldSort;
+            _cube.dataProvider.refresh();
+        }
+	}
+
+	public function refresh():void
+    {
+        //trace("Call buildCubeIteratively");
+        //while (!buildCubeIteratively());
+    }
+
+    /**
+	 *  @private
+	 *  Updates the OLAP cube by processing one data row at a time.
+	 *  Returns true when cube is completely built. A return value of false
+	 *  indicates that this function needs to be called again to complete
+	 *  cube building.
+	 */
+    public function buildCubeIteratively():Boolean
+    {
+        if (!_cube.dataProvider)
+            return true;
+
+        var level:OLAPLevel;
+        var attr:OLAPAttribute;
+
+        if (!prepared)
+        {
+            levels = []; //of IOLAPLevels;
+
+            // create as many levels as number of dimensions
+            for each (var dim:IOLAPDimension in _cube.dimensions)
+            {
+                //TODO should we skip this or just use this?
+                if (dim.isMeasure)
+                    continue;
+
+                for each (attr in dim.attributes)
+                {
+                	//include attributes which are not present in the hierarchy
+                	if (!attr.userHierarchyLevel)
+                        levels = levels.concat(attr.levels.toArray());
+                }
+
+                for each (var h:OLAPHierarchy in dim.hierarchies)
+                {
+                    levels = levels.concat(h.levels.toArray());
+                }
+            }
+
+            // sort the data as it makes decision about completion of handling
+
+            oldSort = _cube.dataProvider.sort;
+
+            //enable check to compare sort-cube performance
+            //if (!oldSort)
+            {
+                newSort = new Sort;
+                var fields:Array = [];
+
+                var field:SortField ;
+                for each (level in levels)
+                {
+                	if (level.attribute && level.attribute.userDataFunction)
+                    {
+                    	attr = level.attribute;
+	                    field= new SortField(attr.dataField);
+	                    field.compareFunction = attr.dataCompareFunction;
+		                fields.push(field);
+    	            }
+                	else
+                    {
+	                    field= new SortField(level.dataField);
+    	                fields.push(field);
+    	            }
+                }
+
+                newSort.fields = fields;
+                _cube.dataProvider.sort = newSort;
+                _cube.dataProvider.refresh();
+            }
+            nodeBuilder = null;
+            queryCubeBuilder = null;
+            initNodeBuilder();
+            prepared = true;
+
+            iterator = _cube.dataProvider.createCursor();
+            return false;
+        }
+
+        // go through each row of data
+        iterator.seek(currentPosition);
+
+        if (!iterator.afterLast && currentPosition != CursorBookmark.LAST)
+        {
+            var currentData:Object = iterator.current;
+            // Signals the builder to prepare itself for a new data row.
+            nodeBuilder.moveToNextRound();
+            var values:Array = [];
+            for each (level in levels)
+            {
+                // go through each dataField in the order of dimension (TODO or user specified order)
+                var value:Object = level.dataFunction(currentData, level.dataField);
+                values.push(value);
+            }
+            nodeBuilder.addValueToNodeBuilder(values, currentData);
+
+            iterator.moveNext();
+            currentPosition = iterator.bookmark;
+            return false;
+        }
+        else
+        {
+            if (!completeNodeBuilder())
+            	return false;
+            prepared = false;
+            currentPosition = CursorBookmark.FIRST;
+            iterator = null;
+
+            if (newSort)
+            {
+                _cube.dataProvider.sort = oldSort;
+                _cube.dataProvider.refresh();
+            }
+            return true;
+    	}
+    }
+
+	/**
+	 * @private
+	 * Method to be invoked repeatedly to generate tuples
+	 * for each combination of row and column query axis position
+	 * intersection. reachedEnd flag should be set to false to start
+	 * a fresh round of iteration.
+	 */
+	private function getNextTuple():OLAPTuple
+	{
+		//if we have reached end returns null
+		if (reachedEnd)
+			return null;
+
+    	var tempTuple:OLAPTuple = queryTuple;
+
+       	//add members from all query axes.
+       	var axisIndex:int = 0;
+       	for each (var pos:Array in queryAxisPositions)
+       	{
+          	tempTuple.addMembers(pos[ tupleIndexObject[axisIndex] ].members);
+          	++axisIndex;
+       	}
+       	//adjust for the last increment
+       	--axisIndex;
+
+       	//increment the axis index of the last query axis
+       	//if the last element of the last query axis has been reached
+       	//reset it to zero and increment the index of last-1 query axis
+       	//do this till we reach the last element of the first query axis
+   		var lastIndex:int = ++tupleIndexObject[axisIndex];
+       	if (lastIndex >= pos.length)
+       	{
+       		while(lastIndex >= pos.length)
+       		{
+	       		tupleIndexObject[axisIndex] = 0;
+    	   		++tupleIndexObject[axisIndex-1];
+    	   		lastIndex = tupleIndexObject[axisIndex-1];
+    	   		--axisIndex;
+    	   		//have we reached the last element of the first query axis?
+    	   		if (axisIndex != -1)
+    	   			pos = queryAxisPositions[axisIndex];
+    	   		else
+    	   		{
+    	   			//done!
+    	   			reachedEnd = true;
+    	   			break;
+    	   		}
+    	   	}
+       	}
+
+		return tempTuple;
+	}
+
+	/**
+	 * @private
+	 * Builds a array of tuples to build the query cube.
+	 */
+    private function buildQueryTuples(query:IOLAPQuery):Boolean
+    {
+        var member:IOLAPMember;
+
+        if (queryCubeColIndex < colPositions.length)
+        {
+            while (queryCubeRowIndex < queryRowCount || (!validRowPositions && queryCubeRowIndex == 0))
+            {
+                do
+                {
+                	//queryTuple would contain the resultant tuple
+                	getNextTuple();
+
+					if (isTupleValid(queryTuple))
+					{
+    				    validRows[queryCubeRowIndex] = 1;
+				        validColumns[queryCubeColIndex] = 1;
+
+                        if (!queryTuples[queryCubeRowIndex][queryCubeColIndex])
+	        	     		queryTuples[queryCubeRowIndex][queryCubeColIndex] = [ queryTuple ];
+	            	 	else
+	             		{
+	             			queryTuples[queryCubeRowIndex][queryCubeColIndex].push(queryTuple);
+	             		}
+	             		//allocate new tuple for next iteration
+                    	queryTuple = new OLAPTuple();
+	    			}
+	    			else
+	    			{
+	    				//we didn't use the tuple so we can reuse it
+	    				queryTuple.clear();
+	    			}
+                } while(!reachedEnd && queryCubeColIndex == tupleIndexObject[0] &&
+                		queryCubeRowIndex == tupleIndexObject[1]);
+
+                ++queryCubeRowIndex;
+                return false;
+            }
+
+       		queryCubeRowIndex = 0;
+            ++queryCubeColIndex;
+            return false;
+        }
+
+		//remove unused columns and rows.
+		var n:int = validRows.length;
+		for (var i:int = n - 1; i > -1; --i)
+		{
+			if (validRows[i] == undefined)
+			{
+				rowPositions.splice(i, 1);
+				queryTuples.splice(i, 1);
+			}
+		}
+
+		queryRowCount = rowPositions.length;
+
+		n = validColumns.length;
+		for (i = n - 1; i > -1; --i)
+		{
+			if (validColumns[i] == undefined)
+			{
+				colPositions.splice(i, 1);
+	            for each (var a:Array in queryTuples)
+	            {
+	                a.splice(i, 1);
+	            }
+			}
+		}
+
+		_queryProgress = 0;
+		queryCubeRowIndex = 0;
+		queryCubeColIndex = 0;
+		queryTuplesBuilt = true;
+		validRows = validColumns = null;
+		return true;
+    }
+
+	/**
+	 *  @private
+	 *  Builds the query cube step by step. Returns false
+	 *  if the process is not complete and this function
+	 *  needs to be called again.
+	 *
+	 */
+    private function buildQueryCube(query:IOLAPQuery):Boolean
+    {
+        var member:IOLAPMember;
+        var cubeToRead:CubeNode = rootNode;
+        //build the sub cube with the query result values
+        var tuple:OLAPTuple;// = new OLAPTuple;
+
+		if (!queryCubeBuilder)
+        {
+			//prepare a new query result cube
+        	initQueryNodeBuilder();
+
+			validRows = new Array(queryRowCount);
+			validColumns = new Array(colPositions.length);
+			queryCubeRowIndex = 0;
+       		queryCubeColIndex = 0;
+        }
+
+        if (queryCubeColIndex < colPositions.length)
+        {
+            var tupleMember:IOLAPMember;
+            while (queryCubeRowIndex < queryRowCount || (!validRowPositions && queryCubeRowIndex == 0))
+            {
+            	var tArray:Array = queryTuples[queryCubeRowIndex][queryCubeColIndex];
+
+                if (!tArray)
+                {
+                    ++queryCubeRowIndex;
+                	continue;
+                }
+
+                for each (tuple in tArray)
+                {
+					var generatedTupleMembers:Array = tuple.membersArray;
+
+	                var value:* = cubeToRead;
+
+	                //skip the last measure level;
+	                var memCount:int = generatedTupleMembers.length -1;
+	                var tupleIndex:int;
+					var userMembers:Array = tuple.explicitMembers.toArray();
+					validRows[queryCubeRowIndex] = 1;
+					validColumns[queryCubeColIndex] = 1;
+
+	                value = cubeToRead;
+	                moveToNextRoundQuery();
+
+	                var prevMemberName:String;
+					for (tupleIndex = 0; tupleIndex < memCount; ++tupleIndex)
+	                {
+	                    tupleMember = generatedTupleMembers[tupleIndex];
+	                    //check for member existence
+	                    //Is this check redundant as the tuple has already been validated?
+	                    if (value.hasOwnProperty(tupleMember.name))
+	                    {
+	                        value = value[tupleMember.name];
+	                        prevMemberName = tupleMember.uniqueName;
+	                        addValueToQueryNodeBuilder(tupleMember.uniqueName, value);
+	                    }
+	                    else
+	                    {
+	                        // remove the position from the axis
+	                        value = undefined;
+	                        break;
+	                    }
+	                }
+
+	                if (value != undefined)
+	                {
+	                    if (value is CubeNode)
+	                        value = value[allNodePropertyName];
+
+	                    var measure:OLAPMeasure = generatedTupleMembers[generatedTupleMembers.length-1] as OLAPMeasure;
+	                   	addMeasureToQueryNodeBuilder(tupleMember.uniqueName, value, measure);
+	                }
+                }
+                ++queryCubeRowIndex;
+                return false;
+            }
+
+       		queryCubeRowIndex = 0;
+            ++queryCubeColIndex;
+            return false;
+        }
+
+        completeQueryNodeBuilding();
+
+		//remove unused columns and rows.
+		for (var temp:int = validRows.length-1; temp > -1; --temp)
+		{
+			if (validRows[temp] == undefined)
+			{
+				rowPositions.splice(temp, 1);
+				queryTuples.splice(temp, 1);
+			}
+		}
+
+		queryRowCount = rowPositions.length;
+
+		for (temp = validColumns.length-1; temp > -1; --temp)
+		{
+			if (validColumns[temp] == undefined)
+			{
+				colPositions.splice(temp, 1);
+	            for each (var a:Array in queryTuples)
+	            {
+	                a.splice(temp, 1);
+	            }
+			}
+		}
+
+		_queryProgress = 0;
+		queryCubeRowIndex = 0;
+		queryCubeColIndex = 0;
+		queryCubeBuilt = true;
+		return true;
+    }
+
+	/**
+	 *  @private
+	 *  Prepares the result object.
+	 *
+	 */
+	private function prepareResult(query:IOLAPQuery):void
+	{
+		queryCubeBuilt = false;
+		queryTuplesBuilt = false;
+    	colPositions = [];
+    	rowPositions = [];
+    	queryTuples = [];
+    	queryTuple = new OLAPTuple();
+
+    	queryAxisPositions = [];
+
+        var member:IOLAPMember;
+        var position:OLAPAxisPosition;
+        var queryIndex:int = 0;
+        var queryAxis:OLAPQueryAxis = query.getAxis(queryIndex) as OLAPQueryAxis;
+        while (queryAxis)
+        {
+	        var queryPositions:Array = [];
+	        for each (var t:OLAPTuple in queryAxis.tuples)
+	        {
+	            position = new OLAPAxisPosition;
+	            for each (member in t.explicitMembers)
+	                position.addMember(member);
+				queryPositions.push(position);
+	        }
+
+	        if (queryPositions.length)
+	        {
+		        queryAxisPositions.push(queryPositions);
+
+				//add a new result axis
+				newResult.setAxis(queryIndex, new OLAPResultAxis());
+
+				//initialize the index object map
+				tupleIndexObject[queryIndex] = 0;
+	        }
+
+	        ++queryIndex;
+	        queryAxis = query.getAxis(queryIndex) as OLAPQueryAxis;
+	    }
+
+        colPositions = queryAxisPositions[0];
+
+        if (queryAxisPositions[1])
+        	rowPositions = queryAxisPositions[1];
+
+		colAxis = newResult.getAxis(0) as OLAPResultAxis;
+		rowAxis = newResult.getAxis(1) as OLAPResultAxis;
+		if (!rowAxis)
+		{
+			rowAxis = new OLAPResultAxis();
+			newResult.setAxis(OLAPResult.ROW_AXIS, rowAxis);
+		}
+
+		slicerAxis = newResult.getAxis(2) as OLAPResultAxis;
+   		slicerPositions = queryAxisPositions[2];
+
+	}
+
+	/**
+	 *  @private
+	 *  Dispatch the query progress event
+	 *
+	 */
+	private function dispatchCubeProgress(progress:int, total:int, message:String=null):void
+	{
+		var ev:CubeEvent = new CubeEvent(CubeEvent.QUERY_PROGRESS);
+		ev.progress = progress;
+		ev.total = total;
+		if (!message)
+			ev.message = "Processing cell : " + progress + " of " + total;
+		ev.message = message;
+		_cube.dispatchEvent(ev);
+	}
+
+	/**
+	 *  @private
+	 *  Insert a value into the object result.
+	 *
+	 */
+	private function insertResult():Boolean
+	{
+        var mainCubeTuple:OLAPTuple;//= new OLAPTuple;
+        while (queryCubeColIndex < colPos.length)
+        {
+            while (queryCubeRowIndex < rowPos.length || (rowPos.length == 0 && queryCubeRowIndex ==0))
+            {
+            	var tArray:Array = queryTuples[queryCubeRowIndex][queryCubeColIndex];
+
+	            if (!tArray)
+            	{
+	            	++queryCubeRowIndex;
+	            	continue;
+                }
+
+            	// we use the first tuple in the tuples array to read the resultant
+            	// aggregation value
+                mainCubeTuple = tArray[0];
+
+                // we need to initialize it for each loop
+                var value:* = undefined;
+
+                //attempt a read from the query cube.
+                if (queryRootNode)
+	            {
+                	// to read from the query cube we need to remove
+                	// the slicer members as we need to only read
+                	// the aggregated value.
+	            	if (removableSlicerMembers && removableSlicerMembers.length)
+	                {
+		                mainCubeTuple.removeElementsAtEnd(removableSlicerMembers.length);
+		                if (measureInSlice)
+		                	mainCubeTuple.addMember(measureInSlice);
+		            }
+                    value = readCubeCell(queryRootNode, false, mainCubeTuple.membersArray);
+                }
+				//attempt a read from the main cube as we failed to read from the
+				//query cube.
+				else if (value == undefined)
+                {
+                	//OLAPTrace.traceMsg("Reading from the main cube.", OLAPTrace.TRACE_LEVEL_2);
+                	value = readCubeCell(rootNode, true, mainCubeTuple.membersArray);
+                }
+
+                if (value != undefined)
+                {
+                    validRows[queryCubeRowIndex] = 1;
+                    validColumns[queryCubeColIndex] = 1;
+                    newResult.setCell(queryCubeRowIndex, queryCubeColIndex, Number(value));
+	            }
+
+                ++queryCubeRowIndex;
+                return false;
+            }
+            queryCubeRowIndex = 0;
+            ++queryCubeColIndex;
+            return false;
+        }
+
+        return true;
+	}
+
+	/**
+	 *  @private
+	 *  Prepare for building the query tuples, query cube and query result.
+	 *
+	 */
+	private function prepareForNewQuery(query:IOLAPQuery):Boolean
+	{
+    	/*
+    	++totalRunCount;
+    	tempStartTime = getTimer();
+    	tOnce = cOnce = rOnce = false;
+    	*/
+    	queryCubeBuilder = null;
+    	prepareResult(query);
+    	validRows = validColumns = null;
+    	_queryProgress = 0;
+
+    	// Even if user has not specified a row axis
+    	// we will have one row in the result
+        if (rowPositions.length)
+        {
+        	validRowPositions = true;
+        	queryRowCount = resultRowCount = rowPositions.length;
+        }
+        else
+        {
+        	validRowPositions = false;
+        	// we will have minimum of one row
+        	resultRowCount = 1;
+        	queryRowCount = 0;
+        }
+
+    	_queryTotal = resultRowCount * colPositions.length;
+		dispatchCubeProgress(_queryProgress, _queryTotal);
+		newResult.query = query;
+		actionFunction = buildQueryTuplesAction;
+
+
+		validRows = new Array(resultRowCount);
+		validColumns = new Array(colPositions.length);
+		queryCubeRowIndex = 0;
+   		queryCubeColIndex = 0;
+   		queryTuples = new Array(resultRowCount);
+   		for (var index:int = 0; index < resultRowCount; ++index)
+   			queryTuples[index] = new Array(colPositions.length);
+        reachedEnd = false;
+        return false;
+	}
+
+	/**
+	 *  @private
+	 *  The action function which in turn calls the buildQueryTyples function.
+	 *
+	 */
+	private function buildQueryTuplesAction(query:IOLAPQuery):Boolean
+    {
+        if (!buildQueryTuples(query))
+        {
+			if (_cube.hasEventListener(CubeEvent.QUERY_PROGRESS))
+			{
+				var newProgress:int = queryCubeColIndex * resultRowCount + queryCubeRowIndex;
+				if (newProgress - _queryProgress > queryProgressEventThreashold)
+				{
+					_queryProgress = newProgress;
+					dispatchCubeProgress(_queryProgress, _queryTotal, "First Pass - Processing cell : " + _queryProgress + " of " + _queryTotal);
+				}
+        	}
+			return false;
+        }
+
+        /* code for performance measurement.
+        if (!tOnce)
+        {
+        	totalTupleTime += (getTimer() - tempStartTime);
+        	trace("Time taken for building Query tuples:" + (totalTupleTime/totalRunCount));
+        	tempStartTime = getTimer();
+        	tOnce = true;
+        }
+        */
+
+		actionFunction = buildQueryCubeAction;
+		return false;
+    }
+
+    /**
+	 *  @private
+	 *  The action function which in turn calls the buildQueryCube function.
+	 *
+	 */
+    private function buildQueryCubeAction(query:IOLAPQuery):Boolean
+    {
+    	if (slicerAxis)
+		{
+			if (!buildQueryCube(query))
+			{
+				if (_cube.hasEventListener(CubeEvent.QUERY_PROGRESS))
+				{
+					var newProgress:int = queryCubeColIndex * resultRowCount + queryCubeRowIndex;
+					if (newProgress - _queryProgress > queryProgressEventThreashold)
+					{
+						_queryProgress = newProgress;
+						dispatchCubeProgress(_queryProgress, _queryTotal, "Second Pass - Processing cell : " + _queryProgress + " of " + _queryTotal);
+					}
+				}
+
+				return false;
+			}
+		}
+        /* code for performance measurement.
+        if (!cOnce)
+        {
+        	totalCubeTime += getTimer() - tempStartTime;
+        	trace("Time taken for building Query tuples + queryCube:" + (totalCubeTime/totalRunCount));
+        	tempStartTime = getTimer();
+        	cOnce = true;
+        }
+        */
+
+		actionFunction = buildQueryResultAction;
+
+		prepareToGenerateResult();
+
+		return false;
+    }
+
+    /**
+	 *  @private
+	 *
+	 */
+    private function prepareToGenerateResult():void
+    {
+        var member:IOLAPMember;
+		if (queryCubeRowIndex == 0 && queryCubeColIndex == 0)
+		{
+			dispatchCubeProgress(_queryTotal, _queryTotal);
+			colAxis.positions = new ArrayCollection(colPositions);
+			colPos = colAxis.positions;
+	        validColumns = new Array(colPos.length);
+
+			rowAxis.positions = new ArrayCollection(rowPositions);
+			rowPos = rowAxis.positions;
+            validRows = new Array(rowPos.length);
+
+			_queryProgress = 0;
+			_queryTotal = resultRowCount * colPositions.length;
+
+            removableSlicerMembers = new ArrayCollection();
+
+			if (slicerAxis)
+			{
+				var slicerPos:IList = slicerAxis.positions = new ArrayCollection(slicerPositions);
+
+                //gather members which need to be removed from tuples
+				var mems:ArrayCollection = slicerPos[0].members;
+				for (var mIndex:int = 0; mIndex < mems.length; ++mIndex)
+				{
+					member = mems.getItemAt(mIndex) as IOLAPMember;
+					removableSlicerMembers.addItem(member);
+					if (member.isMeasure)
+						measureInSlice = member;
+				}
+			}
+		}
+    }
+
+    /**
+	 *  @private
+	 *  The action function which in turn calls the insertResult function.
+	 *
+	 */
+    private function buildQueryResultAction(query:IOLAPQuery):Boolean
+    {
+		if (!insertResult())
+		{
+			if (_cube.hasEventListener(CubeEvent.QUERY_PROGRESS))
+			{
+				var newProgress:int = queryCubeColIndex * rowPos.length + queryCubeRowIndex;
+				if (newProgress - _queryProgress > queryProgressEventThreashold)
+				{
+					_queryProgress = newProgress;
+					dispatchCubeProgress(_queryProgress, _queryTotal, "Third Pass - Processing cell : " + _queryProgress + " of " + _queryTotal);
+				}
+			}
+
+			return false;
+		}
+
+        /* code for performance measurement.
+        if (!rOnce)
+        {
+        	totalResultTime += (getTimer() - tempStartTime);
+            trace("Time taken for building Query tuples + queryCube + result :" + (totalResultTime/totalRunCount));
+        	tempStartTime = getTimer();
+            rOnce = true;
+        }
+        */
+		dispatchCubeProgress(_queryTotal, _queryTotal, "Third Pass - Processing cell : " + _queryTotal + " of " + _queryTotal);
+
+        //remove unused columns and rows.
+        for (var temp:int = validRows.length-1; temp > -1; --temp)
+        {
+            if (validRows[temp] == undefined)
+            {
+                rowPos.removeItemAt(temp);
+                newResult.removeRowData(temp);
+            }
+        }
+
+        for (temp = validColumns.length-1; temp > -1; --temp)
+        {
+            if (validColumns[temp] == undefined)
+            {
+                colPos.removeItemAt(temp);
+                newResult.removeColumnData(temp);
+            }
+        }
+
+        //we are done with this query
+        actionFunction = prepareForNewQuery;
+
+        //let us release all references
+        queryCubeBuilder = null;
+        validRows = validColumns = null;
+        queryTuples = null;
+
+        return true;
+    }
+
+    /**
+    *  @private
+    *  Returns a value reading it from the cube based on the members array
+    *  describing the path to the cell that should be read.
+    *  The mainCube flag indicates whether rootNode points to the main OLAP cube or
+    *  a query cube.
+    */
+    private function readCubeCell(rootNode:CubeNode, mainCube:Boolean,
+                            tupleCubeMembers:Array):*
+    {
+        var value:* = rootNode;
+        for each (var index:IOLAPMember in tupleCubeMembers)
+        {
+			var memberName:String;
+			if (index.isMeasure)
+			{
+				memberName = index.name;
+			}
+			else if (index.isAll)
+			{
+				memberName = mainCube ? allNodePropertyName : allQueryNodePropertyName;
+				//if (!slicerAxis)
+				//	memberName = index.uniqueName ;
+			}
+			else
+			{
+				memberName = mainCube ? index.name : index.uniqueName;
+			}
+
+			if (value.hasOwnProperty(memberName))
+			{
+                 value = value[memberName];
+   			}
+            else
+            {
+                 value = undefined;
+                 break;
+            }
+         }
+
+         if (value != undefined)
+         {
+            // user has stopped at this level
+            // pick the agg all value from the levels below.
+            if (value is CubeNode)
+            {
+                if (mainCube)
+                    value = value[allNodePropertyName];
+                else
+                    value = value[allQueryNodePropertyName];
+            }
+
+            if (index is OLAPMeasure)
+            {
+                //user has chosen measure on the axis
+                //we will use this
+                //value = value[index.name];
+                //if (!(value is Number))
+                //    trace("Invalid assumption about having a value");
+            }
+            else
+            {
+                var measure:OLAPMeasure = _cube.findDimension("Measures").defaultMember as OLAPMeasure;
+                value = value[measure.name];
+            }
+        }
+
+        return value;
+    }
+
+    /*
+    *  @private
+    */
+    mx_internal function sortData():void
+    {
+        for each (var dim:IOLAPDimension in _cube.dimensions)
+        {
+            for each (var hierarchy:OLAPHierarchy in dim.hierarchies)
+            {
+                levels = levels.concat(hierarchy.levels.toArray());
+            }
+        }
+
+        // sort the data as it makes decision about completion of handling
+        var newSort:Sort = new Sort;
+        var fields:Array = [];
+
+        for each (var level:OLAPLevel in levels)
+        {
+            var field:SortField = new SortField(level.dataField);
+            fields.push(field);
+        }
+
+        newSort.fields = fields;
+        _cube.dataProvider.sort = newSort;
+        _cube.dataProvider.refresh();
+    }
+
+    // cube builder API
+
+    /**
+    *  @private
+    *  Signals the start of main OLAP cube building.
+    *
+    */
+    private function initNodeBuilder():void
+    {
+        if (!nodeBuilder)
+        {
+            nodeBuilder = new CubeNodeBuilder;
+            nodeBuilder.cube = _cube;
+            nodeBuilder.levelPreviousToMeasuresIndex = levels.length - 1;
+        }
+        nodeBuilder.initNodeBuilding();
+    }
+
+    /**
+    *  @private
+    *  Property Name used by the main cube in each node for a property,
+    *  which points to the aggregation node of nodes below.
+    *
+    */
+    private function get allNodePropertyName():String
+    {
+        return nodeBuilder.allNodePropertyName;
+    }
+
+    /**
+    *  Returns the root CubeNode of the main OLAP cube.
+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
+    */
+    mx_internal function get rootNode():CubeNode
+    {
+        return nodeBuilder.rootNode;
+    }
+
+    /**
+    *  @private
+    *
+    */
+    private function addValueToNodeBuilder(value:Object, data:Object):void
+    {
+        nodeBuilder.addValueToNodeBuilder(value, data);
+    }
+
+    /**
+    *  @private
+    *  Signals end of input data processing. The node builder
+    *  finalizes the cube by computing aggregates.
+    *
+    */
+    private function completeNodeBuilder():Boolean
+    {
+        return nodeBuilder.completeNodeBuilding();
+    }
+
+    /**
+    *  @private
+    *  QUERY cube builder API
+    */
+    private function initQueryNodeBuilder():void
+    {
+        if (!queryCubeBuilder)
+        {
+            queryCubeBuilder = new QueryCubeBuilder;
+            queryCubeBuilder.cube = _cube;
+        }
+        queryCubeBuilder.initNodeBuilding();
+    }
+
+    /**
+    *  @private
+    *  Property Name used by the query cube in each node for a property,
+    *  which points to the aggregation node of nodes below.
+    *
+    */
+    private function get allQueryNodePropertyName():String
+    {
+        return queryCubeBuilder.allNodePropertyName;
+    }
+
+    /**
+    *  @private
+    *  Returns the root node for the query cube.
+    *
+    */
+    private function get queryRootNode():CubeNode
+    {
+        if (queryCubeBuilder)
+            return queryCubeBuilder.rootNode;
+        return null;
+    }
+
+    /**
+    *  @private
+    *  Adds a value to the query cube.
+    *
+    */
+    private function addValueToQueryNodeBuilder(value:Object, data:Object):void
+    {
+        queryCubeBuilder.addValueToNodeBuilder(value, data);
+    }
+
+    /**
+    *  @private
+    *  Adds a measure value to the query cube.
+    *
+    */
+    private function addMeasureToQueryNodeBuilder(value:Object, data:Object, measure:OLAPMeasure):void
+    {
+        queryCubeBuilder.addMeasureValueToNode(value, data, measure);
+    }
+
+    /**
+    *  @private
+    *  Signals the queryCube builder to finalize the cube so that
+    *  results can be read from it.
+    *
+    */
+    private function completeQueryNodeBuilding():void
+    {
+        queryCubeBuilder.completeNodeBuilding();
+    }
+
+    /**
+    *  @private
+    *  Signals end of processing one tuple in the query.
+    */
+    private function moveToNextRoundQuery():void
+    {
+        queryCubeBuilder.moveToNextRound();
+    }
+
+	/**
+	 *  A helper function which returns true if the Tuple addresses a valid
+	 *  cell in the cube.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+    mx_internal function isTupleValid(tuple:OLAPTuple):Boolean
+    {
+        var generatedTupleMembers:Array = tuple.membersArray;
+
+        var value:* = rootNode;
+
+        //skip the last measure level;
+        var memCount:int = generatedTupleMembers.length -1;
+        var tupleMember:IOLAPMember;
+        for (var tupleIndex:int = 0; tupleIndex < memCount; ++tupleIndex)
+        {
+            tupleMember = generatedTupleMembers[tupleIndex];
+            if (tupleMember.isAll)
+            {
+                value = value[allNodePropertyName];
+            }
+            else
+            {
+            	//move to the next level
+            	value = value[tupleMember.name];
+            	//absense of any value indicates a invalid tuple.
+            	if (value === undefined)
+            		return false;
+            }
+
+        }
+        return true;
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17357
Author:   klin@adobe.com
Date:     2010-08-17T21:41:02.298691Z

Log Message:
-----------
Fix bug where the DataGrid wouldn't redraw its item renderers when the itemRenderer property changed. The itemRenderer setter needs to clear the renderers from the layout as well as the typical item measurements. Also added similar logic in GridColumn for itemRenderer, itemRendererFunction, labelFunction, and dataField.

QE notes: No
Doc notes: No
Bugs: SDK-27262
Reviewer: Hans
Tests run: checkintests, DataGrid
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -881,6 +881,10 @@

             invalidateSize();
             invalidateDisplayList();
+            gridLayout.clearVirtualLayoutCache();
+            if (gridLayout.gridDimensions)
+                gridLayout.gridDimensions.clearTypicalCellWidthsAndHeights();
+
             dispatchChangeEvent("itemRendererChanged");
         }