fixed the shadow map blurring which was always a step higher than the one set (because of >= testing instead of >)

--- src/aerys/minko/render/shader/part/phong/attenuation/MatrixShadowMapAttenuationShaderPart.as
+++ src/aerys/minko/render/shader/part/phong/attenuation/MatrixShadowMapAttenuationShaderPart.as
@@ -81,7 +81,7 @@
 				var uvs 		: Vector.<SFloat>	= new <SFloat>[];
 				var uvDelta		: SFloat;

-				if (quality >= ShadowMappingQuality.LOW)
+				if (quality > ShadowMappingQuality.LOW)
 				{
 					uvDelta = multiply(float3(-1, 0, 1), invertSize);
 					uvs.push(
@@ -92,7 +92,7 @@
 					);
 				}

-				if (quality >= ShadowMappingQuality.MEDIUM)
+				if (quality > ShadowMappingQuality.MEDIUM)
 				{
 					uvDelta = multiply(float3(-2, 0, 2), invertSize);
 					uvs.push(
@@ -101,7 +101,7 @@
 					);
 				}

-				if (quality >= ShadowMappingQuality.HARD)
+				if (quality > ShadowMappingQuality.HARD)
 				{
 					uvDelta = multiply(float4(-2, -1, 1, 2), invertSize);
 					uvs.push(


ISessionManager implementation no longer required when asyncMode==false

--- WeaveData/src/weave/data/CSVParser.as
+++ WeaveData/src/weave/data/CSVParser.as
@@ -208,7 +208,8 @@
 					csvDataArray.splice(iRow, 1);
 			}

-			getCallbackCollection(this).triggerCallbacks();
+			if (asyncMode)
+				getCallbackCollection(this).triggerCallbacks();
 		}

 		/**


Fixed default labelPositions bug

Fixed default labelPositions bug

--- WeaveUI/src/weave/ui/CustomHSlider.as
+++ WeaveUI/src/weave/ui/CustomHSlider.as
@@ -17,6 +17,7 @@
 {
 	import mx.controls.HSlider;
 	import mx.controls.sliderClasses.Slider;
+	import mx.controls.sliderClasses.SliderDirection;
 	import mx.controls.sliderClasses.SliderLabel;
 	import mx.core.UIComponent;
 	import mx.core.mx_internal;
@@ -28,13 +29,18 @@
 	 */
 	public class CustomHSlider extends HSlider
 	{
+		public function CustomHSlider()
+		{
+			direction = SliderDirection.HORIZONTAL;
+		}
+
 		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
 		{
 			super.updateDisplayList(unscaledWidth, unscaledHeight);
 			setLabelPositions(this, _labelPositions);
 		}

-		private var _labelPositions:Array = [];
+		private var _labelPositions:Array = null;

 		/**
 		 * Positions corresponding to the labels property.


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

--- frameworks/projects/automation/src/mx/automation/delegates/controls/CheckBoxAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/controls/CheckBoxAutomationImpl.as
@@ -0,0 +1,110 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+package mx.automation.delegates.controls
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.controls.CheckBox;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  CheckBox control.
+	 *
+	 *  @see mx.controls.CheckBox
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class CheckBoxAutomationImpl extends ButtonAutomationImpl
+	{
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(CheckBox, CheckBoxAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 * @param obj CheckBox object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function CheckBoxAutomationImpl(obj:CheckBox)
+		{
+			super(obj);
+		}
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected function get chk():CheckBox
+		{
+			return uiComponent as CheckBox;
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden properties
+		//
+		//--------------------------------------------------------------------------
+
+		//----------------------------------
+		//  automationValue
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationValue():Array
+		{
+			var result:String = chk.selected ? "[X]" : "[ ]";
+			if (chk.label || chk.toolTip)
+				result += " " + (chk.label || chk.toolTip);
+			return [ result ];
+		}
+
+	}
+}


- Fixed typo in call to get initial hash value (deep link), which broke it.

git-svn-id: d7cf1b07b41ed2a88a7556b81fa6f5b806ccbcaf@26 a4fad56a-dc34-0410-8684-cb6ad95a1988

--- actionscript/unFocus/HistoryKeeper.as
+++ actionscript/unFocus/HistoryKeeper.as
@@ -86,7 +86,7 @@
 						'unFocus.History.addEventListener("historyChange",function(h){unFocus.SwfUtilities.getSwfReference("' +
 							ExternalInterface.objectID + '").updateFromHistory(h)});'
 					);
-					_currentHash = ExternalInterface.call("unFocus_History.getCurrent");
+					_currentHash = ExternalInterface.call("unFocus.History.getCurrent");
 					_available = true;
 				}
 				catch(e:Error) {


Transferred from the Adobe Open Source Subversion Repository

Revision: 4192
Author:   rfrishbe@adobe.com
Date:     2008-11-26T19:39:48.250759Z

Log Message:
-----------
This change will allow us to handle having the same items multiple times in the list, for example “Ryan Frishberg” can now be in the list twice.

In order to do it, rather than using the item to find the itemRenderer or to tell the list that an item’s been selected, we need to use the index instead.  Methods like getItemRenderer and getRendererItem were changed to accept an index rather than an item.  Other methods were added, like isItemIndexSelected() because I felt isItemSelected() is still a useful method to have, even though it’s ambiguous when multiple items come in to play.

For now, I just tried to change the parameters where needed.  Some of the names of the methods were updated to reflect the change, but others weren’t because PARB is going to review a lot of this on Thursday, so it’s easier to make a name change only once (and after PARB approves it).

I also added properties to ItemExistanceChangeEvent.as.  In a later checkin, I’ll create a separate RendererExistanceChangeEvent.as for DataGroups and use ItemExistanceChangeEvents only for IVisualElementContainers (Halo containers  will also dispatch these events).  However, this needs to be PARB reviewed, so I figured it’s best to hold off on this change until later.

Also included in this checkin are some small ASDoc updates to no longer use any of the “addItem(), numItems”, and instead use addElement() or numElements where appropriate.

QE Notes: Steve's excluded any failing tests.  As noted in the checkin, there will probably be some renaming related to these methods.  Also, add some tests for duplicate items now.
Doc Notes: None
Bugs: SDK-17912
Reviewer: Glenn
tests: checkintests, mustella DataGroup, FxDataContainer, FxList

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/ItemExistenceChangedEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -507,7 +507,7 @@
      *  Dynamic skin parts should always be instantiated by this method,
      *  rather than directly by calling the newInstance() method on the factory.
      *  This method creates the part, but does not add it to the display list.
-     *  The componet must call the Group.addItem() method, or the appropriate
+     *  The componet must call the Group.addElement() method, or the appropriate
      *  method to add the skin part to the display list.
      *
      *  @param partName The name of the part.


Transferred from the Adobe Open Source Subversion Repository

Revision: 18503
Author:   jszeto@adobe.com
Date:     2010-11-09T18:36:40.819408Z

Log Message:
-----------
ViewMenu Bug Fixes

http://bugs.adobe.com/jira/browse/SDK-28425 - ViewMenu memory is not freed when the ViewMenu is closed

Added logic to SkinnableComponent to detachSkin when removed from the Stage

http://bugs.adobe.com/jira/browse/SDK-28412 - ViewMenu 5-way press interaction is incorrect

Let ViewMenuItem handle the SPACE and ENTER keys.

QE notes: None
Doc notes: none
Bugs: SDK-28425, SDK-28412
Reviewer: Glenn
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenuItem.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenu.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -147,6 +147,37 @@
     //
     //--------------------------------------------------------------------------

+    private var _skinDestructionPolicy:String = "never";
+    private var skinDestructionPolicyChanged:Boolean = false;
+
+    /**
+     *  @private
+     *
+     *  If set to "auto", then the component will call detachSkin when it has been
+     *  removed from the Stage. If it is then added back to the Stage, the component
+     *  will call attachSkin. Set this to "auto" if you want to reduce the memory
+     *  usage of this component while it is not attached to the Stage.
+     *
+     *  Possible values are "auto" and "never".
+     *
+     *  @default "never"
+     */
+    mx_internal function get skinDestructionPolicy():String
+    {
+        return _skinDestructionPolicy;
+    }
+
+    mx_internal function set skinDestructionPolicy(value:String):void
+    {
+        if (value == _skinDestructionPolicy)
+            return;
+
+        _skinDestructionPolicy = value;
+
+        skinDestructionPolicyChanged = true;
+        invalidateProperties();
+    }
+
     /**
      * @private
      *
@@ -433,6 +464,22 @@
         {
             updateErrorSkin();
             errorStringChanged = false;
+        }
+
+        if (skinDestructionPolicyChanged)
+        {
+            if (skinDestructionPolicy == "auto")
+            {
+                addEventListener(Event.ADDED_TO_STAGE, adddedToStageHandler);
+                addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
+            }
+            else
+            {
+                removeEventListener(Event.ADDED_TO_STAGE, adddedToStageHandler);
+                removeEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
+            }
+
+            skinDestructionPolicyChanged = false;
         }
     }

@@ -1044,6 +1091,25 @@
         }
     }

+    /**
+     *  @private
+     */
+    private function adddedToStageHandler(event:Event):void
+    {
+        if (skin == null)
+        {
+            attachSkin();
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function removedFromStageHandler(event:Event):void
+    {
+        detachSkin();
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Implemented fps value

Implemented fps value

--- src/Player.as
+++ src/Player.as
@@ -190,7 +190,7 @@

     public function streamStatus():Object {
       var status:Object = {
-        'fps': 0,
+        'fps': Math.floor(this.ns.currentFPS + 0.5),
         'resolution': meta.width + 'x' + meta.height,
         'playbackSpeed': 1.0,
         'protocol': this.urlParsed.protocol,


Added a convenient static dumpStack() method.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@4470 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/Log.as
+++ src/as/Log.as
@@ -56,6 +56,15 @@
     {
         var log :ILogger = mx.logging.Log.getLogger("testing");
         log.debug.apply(log, params);
+    }
+
+    /**
+     * A convenience function for quickly printing a stack trace
+     * to the log, useful for debugging.
+     */
+    public static function dumpStack () :void
+    {
+        testing(new Error("dumpStack").getStackTrace());
     }

     /**


Alt-Audio : support live playlist reloading

--- src/org/mangui/hls/loader/AltAudioLevelLoader.as
+++ src/org/mangui/hls/loader/AltAudioLevelLoader.as
@@ -96,6 +96,14 @@
                 var newLevel : Level = new Level();
                 newLevel.updateFragments(frags);
                 newLevel.targetduration = Manifest.getTargetDuration(string);
+            // if stream is live, arm a timer to periodically reload playlist
+            if (!Manifest.hasEndlist(string)) {
+                var timeout : Number = Math.max(100, _reload_playlists_timer + 1000 * newLevel.averageduration - getTimer());
+                CONFIG::LOGGING {
+                    Log.debug("Alt Audio Level Live Playlist parsing finished: reload in " + timeout.toFixed(0) + " ms");
+                }
+                _timeoutID = setTimeout(_loadAudioLevelPlaylist, timeout);
+            }
                 _hls.audioTracks[_current_track].level = newLevel;
             }
             _hls.dispatchEvent(new HLSEvent(HLSEvent.AUDIO_LEVEL_LOADED, level));


added backwards compatibility for missing Weave.properties.panelBackgroundColor

--- WeaveUISpark/src/weave/WeaveProperties.as
+++ WeaveUISpark/src/weave/WeaveProperties.as
@@ -637,7 +637,9 @@
 		public function handleMissingSessionStateProperty(newState:Object, missingProperty:String):void
 		{
 			if (newState.hasOwnProperty('version') && missingProperty == 'mouseoverTextFormat')
-				copySessionState(visTextFormat, mouseoverTextFormat);
+				copySessionState(visTextFormat, mouseoverTextFormat);
+			if (missingProperty == 'panelBackgroundColor')
+				panelBackgroundColor.value = 0xFFFFFF;
 		}
 	}
 }


Adds m4v to valid file type allowed <= 10MB

--- flexEditor/src/org/arisgames/editor/components/GameEditorMediaPickerUploadFormView.as
+++ flexEditor/src/org/arisgames/editor/components/GameEditorMediaPickerUploadFormView.as
@@ -183,7 +183,7 @@
 				{
 					trace("File to Upload: Name = '" + fileChooser.fileList[k].name + "'");
 					fileChosen = fileChooser.fileList[k];
-					if(fileChosen.type == "mov"){
+					if(fileChosen.type == "mov" || fileChosen.type == "m4v"){
 						if(fileChosen.size <= AppConstants.MAX_VIDEO_UPLOAD_SIZE){
 							fileName.text = fileChosen.name;
 							fileOK = true;


#SUP-1764 #comment don't send percentage statistics for live entries #time 2h

--- plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
+++ plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
@@ -72,6 +72,7 @@
 		public var urchinCode : String;

 		public var defaultCategory:String;
+		private var _isLive:Boolean = false;
 		/**
 		 *Constructor.
 		 * @param urchin_code		The google analytics tracking code.
@@ -120,6 +121,7 @@
 			kse.widgetId = config["vo"]["flashvars"].id;
             kse.uiconfId = config["vo"].flashvars.uiConfId;
             kse.entryId =  (facade.retrieveProxy("mediaProxy"))["vo"].entry.id;
+			_isLive = (facade.retrieveProxy("mediaProxy"))["vo"]["isLive"];
  		    kse.clientVer = "3.0:" + facade["kdpVersion"];
             var dt:Date = new Date();
             kse.eventTimestamp = dt.time + dt.timezoneOffset-dt.timezoneOffset*60000; // milisec UTC + users timezone offset
@@ -334,6 +336,9 @@
 			 *
 			 */
 			function percentStatsChanged(currPosition:Number):void {
+				if ( _isLive )
+					return;
+
 				if (_nextCuePoint==-1)
 				{
 					if(_percentages.length == 0 || (_duration - currPosition) < 3 )


Transferred from the Adobe Open Source Subversion Repository

Revision: 22448
Author:   build@adobe.com
Date:     2011-09-08T19:26:12.465737Z

Log Message:
-----------
Version update to 4.6.0

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

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

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 4363
Author:   dloverin@adobe.com
Date:     2008-12-19T15:44:31.082489Z

Log Message:
-----------
Remove FxApplication properties: application, historyManagementEnabled, resetHistory.

QE Notes: None
Doc Notes: None
Bugs: SDK-16418
Reviewer: Alex
tests: checkintests, Application, controls, containers/Accordion, containers/ApplicationControlBar, containers/ControlBar

FxApplication.as
    Remove application, historyManagementEnabled, resetHistory properties.
UIComponentAccImpl.as
FlexPrintJob.as
BrowserManagerImpl.as
HistoryManagerImpl.as
IBrowserManager.as
    Recode references to historyManagementEnabled and resetHistory.
ControlBar.as
    Fix SDK-16418, ApplicationControlBar does not work in Gumbo in 2009 namespace

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/HistoryManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/BrowserManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/UIComponentAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/printing/FlexPrintJob.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IBrowserManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as</path>

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

--- frameworks/projects/framework/src/mx/managers/HistoryManagerImpl.as
+++ frameworks/projects/framework/src/mx/managers/HistoryManagerImpl.as
@@ -237,7 +237,8 @@
 		if (appID)
 			return;

-		if (!ApplicationGlobals.application.historyManagementEnabled)
+		if (!("historyManagementEnabled" in ApplicationGlobals.application) ||
+            !ApplicationGlobals.application.historyManagementEnabled)
 			return;

 		var loaderInfo:LoaderInfo;
@@ -320,7 +321,8 @@
 	 */
 	public function register(obj:IHistoryManagerClient):void
 	{
-		if (!ApplicationGlobals.application.historyManagementEnabled)
+        if (!("historyManagementEnabled" in ApplicationGlobals.application) ||
+            !ApplicationGlobals.application.historyManagementEnabled)
 			return;

 		// Ensure that this object isn't already registered.
@@ -486,7 +488,8 @@
 	 */
 	public function unregister(obj:IHistoryManagerClient):void
 	{
-		if (!ApplicationGlobals.application.historyManagementEnabled)
+        if (!("historyManagementEnabled" in ApplicationGlobals.application) ||
+            !ApplicationGlobals.application.historyManagementEnabled)
 			return;

 		// Find the index of the object in the Array of all
@@ -521,7 +524,8 @@
 	 */
 	public function save():void
 	{
-		if (!ApplicationGlobals.application.historyManagementEnabled)
+        if (!("historyManagementEnabled" in ApplicationGlobals.application) ||
+            !ApplicationGlobals.application.historyManagementEnabled)
 			return;

 		var haveState:Boolean = false;
@@ -578,7 +582,8 @@
 		{
 			BrowserManager.getInstance().setFragment(pendingQueryString);
 			pendingQueryString = null;
-			ApplicationGlobals.application.resetHistory = true;
+			if ("resetHistory" in ApplicationGlobals.application)
+			    ApplicationGlobals.application.resetHistory = true;
 		}
 	}

@@ -602,7 +607,8 @@
 		var p:String;
 		var crc:String;

-		if (!ApplicationGlobals.application.historyManagementEnabled)
+        if (!("historyManagementEnabled" in ApplicationGlobals.application) ||
+            !ApplicationGlobals.application.historyManagementEnabled)
 			return;

 		var pieces:Array = event.url.split(PROPERTY_SEPARATOR);


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/managers/SystemChildrenList.as
+++ frameworks/projects/framework/src/mx/managers/SystemChildrenList.as
@@ -0,0 +1,222 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2006 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+import flash.display.DisplayObject;
+import flash.geom.Point;
+import mx.core.IChildList;
+import mx.core.mx_internal;
+
+[ExcludeClass]
+
+/**
+ *  @private
+ *  A SystemManager has various types of children,
+ *  such as the Application, popups, tooltips, and custom cursors.
+ *
+ *  You can access all the children via the rawChildren property.
+ *  You can access just the popups via popUpChildren,
+ *  the tooltips via toolTipChildren,
+ *  and the custom cursors via cursorChildren.
+ *  Each of these returns a SystemChildrenList which implements IChildList.
+ *
+ *  The SystemChildrenList is given two indices that map
+ *  to a subset of the indices of children within the entire
+ *  set of child indices in the SystemManager.
+ *  It manages the children within those two indices.
+ */
+public class SystemChildrenList implements IChildList
+{
+    include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 */
+	public function SystemChildrenList(owner:SystemManager,
+									   lowerBoundReference:QName,
+									   upperBoundReference:QName)
+	{
+		super();
+
+		this.owner = owner;
+		this.lowerBoundReference = lowerBoundReference;
+		this.upperBoundReference = upperBoundReference;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var owner:SystemManager;
+
+	/**
+	 *  @private
+	 *  Either "noTopMostIndex", "topMostIndex", or "toolTipIndex".
+	 *  The popUpChildren extends from noTopMostIndex to topMostIndex.
+	 *  The toolTips extends from topMostIndex to toolTipIndex.
+	 *  The cursors extends from toolTipIndex to cursorIndex.
+	 */
+	private var lowerBoundReference:QName;
+
+	/**
+	 *  @private
+	 *  Either "topMostIndex", "toolTipIndex", or "cursorIndex".
+	 *  The popUpChildren extends from noTopMostIndex to topMostIndex.
+	 *  The toolTips extends from topMostIndex to toolTipIndex.
+	 *  The cursors extends from toolTipIndex to cursorIndex.
+	 */
+	private var upperBoundReference:QName;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @copy mx.core.IChildList#numChildren
+	 */
+	public function get numChildren():int
+	{
+		return owner[upperBoundReference] - owner[lowerBoundReference];
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#addChild
+	 */
+	public function addChild(child:DisplayObject):DisplayObject
+	{
+		owner.mx_internal::rawChildren_addChildAt(
+			child, owner[upperBoundReference]);
+		owner[upperBoundReference]++;
+		return child;
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#addChildAt
+	 */
+	public function addChildAt(child:DisplayObject, index:int):DisplayObject
+	{
+		owner.mx_internal::rawChildren_addChildAt(
+			child, owner[lowerBoundReference] + index);
+		owner[upperBoundReference]++;
+		return child;
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#removeChild
+	 */
+	public function removeChild(child:DisplayObject):DisplayObject
+	{
+		var index:int = owner.mx_internal::rawChildren_getChildIndex(child);
+		if (owner[lowerBoundReference] <= index &&
+			index < owner[upperBoundReference])
+		{
+			owner.mx_internal::rawChildren_removeChild(child);
+			owner[upperBoundReference]--;
+		}
+		return child;
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#removeChildAt
+	 */
+	public function removeChildAt(index:int):DisplayObject
+	{
+		var child:DisplayObject =
+			owner.mx_internal::rawChildren_removeChildAt(
+				index + owner[lowerBoundReference]);
+		owner[upperBoundReference]--;
+		return child;
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#getChildAt
+	 */
+  	public function getChildAt(index:int):DisplayObject
+  	{
+		var retval:DisplayObject =
+			owner.mx_internal::rawChildren_getChildAt(
+				owner[lowerBoundReference] + index);
+		return retval;
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#getChildByName
+	 */
+  	public function getChildByName(name:String):DisplayObject
+  	{
+		return owner.mx_internal::rawChildren_getChildByName(name);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#getChildIndex
+	 */
+  	public function getChildIndex(child:DisplayObject):int
+  	{
+		var retval:int = owner.mx_internal::rawChildren_getChildIndex(child);
+		retval -= owner[lowerBoundReference];
+		return retval;
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#setChildIndex
+	 */
+	public function setChildIndex(child:DisplayObject, newIndex:int):void
+	{
+		owner.mx_internal::rawChildren_setChildIndex(
+			child, owner[lowerBoundReference] + newIndex);
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#getObjectsUnderPoint
+	 */
+	public function getObjectsUnderPoint(point:Point):Array
+	{
+		return owner.mx_internal::rawChildren_getObjectsUnderPoint(point);
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#contains
+	 */
+	public function contains(child:DisplayObject):Boolean
+	{
+		if (owner.mx_internal::rawChildren_contains(child))
+		{
+			while (child.parent != owner)
+			{
+				child = child.parent;
+			}
+			var childIndex:int = owner.mx_internal::rawChildren_getChildIndex(child);
+			if (childIndex >= owner[lowerBoundReference] &&
+				childIndex < owner[upperBoundReference])
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 2332
Author:   dloverin@adobe.com
Date:     2008-07-02T04:20:22.772203Z

Log Message:
-----------
Fix for checketests(thanks Alex). API clean up.

Remove ISystemManager2.addEventListenerToStage().
Remove ISystemManager2.removeEventListenreFromStage().
Remove ISystemManager2.invalidateStage().
Add FlexEvent.ENTER_FRAME, FlexEvent.RENDER.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/sandbox/TrustTester.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/managers/ISystemManager2.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/tests/checkinapp/checkinapp_testScript.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollThumb.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/marshall-plan-3.0.x/frameworks/projects/framework/src/mx/controls/Button.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>

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

--- frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as
+++ frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as
@@ -182,17 +182,17 @@

 	}

-	override public function addEventListenerToStage(type:String, listener:Function, useCapture:Boolean = false,
+	override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false,
 											priority:int=0, useWeakReference:Boolean=false):void
 	{
-		addEventListener(type, listener, useCapture, priority, useWeakReference);
-		_systemManager.addEventListenerToStage(type, listener, useCapture, priority, useWeakReference);
-	}
-
-	override public function removeEventListenerFromStage(type:String, listener:Function, useCapture:Boolean = false):void
-	{
-		removeEventListener(type, listener, useCapture);
-		_systemManager.removeEventListenerFromStage(type, listener, useCapture);
+		super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+		_systemManager.addEventListener(type, listener, useCapture, priority, useWeakReference);
+	}
+
+	override public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
+	{
+		super.removeEventListener(type, listener, useCapture);
+		_systemManager.removeEventListener(type, listener, useCapture);
 	}

 	/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 17308
Author:   dthakkar@adobe.com
Date:     2010-08-12T23:22:20.533632Z

Log Message:
-----------
Flex integration feature (includes spark formatters and related checkintests.)
UIComponent.as - Added API's to support non visual style client
IAdvancedStyleClient.as - Added setter for StyleParent method
StyleProtoChain.as - Added else loop to verify if the component is IAdvancedStyleClient
StyleProxy.as - added setter for styleParent method (this class inherits IAdvancedStyleClient interface)

QE notes: No
Doc notes: No
Bugs: No
Reviewer: Gordon , Darrell
Tests run: CheckinTests, Mustella
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/styleTest</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/NumberFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/CollatorBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses/NumberBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters/supportClasses</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/CollatorTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/SortingCollator.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/StringToolsTestScript.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/formatters</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/AdvancedStyleClientTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/BasicTests-config.xml</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="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/styleTest/ADVStyleTestEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/NumberFormatterTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/CurrencyFormatterTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/CollatorTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/NumberFormatterTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/DateTimeFormatterTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/CurrencyFormatterTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/DateTimeFormatterTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/AdvancedStyleClientTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses/GlobalizationBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/formatters/IFormatter.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/styleTest/ADVStyleTestClass.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/supportClasses</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/StringToolsTests.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/globalization/MatchingCollator.as</path>

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

--- frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as
+++ frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as
@@ -0,0 +1,998 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 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.formatters
+{
+
+import flash.globalization.CurrencyFormatter;
+import flash.globalization.CurrencyParseResult;
+import flash.globalization.NationalDigitsType;
+
+import mx.core.mx_internal;
+import mx.formatters.IFormatter;
+
+import spark.formatters.supportClasses.NumberBase;
+import spark.globalization.LastOperationStatus;
+
+use namespace mx_internal;
+
+/**
+ *  The CurrencyFormatter class provides locale-sensitive formatting
+ *  and parsing of currency values. It can format currency amounts stored in
+ *  Number objects.
+ *
+ *
This class is a wrapper class around the
+ *  flash.globalization.CurrencyFormatter. Therefore
+ *  the locale-specific formatting
+ *  is provided by the flash.globalization.CurrencyFormatter.
+ *  However this CurrencyFormatter class can be used in mxml declartions,
+ *  uses the locale style for the requested Locale ID name, and has
+ *  methods and properties that are bindable.
+ *

+ *  The flash.globalization.CurrencyFormatter class uses the underlying
+ *  operating system for the formatting functionality and
+ *  to supply the locale specific data. On some operating systems,
+ *  the flash.globalization classes are unsupported, this wrapper
+ *  class provides a fallback functionality in this case.
+ *

+ *
+ *  @see flash.globalization.CurrencyFormatter
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4.5
+ */
+public class CurrencyFormatter extends NumberBase implements IFormatter
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static const CURRENCY_ISOCODE:String = "currencyISOCode";
+    private static const CURRENCY_SYMBOL:String = "currencySymbol";
+    private static const NEGATIVE_CURRENCY_FORMAT:String
+                                                    = "negativeCurrencyFormat";
+    private static const POSITIVE_CURRENCY_FORMAT:String
+                                                    = "positiveCurrencyFormat";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructs a new CurrencyFormatter object to format numbers
+     *  representing currency amounts according to
+     *  the conventions of a given locale.
+     *

+     *  The locale for this class is supplied by the locale style. The
+     *  locale style can be set in several ways:
+     *

+     *

+     *
         *
+     *  Inheriting the style from a UIComponent by calling the
+     *  UIComponent's addStyleClient method.
+     *

+     *

+     *  By using the class in an mxml declaration and inheriting the
+     *  locale from the document that contains the declaration.
+     *

+     *  <listing version="3.0" >
+     *  <fx:Declarations>
+     *         <s:StringTools id="st" />
+     *  </fx:Declarations>
+     *  </listing>
+     *

+     *  By using an mxml declaration and specifying the locale value
+     *  in the list of assignments.
+     *

+     *  <listing version="3.0" >
+     *  <fx:Declarations>
+     *      <s:StringTools id="st_turkish" locale="tr-TR" />
+     *  </fx:Declarations>
+     *  </listing>
+     *

+     *  Calling the setStyle method,
+     *  e.g. st.setStyle("locale", "tr-TR")
+     *

+     *

+     *

+     *  If the locale style is not set by one of the above techniques,
+     *  the methods of this class that depend on the locale
+     *  will throw an error.
+     *
         *
+     *
Certain properties such as the currencySymbol
+     *  and currencyISOCode properties are set
+     *  automatically based on the locale.

+     *
+     *
NOTE: When a fallback locale is used the currency
+     *  properties are set to default values,
+     *  and therefore the currencySymbol or
+     *  currencyISOCode properties might be given unexpected
+     *  values. It is a good idea to examine the
+     *  currencySymbol and currencyISOCode
+     *  property values before formatting a currency amount.
+     *

+     *
+     *  @see actualLocaleIDName
+     *
+     *  @playerversion Flash 10.1
+     *  @langversion 3.0
+     *  @productversion Flex 4.5
+     *  @productversion Flash CS5
+     */
+    public function CurrencyFormatter()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var currencySymbolOverride:String = null;
+
+    /**
+     *  @private
+     */
+    private var currencyISOCodeOverride:String = null;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  actualLocaleIDName
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  @inheritDoc
+     *
+     *  @see flash.globalization.CurrencyFormatter.actualLocaleIDName
+     *  @see #CurrencyFormatter()
+     *
+     *  @playerversion Flash 10.1
+     *  @langversion 3.0
+     *  @productversion Flash CS5
+     *  @productversion Flex 4.5
+     */
+    override public function get actualLocaleIDName():String
+    {
+        if (g11nWorkingInstance)
+            return (g11nWorkingInstance
+                as flash.globalization.CurrencyFormatter).actualLocaleIDName;
+
+        if (!localeStyle)
+        {
+            fallbackLastOperationStatus
+                                = LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return undefined;
+        }
+
+        fallbackLastOperationStatus = LastOperationStatus.NO_ERROR;
+
+        return "en-US";
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  currencyISOCode
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  The three letter ISO 4217 currency code for the actual locale
+     *  being used.
+     *
+     *
This code is used to determine the currency symbol or
+     *  string when formatting currency amounts
+     *  using the format() method with
+     *  the useCurrencySymbol property set to
+     *  false.

+     *
+     *
This property is initialized by the constructor
+     *  based on the actual locale that is used. When a fallback
+     *  locale is used this property reflects the preferred, default
+     *  currency code for the fallback locale.

+     *
+     *  @default dependent on the actual locale and operating system
+     *
+     *  @see #format()
+     *  @see #currencySymbol
+     *
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2
+     *  @langversion 3.0
+     */
+    public function get currencyISOCode():String
+    {
+        if (g11nWorkingInstance)
+            return g11nWorkingInstance.currencyISOCode;
+
+        if (!localeStyle)
+        {
+            fallbackLastOperationStatus
+                                = LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return undefined;
+        }
+
+        return properties.currencyISOCode;
+    }
+
+    public function set currencyISOCode(value:String):void
+    {
+        currencyISOCodeOverride = value;
+
+        if (g11nWorkingInstance)
+        {
+            g11nWorkingInstance.setCurrency(
+                                    value, g11nWorkingInstance.currencySymbol);
+        }
+        else
+        {
+            if (!value)
+                throw new TypeError();
+
+            if (properties)
+                properties.currencyISOCode = value;
+            fallbackLastOperationStatus = LastOperationStatus.NO_ERROR;
+        }
+
+        update();
+    }
+
+    //----------------------------------
+    //  currencySymbol
+    //----------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  The currency symbol or string for the actual locale being used.
+     *
+     *
This property is used as the currency symbol when formatting
+     *  currency amounts using the format() method with
+     *  the withCurrencySymbol parameter set to
+     *  true.

+     *
+     *
This property is initialized by the constructor based on
+     *  the actual locale that is used. When a fallback
+     *  locale is used this property reflects the preferred, default
+     *  currency symbol for the fallback locale.

+     *
+     *  @default dependent on the actual locale and operating system
+     *
+     *  @see #format()
+     *  @see #setCurrency()
+     *  @see #formattingWithCurrencySymbolIsSafe
+     *  @see #currencyISOCode
+     *
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2
+     *  @langversion 3.0
+     */
+    public function get currencySymbol():String
+    {
+        if (g11nWorkingInstance)
+            return g11nWorkingInstance.currencySymbol;
+
+        if (!localeStyle)
+        {
+            fallbackLastOperationStatus
+                                  = LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return undefined;
+        }
+
+        return properties.currencySymbol;
+    }
+
+    public function set currencySymbol(value:String):void
+    {
+        currencySymbolOverride = value;
+
+        if (g11nWorkingInstance)
+        {
+            g11nWorkingInstance.setCurrency(
+                                g11nWorkingInstance.currencySymbol, value);
+        }
+        else
+        {
+            if (!value)
+                throw new TypeError();
+
+            if (properties)
+                properties.currencySymbol = value;
+            fallbackLastOperationStatus = LastOperationStatus.NO_ERROR;
+        }
+
+        update();
+    }
+
+    //----------------------------------
+    //  negativeCurrencyFormat
+    //----------------------------------
+
+    [Bindable("change")]
+    [Inspectable(category="General",
+                        enumeration="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15")]
+
+    /**
+     *   A numeric value that indicates a formatting pattern for negative
+     *  currency amounts. This pattern defines the location of the
+     *  currency symbol and the negative symbol or parentheses in
+     *  relation to the numeric portion of the currency
+     *  amount.
+     *
+     *
The value of this property must be one of the constants
+     *  defined in the table below.
+     *

+     *
+     *
 The table below summarizes the possible formatting patterns
+     *  for negative currency amounts. When a currency amount is formatted
+     *  with the format() method:

+     *
+     *

+     *
The '¤' symbol is replaced with the value of the
+     *       currencyISOCode or
+     *       the currencySymbol property, depending on
+     *       the value of the withCurrencySymbol parameter
+     *       passed to the format() method;

+     *
The '-' character is replaced with the value of the
+     *       negativeNumberSymbol property;

+     *
The 'n' character is replaced with the currency amount
+     *       value that is passed to the format() method.

+     *

+     *
+     *

+     *

+     *            Negative currency format type
+     *            Formatting pattern
+     *

+     *

+     *            0
+     *            (¤n)
+     *

+     *

+     *            1
+     *            -¤n
+     *

+     *

+     *            2
+     *            ¤-n
+     *

+     *

+     *            3
+     *            ¤n-
+     *

+     *

+     *            4
+     *            (n¤)
+     *

+     *

+     *            5
+     *            -n¤
+     *

+     *

+     *            6
+     *            n-¤
+     *

+     *

+     *            7
+     *            n¤-
+     *

+     *

+     *            8
+     *            -n ¤
+     *

+     *

+     *            9
+     *            -¤ n
+     *

+     *

+     *            10
+     *            n ¤-
+     *

+     *

+     *            11
+     *            ¤ n-
+     *

+     *

+     *            12
+     *            ¤ -n
+     *

+     *

+     *            13
+     *            n- ¤
+     *

+     *

+     *            14
+     *            (¤ n)
+     *

+     *

+     *            15
+     *            (n ¤)
+     *

+     *

+     *
+     *  @default dependent on the actual locale and operating system
+     *
+     *  @throws ArgumentError if the assigned value is not between 0 and 15.
+     *
+     *  @see #format()
+     *  @see #currencySymbol
+     *  @see #negativeSymbol
+     *
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2
+     *  @langversion 3.0
+     *  @productversion Flex 4.5
+     */
+    public function get negativeCurrencyFormat():int
+    {
+        return getBasicProperty(properties, NEGATIVE_CURRENCY_FORMAT);
+    }
+
+    public function set negativeCurrencyFormat(value:int):void
+    {
+        if (!g11nWorkingInstance)
+        {
+            if ((value < 0) || (15 < value))
+                throw new TypeError();
+        }
+
+        setBasicProperty(properties, NEGATIVE_CURRENCY_FORMAT, value);
+    }
+
+    //----------------------------------
+    //  positiveCurrencyFormat
+    //----------------------------------
+
+    [Bindable("change")]
+    [Inspectable(category="General", enumeration="0,1,2,3")]
+
+    /**
+     *    A numeric value that indicates a formatting pattern for positive
+     *  currency amounts. This format defines the location of currency symbol
+     *  relative to the numeric portion of the currency amount.
+     *
+     *
The value of this property must be one of the constants
+     *  defined in the table below.
+     *

+     *
+     *
 The table below summarizes the possible formatting patterns
+     *  for positive currency amounts.
+     *  When a currency amount is formatted with the format()
+     *  method:

+     *
+     *

+     *
The '¤' symbol is replaced with the value of the
+     *       currencyISOCode or
+     *       the currencySymbol property, depending on the
+     *       value of the withCurrencySymbol parameter
+     *       passed to the format() method;

+     *
The 'n' character is replaced with the currency amount value
+     *       that is passed to the format() method.

+     *

+     *
+     *

+     *

+     *            Positive currency format type
+     *            Formatting pattern
+     *

+     *

+     *            0
+     *            ¤n
+     *

+     *

+     *            1
+     *            n¤
+     *

+     *

+     *            2
+     *            ¤ n
+     *

+     *

+     *            3
+     *            n ¤
+     *

+     *

+     *
+     *  @throws ArgumentError if the assigned value is not between 0 and 3.
+     *
+     *  @default dependent on the actual locale and operating system
+     *
+     *  @see #currencySymbol
+     *  @see #format()
+     *
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2
+     *  @langversion 3.0
+     *  @productversion Flex 4.5
+     */
+    public function get positiveCurrencyFormat():int
+    {
+        return getBasicProperty(properties, POSITIVE_CURRENCY_FORMAT);
+    }
+
+    public function set positiveCurrencyFormat(value:int):void
+    {
+        if (!g11nWorkingInstance)
+        {
+            if ((value < 0) || (4 < value))
+                throw new TypeError();
+        }
+
+        setBasicProperty(properties, POSITIVE_CURRENCY_FORMAT, value);
+    }
+
+    //----------------------------------
+    //  useCurrencySymbol
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _useCurrencySymbol:Boolean = false;
+
+    [Bindable("change")]
+
+    /**
+     *  Enables the use of the currencySymbol when formatting
+     *  currency amounts.
+     *
+     *
When the withCurrencySymbol property is
+     *  set to true, the value of the
+     *  currencySymbol property is used
+     *  in the string returned by the format method.
+     *  For example: $ 123,456,789.22

+     *
+     *
When the withCurrencySymbol property is set to
+     *  false, the value of the currencyISOCode
+     *  property is used in the string returned by the format method.
+     *  For example: USD 123456789.22

+     *
+     *  @default false
+     *
+     *  @see #formattingWithCurrencySymbolIsSafe
+     *  @see #format
+     *
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2
+     *  @langversion 3.0
+     *  @productversion Flex 4.5
+     */
+    public function get useCurrencySymbol():Boolean
+    {
+        return _useCurrencySymbol;
+    }
+
+    public function set useCurrencySymbol(value:Boolean):void
+    {
+        _useCurrencySymbol = value;
+
+        update();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override mx_internal function createWorkingInstance():void
+    {
+        if (!localeStyle)
+        {
+            fallbackLastOperationStatus
+                                = LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            g11nWorkingInstance = null;
+            properties = null;
+            return;
+        }
+
+        if (enforceFallback)
+        {
+            fallbackInstantiate();
+            g11nWorkingInstance = null;
+            return;
+        }
+
+        g11nWorkingInstance
+                    = new flash.globalization.CurrencyFormatter(localeStyle);
+        if (g11nWorkingInstance &&
+            (g11nWorkingInstance.lastOperationStatus
+                                    != LastOperationStatus.UNSUPPORTED_ERROR))
+        {
+            properties = g11nWorkingInstance;
+            propagateBasicProperties(g11nWorkingInstance);
+
+            if (currencySymbolOverride)
+            {
+                g11nWorkingInstance.setCurrency(
+                    g11nWorkingInstance.currencyISOCode,
+                    currencySymbolOverride);
+            }
+
+            if (currencyISOCodeOverride)
+            {
+                g11nWorkingInstance.setCurrency(
+                    currencyISOCodeOverride,
+                    g11nWorkingInstance.currencySymbol);
+            }
+
+            return;
+        }
+
+        fallbackInstantiate();
+        g11nWorkingInstance = null;
+
+        if (fallbackLastOperationStatus == LastOperationStatus.NO_ERROR)
+        {
+            fallbackLastOperationStatus
+                                = LastOperationStatus.USING_FALLBACK_WARNING;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    [Bindable("change")]
+
+    /**
+     *  Creates a string representing a currency amount formatted
+     *  according to the current properties of this CurrencyFormatter object,
+     *  including the locale, currency symbol, and currency ISO code,
+     *  useCurrencySymbol
+     *
+     *
By default this method uses the currencyISOCode
+     *  property to determine the currency symbol and other
+     *  settings used when formatting.

+     *
+     *
Many countries and regions use the same currency symbols for
+     *  different currencies.
+     *  For example the United States, Australia, New Zealand, Canada,
+     *  and Mexico all use the same dollar sign symbol ($) for local
+     *  currency values. When the formatting currency differs
+     *  from the user's local currency it is best to use the ISO code as
+     *  the currency string.
+     *  You can use the formattingWithCurrencySymbolIsSafe()
+     *  method to test whether the ISO code of the
+     *  currency to be formatted matches the currencyISOCode
+     *  property of the formatter.
+     *

+     *
+     *
This method can format numbers of very large and very small
+     *  magnitudes. However the number of significant digits is
+     *  limited to the precision provided by the Number data type.
+     *

+     *
+     *  @param value The numeric value to be formatted into a currency string.
+     *  @param withCurrencySymbol When set to false the
+     *  currencyISOCode property determines which
+     *  currency string or symbol to use in the output string. When
+     *  set to true, the current value of the
+     *  currencySymbol property is used in the output string.
+     *
+     *  @example  In this example the requested locale is
+     *  fr-CA French (Canada). The example assumes that this locale
+     *  is supported in the user's operating system and therefore
+     *  no fallback locale is used.
+     *  For fr-CA the default currency is Canadian dollars with an
+     *  ISO code of CAD. Therefore when formatting a currency
+     *  with the default values, CAD is used as the currency symbol. When
+     *  the withCurrencySymbol parameter is set to
+     *  true the currencySymbol
+     *  property is used to format the currency amount.
+     *
+     *  <listing version="3.0" >
+     *  var cf:CurrencyFormatter = new CurrencyFormatter("fr-CA");
+     *
+     *  trace(cf.actualLocaleIDName);               // "fr-CA"
+     *  trace(cf.currencyISOCode);                // "CAD"
+     *  trace(cf.currencySymbol);                // "$"
+     *
+     *  trace(cf.format(1254.56));                // "1 254,56 CAD"
+     *  trace(cf.format(1254.56, true));            // "1 254,56 $"
+     *  </listing>
+     *
+     *
The second example shows a method of formatting a currency
+     *  amount in Canadian dollars using the default user's locale.
+     *  The formattingWithCurrencySymbolIsSafe() method
+     *  is used to test to see if the user's default currency is
+     *  Canadian dollars and if so then the format method is used with
+     *  the withCurrencySymbol parameter set to true.
+     *  Otherwise the currency is set to Canadian dollars with
+     *  a more descriptive currency symbol. The example shows how
+     *  the currency would be formatted if the default locale was either
+     *  French (Canada) or English (USA).

+     *
+     *  <listing version="3.0" >
+     *  var cf:CurrencyFormatter = new CurrencyFormatter(LocaleID.DEFAULT);
+     *
+     *  if (cf.formattingWithCurrencySymbolIsSafe("CAD")) {
+     *   trace(cf.actualLocaleIDName);     // "fr-CA French (Canada)"
+     *   trace(cf.format(1254.56, false)); // "1 254,56 $"
+     *  }
+     *  else {
+     *   trace(cf.actualLocaleIDName);     // "en-US English (USA)"
+     *   cf.setCurrency("CAD", "C$")
+     *   trace(cf.format(1254.56, true));  // "C$ 1,254.56"
+     *  }
+     *  </listing>
+     *
+     *  @return A string containing the formatted currency value.
+     *
+     *  @see #currencySymbol
+     *  @see #currencyISOCode
+     *  @see #formattingWithCurrencySymbolIsSafe()
+     *  @see #lastOperationStatus
+     *  @see LastOperationStatus
+     *
+     *  @playerversion Flash 10.1
+     *  @langversion 3.0
+     *  @productversion Flex 4.5
+     *  @productversion Flash CS5
+     */
+    public function format(value:Object):String
+    {
+        if (value == null)
+            return null;
+
+        const number:Number = Number(value);
+
+        if (g11nWorkingInstance)
+            return g11nWorkingInstance.format(number, useCurrencySymbol);
+
+        if (!localeStyle)
+        {
+            fallbackLastOperationStatus
+                                = LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return undefined;
+        }
+
+        fallbackLastOperationStatus = LastOperationStatus.NO_ERROR;
+
+        return (useCurrencySymbol ? currencySymbol : currencyISOCode)
+                                                            + number.toString();
+    }
+
+    [Bindable("change")]
+
+    /**
+     *  Determines whether the currently specified currency symbol can
+     *  be used when formatting currency amounts.
+     *
+     *
Many regions and countries use the same currency symbols.
+     *  This method can be used to
+     *  safeguard against the use of an ambiguous currency symbol, or
+     *  a currency symbol or ISO code that
+     *  is different than expected due to the use of a fallback locale.

+     *
+     *
A common use case for this method is to determine whether
+     *  to show a local currency symbol (if the amount is formatted in
+     *  the user's default currency), or a more specific ISO code
+     *  string (if the amount is formatted in a currency
+     *  different from the user's default).

+     *
+     *
This method compares the requestedISOCode
+     *  parameter against the current currencyISOCode property,
+     *  returning true if the strings are
+     *  equal and false if they are not.
+     *  When the strings are equal, using the format()
+     *  method with the
+     *  useCurrencySymbol property set to true
+     *  results in a formatted currency value string
+     *  with a unique currency symbol for the locale.
+     *  If this method returns false, then using the format()
+     *  method with the useCurrencySymbol
+     *  property set to true could result in the use of an ambiguous
+     *  or incorrect currency symbol.
+     *

+     *
+     *  @param requestedISOCode A three letter ISO 4217 currency code
+     *  (for example, USD for US dollars, EUR for Euros).
+     *  Must contain three uppercase letters from A to Z.
+     *
+     *  @throws TypeError if the requestedISOCode parameter
+     *  is null.
+     *
+     *  @return true if the currencyISOCode
+     *  property matches the requestedISOCode parameter;
+     *  otherwise false.
+     *
+     *  @see #currencySymbol
+     *  @see #currencyISOCode
+     *  @see #useCurrencySymbol
+     *
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2
+     *  @langversion 3.0
+     *  @productversion Flex 4.5
+     */
+    public function formattingWithCurrencySymbolIsSafe(
+                                                requestedISOCode:String):Boolean
+    {
+        if(g11nWorkingInstance)
+        {
+            return g11nWorkingInstance.formattingWithCurrencySymbolIsSafe(
+                                                            requestedISOCode);
+        }
+
+        if (!localeStyle)
+        {
+            fallbackLastOperationStatus
+                                = LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return undefined;
+        }
+
+        fallbackLastOperationStatus = LastOperationStatus.NO_ERROR;
+
+        return requestedISOCode == currencyISOCode;
+    }
+
+    [Bindable("change")]
+
+    /**
+     *  Parses a string into a currency amount and a currency symbol.
+     *
+     *
The parsing algorithm uses the value of the
+     *  decimalSeparator property to determine the
+     *  integral and fractional portion of the number. It uses the
+     *  values of the negativeCurrencyFormat and
+     *  positiveCurrencyFormat properties to determine
+     *  the location of the currency symbol or string relative to the
+     *  currency amount.For negative amounts the value of the
+     *  negativeCurrencyFormat property determines the
+     *  location of the negative symbol and whether parentheses are used.

+     *
+     *
If the order of the currency symbol, minus sign, and number in
+     *  the input string does not match the pattern identified by the
+     *  negativeCurrencyFormat and
+     *  positiveCurrencyFormat properties, then:

+     *
+     *

+     *
The value property of the returned
+     *       CurrencyParseResult object is set to NaN.

+     *
The currencyString property of the returned
+     *       CurrencyParseResult object is set to null.

+     *
The lastOperationStatus property is set to
+     *       indicate that parsing failed.

+     *

+     *
+     *
The input string may include space characters, which are
+     *  ignored during the parsing.

+     *
+     *
Parsing can succeed even if there is no currency symbol.
+     *  No validation is done of the portion of the string
+     *  corresponding to the currency symbol. If there is no currency
+     *  symbol or string, the currencyString property
+     *  in the returned CurrencyParseResult object is set to an
+     *  empty string.

+     *
+     *
+     *  @param inputString The input string to parse.
+     *
+     *  @return A CurrencyParseResult object containing the numeric
+     *  value and the currency symbol or string.
+     *
+     *  @throws TypeError if the inputString parameter is null.
+     *
+     *  @see #decimalSeparator
+     *  @see #negativeCurrencyFormat
+     *  @see #positiveCurrencyFormat
+     *  @see flash.globalization.CurrencyParseResult
+     *
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2
+     *  @langversion 3.0
+     *  @productversion Flex 4.5
+     */
+    public  function parse(inputString:String):CurrencyParseResult
+    {
+        if (g11nWorkingInstance)
+            return g11nWorkingInstance.parse(inputString);
+
+        if (!localeStyle)
+        {
+            fallbackLastOperationStatus
+                                = LastOperationStatus.LOCALE_UNDEFINED_ERROR;
+            return undefined;
+        }
+
+        fallbackLastOperationStatus = LastOperationStatus.NO_ERROR;
+
+        // TODO Implement some kind of simple parsing.
+        return new CurrencyParseResult();
+    }
+
+    /**
+     *  @copy spark.utils.Collator#getAvailableLocaleIDNames
+     *
+     *  @playerversion Flash 10.1
+     *  @langversion 3.0
+     *  @productversion Flash CS5
+     *  @productversion Flex 4.5
+     */
+    static public function getAvailableLocaleIDNames():Vector.<String>
+    {
+        const locales:Vector.<String>
+            = flash.globalization.CurrencyFormatter.getAvailableLocaleIDNames();
+
+        return locales ? locales : new Vector.<String>["en-US"];
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    private function fallbackInstantiate():void
+    {
+        properties =
+            {
+                fractionalDigits: 0,
+                useGrouping: false,
+                groupingPattern: "3",
+                digitsType: NationalDigitsType.EUROPEAN,
+                decimalSeparator: ".",
+                groupingSeparator: ",",
+                negativeSymbol: "-",
+                negativeCurrencyFormat: 0, // eg. ($123.45)
+                positiveCurrencyFormat: 0, // eg. $123.45
+                leadingZero: true,
+                trailingZeros: false,
+                currencyISOCode: "USD",
+                currencySymbol: "$"
+            };
+
+        if (currencySymbolOverride)
+            properties.currencySymbol = currencySymbolOverride;
+
+        if (currencyISOCodeOverride)
+            properties.currencyISOCode = currencyISOCodeOverride;
+
+        propagateBasicProperties(properties);
+
+        fallbackLastOperationStatus = LastOperationStatus.NO_ERROR;
+    }
+}
+}


Fixed bug, when final UploadProgress was firing after FileUploaded for Flash simpleUpload.

--- src/flash/plupload/src/com/plupload/File.as
+++ src/flash/plupload/src/com/plupload/File.as
@@ -119,7 +119,7 @@

 		public function simpleUpload(url:String, settings:Object):void {
 			var file:File = this, request:URLRequest, postData:URLVariables, fileDataName:String;
-
+
 			file._postvars = settings["multipart_params"];
 			file._chunk = 0;
 			file._chunks = 1;
@@ -140,6 +140,9 @@
 			fileDataName = new String(settings["file_data_name"]);

 			file._fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, function(e:DataEvent):void {
+				var pe:ProgressEvent = new ProgressEvent(ProgressEvent.PROGRESS, false, false, file._size, file._size);
+				dispatchEvent(pe);
+
 				// Fake UPLOAD_COMPLETE_DATA event
 				var uploadChunkEvt:UploadChunkEvent = new UploadChunkEvent(
 					UploadChunkEvent.UPLOAD_CHUNK_COMPLETE_DATA,
@@ -149,13 +152,10 @@
 					file._chunk,
 					file._chunks
 				);
-
+
 				file._chunk++;
 				dispatchEvent(uploadChunkEvt);

-				var pe:ProgressEvent = new ProgressEvent(ProgressEvent.PROGRESS, false, false, file._size, file._size);
-				dispatchEvent(pe);
-
 				dispatchEvent(e);
 			});

@@ -170,7 +170,7 @@
 			});

 			// Delegate progress
-			file._fileRef.addEventListener(ProgressEvent.PROGRESS, function(e:ProgressEvent):void {
+			file._fileRef.addEventListener(ProgressEvent.PROGRESS, function(e:ProgressEvent):void {
 				dispatchEvent(e);
 			});


first round events-in-controllers refactoring

--- vendor/ras3r/ras3r/ReactionView.as
+++ vendor/ras3r/ras3r/ReactionView.as
@@ -86,7 +86,7 @@

 		// >>> PROTECTED PROPERTIES
-		protected var controller:ReactionController;
+		private var controller:ReactionController;

 		// >>> PUBLIC METHODS


Make role and affiliation bindings-aware. CS-4050, r=Armando

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

--- src/org/jivesoftware/xiff/conference/Room.as
+++ src/org/jivesoftware/xiff/conference/Room.as
@@ -23,6 +23,8 @@

 package org.jivesoftware.xiff.conference
 {
+	import flash.events.Event;
+
 	import mx.collections.ArrayCollection;

 	import org.jivesoftware.xiff.core.JID;
@@ -556,6 +558,7 @@
 		 *
 		 * @return The user's role
 		 */
+		[Bindable(event=roleSet)]
 		public function get role():String
 		{
 			return myRole;
@@ -568,6 +571,7 @@
 		 *
 		 * @return The user's affiliation
 		 */
+		[Bindable(event=affiliationSet)]
 		public function get affiliation():String
 		{
 			return myAffiliation;
@@ -1069,7 +1073,9 @@
 			if ( isThisUser( aPresence.from ) )
 			{
 				myAffiliation = item.affiliation;
+				dispatchEvent(new Event("affiliationSet")); //update bindings
 				myRole = item.role;
+				dispatchEvent(new Event("roleSet")); //update bindings

 				if (!isActive && aPresence.type != Presence.UNAVAILABLE_TYPE)
 				{


Transferred from the Adobe Open Source Subversion Repository

Revision: 17943
Author:   jszeto@adobe.com
Date:     2010-09-29T22:22:15.975011Z

Log Message:
-----------
ViewMenu initial checkin

Implemented ViewMenu, ViewMenuItem, ViewMenuLayout and all relevant skins.
Integrated into MobileApplicationBase and MobileApplication
Includes PARB review changes
Appearance will change once the visual design has been completed

QE notes: Ready to test!
Doc notes: Needs an ASDoc pass
Bugs: none
Reviewer: Glenn
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/layouts/ViewMenuLayout.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/layouts</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuItemSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenuItem.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenu.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/MobileApplicationSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as
@@ -11,7 +11,11 @@

 package spark.skins.mobile
 {
+import mx.core.ClassFactory;
+import mx.core.IFactory;
+
 import spark.components.MobileApplication;
+import spark.components.ViewMenu;
 import spark.components.ViewNavigator;
 import spark.skins.mobile.supportClasses.MobileSkin;

@@ -43,6 +47,8 @@
     public function MobileApplicationSkin()
     {
         super();
+
+        viewMenu = new ClassFactory(ViewMenu);
     }

     //--------------------------------------------------------------------------
@@ -60,6 +66,12 @@
      *  @productversion Flex 4.5
      */
     public var navigator:ViewNavigator;
+
+
+    /**
+     *  Creates an action menu from this factory when the menu button is pressed
+     */
+    public var viewMenu:IFactory;

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


Temporarily removing poster support

Temporarily removing poster support

--- src/Player.as
+++ src/Player.as
@@ -27,11 +27,11 @@
       stage.align = StageAlign.TOP_LEFT;
       stage.scaleMode = StageScaleMode.NO_SCALE;

-      posterUrl = loaderInfo.parameters.poster;
+      //posterUrl = loaderInfo.parameters['poster'];
       videoUrl = loaderInfo.parameters.video;

       setBackgroundColor();
-      loadPoster();
+      //if (posterUrl) loadPoster();
       loadVideo();
     }

@@ -70,7 +70,7 @@
       video = new Video(stage.stageWidth, stage.stageHeight);
       addChild(video);

-      posterContainer.visible = false;
+      //posterContainer.visible = false;

       stream = new NetStream(connection);
       stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);


Reset audio and video status

Reset audio and video status

Added reset of stream audio and video status in case play is run without
stopping a previously running stream first.

--- src/Player.as
+++ src/Player.as
@@ -129,6 +129,8 @@
         return;
       }

+      this.streamHasAudio = false;
+      this.streamHasVideo = false;
       urlParsed = url.parse(iurl);
       start();
     }


Replaced indentation tabs with spaces

Replaced indentation tabs with spaces

--- src/Player.as
+++ src/Player.as
@@ -124,7 +124,7 @@
       case 'rtsp':
         /* RTSP over TCP */
         client = new RTSPClient(this.video, urlParsed, new RTSPoverTCPHandle(urlParsed));
-		ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamStarted");
+        ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamStarted");
         break;

       case 'http':
@@ -150,13 +150,13 @@
     public function pause():void
     {
       client.pause();
-	  ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamPaused");
+      ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamPaused");
     }

     public function resume():void
     {
       client.resume();
-	  ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamResumed");
+      ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamResumed");
     }

     public function stop():void
@@ -164,7 +164,7 @@
       urlParsed = null;
       ns = null;
       client.stop();
-	  ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamStopped");
+      ExternalInterface.call("Locomote('" +  root.loaderInfo.parameters.id + "').streamStopped");
     }

     public function audioTransmitStopInterface():void {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19363
Author:   mhorn@adobe.com
Date:     2010-12-14T16:57:25.600360Z

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

Modified Paths:
--------------
<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/styles/metadata/BasicInheritingTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/graphics/GradientEntry.as</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/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/Path.as</path>

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

--- frameworks/projects/mx/src/mx/controls/MenuBar.as
+++ frameworks/projects/mx/src/mx/controls/MenuBar.as
@@ -163,7 +163,7 @@
 [Style(name="backgroundSkin", type="Class", inherit="no")]

 /**
- *  The default skin for a MenuBar item
+ *  The default skin for a MenuBar item.
  *
  *  @default mx.skins.halo.ActivatorSkin
  *
@@ -187,7 +187,7 @@
 [Style(name="itemUpSkin", type="Class", inherit="no")]

 /**
- *  The skin when focus is over a MenuBar item either.
+ *  The skin when focus is over a MenuBar item.
  *
  *  @default mx.skins.halo.ActivatorSkin
  *
@@ -1171,8 +1171,8 @@
     override protected function commitProperties():void
     {
         var i:int;
-		var cursor:IViewCursor;
-
+        var cursor:IViewCursor;
+
         if (showRootChanged)
         {
             if (!_hasRoot)
@@ -1213,25 +1213,25 @@
                                                   false,
                                                   EventPriority.DEFAULT_HANDLER, true);

-				if (tmpCollection.length > 0)
-				{
+                if (tmpCollection.length > 0)
+                {
                     cursor = tmpCollection.createCursor();
-				    i= 0;
-				    while (!cursor.afterLast)
-				    {
-					    try
-					    {
-					        insertMenuBarItem(i, cursor.current);
-					    }
-					    catch(e:ItemPendingError)
-					    {
-					      //we probably dont need to actively recover from here
-					    }
-
-					    cursor.moveNext();
-					    i++;
-				    }
-				}
+                    i= 0;
+                    while (!cursor.afterLast)
+                    {
+                        try
+                        {
+                            insertMenuBarItem(i, cursor.current);
+                        }
+                        catch(e:ItemPendingError)
+                        {
+                          //we probably dont need to actively recover from here
+                        }
+
+                        cursor.moveNext();
+                        i++;
+                    }
+                }
             }
         }

@@ -1247,25 +1247,25 @@
                 if (!tmpCollection)
                     tmpCollection = _rootModel;

-				if (tmpCollection.length > 0)
-				{
-				    cursor = tmpCollection.createCursor();
-				    i= 0;
-				    while (!cursor.afterLast)
-				    {
-				      try
-				      {
-				          insertMenuBarItem(i, cursor.current);
-				      }
-				      catch(e:ItemPendingError)
-				      {
-				          //we probably dont need to actively recover from here
-				      }
-
-				      cursor.moveNext();
-				      i++;
-				    }
-				}
+                if (tmpCollection.length > 0)
+                {
+                    cursor = tmpCollection.createCursor();
+                    i= 0;
+                    while (!cursor.afterLast)
+                    {
+                      try
+                      {
+                          insertMenuBarItem(i, cursor.current);
+                      }
+                      catch(e:ItemPendingError)
+                      {
+                          //we probably dont need to actively recover from here
+                      }
+
+                      cursor.moveNext();
+                      i++;
+                    }
+                }
             }
         }


M Specifying parser options in loaders is now optional

--- src/aerys/minko/type/loader/SceneLoader.as
+++ src/aerys/minko/type/loader/SceneLoader.as
@@ -77,7 +77,7 @@
 			REGISTERED_PARSERS.push(parserClass);
 		}

-		public function SceneLoader(parserOptions : ParserOptions)
+		public function SceneLoader(parserOptions : ParserOptions = null)
 		{
 			_currentState	= STATE_IDLE;


I'm not sure how a DisplayObjectContainer has a null child, but I'm seeing it.
Cope.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@366 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flash/DisplayUtil.as
+++ src/as/com/threerings/flash/DisplayUtil.as
@@ -217,6 +217,10 @@
     private static function findInHierarchy0 (
         obj :DisplayObject, name :String, shallow :Boolean, maxDepth :int, curDepth :int = 0) :Array
     {
+        if (obj == null) {
+            return null;
+        }
+
         var bestResult :Array;
         if (obj.name == name) {
             if (shallow) {


DisplayUtil.positionBoundsRelative, the general version of DisplayUtil.positionBounds

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@755 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flash/DisplayUtil.as
+++ src/as/com/threerings/flash/DisplayUtil.as
@@ -32,14 +32,24 @@
 public class DisplayUtil
 {
     /**
+     * Sets the top-left pixel of a DisplayObject to the given location, relative to another
+     * DisplayObject's coordinate space.
+     */
+    public static function positionBoundsRelative (disp :DisplayObject, relativeTo :DisplayObject,
+        x :Number, y :Number) :void
+    {
+        var bounds :Rectangle = disp.getBounds(relativeTo);
+        disp.x = x - bounds.left;
+        disp.y = y - bounds.top;
+    }
+
+    /**
      * Sets the top-left pixel of a DisplayObject to the given location, taking the
      * object's bounds into account.
      */
     public static function positionBounds (disp :DisplayObject, x :Number, y :Number) :void
     {
-        var bounds :Rectangle = disp.getBounds(disp);
-        disp.x = x - bounds.left;
-        disp.y = y - bounds.top;
+        positionBoundsRelative(disp, disp, x, y);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/framework/src/mx/core/IVisualElementContainer.as
+++ frameworks/projects/framework/src/mx/core/IVisualElementContainer.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 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.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////