Transferred from the Adobe Open Source Subversion Repository

Revision: 10633
Author:   dloverin@adobe.com
Date:     2009-09-28T13:24:30.559033Z

Log Message:
-----------
Use styleManager instance instead of StyleManager singleton (framework and compiler generated code)

Modified compiler generated style code for the FlexInit class. The style related changes are only available with the -keep option. AST generation is coming later.

Only the framework project is changed here. The other projects are will be changed soon.

QE notes: None.
Doc notes: None.
Bugs:
Reviewer: Alex and Paul
Tests run: checkintests, all Mustella tests(no new failures)
Is noteworthy for integration: no.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ButtonBarButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/accordionClasses/AccordionHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/CanvasLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/configuration_en.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressIndeterminateSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DateChooserMonthArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/SliderThumbSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollThumbSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleModule.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Form.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleManager2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/ClassDefLib.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/TitleBackground.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/NumericStepperDownSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PopUpButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/ProgrammaticSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/TabSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/textClasses/TextRange.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/LayoutContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/AccordionHeaderSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/CheckBoxIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/NumericStepperUpSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/RadioButtonIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetStyle.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ComboBoxArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeaderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/MenuBarBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressBarSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/BusyCursor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/Request.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/SliderTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DataGridHeaderBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SetStyleActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm</path>

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

--- frameworks/projects/mx/src/mx/skins/halo/TitleBackground.as
+++ frameworks/projects/mx/src/mx/skins/halo/TitleBackground.as
@@ -67,7 +67,7 @@
 		var highlightAlphas:Array = getStyle("highlightAlphas");
 		var headerColors:Array = getStyle("headerColors");
 		var showChrome:Boolean = headerColors != null;
-        StyleManager.getColorNames(headerColors);
+        styleManager.getColorNames(headerColors);

 		var colorDark:Number = ColorUtil.adjustBrightness2(
 			headerColors ? headerColors[1] : 0xFFFFFF, -20);


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/spark/src/spark/components/ButtonBar.as
+++ frameworks/projects/spark/src/spark/components/ButtonBar.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.
-//
-////////////////////////////////////////////////////////////////////////////////

 package spark.components
 {


rename ParserOptions.dependencyLoaderClosure into dependencyLoaderFunction

--- src/aerys/minko/type/loader/parser/ParserOptions.as
+++ src/aerys/minko/type/loader/parser/ParserOptions.as
@@ -20,7 +20,7 @@
 	public final class ParserOptions
 	{
 		private var _loadDependencies			: Boolean	= false;
-		private var _dependencyLoaderClosure	: Function	= defaultDependencyLoaderClosure;
+		private var _dependencyLoaderFunction	: Function	= defaultDependencyLoaderFunction;
         private var _loadSkin                   : Boolean   = false;
 		private var _skinningMethod				: uint		= SkinningMethod.SHADER_DUAL_QUATERNION;
 		private var _mipmapTextures				: Boolean	= true;
@@ -89,14 +89,14 @@
 			_mipmapTextures = value;
 		}

-		public function get dependencyLoaderClosure() : Function
+		public function get dependencyLoaderFunction() : Function
 		{
-			return _dependencyLoaderClosure;
+			return _dependencyLoaderFunction;
 		}

-		public function set dependencyLoaderClosure(value : Function) : void
+		public function set dependencyLoaderFunction(value : Function) : void
 		{
-			_dependencyLoaderClosure = value;
+			_dependencyLoaderFunction = value;
 		}

 		public function get loadDependencies() : Boolean
@@ -123,7 +123,7 @@
 		{
 			return new ParserOptions(
 				_loadDependencies,
-				_dependencyLoaderClosure,
+				_dependencyLoaderFunction,
                 _loadSkin,
 				_skinningMethod,
 				_mipmapTextures,
@@ -145,7 +145,7 @@
 									  parser					: Class 	= null)
 		{
 			_loadDependencies			= loadDependencies;
-			_dependencyLoaderClosure	= dependencyLoaderClosure || _dependencyLoaderClosure;
+			_dependencyLoaderFunction	= dependencyLoaderClosure || _dependencyLoaderFunction;
             _loadSkin                   = loadSkin;
 			_skinningMethod				= skinningMethod;
 			_mipmapTextures				= mipmapTextures;
@@ -155,9 +155,9 @@
 			_parser						= parser;
 		}

-		private function defaultDependencyLoaderClosure(dependencyPath	: String,
-														isTexture		: Boolean,
-														options			: ParserOptions) : ILoader
+		private function defaultDependencyLoaderFunction(dependencyPath	: String,
+														 isTexture		: Boolean,
+														 options		: ParserOptions) : ILoader
 		{
 			var loader : ILoader;


Transferred from the Adobe Open Source Subversion Repository

Revision: 13188
Author:   deeptika@adobe.com
Date:     2009-12-23T14:26:40.641841Z

Log Message:
-----------
Fix for FLEXENT-1204 ([AIR Specific]Not compiling a halo AIR App with automation_spark.swc causes an RTE)

Fix: Moving spark related AIR delegates from automation_air package to new package automation_airspark

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/build.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/manifest_automation_air.xml</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/manifest_automation_airspark.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src/spark/automation/delegates/components/SparkWindowedApplicationAutomationImpl.as</path>
<path kind="dir" action="D">/flex/sdk/trunk/frameworks/projects/automation_air/src/spark</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src/spark/automation/delegates/components/SparkWindowAutomationImpl.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src/spark</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src/spark/automation/delegates/components</path>
<path kind="file" action="M">/flex/sdk/trunk/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/AutomationAirClasses.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src/spark/automation/delegates</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src/AutomationAirSparkClasses.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src/spark/automation</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/automation_airspark/src</path>

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

--- frameworks/projects/automation_airspark/src/spark/automation/delegates/components/SparkWindowAutomationImpl.as
+++ frameworks/projects/automation_airspark/src/spark/automation/delegates/components/SparkWindowAutomationImpl.as
@@ -0,0 +1,178 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.automation.delegates.components
+{
+	import flash.display.DisplayObject;
+	import flash.events.Event;
+
+	import mx.automation.Automation;
+	import mx.automation.IAutomationManager2;
+	import mx.automation.IAutomationObject;
+
+	import spark.components.Window;
+
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines the methods and properties required to perform instrumentation for the
+	 *  Canvas class.
+	 *
+	 *  @see mx.containers.Canvas
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 4
+	 */
+	public class SparkWindowAutomationImpl extends SparkSkinnableContainerAutomationImpl
+	{
+
+		//--------------------------------------------------------------------------
+		//
+		//  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 4
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.components.Window, SparkWindowAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 * @param obj Canvas object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 4
+		 */
+		public function SparkWindowAutomationImpl(obj:spark.components.Window)
+		{
+			super(obj);
+			obj.showInAutomationHierarchy = true;
+			if (obj.menu) // a menu already exists for this window
+				menuChangeHandler(null);
+
+			obj.addEventListener("menuChanged", menuChangeHandler);
+			recordClick = true;
+		}
+
+
+		/**
+		 *  @private
+		 */
+		public function get window():spark.components.Window
+		{
+			return  uiComponent as spark.components.Window;
+		}
+		/**
+		 *  @private
+		 */
+		override public function get automationName():String
+		{
+			var am:IAutomationManager2 = Automation.automationManager2;
+			return am.getAIRWindowUniqueID(window);
+		}
+
+		/**
+		 * @private
+		 */
+		override public function get numAutomationChildren():int
+		{
+			//FlexNativeMenu can also be child of Window.
+			//So this is added if it exists. We are doing this only for Window and
+			//WindowedApplication because at present we receive menuChanged
+			//event only on these 2 controls if a FlexNativeMenu is there
+			var count:int = super.numAutomationChildren;
+			if (window.menu)
+				return(count + 1);
+			else
+				return count;
+		}
+
+
+		override public function getAutomationChildAt(index:int):IAutomationObject
+		{
+			//FlexNativeMenu can also be child of Window.
+			//So if it exists, it is considered to be the first child.
+			// We are doing this only for Window and
+			//WindowedApplication because at present we receive menuChanged
+			//event only on these 2 controls if a FlexNativeMenu is there
+			if (window.menu)
+			{
+				if (index == 0)
+					return window.menu as IAutomationObject;
+				index = index - 1;
+			}
+			return super.getAutomationChildAt(index);
+		}
+
+		/**
+		 * @private
+		 */
+		override public function getAutomationChildren():Array
+		{
+			var childList:Array = new Array();
+
+			// add the menu as the first element
+			if (window.menu )
+				childList.push(window.menu as IAutomationObject);
+
+			var tempList:Array = super.getAutomationChildren();
+			if (tempList)
+			{
+				var n:int = tempList.length;
+				for (var i:int = 0; i < n; i++)
+				{
+					childList.push(tempList[i] as IAutomationObject);
+				}
+			}
+
+			return childList;
+		}
+
+		//--------------------------------------------------------------------------------
+		//
+		// Methods
+		//
+		//--------------------------------------------------------------------------------
+		/**
+		 * @private
+		 */
+		private function menuChangeHandler(event:Event):void
+		{
+			Automation.automationManager2.registerNewFlexNativeMenu(window.menu, window.systemManager as DisplayObject);
+
+		}
+
+	}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17063
Author:   cframpto@adobe.com
Date:     2010-07-26T21:22:18.087520Z

Log Message:
-----------
RTE - grid.selectedItem should be accessed as property not method.  Fix typo in Grid ASdocs.

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

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

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -1479,7 +1479,7 @@
          *  If selectionMode is GridSelectionMode.SINGLE_ROW
          *  or GridSelectionMode.MULTIPLE_ROWS, returns the
          *  item in the dataProvider that is currently selected or
-         *  undefined if not rows are selected.
+         *  undefined if no rows are selected.
          *
          *
When the user changes the selection by interacting with the
          *  control, the control dispatches the selectionChange
@@ -1515,7 +1515,7 @@
         /**
          *  If selectionMode is GridSelectionMode.SINGLE_ROW
          *  or GridSelectionMode.MULTIPLE_ROWS, returns a Vector of
-         *  the dataProvider items that are currently selected
+         *  the dataProvider items that are currently selected.
          *
          *
When the user changes the selection by interacting with the
          *  control, the control dispatches the selectionChange
@@ -2819,6 +2819,7 @@
                 case CollectionEventKind.ADD:
                     if (oldCaretRowIndex >= location)
                         caretRowIndex += event.items.length;
+                    // TBD: call ensureIndexIsVisible
                     break;

                 case CollectionEventKind.REMOVE:
@@ -2829,6 +2830,7 @@
                             caretRowIndex = -1;
                         else
                             caretRowIndex -= itemsLength;
+                        // TBD: call ensureIndexIsVisible
                     }

                     break;
@@ -2839,6 +2841,7 @@
                         itemsLength = event.items.length;
                         if ((oldCaretRowIndex >= oldLocation) && (oldCaretRowIndex < (oldLocation + itemsLength)))
                             caretRowIndex += location - oldLocation;
+                        // TBD: call ensureIndexIsVisible
                     }
                     break;

@@ -2850,9 +2853,11 @@
                 case CollectionEventKind.RESET:
                     caretRowIndex = -1;
                     caretColumnIndex = -1;
+                    horizontalScrollPosition = 0;
+                    verticalScrollPosition = 0;
                     break;
             }
-
+
         }

         /**
@@ -2898,7 +2903,7 @@

             if (gridSelection)
                 gridSelection.dataProviderCollectionChanged(event);
-
+
             if (caretRowIndex != -1)
                 updateCaretForDataProviderChange(event);


Transferred from the Adobe Open Source Subversion Repository

Revision: 7295
Author:   dsubrama@adobe.com
Date:     2009-05-26T23:59:25.112903Z

Log Message:
-----------
-Add in caret support to Spark List. Our default renderers draw a thin 1px blue line (same color as selection color) around items that are currently in focus.
-Selection and careted item stay in-sync unless the Ctrl key is down in which you can caret away on your own.
-With careting (current item in focus) comes the itemFocusChanged event.
-Add in more states to ItemRenderer, which now supports: normal, hovered, selected, normalAndCaret, hoveredAndCaret, selectedAndCaret.
-Because of the addition of a hasState() method on IStateClient2, IR's that don't support the above-mentioned states won't RTE!
-findKey support like in Halo, for Spark List
-Null check for Line when generating DAPI-2 stroke

Reviewers: Ryan for caret stuff, Ryan/Corey for hasState() impl
Doc: Yes
QA: Yes
Checkintests: Pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/DefaultItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IStateClient2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Line.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/DefaultComplexItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -185,12 +185,6 @@
     //
     //--------------------------------------------------------------------------

-    /**
-     *  @private
-     *  Current item in focus
-     */
-    private var currentCaretIndex:Number = -1;
-
     //----------------------------------
     //  allowMultipleSelection
     //----------------------------------
@@ -382,9 +376,10 @@
      *  handle multiple selection via the commitMultipleSelection()
      *  helper method.
      */
-    override protected function commitSelection(dispatchSelectionChanged:Boolean = true):Boolean
-    {
-        var oldIndex:Number = _selectedIndex;
+    override protected function commitSelection(dispatchChangedEvents:Boolean = true):Boolean
+    {
+        var oldSelectedIndex:Number = _selectedIndex;
+        var oldCaretIndex:Number = _currentCaretIndex;

         // Ensure that multiple selection is allowed and that proposed
         // selected indices honors it. For example, in the single
@@ -419,14 +414,22 @@
         // Validate and commit the multiple selection related properties.
         commitMultipleSelection();

-        // Finally, dispatch a selectionChanged event so that all of the bindings
-        // update correctly.
-        if (dispatchSelectionChanged && retVal)
+        // Set the currentCaretIndex based on the current selection
+        setCurrentCaretIndex(selectedIndex);
+
+        // And dispatch selectionChanged and itemFocusChanged events so that all of
+        // the bindings update correctly.
+        if (dispatchChangedEvents && retVal)
         {
             var e:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.SELECTION_CHANGED);
-            e.oldIndex = oldIndex;
+            e.oldIndex = oldSelectedIndex;
             e.newIndex = _selectedIndex;
             dispatchEvent(e);
+
+            e = new IndexChangedEvent(IndexChangedEvent.ITEM_FOCUS_CHANGED);
+            e.oldIndex = oldCaretIndex;
+            e.newIndex = currentCaretIndex;
+            dispatchEvent(e);
         }

         return retVal;
@@ -499,7 +502,6 @@
         // back to its default value.
         _selectedIndices = _proposedSelectedIndices;
         _proposedSelectedIndices = [];
-
     }

     /**
@@ -518,12 +520,12 @@
     }

     /**
-     *  @private
+     *  @private
      */
     override protected function itemInCaret(index:int, caret:Boolean):void
     {
-        super.itemInCaret(index, caret);
-
+    	super.itemInCaret(index, caret);
+
         var renderer:Object = dataGroup ? dataGroup.getElementAt(index) : null;

         if (renderer is IItemRenderer)
@@ -542,7 +544,7 @@

         return index == selectedIndex;
     }
-
+
     /**
      *  @private
      */
@@ -632,31 +634,6 @@
     private function isEmpty(a:Array):Boolean
     {
         return a == null || a.length == 0;
-    }
-
-    /**
-     *  @private
-     *  Handle the setting of the renderer's caret property and the
-     *  dispatching of focus events.
-     */
-    private function handleCaretChange(index:Number, focusIn:Boolean):void
-    {
-        var old:Number = currentCaretIndex;
-        var renderer:Object = dataGroup ? dataGroup.getElementAt(old) : null;
-        if (renderer && renderer is IItemRenderer)
-            renderer.caret = false;
-
-        renderer = dataGroup? dataGroup.getElementAt(index) : null;
-        if (renderer && renderer is IItemRenderer)
-        {
-            renderer.caret = true;
-            currentCaretIndex = index;
-        }
-
-        var e:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.ITEM_FOCUS_CHANGED);
-        e.oldIndex = old;
-        e.newIndex = index;
-        dispatchEvent(e);
     }

     /**
@@ -787,17 +764,18 @@
     {
         // TODO (jszeto) Clear the caret
         var newIndex:Number;
+
         if (!allowMultipleSelection)
         {
-            // Single selection case
+            // Single selection case, set the selectedIndex
             newIndex = dataGroup.getElementIndex(event.currentTarget as IVisualElement);

             // Check to see if we're deselecting the currently selected item
             if (event.ctrlKey && selectedIndex == newIndex)
-                selectedIndex = NO_SELECTION;
+                selectedIndex = NO_SELECTION;
             // Otherwise, select the new item
-            else
-                selectedIndex = newIndex;
+            else
+                selectedIndex = newIndex;
         }
         else
         {
@@ -852,18 +830,24 @@
         if (selectedIndex == NO_SELECTION || doingWholesaleChanges)
         {
             // The case where one item has been newly added and it needs to be
-            // selected because requiresSelection is true.
+            // selected and careted because requiresSelection is true.
             if (dataProvider && dataProvider.length == 1 && requiresSelection)
             {
                 _selectedIndices = [0];
                 _selectedIndex = 0;
+                itemInCaret(0, true);
                 // If the selection properties have been adjusted to account for items that
-                // have been added or removed, send out a "selectionChanged" event so
-                // any bindings to them are updated correctly.
+                // have been added or removed, send out a "selectionChanged" event and
+                // "itemFocusChanged" event so any bindings to them are updated correctly.
                 e = new IndexChangedEvent(IndexChangedEvent.SELECTION_CHANGED);
                 e.oldIndex = -1;
                 e.newIndex = _selectedIndex;
                 dispatchEvent(e);
+
+                e = new IndexChangedEvent(IndexChangedEvent.ITEM_FOCUS_CHANGED);
+                e.oldIndex = -1;
+                e.newIndex = _currentCaretIndex;
+                dispatchEvent(e);
             }
             return;
         }
@@ -933,10 +917,37 @@
                 }
             }
         }
+
+        if (currentCaretIndex == selectedIndex)
+        {
+            // currentCaretIndex is not changing, so we just need to dispatch
+            // an "itemFocusChanged" event to update any bindings and update the
+            // currentCaretIndex backing variable.
+            var oldIndex:Number = currentCaretIndex;
+            _currentCaretIndex = getLastItemValue(newInterval);
+
+            e = new IndexChangedEvent(IndexChangedEvent.ITEM_FOCUS_CHANGED);
+            e.oldIndex = oldIndex;
+            e.newIndex = currentCaretIndex;
+            dispatchEvent(e);
+        }
+        else
+        {
+            // De-caret the previous currentCaretIndex renderer and set the
+            // currentCaretIndexAdjusted flag to true. This will mean in
+            // commitProperties, the currentCaretIndex will be adjusted to
+            // match the selectedIndex;
+
+            // TODO: We should revisit the synchronous nature of the
+            // de-careting/re-careting behavior.
+            itemInCaret(currentCaretIndex, false);
+            currentCaretIndexAdjusted = true;
+            invalidateProperties();
+        }
+
         var oldIndices:Array = selectedIndices;
         _selectedIndices = newInterval;
         _selectedIndex = getLastItemValue(newInterval);
-
         // If the selection has actually changed, trigger a pass to
         // commitProperties where a selectionChanged event will be
         // fired to update any bindings to selection properties.
@@ -987,6 +998,100 @@
     }

     /**
+     *  Tries to find the next item in the data provider that
+     *  starts with the character in the eventCode parameter.
+     *  You can override this to do fancier typeahead lookups. The search
+     *  starts at the selectedIndex location; if it reaches
+     *  the end of the data provider it starts over from the beginning.
+     *
+     *  @param eventCode The key that was pressed on the keyboard.
+     *  @return true if a match was found.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function findKey(eventCode:int):Boolean
+    {
+        var tmpCode:int = eventCode;
+
+        return tmpCode >= 33 &&
+               tmpCode <= 126 &&
+               findString(String.fromCharCode(tmpCode));
+    }
+
+    /**
+     *  Finds an item in the list based on a String,
+     *  and moves the selection to it. The search
+     *  starts at the selectedIndex location; if it reaches
+     *  the end of the data provider it starts over from the beginning.
+     *
+     *  @param str The String to match.
+     *
+     *  @return true if a match is found.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function findString(str:String):Boolean
+    {
+        if (!dataProvider || dataProvider.length == 0)
+            return false;
+
+        var startIndex:int;
+        var stopIndex:int;
+        var retVal:Number;
+
+        if (selectedIndex == -1)
+        {
+            startIndex = 0;
+            stopIndex = dataProvider.length;
+            retVal = findStringLoop(str, startIndex, stopIndex);
+        }
+        else
+        {
+            startIndex = selectedIndex + 1;
+            stopIndex = dataProvider.length;
+            retVal = findStringLoop(str, startIndex, stopIndex);
+            // We didn't find the item, loop back to the top
+            if (retVal == -1)
+            {
+                retVal = findStringLoop(str, 0, selectedIndex);
+            }
+        }
+        if (retVal != -1)
+        {
+            selectedIndex = retVal;
+            ensureItemIsVisible(retVal);
+            return true;
+        }
+        else
+            return false;
+    }
+
+    /**
+     *  @private
+     */
+    private function findStringLoop(str:String, startIndex:int, stopIndex:int):Number
+    {
+        // Try to find the item based on the start and stop indices.
+        for (startIndex; startIndex != stopIndex; startIndex++)
+        {
+            var itmStr:String = itemToLabel(dataProvider.getItemAt(startIndex));
+
+            itmStr = itmStr.substring(0, str.length);
+            if (str == itmStr || str.toUpperCase() == itmStr.toUpperCase())
+            {
+               return startIndex;
+            }
+        }
+        return -1;
+    }
+
+    /**
      *  @private
      *  Build in basic keyboard navigation support in List.
      */
@@ -996,16 +1101,32 @@

         var navigationUnit:uint = mapEventToNavigationUnit(event);

-        if (!dataProvider || !layout || navigationUnit == NavigationUnit.NONE)
+        if (!dataProvider || !layout)
             return;
-
-        var currentIndex:Number = selectedIndex;
+
+        // Hitting the space bar means the current caret item, that is
+        // the item currently in focus, is being selected.
+        if (event.keyCode == Keyboard.SPACE)
+        {
+            selectedIndex = currentCaretIndex;
+            event.preventDefault();
+            return;
+        }
+
+        if (findKey(event.charCode))
+        {
+            event.preventDefault();
+            return;
+        }
+
+        // Some unrecognized key stroke was entered, return.
+        if (navigationUnit == NavigationUnit.NONE)
+            return;

         // Delegate to the layout to tell us what the next item is we should select or focus into.
         // TODO (jszeto) At some point we should refactor this so we don't depend on layout
         // for keyboard handling. If layout doesn't exist, then use some other keyboard handler
-        var proposedNewIndex:int = (selectUponNavigation) ? layout.getDestinationIndex(navigationUnit, currentIndex)
-            : layout.getDestinationIndex(navigationUnit, currentCaretIndex);
+        var proposedNewIndex:int = layout.getDestinationIndex(navigationUnit, currentCaretIndex);

         // TODO (jszeto) proposedNewIndex depends on CTRL key
         // move CTRL key logic into single selection
@@ -1016,10 +1137,11 @@
         // events when the index reaches a limit.
         if (proposedNewIndex == -1)
             return;
+
         event.preventDefault();

-        // Contiguous multi-selection action - create the new selection
-        // interval.
+        // Contiguous multi-selection action. Create the new selection
+        // interval.
         if (allowMultipleSelection && event.shiftKey && selectedIndices)
         {
             var startIndex:Number = getFirstSelectedIndex();
@@ -1039,21 +1161,24 @@
                     newInterval.push(i);
                 }
             }
-            selectedIndices = newInterval;
+            selectedIndices = newInterval;
             ensureItemIsVisible(proposedNewIndex);
         }
         // Entering the caret state with the Ctrl key down
         else if (event.ctrlKey)
         {
-            // TODO (dsubrama) Finish up caret support, including visual
-            // indicators to default renderers.
-            handleCaretChange(proposedNewIndex, true);
-            //ensureItemIsVisible(proposedNewIndex);
-        }
-        // Its just a new selection action
+            var oldCaretIndex:Number = currentCaretIndex;
+            setCurrentCaretIndex(proposedNewIndex);
+            var e:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.ITEM_FOCUS_CHANGED);
+            e.oldIndex = oldCaretIndex;
+            e.newIndex = currentCaretIndex;
+            dispatchEvent(e);
+            ensureItemIsVisible(proposedNewIndex);
+        }
+        // Its just a new selection action, select the new index.
         else
         {
-            selectedIndex = proposedNewIndex;
+            selectedIndex = proposedNewIndex;
             ensureItemIsVisible(proposedNewIndex);
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 4736
Author:   chaase@adobe.com
Date:     2009-01-29T19:31:04.898445Z

Log Message:
-----------
API improvements in some of the effects classes, such as:

- PropertyValuesHolder renamed to AnimationProperty
	- Also, values[] array changed to valueFrom and valueTo Objects
	- Also, 'delta' property changed to valueBy Object property
- FxAnimate.propertyValuesList renamed to FxAnimate.animationProperties
- Constant interpolator renamed Linear (old Linear interpolator went away)
- ColorInterpolator renamed RGBInterpolator
- HSBInterpolator now exists (not used by default: FxAnimateColor uses RGBInterpolator)
- HSBColor: new data structure in mx.utils for holding HSB colors and converting from/to RGB
- various changes to *Instance classes in effects (but these are not generally used externally)

QE Notes: Mustella tests will break due to class and property renames. QE is fixing these issues and a follow-up putback to Mustella is expected
Doc Notes: None
Bugs: -
Reviewer: Gordon
tests: checkintests, Mustella: tests/Effects tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxFadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxResizeInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Constant.as" copyfrom-rev="4610" action="R">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/ColorInterpolator.as" copyfrom-rev="4610" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/RGBInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/HSBInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/HSBColor.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/ColorInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/ArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateShaderTransitionInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Constant.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/IInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/NumberInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/EaseInOut.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AnimationProperty.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Animate.as
+++ frameworks/projects/spark/src/spark/effects/Animate.as
@@ -11,21 +11,21 @@
 package mx.effects
 {

+import flash.sampler.getInvocationCount;
+
+import mx.core.mx_internal;
+import mx.effects.effectClasses.FxAnimateInstance;
 import mx.effects.interpolation.IEaser;
 import mx.effects.interpolation.IInterpolator;
+import mx.effects.interpolation.NumberInterpolator;
 import mx.effects.interpolation.Sine;
-import mx.effects.effectClasses.FxAnimateInstance;
 import mx.events.AnimationEvent;
-
-import mx.core.mx_internal;
-import mx.effects.Effect;
-import mx.effects.IEffectInstance;
 import mx.events.EffectEvent;
 import mx.styles.IStyleClient;

 use namespace mx_internal;

-[DefaultProperty("propertyValuesList")]
+[DefaultProperty("animationProperties")]

 /**
  * Dispatched when the effect starts, which corresponds to a
@@ -78,16 +78,16 @@

 /**
  * This effect animates an arbitrary set of properties between values, as specified
- * in the propertyValuesList array. Example usage is as follows:
+ * in the animationProperties array. Example usage is as follows:
  *
- * @example Using the Animate effect to move a button from (100, 100)
+ * @example Using the FxAnimate effect to move a button from (100, 100)
  * to (200, 150):
  * <listing version="3.0">
  * var button:Button = new Button();
- * var anim:Animate = new Animate(button);
- * anim.propertyValuesList = [
- *     new PropertyValuesHolder("x", [100,200]),
- *     new PropertyValuesHolder("y", [100,150])];
+ * var anim:FxAnimate = new FxAnimate(button);
+ * anim.animationProperties = [
+ *     new AnimationProperty("x", 100, 200),
+ *     new AnimationProperty("y", 100, 150)];
  * anim.play();
  * </listing>
  */
@@ -118,7 +118,7 @@
     //--------------------------------------------------------------------------

     // Cached version of the affected properties. By default, we simply return
-    // the list of properties specified in the propertyValuesList array.
+    // the list of properties specified in the animationProperties array.
     // Subclasses should override getAffectedProperties() if they wish to
     // specify a different set.
     private var affectedProperties:Array = null;
@@ -135,14 +135,14 @@
     //--------------------------------------------------------------------------

     /**
-     * An array of PropertyValuesHolder objects, each of which holds the
+     * An array of AnimationProperty objects, each of which holds the
      * name of the property being animated and the values that the property
      * will take on during the animation. This array takes precedence over
      * any helper properties that may be declared in subclasses of FxAnimate.
      * For example, if this array is set directly on an FxMove object,
      * then any helper values such as xFrom will be ignored.
      */
-    public var propertyValuesList:Array;
+    public var animationProperties:Array;

     /**
      * The easing behavior for this effect. This IEaser
@@ -219,7 +219,7 @@

     /**
      * By default, the affected properties are the same as those specified
-     * in the propertyValuesList array. If subclasses affect
+     * in the animationProperties array. If subclasses affect
      * or track a different set of properties, they should override this
      * method.
      */
@@ -227,12 +227,12 @@
     {
         if (!affectedProperties)
         {
-            if (propertyValuesList)
-            {
-                affectedProperties = new Array(propertyValuesList.length);
-                for (var i:int = 0; i < propertyValuesList.length; ++i)
+            if (animationProperties)
+            {
+                affectedProperties = new Array(animationProperties.length);
+                for (var i:int = 0; i < animationProperties.length; ++i)
                 {
-                    var effectHolder:PropertyValuesHolder = PropertyValuesHolder(propertyValuesList[i]);
+                    var effectHolder:AnimationProperty = AnimationProperty(animationProperties[i]);
                     affectedProperties[i] = effectHolder.property;
                 }
             }
@@ -271,30 +271,16 @@
         animateInstance.adjustConstraints = adjustConstraints;
         animateInstance.disableLayout = disableLayout;

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 6122
Author:   chaase@adobe.com
Date:     2009-04-10T14:30:17.762458Z

Log Message:
-----------
Various refactorings/renamings/changes from effects PARB review.

QE Notes: mx/effects and spark/effects currently broken (and disabled) due to these API changes. Matt is fixing.
Doc Notes: None
Bugs:
Reviewer: Hans
tests: checkintests, mustella tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EaseInOut.as" copyfrom-rev="5944" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EaseInOutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/CompositeEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EaseInOut.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EasingFraction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/EffectEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/TweenEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/RepeatBehavior.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/NumberArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/IEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Animate3DInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimationProperty.as" copyfrom-rev="5944" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SimpleMotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTransitionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateFilterInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Rotate3DInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/events/AnimationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/ArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/IEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/RotateInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/IAnimationTarget.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimationProperty.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Animate.as
+++ frameworks/projects/spark/src/spark/effects/Animate.as
@@ -14,99 +14,59 @@
 import mx.core.mx_internal;
 import mx.effects.Effect;
 import mx.effects.IEffectInstance;
+import mx.events.EffectEvent;

 import spark.effects.animation.Animation;
+import spark.effects.animation.RepeatBehavior;
 import spark.effects.easing.IEaser;
 import spark.effects.easing.Sine;
 import spark.effects.interpolation.IInterpolator;
 import spark.effects.supportClasses.AnimateInstance;
-import spark.events.AnimationEvent;

 use namespace mx_internal;

-[DefaultProperty("animationProperties")]
+[DefaultProperty("motionPaths")]

 /**
- * Dispatched when the effect starts, which corresponds to a
- * call to the AnimateInstance.startHandler() method.
- * Flex also dispatches the first animationUpdate event
- * for the effect at the same time.
+ * Dispatched every time the effect updates the target.
  *
- *
The Effect.effectStart event is dispatched
- * before the animationStart event.

- *
- * @eventType spark.events.AnimationEvent.ANIMATION_START
+ * @eventType spark.events.EffectEvent.EFFECT_UPDATE
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Event(name="animationStart", type="spark.events.AnimationEvent")]
+[Event(name="effectUpdate", type="mx.events.EffectEvent")]

 /**
- * Dispatched every time the effect updates the target.
- * This event corresponds to a call to
- * the AnimateInstance.updateHandler() method.
+ * Dispatched when the effect begins a new repetition, for
+ * any effect that is repeated more than once.
+ * Flex also dispatches an effectUpdate event
+ * for the effect at the same time.
  *
- * @eventType spark.events.AnimationEvent.ANIMATION_UPDATE
+ * @eventType spark.events.EffectEvent.EFFECT_REPEAT
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Event(name="animationUpdate", type="spark.events.AnimationEvent")]
-
-/**
- * Dispatched when the effect begins a new repetition, for
- * any effect that is repeated more than once.
- * This event corresponds to a call to
- * the AnimateInstance.repeatHandler() method.
- * Flex also dispatches an animationUpdate event
- * for the effect at the same time.
- *
- * @eventType spark.events.AnimationEvent.ANIMATION_REPEAT
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Event(name="animationRepeat", type="spark.events.AnimationEvent")]
-
-/**
- * Dispatched when the effect ends.
- * This event corresponds to a call to
- * the AnimateInstance.endHandler() method.
- * Flex also dispatches an animationUpdate event
- * for the effect at the same time.
- *
- *
This event occurs just before an effectEnd event.
- * A repeating effect dispatches this event only after the
- * final repetition.

- *
- * @eventType spark.events.AnimationEvent.ANIMATION_END
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Event(name="animationEnd", type="spark.events.AnimationEvent")]
+[Event(name="effectRepeat", type="mx.events.EffectEvent")]
+

 /**
  * This effect animates an arbitrary set of properties between values, as specified
- * in the animationProperties array. Example usage is as follows:
+ * in the motionPaths array. Example usage is as follows:
  *
  * @example Using the Animate effect to move a button from (100, 100)
  * to (200, 150):
  * <listing version="3.0">
  * var button:Button = new Button();
  * var anim:Animate = new Animate(button);
- * anim.animationProperties = [
- *     new AnimationProperty("x", 100, 200),
- *     new AnimationProperty("y", 100, 150)];
+ * anim.motionPaths = [
+ *     new SimpleMotionPath("x", 100, 200),
+ *     new SimpleMotionPath("y", 100, 150)];
  * anim.play();
  * </listing>
  *
@@ -147,7 +107,7 @@
     //--------------------------------------------------------------------------

     // Cached version of the affected properties. By default, we simply return
-    // the list of properties specified in the animationProperties array.
+    // the list of properties specified in the motionPaths array.
     // Subclasses should override getAffectedProperties() if they wish to
     // specify a different set.
     private var affectedProperties:Array = null;
@@ -157,15 +117,28 @@
     // a custom easer.
     private static var defaultEaser:IEaser = new Sine(.5);

+    // Used to optimize event dispatching: only send out updated events if
+    // there is someone listening
+    private var numUpdateListeners:int = 0;
+
+
     //--------------------------------------------------------------------------
     //
     // Properties
     //
     //--------------------------------------------------------------------------

+    //----------------------------------
+    //  motionPaths
+    //----------------------------------
+    /**
+     * @private
+     * Storage for the motionPaths property.
+     */
+    private var _motionPaths:Array;
     [Inspectable(category="General", arrayType="spark.effects.MotionPath")]
     /**
-     * An array of AnimationProperty objects, each of which holds the
+     * An array of MotionPath objects, each of which holds the
      * name of the property being animated and the values that the property
      * will take on during the animation. This array takes precedence over
      * any helper properties that may be declared in subclasses of Animate.
@@ -177,24 +150,60 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var animationProperties:Array;
-
+    public function get motionPaths():Array
+    {
+        return _motionPaths;
+    }
+    /**
+     * @private
+     */
+    public function set motionPaths(value:Array):void
+    {
+        _motionPaths = value;
+    }
+
+    //----------------------------------
+    //  easer
+    //----------------------------------
+    /**
+     * @private
+     * Storage for the easer property.
+     */
+    private var _easer:IEaser = defaultEaser;
     /**
      * The easing behavior for this effect. This IEaser
      * object will be used to convert the elapsed fraction of
      * the animation into an eased fraction, which will then be used to
      * calculate the value at that eased elapsed fraction.
      *
-     * @default mx.effects.fxEasing.Sine(.5)
-     * @see mx.effects.fxEasing.Sine
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public var easer:IEaser = defaultEaser;
-
+     * @default spark.effects.easing.Sine(.5)
+     * @see spark.effects.easing.Sine
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get easer():IEaser
+    {
+        return _easer;
+    }
+    /**
+     * @private
+     */
+    public function set easer(value:IEaser):void
+    {
+        _easer = value;
+    }
+
+    //----------------------------------
+    //  interpolator
+    //----------------------------------
+    /**
+     * @private
+     * Storage for the interpolator property.
+     */
+    private var _interpolator:IInterpolator = null;
     /**
      * The interpolator used by this effect to calculate values between
      * the start and end values. By default, interpolation is handled
@@ -210,51 +219,60 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var interpolator:IInterpolator = null;
-
+    public function get interpolator():IInterpolator
+    {
+        return _interpolator;
+    }
+    /**
+     * @private
+     */
+    public function set interpolator(value:IInterpolator):void
+    {
+        _interpolator = value;
+    }
+
+    //----------------------------------
+    //  repeatBehavior
+    //----------------------------------
+    /**
+     * @private
+     * Storage for the repeatBehavior property.
+     */
+    private var _repeatBehavior:String = RepeatBehavior.LOOP;
     /**
      * The behavior of a repeating effect (an effect
      * with repeatCount equal to either 0 or >1). This
-     * value should be either Animation.LOOP, where the animation
-     * will repeat in the same order each time, or Animation.REVERSE,
+     * value should be either RepeatBehavior.LOOP, where the animation
+     * will repeat in the same order each time, or RepeatBehavior.REVERSE,
      * where the animation will reverse direction each iteration.
      *
-     * @default Animation.LOOP
-     * @see spark.effects.animation.Animation#repeatBehavior
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public var repeatBehavior:String = Animation.LOOP;
-
-    /**
-     * This flag indicates whether the layout constraints (left, right, top,
-     * and bottom) should be adjusted when the effect ends, based on where
-     * the target has been positioned by the effect. This behavior can
-     * be useful for effects that change the position or size of a component
-     * during the course of running the effect, and when the desired result
-     * is that the target object stays in the resulting position without
-     * adjusting to the original constraints. For example, a Rotate effect
-     * run on a target with left/top constraints might otherwise be moved
-     * to the original constraint position, which has a different effect
-     * than rotating around a specified rotation center.
-     *
-     *
The default value
-     * is false, which means that the original constraints will
-     * be obeyed. To adjust the constraints based on the effect result,
-     * set this property to true.

-     *
-     * @default false
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public var adjustConstraints:Boolean = false;
-
+     * @default RepeatBehavior.LOOP
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get repeatBehavior():String
+    {
+        return _repeatBehavior;
+    }
+    /**
+     * @private
+     */
+    public function set repeatBehavior(value:String):void
+    {
+        _repeatBehavior = value;
+    }
+
+    //----------------------------------
+    //  disableConstraints
+    //----------------------------------
+    /**
+     * @private
+     * Storage for the disableConstraints property.
+     */
+    private var _disableConstraints:Boolean = false;
     /**
      * This property indicates whether the effect should disable constraints on its
      * targets while the effect is running. If set to true, the effect
@@ -268,8 +286,26 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var disableConstraints:Boolean = false;
-
+    public function get disableConstraints():Boolean
+    {
+        return _disableConstraints;
+    }
+    /**
+     * @private
+     */
+    public function set disableConstraints(value:Boolean):void
+    {
+        _disableConstraints = value;
+    }
+
+    //----------------------------------
+    //  disableLayout
+    //----------------------------------
+    /**
+     * @private
+     * Storage for the disableLayout property.
+     */
+    private var _disableLayout:Boolean = false;
     /**
      * This property indicates whether the effect should disable layout on its
      * targets' parents while the effect is running. If set to true, the effect
@@ -284,8 +320,18 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public var disableLayout:Boolean = false;
-
+    public function get disableLayout():Boolean
+    {
+        return _disableLayout;
+    }
+    /**
+     * @private
+     */
+    public function set disableLayout(value:Boolean):void
+    {
+        _disableLayout = value;
+    }
+
     //--------------------------------------------------------------------------
     //
     // Methods
@@ -294,7 +340,7 @@

     /**
      * By default, the affected properties are the same as those specified
-     * in the animationProperties array. If subclasses affect
+     * in the motionPaths array. If subclasses affect
      * or track a different set of properties, they should override this
      * method.
      *
@@ -307,12 +353,12 @@
     {
         if (!affectedProperties)
         {
-            if (animationProperties)
+            if (motionPaths)
             {
-                affectedProperties = new Array(animationProperties.length);
-                for (var i:int = 0; i < animationProperties.length; ++i)
+                affectedProperties = new Array(motionPaths.length);
+                for (var i:int = 0; i < motionPaths.length; ++i)
                 {
-                    var effectHolder:MotionPath = MotionPath(animationProperties[i]);
+                    var effectHolder:MotionPath = MotionPath(motionPaths[i]);
                     affectedProperties[i] = effectHolder.property;
                 }
             }
@@ -333,10 +379,11 @@

         var animateInstance:AnimateInstance = AnimateInstance(instance);

-        animateInstance.addEventListener(AnimationEvent.ANIMATION_START, animationEventHandler);
-        animateInstance.addEventListener(AnimationEvent.ANIMATION_UPDATE, animationEventHandler);
-        animateInstance.addEventListener(AnimationEvent.ANIMATION_REPEAT, animationEventHandler);
-        animateInstance.addEventListener(AnimationEvent.ANIMATION_END, animationEventHandler);
+        animateInstance.addEventListener(EffectEvent.EFFECT_REPEAT, animationEventHandler);
+        // Optimization: don't bother listening for update events if we don't have
+        // any listeners for that event
+        if (numUpdateListeners > 0)
+            animateInstance.addEventListener(EffectEvent.EFFECT_UPDATE, animationEventHandler);

         if (easer)
             animateInstance.easer = easer;
@@ -351,11 +398,11 @@
         animateInstance.disableLayout = disableLayout;
         animateInstance.disableConstraints = disableConstraints;

-        if (animationProperties)
+        if (motionPaths)
         {
-            animateInstance.animationProperties = [];
-            for (var i:int = 0; i < animationProperties.length; ++i)
-                animateInstance.animationProperties[i] = animationProperties[i].clone();
+            animateInstance.motionPaths = [];
+            for (var i:int = 0; i < motionPaths.length; ++i)
+                animateInstance.motionPaths[i] = motionPaths[i].clone();
         }
     }

@@ -380,17 +427,43 @@
     }

     /**
-     * Called when the Animate dispatches an AnimationEvent.
-     * If you override this method, ensure that you call the super method.
+     * @private
+     * Track number of listeners to update event for optimization purposes
+     */
+    override public function addEventListener(type:String, listener:Function,
+        useCapture:Boolean=false, priority:int=0,
+        useWeakReference:Boolean=false):void
+    {
+        super.addEventListener(type, listener, useCapture, priority,
+            useWeakReference);
+        if (type == EffectEvent.EFFECT_UPDATE)
+            ++numUpdateListeners;
+    }
+
+    /**
+     * @private
+     * Track number of listeners to update event for optimization purposes
+     */
+    override public function removeEventListener(type:String, listener:Function,
+        useCapture:Boolean=false):void
+    {
+        super.removeEventListener(type, listener, useCapture);
+        if (type == EffectEvent.EFFECT_UPDATE)
+            --numUpdateListeners;
+    }
+
+    /**
+     * @private
+     * Called when the AnimateInstance object dispatches an EffectEvent.
      *
-     * @param event An event object of type AnimationEvent.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    protected function animationEventHandler(event:AnimationEvent):void
+     * @param event An event object of type EffectEvent.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    private function animationEventHandler(event:EffectEvent):void
     {
         dispatchEvent(event);
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10828
Author:   jszeto@adobe.com
Date:     2009-10-02T17:41:48.523309Z

Log Message:
-----------
FXG stroke and fill translation fix

http://bugs.adobe.com/jira/browse/SDK-23257 - Gradient translation should occur from 0,0, not the upper left bounds

The current API only passes in the shape's bounds. I have added a new targetOrigin parameter to IFill.begin, IStroke.apply and IStroke.createGraphicsStroke of type Point. It is the origin (0,0) of the shape in the target graphic's coordinate space.

Changed the logic in the gradient stroke and fills. The x and y transform properties are now positioned relative to the origin instead of to the top left corner of the bounds. If no x and y are set, then the default behavior remains the same.

Removed the centering logic in LinearGradientStroke when scaleX was set.

This API change has been approved by PARB.

QE notes: Need to add tests that exercise this logic
Doc notes: Need to document additions to the API
Bugs: SDK-23257
Reviewer: Deepa
Tests run: spark/primitives, gumbo/components
Is noteworthy for integration: Yes, modifications to the API

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/FilledElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/IFill.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/IStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColorStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Line.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/BitmapFill.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradient.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/Line.as
+++ frameworks/projects/spark/src/spark/primitives/Line.as
@@ -15,6 +15,7 @@
 import flash.display.Graphics;
 import flash.display.GraphicsStroke;
 import flash.display.IGraphicsData;
+import flash.geom.Point;
 import flash.geom.Rectangle;

 import spark.primitives.supportClasses.StrokedElement;
@@ -255,7 +256,8 @@
         if (stroke)
             graphicsStroke = GraphicsStroke(stroke.createGraphicsStroke(new
             					Rectangle(drawX + measuredX, drawY + measuredY,
-            					Math.max(width, stroke.weight), Math.max(height, stroke.weight))));
+            					Math.max(width, stroke.weight), Math.max(height, stroke.weight)),
+                                new Point(drawX + measuredX, drawY + measuredY)));

         // If the stroke returns a valid graphicsStroke object which is the
         // Drawing API-2 drawing commands to render this stroke, use that


Transferred from the Adobe Open Source Subversion Repository

Revision: 2530
Author:   egeorgie@adobe.com
Date:     2008-07-18T22:44:40.246360Z

Log Message:
-----------
Fix incorrect drawing of line, when xFrom and yFrom are non-zero

Reviewed by Ryan

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Line.as

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

--- frameworks/projects/spark/src/spark/primitives/Line.as
+++ frameworks/projects/spark/src/spark/primitives/Line.as
@@ -195,6 +195,9 @@
         var drawToX:Number = xFrom <= xTo ? drawWidth : -drawWidth;
         var drawToY:Number = yFrom <= yTo ? drawHeight : -drawHeight;

+        drawToX += xFrom;
+        drawToY += yFrom;
+
 		g.moveTo(xFrom, yFrom);
 		g.lineTo(drawToX, drawToY);
 	}


Fixed bug with long running clients. The results for invocation requests with ids exceeding Short.MAX_VALUE could not be processed due to the id being deserialized as a short but stored in the map with an integer key.

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

--- src/as/com/threerings/presents/client/InvocationDirector.as
+++ src/as/com/threerings/presents/client/InvocationDirector.as
@@ -27,6 +27,7 @@
 import com.threerings.util.Boxed;
 import com.threerings.util.HashMap;
 import com.threerings.util.Log;
+import com.threerings.util.Short;

 import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;

@@ -340,11 +341,22 @@
     }

     /**
-     * Used to generate monotonically increasing invocation request ids.
+     * Used to generate (almost) monotonically increasing invocation request ids. The ids wrap
+     * around to Short.MIN_VALUE after Short.MAX_VALUE is reached.
      */
     protected function nextRequestId () :int
     {
-        return _requestId++;
+        // post increment with wraparound - this is necessary because the request id is
+        // serialized as a java short in all instances. since action script does not appear
+        // to support sign extension, wraparound in the integer domain explicitly. This will
+        // make the values in our _listeners map reliable. Cleverer ways to wrapround may exist.
+        var current :int = _requestId;
+        if (_requestId == Short.MAX_VALUE) { // x7fff
+            _requestId = -Short.MIN_VALUE; // x8000
+        } else {
+            _requestId++;
+        }
+        return current;
     }

     /**


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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBarBaseAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBarBaseAutomationImpl.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

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

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

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

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

 package spark.automation.delegates.components.supportClasses
 {


Disable too slow stream timer.

Disable too slow stream timer.

--- HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
+++ HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
@@ -766,7 +766,7 @@
 							// Reset a timer every time this code is reached. If this code is NOT reached for a significant amount of time, it means
 							// we are attempting to stream a quality level that is too high for the current bandwidth, and should switch to the lowest
 							// quality, as a precaution.
-							if (!streamTooSlowTimer)
+							if (false && !streamTooSlowTimer)
 							{
 								// If the timer doesn't yet exist, create it, setting the delay to twice the maximum desired buffer time
 								streamTooSlowTimer = new Timer(_desiredBufferTime_Max * 2000);
@@ -788,8 +788,12 @@
 									changeQualityLevelTo((_videoHandler as HTTPStreamSource)._streamNames[0]);
 								});
 							}
-							streamTooSlowTimer.reset();
-							streamTooSlowTimer.start();
+
+							if(streamTooSlowTimer)
+							{
+								streamTooSlowTimer.reset();
+								streamTooSlowTimer.start();
+							}

 							break;


Updated comments

Updated comments

--- AS_30_MultiTouch/MultiTouchExample.as
+++ AS_30_MultiTouch/MultiTouchExample.as
@@ -12,7 +12,8 @@
 		var box3:MovieClip;
 		var textBox:TextField;
 		var touchID:int;
-
+
+		// CONSTRUCTOR
 		public function MultiTouchExample() {
 			Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

@@ -27,29 +28,11 @@

 			textBox.text = String(Multitouch.maxTouchPoints);

-			// TOUCH EVEN LISTENERS
+			// TOUCH EVENT LISTENERS
 			stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin);
 			stage.addEventListener(TouchEvent.TOUCH_MOVE, onTouchMove);
 			stage.addEventListener(TouchEvent.TOUCH_END, onTouchEnd);
-
 		}
-
-		// ON SCREEN ASSET FUNCTIONS
-		private function createBox(x:int):MovieClip{
-			var mc:MovieClip = new MovieClip();
-			mc.graphics.beginFill(0xFF0000);
-			mc.graphics.drawRect(0,0,50,40);
-			addChild(mc);
-			mc.x=x;
-			return mc;
-		}
-		private function createTextBox():TextField{
-			var tb:TextField = new TextField();
-			tb.autoSize = "left";
-			addChild(tb);
-			return tb;
-		}
-
 		// TOUCH EVENT HANDLERS
 		private function onTouchBegin(event:TouchEvent) {
 		   touchID = event.touchPointID;
@@ -81,7 +64,21 @@
 		   textBox.text = "TOUCH_END" + event.touchPointID;
 		}

-
+		// ON SCREEN ASSET UTILITY FUNCTIONS
+		private function createBox(x:int):MovieClip{
+			var mc:MovieClip = new MovieClip();
+			mc.graphics.beginFill(0xFF0000);
+			mc.graphics.drawRect(0,0,50,40);
+			addChild(mc);
+			mc.x=x;
+			return mc;
+		}
+		private function createTextBox():TextField{
+			var tb:TextField = new TextField();
+			tb.autoSize = "left";
+			addChild(tb);
+			return tb;
+		}
 	}

 }


Replacing invalid ASDOC "@TODO:" with "@TODO"

Change-Id: Ifa02cd35da7be983a42ec11971aa7093753e4e6e

--- WeaveClient/src/weave/VisApplication.as
+++ WeaveClient/src/weave/VisApplication.as
@@ -1146,7 +1146,7 @@
 		/**
 		 * This function tiles all the DraggablePanels on stage
 		 *
-		 * @TODO: create a ui for this so the user can specify how to divide the stage
+		 * @TODO create a ui for this so the user can specify how to divide the stage
 		 *
 		 * @author kmanohar
 		 */
@@ -1484,7 +1484,7 @@
 		}

 		/**
-		 * @TODO: This should be removed -- ideally VisApplication has no context menu items itself, only other classes do
+		 * @TODO This should be removed -- ideally VisApplication has no context menu items itself, only other classes do
 		 */
 		protected function handleContextMenuItemSelect(event:ContextMenuEvent):void
 		{


hack_findHierarchyNode works with ReferencedColumn now

--- WeaveJS/src/weavejs/data/ColumnUtils.as
+++ WeaveJS/src/weavejs/data/ColumnUtils.as
@@ -195,10 +195,14 @@

 		public static function hack_findHierarchyNode(columnWrapper:IColumnWrapper):/*/IWeaveTreeNode & IColumnReference/*/IWeaveTreeNode
 		{
-			var dc:DynamicColumn = hack_findInternalDynamicColumn(columnWrapper);
-			if (!dc)
-				return null;
-			var rc:ReferencedColumn = dc.target as ReferencedColumn;
+			var rc:ReferencedColumn = columnWrapper as ReferencedColumn;
+			if (!rc)
+			{
+				var dc:DynamicColumn = hack_findInternalDynamicColumn(columnWrapper);
+				if (!dc)
+					return null;
+				rc = dc.target as ReferencedColumn;
+			}
 			return rc ? rc.getHierarchyNode() : null;
 		}


Movie.addedToLayer is internal

Movie.addedToLayer is internal

--- runtime/src/main/as/flump/display/Movie.as
+++ runtime/src/main/as/flump/display/Movie.as
@@ -137,7 +137,7 @@
         return this;
     }

-    /** Sets the movie playing.  Movie will automatically stop at its stopFrame, if one is set,
+    /** Sets the movie playing.  Movie will automatically stop at its stopFrame, if one is set,
      *  otherwise it will loop forever.
      *
      * @return this movie for chaining
@@ -192,8 +192,12 @@
         }
     }

-    /** notify this Movie that it has been added to the Layer after initialization */
-    public function addedToLayer() :void {
+    /**
+     * @private
+     *
+     * Called when the Movie has been newly added to a layer.
+     */
+    internal function addedToLayer () :void {
         goTo(0);
         _skipAdvanceTime = true;
     }


FLEX-14766 set id initially to -1

FLEX-14766 set id initially to -1

--- frameworks/projects/framework/src/mx/effects/Tween.as
+++ frameworks/projects/framework/src/mx/effects/Tween.as
@@ -321,7 +321,7 @@
     /**
      *  @private
      */
-    private var id:int;
+    private var id:int = -1;

     /**
      *  @private


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.effects
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 14124
Author:   cframpto@adobe.com
Date:     2010-02-11T17:53:35.882363Z

Log Message:
-----------
Merge 14123 from 4.x branch to trunk.

Log Message:
***********
Two additions/corrections to 14076.  Add key mappings for layoutDirection="rtl" for spark list components.  Correct type of keyCode variable so it is an uint rather than an int to match event.keyCode.

BitmapImage has a hard-coded layout direction="ltr".

QE notes: For layoutDirection="rtl" need to test LEFT, RIGHT, UP and DOWN keys.
Doc notes: None
Bugs: SDK-25330
Reviewed By: Hans
Tests run: checkintests
Is noteworthy for integration: No

Ticket Links:
***********
    http://bugs.adobe.com/jira/browse/SDK-25330

Modified Paths:
**************
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/containers/Accordion.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/ButtonBar.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/CalendarLayout.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/ColorPicker.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/Menu.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/MenuBar.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/RadioButton.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/Tree.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/sliderClasses/SliderThumb.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/core/Container.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/core/UIComponent.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/List.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/RadioButton.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/primitives/BitmapImage.as

Property Changed:
****************
    flex/sdk/branches/4.x/frameworks/

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="dir" action="M">/flex/sdk/trunk/frameworks</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CalendarLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/SliderThumb.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>

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

--- frameworks/projects/mx/src/mx/controls/ColorPicker.as
+++ frameworks/projects/mx/src/mx/controls/ColorPicker.as
@@ -1413,9 +1413,9 @@
     {
         var cpEvent:ColorPickerEvent = null;

-        // If rtl layout, need to swap LEFT for RIGHT so correct action
+        // If rtl layout, need to swap LEFT and RIGHT so correct action
         // is done.
-        var keyCode:int = mapKeycodeForLayoutDirection(event);
+        var keyCode:uint = mapKeycodeForLayoutDirection(event);

         if (event.ctrlKey && keyCode == Keyboard.DOWN)
         {