Transferred from the Adobe Open Source Subversion Repository

Revision: 20687
Author:   smgilson@adobe.com
Date:     2011-03-08T20:09:56.755277Z

Log Message:
-----------
ASDoc updates

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ArrayCollection.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ArrayList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/controls/FlexNativeMenu.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/SortField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/Label.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/PopUpMenuButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/MovieClipSWFLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/ComboBase.as</path>

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

--- frameworks/projects/mx/src/mx/controls/PopUpMenuButton.as
+++ frameworks/projects/mx/src/mx/controls/PopUpMenuButton.as
@@ -372,6 +372,11 @@
      *  explicitly; for example, use @icon to specify the icon attribute.

      *
      *  @default "icon"
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get iconField():String
     {
@@ -426,6 +431,11 @@
      *

      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get iconFunction():Function
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 17486
Author:   aharui@adobe.com
Date:     2010-08-26T04:38:55.058331Z

Log Message:
-----------
Fix tilelayout bug where it would layout differently based on a previous layout

QE notes: none
Doc notes: none
Bugs: SDK-26462
Reviewer: Evtim
Tests run: checkintests mustella/gumbo/List
Is noteworthy for integration: no

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/TileLayout.as

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

--- frameworks/projects/spark/src/spark/layouts/TileLayout.as
+++ frameworks/projects/spark/src/spark/layouts/TileLayout.as
@@ -1469,6 +1469,7 @@
             // measured min size is guaranteed to have enough rows to fit all elements
             layoutTarget.measuredMinHeight = Math.ceil(_rowCount * (_rowHeight + _verticalGap) - _verticalGap);
         }
+		_numElementsCached = -1;
     }

     /**


fixed some typos (they weren't causing any problems, I just noticed them);

--- flexEditor/src/org/arisgames/editor/view/QuestsEditorView.as
+++ flexEditor/src/org/arisgames/editor/view/QuestsEditorView.as
@@ -65,9 +65,9 @@
         AppServices.getInstance().getQuestsByGameId(GameModel.getInstance().game.gameId, new Responder(handleLoadQuests, handleFault));
     }

-	public function handleRequiementsForActiveButtonClick(evt:MouseEvent):void
-	{
-		trace("QuestsEditorView: handleRequiementsForActiveButtonClick() called with Selected Index = '" + dg.selectedIndex + "'");
+	public function handleRequirementsForActiveButtonClick(evt:MouseEvent):void
+	{
+		trace("QuestsEditorView: handleRequirementsForActiveButtonClick() called with Selected Index = '" + dg.selectedIndex + "'");
 		this.openRequirementsEditor(AppConstants.REQUIREMENTTYPE_QUESTDISPLAY);

 	}
@@ -179,7 +179,7 @@
                     trace("&&&&& Checking j = '" + j + "'; Quest Id = '" + q.questId + "'");
                     if (isNaN(q.questId))
                     {
-                        trace("Found previusly added / saved quest.  Add Id to it and exiting method.");
+                        trace("Found previusly added / saved quest.  Add ID to it and exiting method.");
                         q.questId = qid;
                         quests.refresh();
                         return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 14277
Author:   deeptika@adobe.com
Date:     2010-02-19T10:06:44.539275Z

Log Message:
-----------
Mirroring changes:2 Merging revision 14275 from 4.x branch
QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/series/PieSeries.as

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

--- frameworks/projects/charts/src/mx/charts/series/PieSeries.as
+++ frameworks/projects/charts/src/mx/charts/series/PieSeries.as
@@ -1261,6 +1261,7 @@
         _measuringField = IUITextField(createInFontContext(UITextField));
         _measuringField.visible = false;
         _measuringField.styleName = this;
+
         _measuringField.autoSize = TextFieldAutoSize.LEFT;
         addChild(DisplayObject(_measuringField));

@@ -1890,7 +1891,11 @@

         // the flash player screws up display of device fonts at very small point sizes...it blows out to large sizes instead. So if it looks
         // like fonts will be displayed at a tiny point size, just don't show them at all.
-        var actualScale:Number = r2.x - r1.x;
+        var actualScale:Number;
+		if(chart && chart.layoutDirection == "rtl")
+			actualScale = r1.x - r2.x;
+		else
+			actualScale = r2.x - r1.x;
         if (getStyle("fontSize")*actualScale < 2)
             labelPosition = "none";

@@ -2641,10 +2646,11 @@

             label = ld.label = labels[firstLabelIndex++];
+			label.scaleX = label.scaleY = labelScale;
             label.x = ld.labelX;
             label.y = ld.labelY;
             label.text = ld.labelText;
-            label.scaleX = label.scaleY = labelScale;
+

             endRad = (ld.labelSin == 0)? leftEdge:((label.y + label.height/2 - o.y)/ld.labelSin);

@@ -2693,10 +2699,11 @@

             label = ld.label = labels[firstLabelIndex++];
+			label.scaleX = label.scaleY = labelScale;
             label.x = ld.labelX;
             label.y = ld.labelY;
             label.text = ld.labelText;
-            label.scaleX = label.scaleY = labelScale;
+

             endRad = (label.y + label.height/2 - o.y)/ld.labelSin;


Fix error in 3D BitmapDataZone

Fix error in 3D BitmapDataZone

--- src/org/flintparticles/threeD/zones/BitmapDataZone.as
+++ src/org/flintparticles/threeD/zones/BitmapDataZone.as
@@ -222,14 +222,14 @@
 				init();
 			}
 			var point:Point =  Point( _validPoints.getRandomValue() ).clone();
-			var d1:Vector3D = _scaledWidth;
+			var d1:Vector3D = _scaledWidth.clone();
 			d1.scaleBy( point.x );
-			var d2:Vector3D = _scaledHeight;
+			var d2:Vector3D = _scaledHeight.clone();
 			d2.scaleBy( point.y );
 			d1.incrementBy( d2 );
 			return _corner.add( d1 );
 		}
-
+
 		/**
 		 * The getVolume method returns the size of the zone.
 		 * This method is used by the MultiZone class. Usually,


added more methods to make code more readable without resorting to comments

--- src/org/osflash/signals/natives/NativeMappedSignal.as
+++ src/org/osflash/signals/natives/NativeMappedSignal.as
@@ -4,10 +4,9 @@
 	import flash.events.IEventDispatcher;

 	/**
-	 * The NativeMappedSignal class is used to map/transform an event into another type of data
-	 * that is sent along with the dispatch call as an argument.
-	 *
-	 * This is used to form a border where flash native Events do not cross.
+	 * The NativeMappedSignal class is used to map/transform an event other forms of data.
+	 * The transformed data is then sent along with the dispatched Signal.
+	 * This can be used to form a border where native flash Events do not cross.
 	 */
 	public class NativeMappedSignal extends NativeRelaySignal
 	{
@@ -16,15 +15,17 @@
 		 */
 		protected var _eventClass:Class;

-		public function get eventClass ():Class {
+		public function get eventClass ():Class
+		{
 			return _eventClass;
 		}

-		private var _propertyFilterFunction:Function = null;
+		private var _mappingFunction:Function = null;

 		/*open for extension but closed for modifications*/
-		protected function get propertyFilterFunction ():Function {
-			return _propertyFilterFunction;
+		protected function get mappingFunction ():Function
+		{
+			return _mappingFunction;
 		}

 		/**
@@ -34,29 +35,18 @@
 		 *
 		 * @param	target	An object that implements the flash.events.IEventDispatcher interface.
 		 * @param	eventType The event string name that would normally be passed to IEventDispatcher.addEventListener().
-		 * @param 	valueClass The Class that the eventType will be mapped to
-		 * @param	mapToObjectOrFunction an object or a Function that should return an object of the same type as the valueClass argument.
-		 * If mapTo is an Object then this is what will be sent along with the signal as a value class.
-		 * If mapTo is a function the Object returned from the function is passed along as the argument with the signal.
-		 * If the mapping function can have zero or one argument. In the case of a single argument it should be of type Event.
-		 * If the mapping function does not need to know about the event then implement it with zero arguments are no Event will passed to it.
+		 * @param 	eventClass An optional class reference that enables an event type check in dispatch().
+		 * @param	mappedTypes an optional list of types that enables the checking of the types mapped from an Event.
 		 */
-		public function NativeMappedSignal(target:IEventDispatcher, eventType:String, eventClass:Class=null, ... propertyTypes)
-		{
-			/*We keep this class but it is not our valueClass.*/
+		public function NativeMappedSignal(target:IEventDispatcher, eventType:String, eventClass:Class=null, ... mappedTypes)
+		{
 			_eventClass = eventClass || Event;
-
-			/*I want to use the super-contructor,
-			but the implicit call of setValueClasses(Event) will only be temporarily,
-			instead we want the valueClasses given as parameter in this constructor*/
 			super(target, eventType);
-
-			/*if valueClasses are not provided this will call the listeners with no parameter*/
-			setValueClasses(propertyTypes);
-		}
-
-		/**
-		 * @param objectOrFunction This can either be a list of object literals or a function that returns list of objects.
+			setValueClasses(mappedTypes);
+		}
+
+		/**
+		 * @param objectListOrFunction This can either be a list of object literals or a function that returns list of objects.
 		 * If the argument is a list of object literals mapTo(): then this list is passed along with the Signal dispatch.
 		 *
 		 * Here's an example passing an object literal:
@@ -106,21 +96,32 @@
 		 */
 		public function mapTo(...objectListOrFunction):NativeMappedSignal
 		{
-			if (objectListOrFunction.length == 1 && objectListOrFunction[0] is Function)
-			{
-				_propertyFilterFunction = objectListOrFunction[0] as Function;
+			if (isArgumentListAFunction(objectListOrFunction))
+			{
+				_mappingFunction = objectListOrFunction[0] as Function;

-				if (_propertyFilterFunction.length > 1)
+				if (hasFunctionMoreThanOneArgument(_mappingFunction))
 				{
-					throw new ArgumentError('Mapping function has ' + _propertyFilterFunction.length + ' arguments but it needs zero or one of type Event');
+					throw new ArgumentError('Mapping function has ' + _mappingFunction.length
+						+ ' arguments but it needs zero or one of type Event');
 				}
 			}
 			else
 			{
-				_propertyFilterFunction = function ():Object { return objectListOrFunction; };
+				_mappingFunction = function ():Object { return objectListOrFunction; };
 			}

 			return this
+		}
+
+		private function isArgumentListAFunction(argList:Array):Boolean
+		{
+			return argList.length == 1 && argList[0] is Function
+		}
+
+		private function hasFunctionMoreThanOneArgument(f:Function):Boolean
+		{
+			return f.length > 1
 		}

 		/**
@@ -135,26 +136,10 @@
 		 */
 		override public function dispatch (... valueObjects):void
 		{
-			/*_target will call this with the dispatched Event as the only parameter*/
-			if (valueObjects.length == 1 && valueObjects[0] is _eventClass)
-			{
-				var mappedData:Object = filterPropertyArguments(valueObjects[0] as Event)
-
-				if (mappedData is Array)
-				{
-					if (_valueClasses.length == 1 && _valueClasses[0] == Array)
-					{
-						super.dispatch.call(null, mappedData);
-					}
-					else
-					{
-						super.dispatch.apply(null, mappedData);
-					}
-				}
-				else
-				{
-					super.dispatch.call(null, mappedData);
-				}
+			if (areValueObjectValidForMapping(valueObjects))
+			{
+				var mappedData:Object = mapEvent(valueObjects[0] as Event)
+				dispatchMappedData(mappedData)
 			}
 			else
 			{
@@ -162,10 +147,43 @@
 			}
 		}

+		private function areValueObjectValidForMapping(valueObjects:Array):Boolean
+		{
+			return valueObjects.length == 1 && valueObjects[0] is _eventClass;
+		}
+
+		private function dispatchMappedData(mappedData:Object):void
+		{
+			if (mappedData is Array)
+			{
+				if (shouldArrayBePassedWithoutUnrolling)
+				{
+					super.dispatch.call(null, mappedData);
+				}
+				else
+				{
+					super.dispatch.apply(null, mappedData);
+				}
+			}
+			else
+			{
+				super.dispatch.call(null, mappedData);
+			}
+		}
+
+		private function get shouldArrayBePassedWithoutUnrolling():Boolean
+		{
+			return _valueClasses.length == 1 && _valueClasses[0] == Array;
+		}

 		protected function get propertyFilterFunctionWantsEvent():Boolean
 		{
-			return _propertyFilterFunction.length == 1;
+			return _mappingFunction.length == 1;
+		}
+
+		protected function get propertyFilterFunctionExists():Boolean
+		{
+			return _mappingFunction != null
 		}

 		/**
@@ -177,28 +195,24 @@
 		 * MAKE SURE to also override setPropertyFilterFunction(...) if it should not be allowed.
 		 *
 		 * @parameter eventFromTarget the event that was dispatched from target.
-		 * @return An array with value gathered from eventFromTarget.
-		 * 				The default implemetation uses propertyFilterFunction if it is set.
-		 * 				Otherwise it returns [] if valueClasses.length > 0 or throws an ArgumentError.
-		 *
-		 *
-		 * @see #setPropertyFilterFunction()
-		 *
-		 * @internal
-		 * This function gets called by dispatch to recieve the needed property-values from eventFromTarget.
-		 * It has to return an array that matches length and types of valueClasses, wich is checked by super.dispatch.apply(null,[returned array]) afterwards.
+		 * @return An object or Array of objects mapped from an Event. The mapping will be performed by the mapping function
+		 * if it is set (using mapTo). A list of object literals can also be supplied.
+		 * If no mapping function or object literals are supplied then an empty Array is returned.
+		 * if valueClasses.length > 0 or throws an ArgumentError.
+		 *
+		 * @see #mapTo()
 		 * */
-		protected function filterPropertyArguments (eventFromTarget:Event):Object
-		{
-			if (_propertyFilterFunction != null)
+		protected function mapEvent (eventFromTarget:Event):Object
+		{
+			if (propertyFilterFunctionExists)
 			{
 				if (propertyFilterFunctionWantsEvent)
 				{
-					return _propertyFilterFunction(eventFromTarget);
+					return _mappingFunction(eventFromTarget);
 				}
 				else
 				{
-					return _propertyFilterFunction();
+					return _mappingFunction();
 				}
 			}
 			else if (valueClasses.length == 0)
@@ -206,7 +220,8 @@
 				return [];
 			}

-			throw new ArgumentError("There are valueClasses set to be dispatched <" + valueClasses + "> but propertyFilterFunction is null.");
+			throw new ArgumentError("There are valueClasses set to be dispatched <" + valueClasses
+				+ "> but propertyFilterFunction is null.");
 		}
 	}
 }


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

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPTuple.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPTuple.as
@@ -0,0 +1,452 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.Dictionary;
+
+import mx.collections.ArrayCollection;
+import mx.collections.IList;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ *  The OLAPTuple class reprsents a tuple expression pointing to an OLAP cube cell.
+ *  A tuple is made up of one member from every dimension that is contained within a cube.
+ *  The complete expression of a tuple identifier is made up of one or more explicitly specified members,
+ *  in parentheses.
+ *  A tuple can be fully qualified, can contain implicit members, or can contain a single member.
+ *  Any dimension that is not explicitly referenced within a tuple is implicitly referenced.
+ *
+ *
The member for the implicitly referenced dimension depends on the structure of the dimension:
+ *

+ *
If the implicitly referenced dimension has a default member,
+ *      the default member is added to the tuple.

+ *
If the implicitly referenced dimension has no default member,
+ *      the (All) member of the default hierarchy is used.

+ *
If the implicitly referenced dimension has no default member,
+ *      and the default hierarchy has no (All) member,
+ *      the first member of the topmost level of the default hierarchy is used.

+ *

+ *

+ *
+ *  @see mx.olap.IOLAPTuple
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class OLAPTuple implements IOLAPTuple
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function OLAPTuple()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+    *  @private
+    *  For improving performance we cache the computed members list here.
+    *  We need to clear this cache when user alters the tuple by adding
+    *  a new element.
+    */
+    private var cachedMembers:ArrayCollection = new ArrayCollection();
+
+    /**
+     *  @private
+     *  Flag which indicates the validity of the cachedMembers variable.
+     *  If the flag is false we need to rebuild the cachedMemebers.
+     */
+    private var cacheValid:Boolean;
+
+    //a copy of members added by the user
+    private var _explicitMembers:ArrayCollection = new ArrayCollection();
+
+    /**
+     *  @private
+     *  Flag which indicates the validity of the _explicityMembers variable.
+     *  If the flag is false we need to rebuild the _explicityMembers.
+     */
+    private var explicitMembersValid:Boolean = false;
+
+    //original lists of members added by user
+    private var _userMembers:Array = [];
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // explicitMembers
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get explicitMembers():IList
+    {
+        if (!explicitMembersValid)
+        {
+        	_explicitMembers.source = _userMembers.slice(0);
+        	explicitMembersValid = true;
+    	}
+
+        return _explicitMembers;
+    }
+
+    //----------------------------------
+    // userMembers
+    //----------------------------------
+
+    /**
+    * @private
+    */
+    mx_internal function get userMembers():Array
+    {
+        var temp:Array = [];
+        for each (var m:IOLAPMember in _userMembers)
+        {
+            temp.push(m);
+            // member should not be from the attribute hierarchy because
+            // in that case there won't be any parent other than all.
+            if (!(m.hierarchy is OLAPAttribute))
+            {
+                m = m.parent;
+                while (m && OLAPHierarchy(m.hierarchy).allLevel != m.level)
+                {
+                    temp.push(m);
+                    m = m.parent;
+                }
+            }
+
+        }
+        return temp;
+    }
+
+    //----------------------------------
+    // members
+    //----------------------------------
+
+    /**
+     *  @private
+     *  A list of IOLAPMember instances that represent the members of the tuple.
+     */
+    mx_internal function get members():IList
+    {
+        if (cacheValid)
+            return cachedMembers;
+
+        var temp:Array = [];
+
+        // get the cube and all its dimensions
+        var cube:OLAPCube = (_userMembers[0] as IOLAPMember).level.hierarchy.dimension.cube as OLAPCube;
+
+        //get all levels in all dimensions
+        var attributeLevels:Array = cube.attributeLevels;
+
+        // get all user specified levels
+        var userLevels:Dictionary = new Dictionary();
+        for each (var m:IOLAPMember in _userMembers)
+        {
+            // if the member has parent we need to include it too
+            // example: if 2000-Q1-Jan is added by the user we need to
+            // add Q1 and 2000
+            //if (userLevels[m.level] != undefined && userLevels[m.level] != m)
+            //    trace("*** Over writing a level specification ***");
+            userLevels[m.level] = m;
+            var mt:IOLAPMember = m;
+            //skip the all level?
+            while (mt.parent && mt.parent.parent)
+            {
+                mt = mt.parent;
+               //if (userLevels[mt.level] != undefined && userLevels[m.level] != m)
+               //     trace("*** Over writing a level specification ***");
+                userLevels[mt.level] = mt;
+            }
+        }
+
+        //check which levels user has covered, add the remaining levels all member.
+        var n:int = attributeLevels.length;
+        for (var i:int = 0; i < n; ++i)
+        {
+            // has user covered this level?
+            var level:OLAPAttributeLevel = attributeLevels[i];
+            var hierarchy:OLAPHierarchy = level.hierarchy as OLAPHierarchy;
+            var newMem:IOLAPMember = userLevels[level];
+
+            if (!newMem)
+            {
+                // see if user is using the level from the user defined hierarchy
+                if (hierarchy is OLAPAttribute)
+                    newMem = userLevels[level.userLevel];
+            }
+
+            if (newMem)
+            {
+                temp.push(newMem);
+                if (level == hierarchy.allLevel)
+                    ++i;
+            }
+            else
+            {
+                if (level == hierarchy.allLevel)
+                {
+                    if (!userLevels[attributeLevels[i + 1]] &&
+                        !userLevels[attributeLevels[i + 1].userLevel])
+                    {
+                        temp.push(hierarchy.allMember);
+                        ++i;
+                    }
+                }
+                else
+                {
+                    if (level.levelAllMember)
+                        temp.push(level.levelAllMember);
+                    else
+                        temp.push(hierarchy.defaultMember);
+                }
+            }
+        }
+
+        //search for user specified measure
+        var measureFound:Boolean = false;
+        for each (var measure:Object in explicitMembers)
+        {
+            if (measure is OLAPMeasure)
+            {
+                measureFound = true;
+                temp.push(measure);
+                break;
+            }
+        }
+        //if no measure was found take the default one
+        if (!measureFound)
+            temp.push(cube.defaultMeasure);
+
+        cachedMembers.source = temp;
+		cacheValid = true;
+
+        return cachedMembers;
+    }
+
+    //----------------------------------
+    // membersArray
+    //----------------------------------
+
+    /**
+     *  Intead of accessing members this is used to access
+     *  the internal array to avoid creating a duplicate.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    mx_internal function get membersArray():Array
+    {
+    	var x:IList = members;
+    	return cachedMembers.source;
+    }
+
+    //----------------------------------
+    // isValid
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Contains true if the tuple is valid,
+     *  and false if not.
+     */
+    mx_internal function get isValid():Boolean
+    {
+        //check if we have any member from attribute hierarchy and the same member from
+        // a user defined hierarchy-level. If it is present then this is a invalid tuple (for now!)
+        var n:int = _userMembers.length;
+        for (var i:int = 0; i < n; ++i)
+        {
+            var member:OLAPMember = _userMembers[i];
+            var attrHierarchy:OLAPAttribute = member.hierarchy as OLAPAttribute;
+            if (!attrHierarchy)
+                continue;
+
+            var memLevel:OLAPLevel = attrHierarchy.userHierarchyLevel;
+            for (var j:int = 0; j < n; ++j)
+            {
+                if (j == i)
+                    continue;
+                var nextMember:OLAPMember = _userMembers[j];
+                if (nextMember.level == memLevel)
+                    return false;
+            }
+        }
+
+        var cube:OLAPCube = (_userMembers[0] as IOLAPMember).dimension.cube as OLAPCube;
+        return cube.isTupleValid(this);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addMembers(value:IList):void
+    {
+        explicitMembersValid = false;
+        cacheValid = false;
+        var n:int = value.length;
+        for (var i:int = 0; i < n; ++i)
+        {
+            _userMembers.push(value.getItemAt(i));
+        }
+    }
+
+    /**
+     *  @private
+     *  Removes members from the tuple.
+     *
+     *  @param element The members to remove, as a list of IOLAPMember instances.
+     */
+    mx_internal function removeElements(value:IList):void
+    {
+        explicitMembersValid = false;
+        cacheValid = false;
+
+        var n:int = value.length;
+        for (var i:int = 0; i < n; ++i)
+        {
+        	var removeIndex:int = _userMembers.indexOf(value.getItemAt(i));
+        	if (removeIndex != -1)
+        		_userMembers.splice(removeIndex, 1);
+        }
+    }
+
+    /**
+     *  @private
+     *  Removes members from the tuple.
+     *
+     *  @param element The members to remove, as a list of IOLAPMember instances.
+     */
+    mx_internal function removeElementsAtEnd(count:int):void
+    {
+		explicitMembersValid = false;
+        cacheValid = false;
+        _userMembers.splice(-1, count);
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addMember(element:IOLAPElement):void
+    {
+        explicitMembersValid = false;
+        cacheValid = false;
+        if (element is IOLAPDimension)
+        {
+            var dim:IOLAPDimension = element as IOLAPDimension;
+            OLAPTrace.traceMsg("Getting default member of dimension:" + dim.name,
+                                        OLAPTrace.TRACE_LEVEL_3);
+            _userMembers.push(dim.defaultMember);
+        }
+        else if (element is IOLAPHierarchy)
+        {
+            var h:IOLAPHierarchy = element as IOLAPHierarchy;
+            _userMembers.push(h.defaultMember);
+            OLAPTrace.traceMsg("Getting default member of hierarchy:" + h.name,
+                                        OLAPTrace.TRACE_LEVEL_3);
+        }
+        else if (element is IOLAPMember)
+        {
+            _userMembers.push(element);
+        }
+        else if (element is IOLAPLevel)
+        {
+            // should we just pick up the first member?
+            OLAPTrace.traceMsg("Error a level is being passed as input to tuple:" + element.name,
+                                            OLAPTrace.TRACE_LEVEL_1);
+        }
+    }
+
+    /**
+     *  Removes all members from the tuple.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    mx_internal function clear():void
+    {
+        cacheValid = false;
+        _userMembers.splice(0);
+        explicitMembersValid = false;
+    }
+
+    /**
+    * Creates a clone of this tuple.
+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
+    */
+    mx_internal function clone():OLAPTuple
+    {
+        var newTuple:OLAPTuple = new OLAPTuple;
+        newTuple._userMembers = _userMembers.slice(0);
+        return newTuple;
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 16727
Author:   jszeto@adobe.com
Date:     2010-06-29T20:42:03.768739Z

Log Message:
-----------
Form and ComboBox Bug Fixes

SDK-25765 - ComboBox does not commit item when closed if Enter key is pressed

I changed the fix for this bug.

Instead of only committing the selection in ComboBox.applySelection if the dropDown is closed, we keep track of the user defined selection in DropDownList.keyDownHandler.

SDK-26268 - ComboBox does not commit value with TAB when openOnInput = false

Removed the restriction in ComboBox.applySelection that the dropDown must be open in order to commit

SDK-26442 -  When arrowing between the first two items in a flex combo box the selection is always on the secodn item

Fixed logic bug in ComboBox.changeHighlightedSelection.

SDK-26752 - error string no longer appears for Spark or MX components

The errorString was getting set in MXML. At that time, the component is not parented and not hooked up to its styles. So the call to get the showErrorTip style was returning false.

I moved this logic to commitProperties which solves the timing issue.

SDK-26497 - Spark Form displays errors in a seemingly random order

Changed the dictionary of invalid elements into a sorted array.
An element's sort order is based on its position in the display list tree using a depth first search. The position is represented by a Vector.<int>, with each item being the child index of the element's ancestor at that depth. For example, the second child of the first child of the root would have a Vector like this [0,0,1].

Whenever an element is invalid, we add it to the sorted array and perform a re-sort. We can live with using a heavy data structure like a Vector of ints because there should only be a few errors at a time in a Form. The alternative is to traverse the entire tree and store a pointer and the sort order for each node.

We make an assumption that the order in the display list tree is equivalent to the visual order of the Form's input controls. Since the Form's layout is based on VerticalLayout, this is a valid assumption. This same algorithm would work if the Form was switched to a horizontal layout.

SDK-26697 - Cannot reset Spark Form to original state if form had validation errors

Added logic to Form to listen for the errorStringChanged event on an invalid element. We don't use the same technique as in FormItem, which listens for errorStringChanged in the capture phase on the FormItem's contentGroup. This is because FormItem's errorString is set to the combined errorStrings of its children. If Form used the same technique, the error strings would appear twice.

QE notes: retest SDK-25765
Doc notes: none
Bugs: SDK-25765, SDK-26268, SDK-26442, SDK-26752, SDK-26497, SDK-26697
Reviewer: Kevin
Tests run: full run
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ComboBox.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Form.as</path>

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

--- frameworks/projects/spark/src/spark/components/ComboBox.as
+++ frameworks/projects/spark/src/spark/components/ComboBox.as
@@ -582,7 +582,7 @@
             else
                 setSelectedIndex(NO_SELECTION, true);
         }
-        else if (isDropDownOpen)
+        else
         {
             setSelectedIndex(actualProposedSelectedIndex, true);
         }
@@ -726,7 +726,7 @@
     {
         super.changeHighlightedSelection(newIndex, scrollToTop);

-        if (newIndex > 0)
+        if (newIndex >= 0)
         {
             var item:Object = dataProvider ? dataProvider.getItemAt(newIndex) : undefined;
             if (item)


Transferred from the Adobe Open Source Subversion Repository

Revision: 17425
Author:   rfrishbe@adobe.com
Date:     2010-08-20T17:29:56.448841Z

Log Message:
-----------
Pretty basic refactoring for PARB (though it is a lot of files).  Renamed GestureCaptureEvent/GestureCaptureReason (these were previously TouchScrollEvent) to TouchInteractionEvent/TouchInteractionReason.  inputMode has been renamed to interactionMode and has a new enumeration class, mx.core.InteractionMode.

There's on non-PARB change that was made was in List and mobiletheme/defaults.css. I found a bug in that the item renderer wasn't highlighting on mousedown anymore. There were two issues at play. Firstly the touchDelay was set to 100 ms in the Scroller only, so I added it to List and added a FIXME comment to myself figuring out if the code in List should use scroller.getStyle("touchDelay") or itemRenderer.getStyle("touchDelay") instead of getStyle("touchDelay"). Also, I found out that the code doesn't deal with touchDelay=0 very well. Since we're planning on working on this code anyways (and possibly moving it in to ItemRenderer itself with a new downstate), I just put in a hack with a FIXME to handle this case for now.

QE notes: None
Doc notes: None
Bugs: -
Reviewer: Jason SJ, Chiedo
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/GestureCaptureEvent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/InteractionMode.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/GestureCaptureReason.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/GestureCaptureEvent.as" copyfrom-rev="17393" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchInteractionEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/GestureCaptureReason.as" copyfrom-rev="17393" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchInteractionReason.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -26,13 +26,14 @@
 import mx.core.IUIComponent;
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
+import mx.core.InteractionMode;
 import mx.core.LayoutDirection;
 import mx.core.ScrollPolicy;
 import mx.core.mx_internal;
 import mx.effects.easing.Exponential;
 import mx.events.EffectEvent;
-import mx.events.GestureCaptureEvent;
 import mx.events.PropertyChangeEvent;
+import mx.events.TouchInteractionEvent;
 import mx.managers.IFocusManagerComponent;

 import spark.components.Group;
@@ -550,8 +551,8 @@
      *  Used to keep track of whether we should capture the next
      *  mousedown event that we receive or whether we should let it dispatch
      *  normally.  We capture the mousedown event if a scroll-throw is
-     *  currently happening.  We set this property in mouseDown, gestureCaptureStart,
-     *  and gestureCaptureEnd.
+     *  currently happening.  We set this property in mouseDown, touchInteractionStart,
+     *  and touchInteractionEnd.
      */
     private var captureNextMouseDown:Boolean = false;

@@ -1007,9 +1008,9 @@
     private function installTouchListeners():void
     {
         addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
-        addEventListener(GestureCaptureEvent.GESTURE_CAPTURE_STARTING, gestureCaptureStartingHandler);
-        addEventListener(GestureCaptureEvent.GESTURE_CAPTURE_START, gestureCaptureStartHandler);
-        addEventListener(GestureCaptureEvent.GESTURE_CAPTURE_END, gestureCaptureEndHandler);
+        addEventListener(TouchInteractionEvent.TOUCH_INTERACTION_STARTING, touchInteractionStartingHandler);
+        addEventListener(TouchInteractionEvent.TOUCH_INTERACTION_START, touchInteractionStartHandler);
+        addEventListener(TouchInteractionEvent.TOUCH_INTERACTION_END, touchInteractionEndHandler);

         // capture mouse listeners to help block click and mousedown events.
         // mousedown is blocked when a scroll is in progress
@@ -1024,9 +1025,9 @@
     private function uninstallTouchListeners():void
     {
         removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
-        removeEventListener(GestureCaptureEvent.GESTURE_CAPTURE_STARTING, gestureCaptureStartingHandler);
-        removeEventListener(GestureCaptureEvent.GESTURE_CAPTURE_START, gestureCaptureStartHandler);
-        removeEventListener(GestureCaptureEvent.GESTURE_CAPTURE_END, gestureCaptureEndHandler);
+        removeEventListener(TouchInteractionEvent.TOUCH_INTERACTION_STARTING, touchInteractionStartingHandler);
+        removeEventListener(TouchInteractionEvent.TOUCH_INTERACTION_START, touchInteractionStartHandler);
+        removeEventListener(TouchInteractionEvent.TOUCH_INTERACTION_END, touchInteractionEndHandler);

         removeEventListener(MouseEvent.CLICK, touchScrolling_captureMouseHandler, true);
         removeEventListener(MouseEvent.MOUSE_DOWN, touchScrolling_captureMouseHandler, true);
@@ -1239,9 +1240,9 @@
             invalidateSkin();
         }

-        if (allStyles || styleProp == "inputMode")
-        {
-            if (getStyle("inputMode") == "touch")
+        if (allStyles || styleProp == "interactionMode")
+        {
+            if (getStyle("interactionMode") == InteractionMode.TOUCH)
             {
                 installTouchListeners();

@@ -1473,12 +1474,12 @@
      *  @private
      *  Event handler dispatched when someone is about to start scrolling.
      */
-    private function gestureCaptureStartingHandler(event:GestureCaptureEvent):void
+    private function touchInteractionStartingHandler(event:TouchInteractionEvent):void
     {
         // if it's us, don't do anything
         // if it's someone else and we've started scrolling, cancel this event
         // if it's someone else and we haven't started scrolling, don't do anything
-        // here yet. Worry about it in the gestureCaptureStartHandler().
+        // here yet. Worry about it in the touchInteractionStartHandler().
         if (event.relatedObject != this && (horizontalScrollInProgress || verticalScrollInProgress))
         {
             event.preventDefault();
@@ -1489,7 +1490,7 @@
      *  @private
      *  Event handler dispatched when someone has started scrolling.
      */
-    private function gestureCaptureStartHandler(event:GestureCaptureEvent):void
+    private function touchInteractionStartHandler(event:TouchInteractionEvent):void
     {
         if (event.relatedObject != this)
         {
@@ -1650,7 +1651,7 @@
      *  When the throw is over, no need to listen for mouse events anymore.
      *  Also, use this to hide the scrollbars.
      */
-    private function gestureCaptureEndHandler(event:GestureCaptureEvent):void
+    private function touchInteractionEndHandler(event:TouchInteractionEvent):void
     {
         if (event.relatedObject == this)
         {
@@ -1693,8 +1694,8 @@
 import flash.utils.getTimer;

 import mx.core.mx_internal;
-import mx.events.GestureCaptureEvent;
-import mx.events.GestureCaptureReason;
+import mx.events.TouchInteractionEvent;
+import mx.events.TouchInteractionReason;
 import mx.events.SandboxMouseEvent;
 import mx.utils.GetTimerUtil;

@@ -2032,9 +2033,9 @@
             if (shouldBeScrolling)
             {
                 // Dispatch a cancellable and bubbling event to notify others
-                var scrollStartingEvent:GestureCaptureEvent = new GestureCaptureEvent(GestureCaptureEvent.GESTURE_CAPTURE_STARTING, true, true);
+                var scrollStartingEvent:TouchInteractionEvent = new TouchInteractionEvent(TouchInteractionEvent.TOUCH_INTERACTION_STARTING, true, true);
                 scrollStartingEvent.relatedObject = scroller;
-                scrollStartingEvent.reason = GestureCaptureReason.SCROLL;
+                scrollStartingEvent.reason = TouchInteractionReason.SCROLL;
                 var eventAccepted:Boolean = mouseDownedDisplayObject.dispatchEvent(scrollStartingEvent);

                 // if the event was preventDefaulted(), then stop scrolling scrolling
@@ -2050,9 +2051,9 @@
                 }

                 // if the event has been accepted, then dispatch a bubbling start event
-                var scrollStartEvent:GestureCaptureEvent = new GestureCaptureEvent(GestureCaptureEvent.GESTURE_CAPTURE_START, true, true);
+                var scrollStartEvent:TouchInteractionEvent = new TouchInteractionEvent(TouchInteractionEvent.TOUCH_INTERACTION_START, true, true);
                 scrollStartEvent.relatedObject = scroller;
-                scrollStartEvent.reason = GestureCaptureReason.SCROLL;
+                scrollStartEvent.reason = TouchInteractionReason.SCROLL;
                 mouseDownedDisplayObject.dispatchEvent(scrollStartEvent);

                 // FIXME (rfrishbe): the difference should not be from the original point but from the slop.
@@ -2161,7 +2162,7 @@
         lastVelocity.x *= movedRatio.x;
         lastVelocity.y *= movedRatio.y;

-        var scrollEndEvent:GestureCaptureEvent;
+        var scrollEndEvent:TouchInteractionEvent;

         // FIXME (rfrishbe): should be minXVelocity, minYVelocity, minDiagonalVelocity
         // FIXME (rfrishbe): this should be parameterized better and the heuristic should
@@ -2172,9 +2173,9 @@
             isScrolling = false;

             // don't do anything
-            scrollEndEvent = new GestureCaptureEvent(GestureCaptureEvent.GESTURE_CAPTURE_END);
+            scrollEndEvent = new TouchInteractionEvent(TouchInteractionEvent.TOUCH_INTERACTION_END);
             scrollEndEvent.relatedObject = scroller;
-            scrollEndEvent.reason = GestureCaptureReason.SCROLL;
+            scrollEndEvent.reason = TouchInteractionReason.SCROLL;
             scroller.dispatchEvent(scrollEndEvent);
             return;
         }
@@ -2197,9 +2198,9 @@
             isScrolling = false;

             // don't do anything
-            scrollEndEvent = new GestureCaptureEvent(GestureCaptureEvent.GESTURE_CAPTURE_END);
+            scrollEndEvent = new TouchInteractionEvent(TouchInteractionEvent.TOUCH_INTERACTION_END);
             scrollEndEvent.relatedObject = scroller;
-            scrollEndEvent.reason = GestureCaptureReason.SCROLL;
+            scrollEndEvent.reason = TouchInteractionReason.SCROLL;
             scroller.dispatchEvent(scrollEndEvent);
         }
     }
@@ -2254,15 +2255,15 @@

     /**
      *  @private
-     *  When the touchScrollThrow is over, we should dispatch a gestureCaptureEnd.
+     *  When the touchScrollThrow is over, we should dispatch a touchInteractionEnd.
      */
     public function touchScrollThrowAnimationEnd():void
     {
         isScrolling = false;

-        var scrollEndEvent:GestureCaptureEvent = new GestureCaptureEvent(GestureCaptureEvent.GESTURE_CAPTURE_END);
+        var scrollEndEvent:TouchInteractionEvent = new TouchInteractionEvent(TouchInteractionEvent.TOUCH_INTERACTION_END);
         scrollEndEvent.relatedObject = scroller;
-        scrollEndEvent.reason = GestureCaptureReason.SCROLL;
+        scrollEndEvent.reason = TouchInteractionReason.SCROLL;
         scroller.dispatchEvent(scrollEndEvent);
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 7156
Author:   egeorgie@adobe.com
Date:     2009-05-20T21:43:02.892782Z

Log Message:
-----------
Fix bug http://bugs.adobe.com/jira/browse/SDK-20571 BasicLayout:fractional numbers for size,position of an element not rounded up

Fix: make sure that the measured sizes and the content sizes that are calculated by the layouts are rounded up to the nearest pixel.

QE Notes: Some mustella test may expectedly fail if they are dealing with groups with non-integer sized content (most common case - unconstrained Rect with 1 pixel stroke).

Doc Notes: None
Bugs: SDK-20571
Reviewer: Hans
tests: build, checkintests, mustella (gumbo layouts)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/BasicLayout.as
+++ frameworks/projects/spark/src/spark/layouts/BasicLayout.as
@@ -237,7 +237,7 @@
             }
             else if (!isNaN(baseline))
             {
-                extY = baseline - layoutElement.baselinePosition;
+                extY = Math.round(baseline - layoutElement.baselinePosition);
             }
             else if (!isNaN(top) || !isNaN(bottom))
             {
@@ -268,11 +268,12 @@
             minHeight = Math.max(minHeight, extY + elementMinHeight);
         }

-        layoutTarget.measuredWidth = Math.max(width, minWidth);
-        layoutTarget.measuredHeight = Math.max(height, minHeight);
-
-        layoutTarget.measuredMinWidth = minWidth;
-        layoutTarget.measuredMinHeight = minHeight;
+        // Use Math.ceil() to make sure that if the content partially occupies
+        // the last pixel, we'll count it as if the whole pixel is occupied.
+        layoutTarget.measuredWidth = Math.ceil(Math.max(width, minWidth));
+        layoutTarget.measuredHeight = Math.ceil(Math.max(height, minHeight));
+        layoutTarget.measuredMinWidth = Math.ceil(minWidth);
+        layoutTarget.measuredMinHeight = Math.ceil(minHeight);
     }

     /**
@@ -374,7 +375,7 @@
                 if (!isNaN(right))
                      availableWidth -= right;

-                childWidth = availableWidth * Math.min(percentWidth * 0.01, 1);
+                childWidth = Math.round(availableWidth * Math.min(percentWidth * 0.01, 1));
                 elementMaxWidth = Math.min(elementMaxWidth,
                     maxSizeToFitIn(unscaledWidth, hCenter, left, right, layoutElement.getLayoutBoundsX()));
             }
@@ -391,7 +392,7 @@
                 if (!isNaN(bottom))
                     availableHeight -= bottom;

-                childHeight = availableHeight * Math.min(percentHeight * 0.01, 1);
+                childHeight = Math.round(availableHeight * Math.min(percentHeight * 0.01, 1));
                 elementMaxHeight = Math.min(elementMaxHeight,
                     maxSizeToFitIn(unscaledHeight, vCenter, top, bottom, layoutElement.getLayoutBoundsY()));
             }
@@ -430,7 +431,7 @@
             if (!isNaN(vCenter))
                 childY = Math.round((unscaledHeight - elementHeight) / 2 + vCenter);
             else if (!isNaN(baseline))
-                childY = baseline - IVisualElement(layoutElement).baselinePosition;
+                childY = Math.round(baseline - IVisualElement(layoutElement).baselinePosition);
             else if (!isNaN(top))
                 childY = top;
             else if (!isNaN(bottom))
@@ -446,7 +447,9 @@
             maxY = Math.max(maxY, childY + elementHeight);
         }

-        layoutTarget.setContentSize(maxX, maxY);
+        // Make sure that if the content spans partially over a pixel to the right/bottom,
+        // the content size includes the whole pixel.
+        layoutTarget.setContentSize(Math.ceil(maxX), Math.ceil(maxY));
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19635
Author:   aharui@adobe.com
Date:     2011-01-07T00:25:18.039632Z

Log Message:
-----------
revert the layout changes from svn 18635.  Management feels that there isn't enough time to thoroughly test the changes.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/core/Application.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airspark/src/spark/components/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/IContainerInvalidating.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/ILayoutManagerContainerClient.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/IStyleManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/core/Container.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/LayoutManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Application.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/BasicLayout.as
+++ frameworks/projects/spark/src/spark/layouts/BasicLayout.as
@@ -512,18 +512,9 @@
             // Set position
             layoutElement.setLayoutBoundsPosition(childX, childY);

-            // update content limits.  For centered objects the only thing
-            // that affects content size is its own size, not its position
-            // since its position can change based on container size.
-            if (!isNaN(hCenter))
-                maxX = Math.max(maxX, elementWidth);
-            else
-                maxX = Math.max(maxX, childX + elementWidth);
-
-            if (!isNaN(vCenter))
-                maxY = Math.max(maxY, elementHeight);
-            else
-                maxY = Math.max(maxY, childY + elementHeight);
+            // update content limits
+            maxX = Math.max(maxX, childX + elementWidth);
+            maxY = Math.max(maxY, childY + elementHeight);
         }

         // Make sure that if the content spans partially over a pixel to the right/bottom,


added support for 'regex' property as an alternative to the preferred 'regexp' property

--- WeaveData/src/weave/data/KeySets/ColumnDataFilter.as
+++ WeaveData/src/weave/data/KeySets/ColumnDataFilter.as
@@ -111,7 +111,7 @@
 				{
 					if (!_regexps)
 						_regexps = [];
-					regexp = new RegExp(value[REGEXP]);
+					regexp = toRegExp(value);
 					_regexps.push(regexp);
 				}
 			}
@@ -220,7 +220,7 @@
 			}
 			else if (isRegExp(value))
 			{
-				return new RegExp(value[REGEXP] || value[ALTERNATE_REGEX_PROPERTY]).toString();
+				return toRegExp(value).toString();
 			}

 			return null;
@@ -230,6 +230,11 @@
 		{
 			return obj != null && typeof obj == 'object'
 				&& (obj.hasOwnProperty(REGEXP) || obj.hasOwnProperty(ALTERNATE_REGEX_PROPERTY));
+		}
+
+		private static function toRegExp(value:Object):RegExp
+		{
+			return new RegExp(value[REGEXP] || value[ALTERNATE_REGEX_PROPERTY]);
 		}

 		private var _deprecatedRangeState:Object;


FLEX-33514 fixed am/pm issue with other locales

--- frameworks/projects/framework/src/mx/formatters/DateFormatter.as
+++ frameworks/projects/framework/src/mx/formatters/DateFormatter.as
@@ -136,8 +136,10 @@

         var count:int = 0;
         var len:int = str.length;
+		var isPM:Boolean = false;

 		var punctuation:Object = {};
+		var ampm:Object = {};

 		punctuation["/"] = {general:true, date:true, time:false};
 		punctuation[":"] = {general:true, date:false, time:true};
@@ -151,11 +153,18 @@
 		punctuation["月"] = {general:true, date:true, time:false};
 		punctuation["日"] = {general:true, date:true, time:false};
 		punctuation["午"] = {general:false, date:false, time:true};
-
 		// Korean
 		punctuation["년"] = {general:true, date:true, time:false};
 		punctuation["월"] = {general:true, date:true, time:false};
 		punctuation["일"] = {general:true, date:true, time:false};
+
+		ampm["PM"] = true;
+		ampm["pm"] = true;
+		ampm["\u33D8"] = true; // unicode pm
+		ampm["μμ"] = true; // Greek
+		ampm["午後"] = true; // Japanese
+		ampm["上午"] = true; // Chinese
+		ampm["오후"] = true; // Korean

         // Strip out the Timezone. It is not used by the DateFormatter
         var timezoneRegEx:RegExp = /(GMT|UTC)((\+|-)\d\d\d\d )?/ig;
@@ -237,6 +246,17 @@
                     }
                 }
                 marker = 0;
+
+				// Other lacales AM/PM
+				if (ampm.hasOwnProperty(word))
+				{
+					isPM = true;
+
+					if (hour > 12)
+						break; // error
+					else if (hour >= 0)
+						hour += 12;
+				}
             }

             else if ("0" <= letter && letter <= "9")
@@ -296,7 +316,17 @@
                 else if (punctuation.hasOwnProperty(letter) && punctuation[letter].time)
                 {
                     if (hour < 0)
+					{
                         hour = num;
+
+						if (isPM)
+						{
+							if (hour > 12)
+								break; //error
+							else
+								hour += 12;
+						}
+					}
                     else if (min < 0)
                         min = num;
 					else if (sec < 0)


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

--- frameworks/projects/spark/src/spark/accessibility/ListAccImpl.as
+++ frameworks/projects/spark/src/spark/accessibility/ListAccImpl.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 spark.accessibility
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3509
Author:   jimurphy@adobe.com
Date:     2008-10-07T18:19:17.646255Z

Log Message:
-----------
Rename of flex -> mx.

For compatibility reasons it was decided that the new functionality remain integrated with the old framework, although we will continue to build two separate SWCs, one with primarily existing framework classes, and one with new Flex 4 classes. This change removes duplicate names from the Flex 4 framework to avoid class name overlapping with the old framework code.  The naming overlap consists of two major areas:  New Components, and New Effects

Modified Paths:
--------------
386 paths were modified

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

--- frameworks/projects/spark/src/spark/filters/ColorMatrixFilter.as
+++ frameworks/projects/spark/src/spark/filters/ColorMatrixFilter.as
@@ -1,4 +1,4 @@
-package flex.filters
+package mx.filters
 {
 import flash.filters.BitmapFilter;
 import flash.filters.ColorMatrixFilter;


Branch merge

Branch merge

--- as3/smartform/src/com/rpath/raf/views/ExtendedFormItem.as
+++ as3/smartform/src/com/rpath/raf/views/ExtendedFormItem.as
@@ -41,7 +41,7 @@
             var lbl:Label = FormItem(event.currentTarget).itemLabel as Label;
             lbl.selectable = true;
             lbl.enabled = true;
-            lbl.setStyle("color", "blue");
+            lbl.setStyle("color", "#6666ff");
             lbl.setStyle("textDecoration", "underline");
             lbl.toolTip = "Click here for more information";
             lbl.useHandCursor = true;


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

--- frameworks/projects/charts/src/mx/charts/chartClasses/PolarChart.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/PolarChart.as
@@ -0,0 +1,718 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.charts.chartClasses
+{
+
+import flash.display.DisplayObject;
+import flash.events.KeyboardEvent;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+import flash.ui.Keyboard;
+
+import mx.charts.ChartItem;
+import mx.charts.LinearAxis;
+import mx.charts.events.ChartItemEvent;
+import mx.charts.styles.HaloDefaults;
+import mx.core.IUIComponent;
+import mx.core.mx_internal;
+import mx.graphics.SolidColor;
+import mx.graphics.Stroke;
+import mx.styles.CSSStyleDeclaration;
+import mx.core.IFlexModuleFactory;
+
+use namespace mx_internal;
+
+/**
+ *  The PolarChart control serves as base class for circular charts
+ *  based in polar coordinates.
+ *
+ *
A chart's minimum size is 20,20 pixels.

+ *
A chart's maximum size is unbounded.

+ *
A chart's preferred size is 400,400 pixels.

+ *
+ *  @see mx.charts.CategoryAxis
+ *  @see mx.charts.LinearAxis
+ *  @see mx.charts.chartClasses.ChartBase
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class PolarChart extends ChartBase
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class initialization
+    //
+    //--------------------------------------------------------------------------
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function PolarChart()
+    {
+        super();
+
+        transforms = [ new PolarTransform() ];
+
+        var aa:LinearAxis = new LinearAxis();
+        aa.autoAdjust = false;
+        angularAxis = aa;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var _moduleFactoryInitialized:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var axisLayoutDirty:Boolean = true;
+
+    /**
+     *  @private
+     */
+    private var _axisDirty:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  angularAxis
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the angularAxis property.
+     */
+    private var _angularAxis:IAxis;
+
+    [Inspectable(category="Data")]
+
+    /**
+     *  The axis object used to map data values to an angle
+     *  between 0 and 2 * PI.
+     *  By default, this is a linear axis with the autoAdjust
+     *  property set to false.
+     *  So, data values are mapped uniformly around the chart.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get angularAxis():IAxis
+    {
+        return _angularAxis;
+    }
+
+    /**
+     *  @private
+     */
+    public function set angularAxis(value:IAxis):void
+    {
+        _transforms[0].setAxis(PolarTransform.ANGULAR_AXIS, value);
+        _angularAxis = value;
+        _axisDirty = true;
+
+        invalidateData();
+        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  radialAxis
+    //----------------------------------
+
+    [Inspectable(category="Data")]
+
+    /**
+     *  The axis object used to map data values to a radial distance
+     *  between the center and the outer edge of the chart.
+     *  By default, this is a linear axis with the autoAdjust
+     *  property set to false.
+     *  So, data values are  mapped uniformly from the inside
+     *  to the outside of the chart
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get radialAxis():IAxis
+    {
+        return _transforms[0].getAxis(PolarTransform.RADIAL_AXIS);
+    }
+
+    /**
+     *  @private
+     */
+    public function set radialAxis(value:IAxis):void
+    {
+        _transforms[0].setAxis(PolarTransform.RADIAL_AXIS, value);
+        _axisDirty = true;
+
+        invalidateData();
+        invalidateProperties();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overriden methods: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private function initStyles():Boolean
+	{
+		HaloDefaults.init(styleManager);
+
+		var polarChartStyle:CSSStyleDeclaration =
+			HaloDefaults.createSelector("mx.charts.chartClasses.PolarChart", styleManager);
+
+		polarChartStyle.defaultFactory = function():void
+		{
+			this.dataTipRenderer = DataTip;
+			this.fill = new SolidColor(0xFFFFFF, 0);
+			this.calloutStroke = new Stroke(0x888888,2);
+			this.fontSize = 10;
+		}
+
+		return true;
+	}
+
+	/**
+	 *  @inheritDoc
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	override public function set moduleFactory(factory:IFlexModuleFactory):void
+	{
+		super.moduleFactory = factory;
+
+		if (_moduleFactoryInitialized)
+			return;
+
+		_moduleFactoryInitialized = true;
+
+		// our style settings
+		initStyles();
+	}
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        // If the angular or radial axes is re-set then you have to invalidate the series
+        // as they might be using the same axes as the chart's
+        if (_axisDirty == true)
+        {
+        	var n:int = series.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                series[i].invalidateProperties();
+            }
+
+            n = annotationElements.length;
+            for (i = 0; i < n; i++)
+            {
+                var h:Object;
+                h = annotationElements[i];
+                if (!h)
+                    continue;
+                if (h is IDataCanvas)
+                    h.invalidateProperties();
+            }
+
+            n = backgroundElements.length;
+            for (i = 0; i < n; i++)
+            {
+                h = backgroundElements[i];
+                if (!h)
+                    continue;
+                if (h is IDataCanvas)
+                    h.invalidateProperties();
+            }
+
+            _axisDirty = false;
+        }
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // Force the range to update any automatic mappings.
+        _angularAxis.getLabelEstimate();
+
+        var paddingLeft:Number = getStyle("paddingLeft");
+        var paddingRight:Number = getStyle("paddingRight");
+        var paddingTop:Number = getStyle("paddingTop");
+        var paddingBottom:Number = getStyle("paddingBottom");
+
+        var rcElements:Rectangle = new Rectangle(
+            paddingLeft, paddingTop,
+            unscaledWidth - paddingLeft - paddingRight,
+            unscaledHeight - paddingTop - paddingBottom);
+
+        var i:int;
+        var n: int = _transforms.length;
+        for (i = 0; i < n; i++)
+        {
+            _transforms[i].setSize(rcElements.width,rcElements.height);
+        }
+
+        n = allElements.length;
+        for (i = 0; i < n; i++)
+        {
+            var c:DisplayObject = allElements[i];
+            if (c is IUIComponent)
+            {
+                (c as IUIComponent).setActualSize(rcElements.width,
+                                                 rcElements.height);
+            }
+            else
+            {
+                c.width = rcElements.width;
+                c.height = rcElements.height;
+            }
+            if (c is Series)
+                PolarTransform((c as Series).dataTransform).setSize(rcElements.width,rcElements.height);
+            if (c is IDataCanvas)
+                PolarTransform((c as Object).dataTransform).setSize(rcElements.width, rcElements.height);
+        }
+
+        if (_seriesHolder.mask)
+        {
+            _seriesHolder.mask.width = rcElements.width;
+            _seriesHolder.mask.height = rcElements.height;
+        }
+
+        if (_backgroundElementHolder.mask)
+        {
+            _backgroundElementHolder.mask.width = rcElements.width;
+            _backgroundElementHolder.mask.height = rcElements.height;
+        }
+
+        if (_annotationElementHolder.mask)
+        {
+            _annotationElementHolder.mask.width = rcElements.width;
+            _annotationElementHolder.mask.height = rcElements.height;
+        }
+
+        _seriesHolder.move(rcElements.left, rcElements.top);
+        _backgroundElementHolder.move(rcElements.left, rcElements.top);
+        _annotationElementHolder.move(rcElements.left, rcElements.top);
+
+        axisLayoutDirty = false;
+        advanceEffectState();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overriden methods: ChartBase
+    //
+    //--------------------------------------------------------------------------
+
+    [Deprecated(replacement="IChartElement2.dataToLocal()")]
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function dataToLocal(...dataValues):Point
+    {
+        var data:Object = {};
+
+        var da:Array /* of Object */ = [ data ];
+
+        var len:int = dataValues.length;
+
+        if (len > 0)
+        {
+            data["d0"] = dataValues[0];
+
+            _transforms[0].getAxis(PolarTransform.ANGULAR_AXIS).
+                mapCache(da, "d0", "v0");
+        }
+
+        if (len > 1)
+        {
+            data["d1"] = dataValues[1];
+
+            _transforms[0].getAxis(PolarTransform.RADIAL_AXIS).
+                mapCache(da, "d1", "v1");
+        }
+
+        _transforms[0].transformCache(da, "v0", "s0", "v1", "s1");
+
+        return new Point(_transforms[0].origin.x +
+                         Math.cos(data.s0) * data.s1,
+                         _transforms[0].origin.y -
+                         Math.sin(data.s0) * data.s1);
+    }
+
+    [Deprecated(replacement="IChartElement2.localToData()")]
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function localToData(v:Point):Array /* of Object */
+    {
+        var dx:Number = v.x - _transforms[0].origin.x;
+        var dy:Number = v.y - _transforms[0].origin.y;
+
+        var a:Number = calcAngle(dx,dy);
+
+        var r:Number = Math.sqrt(dx * dx + dy * dy);
+
+        var values:Array /* of Object */ = _transforms[0].invertTransform(a, r);
+        return values;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override protected function get dataRegion():Rectangle
+    {
+        return getBounds(this);
+    }
+
+   /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function getLastItem(direction:String):ChartItem
+    {
+        var item:ChartItem = null;
+
+        if (_caretItem)
+            item = Series(_caretItem.element).items[Series(_caretItem.element).items.length - 1];
+        else
+            item = getPreviousSeriesItem(series);
+
+        return item;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function getFirstItem(direction:String):ChartItem
+    {
+        var item:ChartItem = null;
+
+        if (_caretItem)
+            item = Series(_caretItem.element).items[0];
+        else
+            item = getNextSeriesItem(series);
+
+        return item;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function getNextItem(direction:String):ChartItem
+    {
+        if (direction == ChartBase.HORIZONTAL)
+            return getNextSeriesItem(series);
+        else if (direction == ChartBase.VERTICAL)
+            return getNextSeries(series);
+
+        return null;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function getPreviousItem(direction:String):ChartItem
+    {
+        if (direction == ChartBase.HORIZONTAL)
+            return getPreviousSeriesItem(series);
+        else if (direction == ChartBase.VERTICAL)
+            return getPreviousSeries(series);
+
+        return null;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function keyDownHandler(event:KeyboardEvent):void
+    {
+        if (selectionMode == "none")
+            return;
+
+        var item:ChartItem = null;
+        var bSpace:Boolean = false;
+
+        switch (event.keyCode)
+        {
+            case Keyboard.UP:
+            {
+                item = getNextItem(ChartBase.VERTICAL);
+                break;
+            }
+
+            case Keyboard.DOWN:
+            {
+                item = getPreviousItem(ChartBase.VERTICAL);
+                break;
+            }
+
+            case Keyboard.LEFT:
+            {
+                item = getPreviousItem(ChartBase.HORIZONTAL);
+                break;
+            }
+
+            case Keyboard.RIGHT:
+            {
+                item = getNextItem(ChartBase.HORIZONTAL);
+                break;
+            }
+
+            case Keyboard.END:
+            case Keyboard.PAGE_DOWN:
+            {
+                item = getLastItem(ChartBase.HORIZONTAL);
+                break;
+            }
+
+            case Keyboard.HOME:
+            case Keyboard.PAGE_UP:
+            {
+                item = getFirstItem(ChartBase.HORIZONTAL);
+                break;
+            }
+
+            case Keyboard.SPACE:
+            {
+                handleSpace(event);
+                event.stopPropagation();
+                return;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+
+        if (item)
+        {
+            event.stopPropagation();
+            handleNavigation(item,event);
+        }
+    }
+
+    /**
+     *  @private
+     */
+
+    override mx_internal function handleShift(item:ChartItem):void
+    {
+        var anchorSeries:Series = Series(_anchorItem.element);
+        var itemSeries:Series = Series(item.element);
+
+        if (anchorSeries != itemSeries)
+            return;
+
+        var index1:int = anchorSeries.items.indexOf(_anchorItem);
+        var index2:int = itemSeries.items.indexOf(item);
+
+        var len:int = anchorSeries.items.length;
+        if (index1 > index2) // select everything
+        {
+            index1 = 0;
+            index2 = len - 1;
+        }
+        var temp:ChartItem = _anchorItem;
+        clearSelection();
+        _anchorItem = temp;
+
+        for (var i:int = index1; i <= index2; i++)
+        {
+            anchorSeries.addItemtoSelection(anchorSeries.items[i]);
+        }
+
+        _selectedSeries = anchorSeries;
+        _caretItem = item;
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function updateKeyboardCache():void
+    {
+
+        // Check whether all the series' transformations have been done, otherwise Series' renderdata would not be valid and hence the display too.
+        // This is done as setting up KeyboardCache can take sometime, if done on first access.
+        var n:int = _transforms.length;
+        var m:int;
+        for (var i:int = 0; i < n; i++)
+        {
+        	m = _transforms[i].elements.length;
+            for (var j:int = 0; j < m; j++)
+            {
+                if (_transforms[i].elements[j] is Series && getSeriesTransformState(_transforms[i].elements[j]) == true)
+                    return;
+            }
+        }
+
+        // Restore Selection
+
+        var arrObjects:Array /* of Object */ = [];
+        var arrSelect:Array /* of ChartItem */ = [];
+        var arrItems:Array /* of ChartItem */;
+        var index:int;
+        var bExistingSelection:Boolean = false;
+        var nCount:int = 0;
+        n = series.length;
+        for (i = 0; i < n; i++)
+        {
+            arrItems = series[i].items;
+            if (arrItems && series[i].selectedItems.length > 0)
+            {
+                bExistingSelection = true;
+                m = arrItems.length;
+                for (j = 0; j < m; j++)
+                {
+                    arrObjects.push(arrItems[j].item);
+                }
+
+                nCount += series[i].selectedItems.length;
+                m = series[i].selectedItems.length;
+                for (j = 0; j < m; j++)
+                {
+                    index = arrObjects.indexOf(series[i].selectedItems[j].item);
+                    if (index != -1)
+                        arrSelect.push(series[i].items[index]);
+                }
+                arrObjects = [];
+                series[i].emptySelectedItems();
+            }
+        }
+        if (bExistingSelection)
+        {
+            selectSpecificChartItems(arrSelect);
+            if (nCount != arrSelect.length)
+                dispatchEvent(new ChartItemEvent(ChartItemEvent.CHANGE,null,null,this));
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function calcAngle(x:Number, y:Number):Number
+    {
+        const twoMP:Number = Math.PI * 2;
+
+        var angle:Number;
+
+        var at:Number = Math.atan(-y / x);
+
+        if (x < 0)
+            angle = at + Math.PI;
+        else if (y < 0)
+            angle = at;
+        else
+            angle = at + twoMP;
+
+        return angle;
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 2361
Author:   dloverin@adobe.com
Date:     2008-07-03T15:51:44.977554Z

Log Message:
-----------
Clean up SystemManagerProxy.as and mx/sandbox.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/sandbox/IParentAccess.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/sandbox/ISandboxBridgeAccess.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/sandbox/SandboxBridgeGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/sandbox/IChildAccess.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/sandbox/ISandboxBridgeProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/sandbox/ISandboxBridgeGroup.as</path>

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

--- frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as
+++ frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as
@@ -55,15 +55,16 @@

 /**
- * This class acts as the SystemManager for a popup that is
- * added to the top-level SystemManager from a sandboxed application.
- * Instead of the popup being a child of the top-level
- * SystemManager as is normally done, the popup is a child of a
- * SystemManagerProxy, created in the same sandbox. The SystemManagerProxy
- * is the actual display object added to the top-level SystemManager.
- * The scheme is done to give the popup a "friendly" SystemManager
- * it can talk to. Otherwise the popup would not be able to access the
- * SystemManager that is its parent.
+ *  This class acts as the SystemManager for a popup window that is
+ *  added to a parent SystemManager from a compatible application.
+ *  Instead of the popup window being a child of the host
+ *  SystemManager as is normally done, the popup is a child of a
+ *  SystemManagerProxy, created in the same application domain.
+ *  The SystemManagerProxy is the actual display object added to the
+ *  host SystemManager.
+ *  The scheme is done to give the popup window a SystemManager,
+ *  with the same version of Flex and created in the same application domain,
+ *  that the pop up window will be able to talk to.
  */
 public class SystemManagerProxy extends SystemManager
 {
@@ -71,11 +72,10 @@

 	/**
-	 * Create a new SystemManagerProxy.
+	 *  Constructor.
 	 *
-	 * @param systemManager the system manager that this class is a proxy for.
-	 *        This is the system manager in the same sandbox as the popup
-	 * 		  that will eventually be added as a child of this class.
+	 *  @param systemManager the system manager that this class is a proxy for.
+	 *  This is the system manager in the same application domain as the popup.
 	 */
 	public function SystemManagerProxy(systemManager:ISystemManager2)
 	{
@@ -92,20 +92,35 @@

 	}

-	private function proxyMouseDownHandler(event:MouseEvent):void
-	{
-		// Tell our parent system manager we are active.
-	 	SystemManager(_systemManager).fireActivatedWindowEvent(this);
-	}
-
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  systemManager
+    //----------------------------------
+
 	private var _systemManager:ISystemManager2;
-
+
+    /**
+    *   The SystemManager that is being proxied. This is the SystemManager of
+    *   the application that created this proxy and the pop up window
+    *   that is a child of this proxy.
+    */
 	public function get systemManager():ISystemManager2
 	{
 		return _systemManager;
 	}

-		/**
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: SystemManager
+    //
+    //--------------------------------------------------------------------------
+
+	/**
 	 *  @inheritDoc
 	 */
 	override public function getDefinitionByName(name:String):Object
@@ -114,17 +129,27 @@
 	}

+    /**
+     *  @inheritDoc
+     */
 	override public function create(... params):Object
 	{
 		return IFlexModuleFactory(_systemManager).create.apply(this, params);
 	}

+    /**
+     *  @inheritDoc
+     */
 	override public function useBridge():Boolean
 	{
 		return false;		// proxy does not want to use the bridge
 	}

+    /**
+     *  Override to size mouse catcher to the size fo the system manager we
+     *  are the proxy for.
+     */
 	override mx_internal function resizeMouseCatcher():void
 	{
 		if (mouseCatcher)
@@ -138,50 +163,9 @@
 		}
 	}

-	/**
-	 * Listen to when our popup has started dragging. Expand the mouse catcher to catch
-	 * all the mouse moves when dragging.
-	 */
-	private function startDraggingHandler(event:Event):void
-	{
-		// trace("startDraggingHandler");
-		// Add the mouseCatcher as child 0.
-		if (!mouseCatcher)
-		{
-			mouseCatcher = new FlexSprite();
-			mouseCatcher.name = "mouseCatcher";
-			// Must use addChildAt because a creationComplete handler can create a
-			// dialog and insert it at 0.
-			noTopMostIndex++;
-			$addChildAt(mouseCatcher, 0);
-			resizeMouseCatcher();
-			if (!topLevel)
-			{
-				mouseCatcher.visible = false;
-				mask = mouseCatcher;
-			}
-		}
-
-		var screen:Rectangle = SystemManager(_systemManager).screen;
-		setActualSize(screen.width, screen.height);
-	}
-
-	/**
-	 * Called when dragging has stopped. We not reduce the size of the mouse
-	 * catcher so client area may be clicked on.
-	 */
-	private function stopDraggingHandler(event:Event):void
-	{
-		// trace("stopDraggingHandler");
-		if (mouseCatcher)
-		{
-			$removeChildAt(0);
-			noTopMostIndex--;
-			mouseCatcher = null;
-		}
-
-	}
-
+    /**
+     *  @inheritDoc
+     */
 	override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false,
 											priority:int=0, useWeakReference:Boolean=false):void
 	{
@@ -189,6 +173,9 @@
 		_systemManager.addEventListener(type, listener, useCapture, priority, useWeakReference);
 	}

+    /**
+     *  @inheritDoc
+     */
 	override public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
 	{
 		super.removeEventListener(type, listener, useCapture);
@@ -201,6 +188,8 @@
 	override public function activate(f:IFocusManagerContainer):void
 	{
 		// trace("SM Proxy: activate " + f );
+
+		// activate the proxied SystemManager.
 		var bridge:IEventDispatcher = _systemManager.sandboxBridgeGroup ?
 									  _systemManager.sandboxBridgeGroup.parentBridge : null;
 		if (bridge)
@@ -216,10 +205,14 @@
 		}
 	}

+    /**
+     *  @inheritDoc
+     */
 	override public function deactivate(f:IFocusManagerContainer):void
 	{
 		// trace("SM Proxy: deactivate " + f );

+        // deactivate the proxied SystemManager.
 		var sm:ISystemManager2 = ISystemManager2(_systemManager);
 		var bridge:IEventDispatcher = sm.sandboxBridgeGroup ? sm.sandboxBridgeGroup.parentBridge : null;
 		if (bridge)
@@ -235,17 +228,97 @@
 		}
 	}

+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Activates the FocusManager in an IFocusManagerContainer for the
+     *  pop up window parented by this proxy.
+     *
+     *  @param f IFocusManagerContainer the top-level window
+     *  whose FocusManager should be activated.
+     */
 	public function activateProxy(f:IFocusManagerContainer):void
 	{
 		super.activate(f);
 	}

+    /**
+     *  Deactivates the focus manager for the pop up window parented by this
+     *  proxy.
+     *
+     *  @param f IFocusManagerContainer the top-level window
+     *  whose FocusManager should be deactivated.
+     */
 	public function deactivateProxy(f:IFocusManagerContainer):void
 	{
 		if (f)
-			f.focusManager.deactivate();
-	}
-
+            f.focusManager.deactivate();
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *
+     *  Handle mouse downs on the pop up window.
+     */
+    private function proxyMouseDownHandler(event:MouseEvent):void
+    {
+        // Tell our parent system manager we are active.
+        SystemManager(_systemManager).fireActivatedWindowEvent(this);
+    }
+
+    /**
+     *  Listen to when our popup has started dragging. Expand the mouse catcher to catch
+     *  all the mouse moves when dragging.
+     */
+    private function startDraggingHandler(event:Event):void
+    {
+        // trace("startDraggingHandler");
+        // Add the mouseCatcher as child 0.
+        if (!mouseCatcher)
+        {
+            mouseCatcher = new FlexSprite();
+            mouseCatcher.name = "mouseCatcher";
+            // Must use addChildAt because a creationComplete handler can create a
+            // dialog and insert it at 0.
+            noTopMostIndex++;
+            $addChildAt(mouseCatcher, 0);
+            resizeMouseCatcher();
+            if (!topLevel)
+            {
+                mouseCatcher.visible = false;
+                mask = mouseCatcher;
+            }
+        }
+
+        var screen:Rectangle = SystemManager(_systemManager).screen;
+        setActualSize(screen.width, screen.height);
+    }
+
+    /**
+     *  Called when dragging has stopped. We not reduce the size of the mouse
+     *  catcher so client area may be clicked on.
+     */
+    private function stopDraggingHandler(event:Event):void
+    {
+        // trace("stopDraggingHandler");
+        if (mouseCatcher)
+        {
+            $removeChildAt(0);
+            noTopMostIndex--;
+            mouseCatcher = null;
+        }
+    }
+
 }

 }