Transferred from the Adobe Open Source Subversion Repository

Revision: 10870
Author:   cframpto@adobe.com
Date:     2009-10-05T18:23:10.599724Z

Log Message:
-----------
In the past when the width (or maxWidth) wasn’t specified we told TLF that the width was our default maxWidth=10000.  This had implications especially when the text was rtl or textAlign != left because it aligned over a width of 10000. With this change we let TLF measure.  It will figure out the widest line and use that for the width.  Text will be aligned on that width.  So if there is only one line, and no explicit width, left, center and right alignment all look the same.

Truncation results will be slightly different now if there isn’t an explicit width.  We will let TLF measure the width and it will use that width for the truncation.  Depending on whether the last line is the widest line or not, it may have to remove some of the text to make room for the truncation indicator.

QE notes: there are a handful of RichText and Label failures as a result of this change - Ella approved the submit.
Doc notes:
Bugs: SDK-22909
Reviewer: Gordon
Tests run: checkintests, TextArea, TextInput, NumericStepper, RichText, Label
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -428,13 +428,13 @@
         // as we may have messed up the text lines.
         invalidateDisplayList();

-        // Put on next pixel boundary for crisp edges.
-        bounds.width = Math.ceil(bounds.width);
-        bounds.height = Math.ceil(bounds.height);
+        // Put on next pixel boundary for crisp edges.  If text is aligned,
+        // x and/or y may not be 0.
+        var newMeasuredHeight:Number = Math.ceil(bounds.bottom);

         // If the measured height is not affected, then constrained
         // width measurement is not neccessary.
-        if (!isNaN(_widthConstraint) && measuredHeight == bounds.height)
+        if (!isNaN(_widthConstraint) && measuredHeight == newMeasuredHeight)
             return;

         // Call super.measure() here insted of in the beginning of the method,
@@ -442,8 +442,8 @@
         // still be valid if we decided to do an early return above.
         super.measure();

-        measuredWidth = bounds.width;
-        measuredHeight = bounds.height;
+        measuredWidth = Math.ceil(bounds.right);
+        measuredHeight = newMeasuredHeight;

         // Remember the number of text lines during measure. We can use this to
         // optimize the double measure scheme for text reflow.
@@ -528,22 +528,24 @@

         var compose:Boolean = false;
         var clipText:Boolean = false;
+        var contentHeight:Number = Math.ceil(bounds.bottom);
+        var contentWidth:Number = Math.ceil(bounds.right);

         // FIXME (gosmith): optimize for right-to-left text so compose isn't always done
         // when height or width changes.
         if (invalidateCompose ||
-            composeForAlignStyles(unscaledWidth, unscaledHeight))
+            composeForAlignStyles(unscaledWidth, unscaledHeight, contentWidth, contentHeight))
         {
             compose = true;
         }
-        else if (unscaledHeight != bounds.height)
+        else if (unscaledHeight != contentHeight)
         {
             // Height changed.
-            if (composeOnHeightChange(unscaledHeight))
+            if (composeOnHeightChange(unscaledHeight, contentHeight))
             {
                 compose = true;
             }
-            else if (unscaledHeight < bounds.height)
+            else if (unscaledHeight < contentHeight)
             {
                 // Don't need to recompose but need to clip since not all the
                 // height is needed.
@@ -552,14 +554,14 @@
         }

         // Width changed.
-        if (!compose && unscaledWidth != bounds.width)
-        {
-            if (composeOnWidthChange(unscaledWidth))
+        if (!compose && unscaledWidth != contentWidth)
+        {
+            if (composeOnWidthChange(unscaledWidth, contentWidth))
             {
                 compose = true;
             }
             else if (getStyle("lineBreak") == "explicit" &&
-                     unscaledWidth < bounds.width)
+                     unscaledWidth < contentWidth)
             {
                 // Explicit line breaks.  Don't need to recompose but need to
                 // clip since the not all the width is needed.
@@ -638,13 +640,17 @@
      *  @private
      */
     private function composeForAlignStyles(unscaledWidth:Number,
-                                             unscaledHeight:Number):Boolean
+                                           unscaledHeight:Number,
+                                           contentWidth:Number,
+                                           contentHeight:Number):Boolean
     {
         // For textAlign, if the composeWidth isn't the same
         // as the unscaledWidth, and the text isn't left aligned, we need to
         // recompose.
         //
-        if (isNaN(_composeWidth) || _composeWidth != unscaledWidth)
+        var width:Number = isNaN(_composeWidth) ?
+                           contentWidth : _composeWidth;
+        if (unscaledWidth != width)
         {
             var direction:String = getStyle("direction");
             var textAlign:String = getStyle("textAlign");
@@ -661,7 +667,9 @@
         // For verticalAlign, if the composeHeight isn't the same as the
         // unscaledHeight, and the text isn't top aligned, we need to
         // recompose (or adjust the y values of all the text lines).
-        if (isNaN(_composeHeight) || _composeHeight != unscaledHeight)
+        var height:Number = isNaN(_composeHeight) ?
+                            contentHeight : _composeHeight;
+        if (unscaledHeight != height)
         {
             var verticalAlign:String = getStyle("verticalAlign");
             var topAligned:Boolean = (verticalAlign == "top");
@@ -676,14 +684,15 @@
     /**
      *  @private
      */
-    private function composeOnHeightChange(unscaledHeight:Number):Boolean
+    private function composeOnHeightChange(unscaledHeight:Number,
+                                           contentHeight:Number):Boolean
     {
         // Height increased and there may be more text.  It is possible that
         // there is more text even if isOverset isn't set.  If height
         // was specified, it will compose just enough text to fit the
         // composition bounds and depending on text placement, it may not
         // be overset.
-        if (unscaledHeight > bounds.height &&
+        if (unscaledHeight > contentHeight &&
             (isOverset || !isNaN(_composeHeight)))
             return true;

@@ -698,7 +707,7 @@
             // redo the truncation if we don't already have the number of
             // truncation lines needed.
             if (maxDisplayedLines > 0 &&
-               (unscaledHeight < bounds.height ||
+               (unscaledHeight < contentHeight ||
                  textLines.length != maxDisplayedLines))
             {
                 return true;
@@ -715,7 +724,8 @@
     /**
      *  @private
      */
-    private function composeOnWidthChange(unscaledWidth:Number):Boolean
+    private function composeOnWidthChange(unscaledWidth:Number,
+                                          contentWidth:Number):Boolean
     {
         // If toFit, then the composeWidth must equal the unscaledWidth
         // so that the text flows properly.
@@ -749,28 +759,19 @@

 	/**
 	 *  @private
-	 *  Adds the TextLines created by composeTextLines()
-     *  to a specified DisplayObjectContainer.
+	 *  Adds the TextLines created by composeTextLines() to this container.
 	 */
-	mx_internal function addTextLines(container:DisplayObjectContainer,
-								      index:int = 0):void
+	mx_internal function addTextLines(index:int = 0):void
 	{
 		var n:int = textLines.length;
         if (n == 0)
             return;

-        var addChildAtMethod:Function = container is UIComponent ?
-        								UIComponent(container).$addChildAt :
-        								container.addChildAt;
-
         for (var i:int = n - 1; i >= 0; i--)
-		{
-			var textLine:DisplayObject = textLines[i];
-
-            //trace(container.name, "addTextLines", textLine.x, textLine.y, drawX, drawY);
-
-			addChildAtMethod(textLine, index);
-		}
+        {
+            var textLine:DisplayObject = textLines[i];
+            $addChildAt(textLine, index);
+        }
 	}

 	/**
@@ -791,15 +792,10 @@
 		var container:DisplayObjectContainer =
 			textLines[0].parent;

-         var removeChildMethod:Function = container is UIComponent ?
-										 UIComponent(container).$removeChild :
-										 container.removeChild;
-
 		for (var i:int = 0; i < n; i++)
 		{
-			var textLine:DisplayObject = textLines[i];
-
-            removeChildMethod(textLine);
+			var textLine:DisplayObject = textLines[i];
+            UIComponent(container).$removeChild(textLine);
 		}
 	}

@@ -921,7 +917,7 @@
         // If we're truncating, recompose the text.
         if (maxDisplayedLines != 0)
         {
-            invalidateCompose = true;
+            invalidateTextLines();

             invalidateSize();
             invalidateDisplayList();


Transferred from the Adobe Open Source Subversion Repository

Revision: 13693
Author:   hmuller@adobe.com
Date:     2010-01-21T20:25:54.403160Z

Log Message:
-----------
Initial version of the mirroring layout code.  Only Spark is supported.  API revisions for this feature are very likely to follow.

QE notes:
Doc notes:
Bugs:
Reviewer: Evtim
Tests run: All Mustella tests pass
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/MatrixUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/defaults.css</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/spark/src/spark/skins/spark/CheckBoxSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutDirection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</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/spark/src/spark/skins/spark/PanelSkin.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/spark/src/spark/utils/BitmapUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -156,6 +156,9 @@
         // set mouseChildren to false so that the TextLines that get
         // added don't trap the mouse events.
         mouseChildren = false;
+
+		// this component assumes that its coordinate system will not be mirrored
+		layoutDirection = "ltr";

 		var resourceManager:IResourceManager = ResourceManager.getInstance();


[BUGFIX] [PLEASE REVIEW] This seems necessary for IEventDispatcher implementations (not extending EventDispatcher). Otherwise TypeError occurs. Not ideal...

--- frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
+++ frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
@@ -61,8 +61,20 @@
 	{
         public function EventDispatcher(target:IEventDispatcher = null)
         {
-            if (target != null)
-                setTargetForTesting(target);
+            if (target != null) {
+				setTargetForTesting(target);
+				//the following can be required with IEventDispatcher implementation instead of extending EventDispatcher
+				//(fireListeners is not required by IEventDispatcher, but is called on the 'currentTarget'
+				//by the ancestor goog.events.EventTarget code)
+				var obj:Object = target;
+				if (!obj.fireListeners) {
+					var me:EventDispatcher = this;
+					obj.fireListeners = function ():* {
+						me.fireListeners.apply(me,arguments);
+					};
+				}
+			}
+
         }

         public function hasEventListener(type:String):Boolean


Transferred from the Adobe Open Source Subversion Repository

Revision: 19767
Author:   aharui@adobe.com
Date:     2011-01-14T18:00:12.563159Z

Log Message:
-----------
Upgrade IconItemRenderer and ViewNavigatorBase to use MultiDPIBitmapSource

QE notes: Ryan says he'll change the name of the decoratorClass property in a later change list
Doc notes:  see QE notes
Bugs: SDK-29081, SDK-29082
Reviewer: Ryan, Chiedo
Tests run: checkintests
Is noteworthy for integration: no

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
@@ -13,6 +13,7 @@
 {
 import flash.display.StageOrientation;
 import flash.events.StageOrientationEvent;
+import flash.system.Capabilities;
 import flash.utils.getDefinitionByName;
 import flash.utils.getQualifiedClassName;

@@ -21,11 +22,13 @@
 import mx.events.FlexEvent;
 import mx.events.PropertyChangeEvent;
 import mx.managers.SystemManager;
+import mx.utils.DensityUtil;

 import spark.components.SkinnableContainer;
 import spark.components.View;
 import spark.core.ContainerDestructionPolicy;
 import spark.events.DisplayLayerObjectExistenceEvent;
+import spark.utils.MultiDPIBitmapSource;

 use namespace mx_internal;

@@ -233,7 +236,7 @@
     //  icon
     //----------------------------------

-    private var _icon:Class;
+    private var _icon:Object;

     /**
      *  The icon used when this navigator is represented
@@ -246,7 +249,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public function get icon():Class
+    public function get icon():Object
     {
         return _icon;
     }
@@ -254,11 +257,11 @@
     /**
      *  @private
      */
-    public function set icon(value:Class):void
+    public function set icon(value:Object):void
     {
         if (_icon != value)
         {
-            var oldValue:Class = _icon;
+            var oldValue:Object = _icon;
             _icon = value;

             if (hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
@@ -514,7 +517,26 @@
      */
     public function saveViewData():Object
     {
-        return {label:label, iconClassName:getQualifiedClassName(icon)};
+        var iconData:Object = icon;
+
+        if (iconData is MultiDPIBitmapSource)
+        {
+            var app:Object = FlexGlobals.topLevelApplication;
+            var dpi:int;
+            if ("runtimeDPI" in app)
+                dpi = app["runtimeDPI"];
+            else
+                dpi = DensityUtil.classifyDPI(Capabilities.screenDPI);
+
+            iconData = MultiDPIBitmapSource(iconData).getSource(dpi);
+        }
+
+        if (iconData is Class)
+            return {label:label, iconClassName:getQualifiedClassName(iconData)};
+        if (iconData is String)
+            return {label:label, iconStringName: iconData};
+
+        return {label:label};
     }

     /**
@@ -536,7 +558,7 @@
         label = value.label;

         var iconClassName:String = value.iconClassName;
-        icon = (iconClassName == "null") ? null : getDefinitionByName(iconClassName) as Class;
+        icon = (iconClassName == "null") ? value.iconStringName : getDefinitionByName(iconClassName) as Class;
     }

     /**


set BasicMaterial.diffuseColor to be Object in order to accept both uint and Vector4 color values

--- src/aerys/minko/render/material/basic/BasicMaterial.as
+++ src/aerys/minko/render/material/basic/BasicMaterial.as
@@ -41,11 +41,11 @@
 			setProperty(BasicProperties.TRIANGLE_CULLING, value);
 		}

-		public function get diffuseColor() : uint
+		public function get diffuseColor() : Object
 		{
 			return getProperty(BasicProperties.DIFFUSE_COLOR);
 		}
-		public function set diffuseColor(value : uint) : void
+		public function set diffuseColor(value : Object) : void
 		{
 			setProperty(BasicProperties.DIFFUSE_COLOR, value);
 		}


Added writeByteAt and fromString to BinaryData

--- frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
+++ frameworks/projects/Core/src/main/flex/org/apache/flex/utils/BinaryData.as
@@ -56,6 +56,21 @@
     {
         ba = bytes ? bytes : new ArrayBuffer(0);
     }
+
+	/**
+	 *  Utility method to create a BinaryData object from a string.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.7.0
+	 */
+	public static function fromString(str:String):BinaryData
+	{
+		var bd:BinaryData = new BinaryData();
+		bd.writeUTFBytes(str);
+		return bd;
+	}

 	private var _endian:String = Endian.DEFAULT;

@@ -285,7 +300,30 @@
 	{
 		private var typedArray:Uint8Array;
 	}
-
+
+	/**
+	 *  Writes a byte of binary data at the specified index. Does not change the position property.
+	 *  This is a method for optimzed writes with no range checking.
+	 *  If the specified index is out of range, it can throw an error.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public function writeByteAt(idx:uint,byte:int):void
+	{
+		COMPILE::SWF
+			{
+				ba[idx] = byte;
+			}
+			COMPILE::JS
+			{
+				if(typedArray == null)
+					typedArray = new Uint8Array(ba);
+				typedArray[idx] = byte;
+			}
+	}

     /**
      *  Read a short int of binary data at the current position


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

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

 package mx.collections
 {


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

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

 package mx.printing
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 22564
Author:   tkraikit@adobe.com
Date:     2011-09-14T19:50:07.656843Z

Log Message:
-----------
Update ASDoc "@productversion Flex 4.5.2" => "@productversion Flex 4.6"

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/collections/OnDemandDataProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DateSpinnerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/graphics/BitmapScaleMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ContentBackgroundAppearance.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/FlexVersion.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ArrowDirection.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/globalization/supportClasses/FormatPattern.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultTransparentNavigationButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/core/ISoftKeyboardHintClient.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/CalloutArrow.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/YearProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/calendarClasses/DateSelectorDisplayMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ToggleSwitch.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultBeveledBackButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListScrollerSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/ScrollSnappingMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/StageTextSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultTransparentActionButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/StageTextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/ToggleSwitchSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutPosition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreenImageSource.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/SkinnablePopUpContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SplitViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/Callout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/StageTextInputSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/collections/NumericDataProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreenImage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/globalization/supportClasses/CalendarDate.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultBeveledActionButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/globalization/supportClasses/DateTimeFormatterEx.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ToggleSwitchSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ToggleSwitchSkin.as
@@ -42,7 +42,7 @@
  *
  *  @langversion 3.0
  *  @playerversion AIR 3
- *  @productversion Flex 4.5.2
+ *  @productversion Flex 4.6
  *
  *  @see spark.components.ToggleSwitch
  */
@@ -58,7 +58,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      **/
     public function ToggleSwitchSkin()
     {
@@ -121,7 +121,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutThumbWidth:Number;

@@ -130,7 +130,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutThumbHeight:Number;

@@ -139,7 +139,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutCornerEllipseSize:Number;

@@ -148,7 +148,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutStrokeWeight:Number;

@@ -157,7 +157,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutBorderSize:Number;

@@ -166,7 +166,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutInnerPadding:Number;

@@ -175,7 +175,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutOuterPadding:Number;

@@ -184,7 +184,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected var layoutTextShadowOffset:Number;

@@ -194,7 +194,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     public var selectedLabelDisplay:LabelDisplayComponent;

@@ -204,7 +204,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     public var unselectedLabelDisplay:LabelDisplayComponent;

@@ -244,7 +244,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     public var thumb:IVisualElement;

@@ -253,7 +253,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     public var track:IVisualElement;

@@ -324,7 +324,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected function get selectedLabel():String
     {
@@ -347,7 +347,7 @@
      *
      *  @langversion 3.0
      *  @playerversion AIR 3
-     *  @productversion Flex 4.5.2
+     *  @productversion Flex 4.6
      */
     protected function get unselectedLabel():String
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8654
Author:   jszeto@adobe.com
Date:     2009-07-17T00:20:24.630989Z

Log Message:
-----------
TrackBase mouse handling

http://bugs.adobe.com/jira/browse/SDK-22044 - SkinnableComponent mouse handling needs to be MarshallPlan compliant

I have updated the track based components mouse handlers to be Marshall Plan compliant. The previous code was using the SkinnableComponent.addSystemHandlers which listen for the event on both the systemManager and the stage. I removed addSystemHandler/removeSystemHandler and added the listeners to the sandbox. I also added listeners for the SandboxMouseEvents for MOUSE_UP_SOMEWHERE.

QE notes: Need marshall plan tests for Slider and ScrollBar
Doc notes: None
Bugs: SDK-22044
Reviewer: Glenn, Alex
Tests run: ScrollBar, Scroller, Slider
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as
@@ -436,8 +436,7 @@
     override protected function focusInHandler(event:FocusEvent):void
     {
         super.focusInHandler(event);
-
-        addSystemHandlers(MouseEvent.MOUSE_WHEEL, system_mouseWheelHandler, stage_mouseWheelHandler);
+        systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_WHEEL, system_mouseWheelHandler);
     }

     /**
@@ -446,8 +445,7 @@
     override protected function focusOutHandler(event:FocusEvent):void
     {
         super.focusOutHandler(event);
-
-        removeSystemHandlers(MouseEvent.MOUSE_WHEEL, system_mouseWheelHandler, stage_mouseWheelHandler);
+        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_WHEEL, system_mouseWheelHandler);
     }

     /**
@@ -526,22 +524,12 @@
      */
     protected function system_mouseWheelHandler(event:MouseEvent):void
     {
-        var newValue:Number = nearestValidValue(value + event.delta * stepSize, stepSize);
-        setValue(newValue);
-        event.preventDefault();
-    }
-
-    /**
-     *  @private
-     *  Handles the mouseWheel event when the component is in focus. The thumb is
-     *  moved by the amount of the mouse event delta multiplied by the stepSize.
-     */
-    private function stage_mouseWheelHandler(event:MouseEvent):void
-    {
-        if (event.target != stage)
-            return;
-
-        system_mouseWheelHandler(event);
+        if (!event.isDefaultPrevented())
+        {
+            var newValue:Number = nearestValidValue(value + event.delta * stepSize, stepSize);
+            setValue(newValue);
+            event.preventDefault();
+        }
     }

     //---------------------------------
@@ -554,23 +542,16 @@
      *  the mouse down point in clickOffset.
      */
     protected function thumb_mouseDownHandler(event:MouseEvent):void
-    {
-        addSystemHandlers(MouseEvent.MOUSE_MOVE, system_mouseMoveHandler, stage_mouseMoveHandler);
-        addSystemHandlers(MouseEvent.MOUSE_UP, system_mouseUpHandler, stage_mouseUpHandler);
+    {
+        systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_MOVE,
+            system_mouseMoveHandler, true);
+        systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP,
+            system_mouseUpHandler, true);
+        systemManager.getSandboxRoot().addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE,
+            system_mouseUpHandler);
+
         clickOffset = thumb.globalToLocal(new Point(event.stageX, event.stageY));
         dispatchEvent(new TrackBaseEvent(TrackBaseEvent.THUMB_PRESS));
-    }
-
-    /**
-     *  @private
-     *  Capture mouse-move events on the thumb anywhere on the stage
-     */
-    private function stage_mouseMoveHandler(event:MouseEvent):void
-    {
-        if (event.target != stage)
-            return;
-
-        system_mouseMoveHandler(event);
     }

     /**
@@ -596,27 +577,20 @@

         event.updateAfterEvent();
     }
-
-    /**
-     *  @private
-     *  Handle mouse-up events anywhere on the stage.
-     */
-    private function stage_mouseUpHandler(event:MouseEvent):void
-    {
-        if (event.target != stage)
-            return;
-
-        system_mouseUpHandler(event);
-    }
-
+
     /**
      *  @private
      *  Handle mouse-up events anywhere on or off the stage.
      */
-    protected function system_mouseUpHandler(event:MouseEvent):void
-    {
-        removeSystemHandlers(MouseEvent.MOUSE_MOVE, system_mouseMoveHandler, stage_mouseMoveHandler);
-        removeSystemHandlers(MouseEvent.MOUSE_UP, system_mouseUpHandler, stage_mouseUpHandler);
+    protected function system_mouseUpHandler(event:Event):void
+    {
+        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_MOVE,
+            system_mouseMoveHandler, true);
+        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP,
+            system_mouseUpHandler, true);
+        systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE,
+            system_mouseUpHandler);
+
         dispatchEvent(new TrackBaseEvent(TrackBaseEvent.THUMB_RELEASE));
     }

@@ -643,7 +617,7 @@
     private function mouseDownHandler(event:MouseEvent):void
     {
         systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP,
-                                                        system_mouseUpSomewhereHandler);
+                                                        system_mouseUpSomewhereHandler, true);
         systemManager.getSandboxRoot().addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE,
                                                         system_mouseUpSomewhereHandler);

@@ -656,7 +630,7 @@
     private function system_mouseUpSomewhereHandler(event:Event):void
     {
         systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP,
-                                                           system_mouseUpSomewhereHandler);
+                                                           system_mouseUpSomewhereHandler, true);
         systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE,
                                                            system_mouseUpSomewhereHandler);


Transferred from the Adobe Open Source Subversion Repository

Revision: 21689
Author:   aaltman@adobe.com
Date:     2011-07-22T17:11:13.369171Z

Log Message:
-----------
Fixes for StageText DPI-based scaling and effect artifacts

QE notes: None
Doc notes: None
Bugs: SDK-30807, SDK-30810, SDK-30739
Reviewer: egeorgie
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
@@ -11,19 +11,17 @@

 package spark.components.supportClasses
 {
-import flash.accessibility.AccessibilityProperties;
+import flash.display.Bitmap;
+import flash.display.BitmapData;
+import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
-import flash.display.Sprite;
 import flash.display.Stage;
 import flash.events.Event;
 import flash.events.EventDispatcher;
 import flash.events.FocusEvent;
 import flash.events.SoftKeyboardEvent;
-import flash.geom.Matrix;
-import flash.geom.Matrix3D;
 import flash.geom.Point;
 import flash.geom.Rectangle;
-import flash.geom.Vector3D;
 import flash.system.Capabilities;
 import flash.text.AutoCapitalize;
 import flash.text.ReturnKeyLabel;
@@ -38,25 +36,20 @@
 import flashx.textLayout.formats.LineBreak;

 import mx.core.DPIClassification;
-import mx.core.DesignLayer;
 import mx.core.FlexGlobals;
-import mx.core.IInvalidating;
-import mx.core.IVisualElement;
 import mx.core.LayoutDirection;
 import mx.core.UIComponent;
-import mx.core.UITextFormat;
 import mx.core.mx_internal;
+import mx.events.EffectEvent;
 import mx.events.FlexEvent;
-import mx.geom.TransformOffsets;
-import mx.managers.FocusManager;
-import mx.styles.CSSStyleDeclaration;
-import mx.styles.ISimpleStyleClient;
-import mx.styles.IStyleClient;
-
+import mx.events.MoveEvent;
+import mx.events.ResizeEvent;
+import mx.managers.SystemManager;
+
+import spark.components.Application;
 import spark.core.IEditableText;
 import spark.core.ISoftKeyboardHintClient;
 import spark.events.TextOperationEvent;
-import spark.primitives.Rect;

 use namespace mx_internal;

@@ -586,6 +579,29 @@
     override public function get baselinePosition():Number
     {
         return measureTextLineHeight();
+    }
+
+    //----------------------------------
+    //  densityScale
+    //----------------------------------
+
+    private var _densityScale:Number;
+
+    /**
+     *  The scale factor necessary to account for differences in the design
+     *  resolution of the application (applicationDPI) and the resolution of the
+     *  device the application is running on.
+     */
+    private function get densityScale():Number
+    {
+        if (isNaN(_densityScale))
+        {
+            var application:Application = FlexGlobals.topLevelApplication as Application;
+            var sm:SystemManager = application ? application.systemManager as SystemManager : null;
+            _densityScale = sm ? sm.densityScale : 1.0;
+        }
+
+        return _densityScale;
     }

     //----------------------------------
@@ -1360,9 +1376,9 @@
             var fontSize:* = getStyle("fontSize");

             if (fontSize != undefined)
-                stageText.fontSize = fontSize;
+                stageText.fontSize = fontSize * densityScale;
             else
-                stageText.fontSize = defaultStyles["fontSize"];
+                stageText.fontSize = defaultStyles["fontSize"] * densityScale;

             var color:* = getStyle("color");

@@ -1375,6 +1391,69 @@
         }
     }

+    private var textImage:Bitmap = null;
+    private var numEffectsRunning:int = 0;
+
+    /**
+     *  If a StageText is visible, this will capture a bitmap copy of what it is
+     *  displaying. This includes any text visible in the StageText and may
+     *  include the text insertion cursor if it is visible at the time of the
+     *  call.
+     */
+    mx_internal function captureBitmapData():BitmapData
+    {
+        if (!stageText || !localViewPort ||
+            localViewPort.width == 0 || localViewPort.height == 0 ||
+            !visible || !calcAncestorsVisible())
+            return null;
+
+        var bitmap:BitmapData = new BitmapData(stageText.viewPort.width,
+            stageText.viewPort.height, true, 0x00FFFFFF);
+
+        stageText.drawViewPortToBitmapData(bitmap);
+
+        return bitmap;
+    }
+
+    /**
+     *  Generate an image that represents this StageText and replace the live
+     *  StageText display with that image. Used for display while effects are
+     *  playing.
+     */
+    private function createProxyImage():void
+    {
+        if (textImage == null)
+        {
+            var imageData:BitmapData = captureBitmapData();
+
+            if (imageData)
+            {
+                textImage = new Bitmap(imageData);
+                textImage.scaleX = 1.0 / densityScale;
+                textImage.scaleY = 1.0 / densityScale;
+                addChild(textImage);
+
+                updateViewPort();
+            }
+        }
+    }
+
+    /**
+     *  Destroy any previously created proxy image and restore the visibility of
+     *  the StageText display that the proxy image had represented.
+     */
+    private function disposeProxyImage():void
+    {
+        if (textImage != null)
+        {
+            removeChild(textImage);
+            textImage.bitmapData.dispose();
+            textImage = null;
+
+            updateViewPort();
+        }
+    }
+
     /**
      *  Tell the StageText what rectangle it needs to render in. The StageText
      *  is not part of the normal display hierarchy, so its coordinates are
@@ -1389,10 +1468,22 @@
                 var globalPoint:Point = parent.localToGlobal(localViewPort.topLeft);
                 var globalRect:Rectangle = new Rectangle(globalPoint.x, globalPoint.y);

-                if (_visible)
+                if (_visible && calcAncestorsVisible())
                 {
-                    globalRect.width = localViewPort.width;
-                    globalRect.height = localViewPort.height;
+                    if (textImage)
+                    {
+                        textImage.x = 0;
+                        textImage.y = 0;
+                    }
+                    else
+                    {
+                        // Transform the bottom-right corner of the local rect
+                        // instead of setting width/height to account for any
+                        // transformations applied to ancestor objects.
+                        globalRect.bottomRight = parent.localToGlobal(localViewPort.bottomRight);
+                        globalRect.width = Math.floor(globalRect.width);
+                        globalRect.height = Math.floor(globalRect.height);
+                    }
                 }

                 stageText.viewPort = globalRect;
@@ -1412,36 +1503,40 @@
         const applicationDPI:Number = FlexGlobals.topLevelApplication.applicationDPI;
         const isAndroid:Boolean = Capabilities.version.indexOf("AND") == 0;

-        var verticalPadPerPixel:Number = 0;
-        var baseHorizontalPad:Number = 0;
-        var baseVerticalPad:Number = 0;
-        var minMetrics:TextLineMetrics = measureText("Wj");
-        var minSize:Point = new Point(minMetrics.width, minMetrics.height);
+        var verticalPad:Number = 0;
+        var horizontalPad:Number = 0;

         if (isAndroid)
         {
-            switch (applicationDPI)
-            {
-                case DPIClassification.DPI_320:
-                    verticalPadPerPixel = 0.75;
-                    baseHorizontalPad = 11;
-                    baseVerticalPad = 15;
-                    break;
-                case DPIClassification.DPI_240:
-                    verticalPadPerPixel = 0.36;
-                    baseHorizontalPad = 9;
-                    baseVerticalPad = 12;
-                    break;
-                default:
-                    verticalPadPerPixel = 0.125;
-                    baseHorizontalPad = 7;
-                    baseVerticalPad = 7;
-                    break;
-            }
-        }
-
-        return new Point(baseHorizontalPad,
-            baseVerticalPad + Math.ceil(minSize.y * verticalPadPerPixel));
+            var androidDensityScale:Number = 1.0;
+
+            // Android uses different density classifications from Flex.
+            // No scaling is applied to 160 DPI.
+            // Low density is assumed to be 120 DPI (scale factor 0.75)
+            // High density is assumed to be 240 DPI (scale factor 1.5)
+            // Flex's scale (the ratio between application and device DPI) has
+            // been set to the application and StageText appears to be using
+            // that, so use only application DPI when determining scale here.
+            if (applicationDPI < DPIClassification.DPI_160)
+                androidDensityScale = 0.75;
+            else if (applicationDPI == DPIClassification.DPI_240)
+                androidDensityScale = 1.5;
+            else if (applicationDPI == DPIClassification.DPI_320)
+                androidDensityScale = 2.0;
+
+            // Part of the padding that Android uses is based only on resolution
+            // Magic numbers have been determined through experimentation
+            horizontalPad = 9 * androidDensityScale;
+            verticalPad = 10 * androidDensityScale;
+
+            // Some of the vertical padding is based on the height of the font
+            // Magic numbers have been determined through experimentation
+            var minMetrics:TextLineMetrics = measureText("Wj");
+            var halfHeight:Number = Math.ceil(0.5 * minMetrics.height);
+            verticalPad += Math.floor(halfHeight / 7);
+        }
+
+        return new Point(horizontalPad, verticalPad);
     }

     /**
@@ -1459,6 +1554,93 @@
         return lineMetrics.height + internalPadding.y;
     }

+    private var ancestorsVisible:Boolean;
+    private var ancestorsVisibleInvalidateFlag:Boolean = true;
+
+    /**
+     *  Returns true if every ancestor of this object is visible.
+     */
+    private function calcAncestorsVisible():Boolean
+    {
+        if (ancestorsVisibleInvalidateFlag)
+        {
+            var result:Boolean = visible;
+            var ancestor:DisplayObject = parent;
+
+            while (result && ancestor)
+            {
+                result = ancestor.visible;
+                ancestor = ancestor.parent;
+            }
+
+            ancestorsVisible = result;
+            ancestorsVisibleInvalidateFlag = false;
+        }
+
+        return ancestorsVisible;
+    }
+
+    private var watchedAncestors:Vector.<UIComponent> = new Vector.<UIComponent>();
+
+    private function gatherAncestorComponents():Vector.<UIComponent>
+    {
+        var ancestors:Vector.<UIComponent> = new Vector.<UIComponent>();
+        var ancestorObj:DisplayObject = parent;
+
+        while (ancestorObj)
+        {
+            if (ancestorObj is UIComponent)
+                ancestors.push(ancestorObj as UIComponent);
+
+            ancestorObj = ancestorObj.parent;
+        }
+
+        return ancestors;
+    }
+
+    /**
+     *  Search for ancestor components and add listeners to them for changes in
+     *  visibility or geometry. This is necessary because StageText is separate
+     *  from the display object hierarchy and must have its position and
+     *  visibilty updated manually to account for changes in the hierarchy.
+     *  Listeners are needed on all ancestor components because components will
+     *  not dispatch move, resize, show, or hide events unless they have
+     *  listeners for those events.
+     */
+    private function updateWatchedAncestors():void
+    {
+        var newWatchedAncestors:Vector.<UIComponent> = gatherAncestorComponents();
+
+        var i:int;
+        for (i = 0; i < watchedAncestors.length; i++)
+        {
+            var ancestor:UIComponent = watchedAncestors[i];
+
+            if (newWatchedAncestors.indexOf(ancestor) == -1)
+            {
+                ancestor.removeEventListener(MoveEvent.MOVE, ancestor_moveHandler);
+                ancestor.removeEventListener(ResizeEvent.RESIZE, ancestor_resizeHandler);
+                ancestor.removeEventListener(FlexEvent.SHOW, ancestor_showHandler);
+                ancestor.removeEventListener(FlexEvent.HIDE, ancestor_hideHandler);
+            }
+        }
+
+        for (i = 0; i < newWatchedAncestors.length; i++)
+        {
+            var newAncestor:UIComponent = newWatchedAncestors[i];
+
+            if (watchedAncestors.indexOf(newAncestor) == -1)
+            {
+                newAncestor.addEventListener(MoveEvent.MOVE, ancestor_moveHandler, false, 0, true);
+                newAncestor.addEventListener(ResizeEvent.RESIZE, ancestor_resizeHandler, false, 0, true);
+                newAncestor.addEventListener(FlexEvent.SHOW, ancestor_showHandler, false, 0, true);
+                newAncestor.addEventListener(FlexEvent.HIDE, ancestor_hideHandler, false, 0, true);
+            }
+        }
+
+        watchedAncestors = newWatchedAncestors;
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Overridden event handlers
@@ -1484,6 +1666,41 @@
     //
     //--------------------------------------------------------------------------

+    private function ancestor_hideHandler(event:FlexEvent):void
+    {
+        // Shortcut: If any ancestor hid, the StageText must hide. No need to
+        // recalculate visibility.
+        ancestorsVisible = false;
+        ancestorsVisibleInvalidateFlag = false;
+        invalidateViewPortFlag = true;
+
+        invalidateProperties();
+    }
+
+    private function ancestor_moveHandler(event:MoveEvent):void
+    {
+        // Any change in ancestor geometry may affect the StageText's geometry.
+        invalidateViewPortFlag = true;
+        invalidateProperties();
+    }
+
+    private function ancestor_resizeHandler(event:ResizeEvent):void
+    {
+        // Any change in ancestor geometry may affect the StageText's geometry.
+        invalidateViewPortFlag = true;
+        invalidateProperties();
+    }
+
+    private function ancestor_showHandler(event:FlexEvent):void
+    {
+        // An ancestor was shown, but some other ancestor may still be hidden.
+        // Invalidate visibility and recalculate it later.
+        ancestorsVisibleInvalidateFlag = true;
+        invalidateViewPortFlag = true;
+
+        invalidateProperties();
+    }
+
     private function stageText_changeHandler(event:Event):void
     {
         var foundChange:Boolean = false;
@@ -1556,6 +1773,64 @@
             event.bubbles, event.cancelable, this, event.triggerType));
     }

+    private function stage_effectStartHandler(event:EffectEvent):void
+    {
+        // An effect is starting, but the effect will only affect the StageText
+        // if its target is an ancestor of it.
+        var ancestor:DisplayObjectContainer = parent;
+
+        while (ancestor != null && ancestor != event.target)
+            ancestor = ancestor.parent;
+
+        if (ancestor != null)
+        {
+            // The first effect affecting the StageText that starts causes us
+            // to replace the StageText with a bitmap.
+            if (numEffectsRunning++ == 0)
+                createProxyImage();
+        }
+    }
+
+    private function stage_effectEndHandler(event:EffectEvent):void
+    {
+        var ancestor:DisplayObjectContainer = parent;
+
+        while (ancestor != null && ancestor != event.target)
+            ancestor = ancestor.parent;
+
+        if (ancestor != null)
+        {
+            // The last effect affecting the StageText to end causes us to put
+            // the live StageText back and remove the bitmap.
+            if (--numEffectsRunning == 0)
+                disposeProxyImage();
+        }
+    }
+
+    private function stage_hierarchyChangedHandler(event:Event):void
+    {
+        // If an ancestor is added to or removed from the list of this
+        // StageText's ancestors, update the list of components we watch for
+        // visibility and geometry changes.
+        var target:Object = event.target;
+        var foundTarget:Boolean = false;
+        var ancestor:DisplayObject = this;
+
+        while (ancestor != null)
+        {
+            if (target == ancestor)
+            {
+                foundTarget = true;
+                break;
+            }
+
+            ancestor = ancestor.parent;
+        }
+
+        if (foundTarget)
+            updateWatchedAncestors();
+    }
+
     private function addedToStageHandler(event:Event):void
     {
         if (stageText == null)
@@ -1563,19 +1838,29 @@

         stageText.stage = stage;

+        stageText.stage.addEventListener(EffectEvent.EFFECT_START, stage_effectStartHandler, true, 0, true);
+        stageText.stage.addEventListener(EffectEvent.EFFECT_END, stage_effectEndHandler, true, 0, true);
+
+        stageText.stage.addEventListener(Event.ADDED, stage_hierarchyChangedHandler, false, 0, true);
+        stageText.stage.addEventListener(Event.REMOVED, stage_hierarchyChangedHandler, false, 0, true);
+
+        updateWatchedAncestors();
+
         if (deferredViewPortUpdate)
             updateViewPort();
     }

-    /**
-     *  Clean up and dispose of our StageText.
-     *  TODO: This fails on iOS because of bug 2906305.
-     */
     private function removedFromStageHandler(event:Event):void
     {
         if (stageText == null)
             return;

+        stageText.stage.removeEventListener(EffectEvent.EFFECT_START, stage_effectStartHandler, true);
+        stageText.stage.removeEventListener(EffectEvent.EFFECT_END, stage_effectEndHandler, true);
+
+        stageText.stage.removeEventListener(Event.ADDED, stage_hierarchyChangedHandler);
+        stageText.stage.removeEventListener(Event.REMOVED, stage_hierarchyChangedHandler);
+
         stageText.stage = null;

         stageText.removeEventListener(Event.CHANGE, stageText_changeHandler);


Transferred from the Adobe Open Source Subversion Repository

Revision: 17372
Author:   gruehle@adobe.com
Date:     2010-08-18T23:23:45.776465Z

Log Message:
-----------
More mobile text feature work:
* Address all remaining TODOs in the code
* Alphabetize the properties in IEditableText and MobileTextField
* Add support for embedded fonts

QE notes: No
Doc notes: No
Bugs: SDK-27474
Reviewer: Jason Szeto
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TextInput_border.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/IEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
@@ -13,6 +13,8 @@
 {
 import flash.events.Event;
 import flash.events.KeyboardEvent;
+import flash.geom.Rectangle;
+import flash.text.Font;
 import flash.text.TextField;
 import flash.text.TextFieldType;
 import flash.text.TextFormat;
@@ -21,6 +23,7 @@

 import mx.core.mx_internal;
 import mx.events.FlexEvent;
+import mx.resources.ResourceManager;
 import mx.styles.IStyleClient;

 import spark.core.IEditableText;
@@ -28,17 +31,12 @@

 use namespace mx_internal;

-// TODO:
-//  - load truncation indicator from resource
-//  - verify focusEnabled functionality
-//  - implement heightInLines/widthInChars (or remove)
-//  - implement scrollToRange()
-//  - dispatch isTruncatedChanged
-//
+[ResourceBundle("core")]
+
 //
 // To use:
 //   in createChildren():
-//       var tf:MobileTextField = new MobileTextField();
+//       var tf:MobileTextField = createInFontContext(MobileTextField);
 //       tf.styleProvider = this;
 //       tf.editable = true|false;   // for editable text
 //       tf.multiline = true|false;  // for multiline text
@@ -63,7 +61,8 @@
 //   in styleChanged():
 //       tf.styleChanged(styleProp);
 //
-// Supported styles: textAlign, fontFamily, fontWeight, "colorName", fontSize, fontStyle, textDecoration, textIndent, leading, letterSpacing, paddingLeft, paddingRight
+// Supported styles: textAlign, fontFamily, fontWeight, "colorName", fontSize, fontStyle,
+//                   textDecoration, textIndent, leading, letterSpacing

 /**
  *  The MobileTextField class is a text primitive for use in ActionScript
@@ -79,6 +78,24 @@

     //--------------------------------------------------------------------------
     //
+    //  Class variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Most resources are fetched on the fly from the ResourceManager,
+     *  so they automatically get the right resource when the locale changes.
+     *  But since truncateToFit() can be called frequently,
+     *  this class caches this resource value in this variable.
+     *  Note that this class does _not_ support runtime local changes to
+     *  the truncation indicator. The dynamic local change code in UITextField
+     *  can be used here, if needed.
+     */
+    private static var truncationIndicatorResource:String;
+
+    //--------------------------------------------------------------------------
+    //
     //  Constructor
     //
     //--------------------------------------------------------------------------
@@ -86,12 +103,19 @@
     public function MobileTextField()
     {
         super();
+
         // Add a high priority change handler so we can capture the event
         // and re-dispatch as a TextOperationEvent
         addEventListener(Event.CHANGE, changeHandler, false, 100);

         // Add a key down listener to listen for enter key
         addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
+
+        if (!truncationIndicatorResource)
+        {
+            truncationIndicatorResource = ResourceManager.getInstance().
+                getString("core", "truncationIndicator");
+        }
     }

     //--------------------------------------------------------------------------
@@ -247,8 +271,50 @@

     public function set horizontalScrollPosition(value:Number):void
     {
-        // TODO: range check?
-        scrollH = int(value);
+        scrollH = Math.min(Math.max(0, int(value)), maxScrollH);
+    }
+
+    //----------------------------------
+    //  lineBreak
+    //----------------------------------
+
+    /**
+     *  Controls word wrapping within the text. This property corresponds
+     *  to the lineBreak style.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function get lineBreak():String
+    {
+        return wordWrap ? "toFit" : "explicit";
+    }
+
+    public function set lineBreak(value:String):void
+    {
+        wordWrap = !(value == "explicit");
+    }
+
+    //----------------------------------
+    //  selectionActivePosition
+    //----------------------------------
+
+    /**
+     *  The active, or last clicked position, of the selection.
+     *  If the implementation does not support selection anchor
+     *  this is the last character of the selection.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function get selectionActivePosition():int
+    {
+        // TextField doesn't have selection "active" position
+        return selectionEndIndex;
     }

     //----------------------------------
@@ -272,54 +338,26 @@
     }

     //----------------------------------
-    //  selectionActivePosition
-    //----------------------------------
-
-    /**
-     *  The active, or last clicked position, of the selection.
-     *  If the implementation does not support selection anchor
-     *  this is the last character of the selection.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2.0
-     *  @productversion Flex 4.5
-     */
-    public function get selectionActivePosition():int
-    {
-        // TextField doesn't have selection "active" position
-        return selectionEndIndex;
-    }
-
-
-    ///////
-    /// TODO: Figure out if we can implement these properties. If not, they should
-    //  be removed from this class and IEditableText.
-    ///////
-
-    public function get heightInLines():Number
-    {
-        // TODO: implement me (or remove)
-        return 1;
-    }
-
-    public function set heightInLines(value:Number):void
-    {
-        // TODO: implement me (or remove)
-    }
-
-    public function get widthInChars():Number
-    {
-        // TODO: implement me (or remove)
-        return 1;
-    }
-
-    public function set widthInChars(value:Number):void
-    {
-        // TODO: implement me (or remove)
-    }
-
-
+    //  verticalScrollPosition
+    //----------------------------------
+
+    /**
+     *  The vertical scroll position of the text.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function get verticalScrollPosition():Number
+    {
+        return scrollV;
+    }
+
+    public function set verticalScrollPosition(value:Number):void
+    {
+        scrollV = Math.min(Math.max(0, int(value)), maxScrollV);
+    }

     //--------------------------------------------------------------------------
     //
@@ -340,7 +378,14 @@
      */
     public function scrollToRange(anchorPosition:int, activePosition:int):void
     {
-        // TODO: implement me
+        // If either part of the selection is in range (determined by
+        // a non-null return value from getCharBoundaries()), we
+        // don't need to do anything.
+        if (getCharBoundaries(anchorPosition) || getCharBoundaries(activePosition))
+            return;
+
+        // Scroll so the anchor position is visible on the top line.
+        verticalScrollPosition = getLineIndexOfChar(anchorPosition);
     }

     /**
@@ -384,8 +429,8 @@
      */
     public function selectRange(anchorIndex:int, activeIndex:int):void
     {
-        // TODO: normalize?
-        setSelection(anchorIndex, activeIndex);
+        setSelection(Math.min(anchorIndex, activeIndex),
+                     Math.max(anchorIndex, activeIndex));
     }

     /**
@@ -412,13 +457,6 @@
     public function setFocus():void
     {
         stage.focus = this;
-    }
-
-    // TODO: consider adding lineBreak property instead of using a style.
-    public function setStyle(styleProp:String, value:*):void // Only used for setStyle("lineBreak", "explicit")
-    {
-        if (styleProp == "lineBreak")
-            wordWrap = !(value == "explicit");
     }

     //--------------------------------------------------------------------------
@@ -503,6 +541,9 @@
             //textFormat.leftMargin = getStyleFunction("paddingLeft");
             //textFormat.rightMargin = getStyleFunction("paddingRight");

+            // Check for embedded fonts
+            embedFonts = isFontEmbedded(textFormat);
+
             defaultTextFormat = textFormat;
             setTextFormat(textFormat);
             invalidateStyleFlag = false;
@@ -545,19 +586,11 @@
      */
     public function truncateToFit(truncationIndicator:String = "..."):Boolean
     {
-    //    if (!truncationIndicator)
-    //          truncationIndicator = truncationIndicatorResource;
-
-        // Ensure that the proper CSS styles get applied to the textField
-        // before measuring text.
-        // Otherwise the callLater(validateNow) in styleChanged()
-        // can apply the CSS styles too late.
-    //     commitStyles();
+        if (!truncationIndicator)
+            truncationIndicator = truncationIndicatorResource;

         var originalText:String = super.text;
-
-        untruncatedText = originalText;
-
+        var oldIsTruncated:Boolean = _isTruncated;
         var w:Number = width;

         _isTruncated = false;
@@ -580,7 +613,39 @@
             }

             _isTruncated = true;
-            return true;
+        }
+
+        // Dispatch "isTruncatedChange"
+        if (_isTruncated != oldIsTruncated)
+            dispatchEvent(new Event("isTruncatedChanged"));
+
+        return _isTruncated;
+    }
+
+    /**
+     *  @private
+     */
+    private function isFontEmbedded(format:TextFormat):Boolean
+    {
+        if (!embeddedFonts)
+            embeddedFonts = Font.enumerateFonts();
+
+        for (var i:int = 0; i < embeddedFonts.length; i++)
+        {
+            var font:Font = Font(embeddedFonts[i]);
+            if (font.fontName == format.font)
+            {
+                var style:String = "regular";
+                if (format.bold && format.italic)
+                    style = "boldItalic";
+                else if (format.bold)
+                    style = "bold";
+                else if (format.italic)
+                    style = "italic";
+
+                if (font.fontStyle == style)
+                    return true;
+            }
         }

         return false;
@@ -626,13 +691,12 @@

     // Name of the style to use for determining the text color
     mx_internal var colorName:String = "color";
-
-
-    private static var supportedStyles:String = "textAlign fontFamily fontWeight color fontSize textDecoration textIndent leading letterSpacing paddingLeft paddingRight"
+
+    private static var supportedStyles:String = "textAlign fontFamily fontWeight fontStyle color fontSize textDecoration textIndent leading letterSpacing"
     private var invalidateStyleFlag:Boolean = true;
     private static var textFormat:TextFormat = new TextFormat();
-    private var untruncatedText:String;  // TODO: Use it or loose it
     private var _isTruncated:Boolean = false;
+    private static var embeddedFonts:Array;

     /**
      *  @private


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/core/EventPriority.as
+++ frameworks/projects/framework/src/mx/core/EventPriority.as
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2006 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+/**
+ *  The EventPriority class defines constant values
+ *  for the priority argument of the
+ *  addEventListener() method of EventDispatcher.
+ *
+ *
The higher the number, the higher the priority of the event listener.
+ *  All listeners with priority N will be processed
+ *  before listeners of priority N - 1.
+ *  If two or more listeners share the same priority,
+ *  they are processed in the order in which they were added.

+ *
+ *
Priorities can be positive, 0, or negative.
+ *  The default priority is 0.

+ *
+ *
You should not write code that depends on the numeric values
+ *  of these constants.
+ *  They are subject to change in future versions of Flex.

+ */
+public final class EventPriority
+{
+	include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  The CursorManager has handlers for mouse events
+	 *  which must be executed before other mouse event handlers,
+	 *  so they have a high priority.
+	 */
+	public static const CURSOR_MANAGEMENT:int = 200;
+
+	/**
+	 *  Autogenerated event handlers that evaluate data-binding expressions
+	 *  need to be executed before any others, so they have a higher priority
+	 *  than the default.
+	 */
+	public static const BINDING:int = 100;
+
+	/**
+	 *  Event handlers on component instances are executed with the default
+	 *  priority, 0.
+	 */
+	public static const DEFAULT:int = 0;
+
+	/**
+	 *  Some components listen to events that they dispatch on themselves
+	 *  and let other listeners call the preventDefault()
+	 *  method to tell the component not to perform a default action.
+	 *  Those components must listen with a lower priority than the default
+	 *  priority, so that the other handlers are executed first and have
+	 *  a chance to call preventDefault().
+	 */
+	public static const DEFAULT_HANDLER:int = -50;
+
+	/**
+	 *  Autogenerated event handlers that trigger effects are executed
+	 *  after other event handlers on component instances, so they have
+	 *  a lower priority than the default.
+	 */
+	public static const EFFECT:int = -100;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 4460
Author:   gosmith@adobe.com
Date:     2009-01-09T01:53:33.590972Z

Log Message:
-----------
Renamed UIComponentAccImpl to UIComponentAccProps because it extends AccessibilityProperties, not AccessibilityImplementation.

Added comments with the identifier for each magic role constant, so that it is easier to understand what roles our components are using.

Moved two static methods from UIComponentAccProperties to AccImpl because they make more sense there.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: None (no functional changes)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ButtonAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ColorPickerAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DataGridAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DateFieldAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/SliderAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/CheckBoxAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/LinkButtonAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/MenuBarAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ComboBaseAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/RadioButtonAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TabBarAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TreeAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/PanelAccImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/UIComponentAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DateChooserAccImpl.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/UIComponentAccImpl.as" copyfrom-rev="4437" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/UIComponentAccProps.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/MenuAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ListBaseAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AlertAccImpl.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/accessibility/AccordionHeaderAccImpl.as</path>

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

--- frameworks/projects/mx/src/mx/accessibility/MenuAccImpl.as
+++ frameworks/projects/mx/src/mx/accessibility/MenuAccImpl.as
@@ -161,7 +161,7 @@
 	{
 		super(master);

-		role = 0x0B;
+		role = 0x0B; // ROLE_SYSTEM_MENUPOPUP
 	}

 	//--------------------------------------------------------------------------
@@ -198,10 +198,7 @@
 	 */
 	override public function get_accRole(childID:uint):uint
 	{
-		if (childID == 0)
-			return role;
-
-		return ROLE_SYSTEM_MENUITEM;
+		return childID == 0 ? role : ROLE_SYSTEM_MENUITEM;
 	}

 	/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 12324
Author:   smgilson@adobe.com
Date:     2009-12-01T16:08:24.785393Z

Log Message:
-----------
ASDoc updates in preparation for localization

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/BorderContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/CheckBox.as
+++ frameworks/projects/spark/src/spark/components/CheckBox.as
@@ -27,6 +27,8 @@

 /**
  *  @copy spark.components.supportClasses.GroupBase#style:symbolColor
+ *
+ *  @default 0x000000
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -87,9 +89,12 @@
  *  @mxml
  *
  *
The <s:CheckBox> tag inherits all of the tag
- *  attributes of its superclass and adds no tag attributes:

+ *  attributes of its superclass and adds the following attributes:

  *

- *  <s:CheckBox/>
+ *  <s:CheckBox
+ *    Properties
+ *    symbolColor="0x000000"
+ *  />
  *

  *
  *  @includeExample examples/CheckBoxExample.mxml


Transferred from the Adobe Open Source Subversion Repository

Revision: 3720
Author:   rfrishbe@adobe.com
Date:     2008-10-17T20:29:07.535175Z

Log Message:
-----------
TextView and TextGraphic now support XML content.

QE Notes: Test the new XML feature
Doc Notes: None
Bugs: SDK-16361
Reviewer: Gordon

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -407,7 +407,7 @@
     /**
      *  @private
      */
-    private function importMarkup(markup:String):TextFlow
+    private function importStringMarkup(markup:String):TextFlow
     {
         markup = '<TextFlow xmlns="http://ns.adobe.com/tcal/2008">' +
                  markup +
@@ -415,6 +415,14 @@

         return TextFilter.importToFlow(markup, TextFilter.TCAL_FORMAT);
     }
+
+    /**
+     *  @private
+     */
+    private function importXMLMarkup(markup:XML):TextFlow
+    {
+        return TextFilter.importToFlow(markup, TextFilter.TCAL_FORMAT);
+    }

     /**
      *  @private
@@ -438,9 +446,13 @@
                 textFlow = new TextFlow();
                 textFlow.mxmlChildren = [ _content ];
             }
+	        else if (_content is XML)
+            {
+                textFlow = importXMLMarkup(XML(_content));
+            }
             else if (_content is String)
             {
-                textFlow = importMarkup(String(_content));
+                textFlow = importStringMarkup(String(_content));
             }
             else if (_content == null)
             {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3429
Author:   hmuller@adobe.com
Date:     2008-09-30T20:57:43.716432Z

Log Message:
-----------
Removed the flex.layout.ILayout interface.   All references to this interface
have been replaced with flex.layout.LayoutBase.

Added verticalScrollPositionDelta() and horizontalScrollPositionDelta() to
IViewport put provisional implementations in TextView.

Added LayoutBase clipContent property and exposed same in GroupBase
and TextView.  The latter is provisional.

ScrollerSkin measure() and updateDisplayList() now handle a null viewport.
This fixes bugs 17079, 17029.

ScrollerSkin updateDisplayList() now respects the minimum width for
its horizontalScrollBar and the minimum height for verticalScrollBar
(the corresponding HSB height and VSB width are already set to their
preferred sizes).

ScrollSkin's measure now ignores the min size of its viewport, it's
minimum size is only based on its visible scrollbars.  This ensures
that the viewport can get as small as possible.  This change corrects
bug 16840.

QE: Removing ILayout may break some tests
Doc: No
Checkintests: Pass
Reviewer: Evtim
Bugs:
  SDK-17079 - RTE if empty Scroller is created
  SDK-17029 - RTE when Scroller's viewport is set to null
  SDK-16840 - Scroller is unusable if height is set as a percentage height

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/DataComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ItemsComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/intf/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/ScrollerSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -370,6 +370,7 @@
         if (instance == verticalScrollBar)
         {
         	verticalScrollBar.addEventListener("valueCommit", vsb_valueCommitHandler);
+        	//verticalScrollBar.minHeight = 0;
         }

         if (instance == horizontalScrollBar)
@@ -401,14 +402,12 @@
      */
     override protected function keyDownHandler(event:KeyboardEvent):void
     {
-    	if (!viewport)
+        var vp:IViewport = viewport;
+    	if (!vp)
     	    return;

         // TBD: is special handling for textfields needed here, as in mx.core.Container?

-        // TBD: IViewport should expose horiztonal,verticalScrollPositionDelta methods
-        var vp:LayoutBase = LayoutBase(Group(viewport).layout);
-
         if (verticalScrollBar && verticalScrollBar.visible)
         {
         	var vspDelta:Number = NaN;
@@ -425,7 +424,7 @@
             }
             if (!isNaN(vspDelta))
             {
-            	viewport.verticalScrollPosition += vspDelta;
+            	vp.verticalScrollPosition += vspDelta;
             	event.stopPropagation();
             }
         }
@@ -442,7 +441,7 @@
             }
             if (!isNaN(hspDelta))
             {
-                viewport.horizontalScrollPosition += hspDelta;
+                vp.horizontalScrollPosition += hspDelta;
                 event.stopPropagation();
             }
         }