Transferred from the Adobe Open Source Subversion Repository

Revision: 2464
Author:   jimurphy@adobe.com
Date:     2008-07-14T19:50:33.449468Z

Log Message:
-----------
add flex 4 to trunk

Modified Paths:
--------------
134 paths were modified

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

--- frameworks/projects/spark/src/spark/effects/RemoveAction.as
+++ frameworks/projects/spark/src/spark/effects/RemoveAction.as
@@ -0,0 +1,175 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flex.effects
+{
+import flex.effects.effectClasses.RemoveActionInstance;
+
+import mx.core.mx_internal;
+import mx.effects.Effect;
+import mx.effects.effectClasses.PropertyChanges;
+import mx.effects.effectClasses.RemoveChildActionInstance;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="duration", kind="property")]
+
+/**
+ *  The RemoveChildAction class defines an action effect that corresponds
+ *  to the RemoveChild property of a view state definition.
+ *  You use a RemoveChildAction effect within a transition definition
+ *  to control when the view state change defined by a RemoveChild property
+ *  occurs during the transition.
+ *
+ *  @mxml
+ *
+ *
The <mx:RemoveChildAction> tag
+ *  inherits all of the tag attributes of its superclass,
+ *  and adds the following tag attributes:

+
+ *

+ *  <mx:RemoveChildAction
+ *    Properties
+ *    id="ID"
+ *  />
+ *

+ *
+ *  @see mx.effects.effectClasses.RemoveChildActionInstance
+ *  @see mx.states.RemoveChild
+ *
+ *  @includeExample ../states/examples/TransitionExample.mxml
+ */
+public class RemoveAction extends Effect
+{
+    include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+    private static var AFFECTED_PROPERTIES:Array = [ "parent", "elementHost", "index" ];
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @param target The Object to animate with this effect.
+	 */
+	public function RemoveAction(target:Object = null)
+	{
+		super(target);
+
+		instanceClass = RemoveActionInstance;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override public function getAffectedProperties():Array /* of String */
+	{
+		return AFFECTED_PROPERTIES;
+	}
+
+	/**
+	 *  @private
+	 */
+	private function propChangesSortHandler(
+					first:PropertyChanges,
+					second:PropertyChanges):Number
+	{
+		if (first.start.index > second.start.index)
+			return 1;
+		else if (first.start.index < second.start.index)
+			return -1;
+
+		return 0;
+	}
+
+	/**
+	 *  @private
+	 */
+	override mx_internal function applyStartValues(propChanges:Array,
+									 		  targets:Array):void
+	{
+		if (propChanges)
+			propChanges.sort(propChangesSortHandler);
+
+		super.applyStartValues(propChanges, targets);
+	}
+
+	/**
+	 *  @private
+	 */
+	override protected function getValueFromTarget(target:Object,
+												   property:String):*
+	{
+	    var hasParent:Boolean;
+        try {
+            target.parent;
+            hasParent = true;
+        } catch (e:Error) {
+            hasParent = false;
+        }
+        var container:* = (hasParent ? target.parent : target.elementHost);
+        if (property == "index")
+            return container ?
+                (hasParent ? container.getChildIndex(target) : container.getItemIndex(target)) : 0;
+
+		return super.getValueFromTarget(target, property);
+	}
+
+	/**
+	 *  @private
+	 */
+	override protected function applyValueToTarget(target:Object,
+												   property:String,
+												   value:*,
+												   props:Object):void
+	{
+	    var hasParent:Boolean;
+        try {
+            target.parent;
+            hasParent = true;
+        } catch (e:Error) {
+            hasParent = false;
+        }
+        if (property == "parent" && value)
+            if (hasParent && target.parent == null)
+                value.addChildAt(target, Math.min(props.index, value.numChildren));
+        if (property == "elementHost" && value)
+            if (!hasParent && target.elementHost == null)
+                value.addItemAt(target, Math.min(props.index, value.numChildren));
+
+		// Ignore index - it's applied along with parent
+	}
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 2954
Author:   chaase@adobe.com
Date:     2008-08-22T01:01:32.343242Z

Log Message:
-----------
Fixes to some ending and repeat bugs in the new Flex4 effects, plus refactoring of Sine/Power to subclass from new class, EaseInOut, which takes care of common easing in/out functionality and simplifies each subclass.

reviewed by: Jason S
tests: checkintests, mustella tests/Effects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animation.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/EaseInOut.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Sine.as</path>

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

--- frameworks/projects/spark/src/spark/effects/easing/Power.as
+++ frameworks/projects/spark/src/spark/effects/easing/Power.as
@@ -15,7 +15,7 @@
  * instance is created with a power parameter describing the
  * behavior of the expression.
  */
-public class Power implements IEaser
+public class Power extends EaseInOut
 {
     /**
      * Storage for the exponent property
@@ -40,60 +40,35 @@
     }

     /**
-     * Storage for the easeIn property
+     * Constructs a Power instance with optional easeInFraction and exponent
+     * values
      */
-    private var _easeIn:Number;
-    /**
-     * The percentage of an animation that should be spent accelerating
-     * according to the power formula. This factor sets an implicit
-     * "easeOut" parameter, equal to (1 - easeIn), so that any time not
-     * spent easing in is spent easing out. For example, to have an easing
-     * equation that spends half the time easing in and half easing out,
-     * set easeIn equal to .5.
-     *
-     * @default .5
-     */
-    public function get easeIn():Number
+    public function Power(easeInFraction:Number = .5, exponent:Number = 2)
     {
-        return _easeIn;
-    }
-    public function set easeIn(value:Number):void
-    {
-        _easeIn = value;
+        super(easeInFraction);
+        this.exponent = exponent;
     }

     /**
-     * Constructs a Power instance with optional easeIn and exponent
-     * values
+     * @inheritDoc
+     *
+     * The easeIn calculation for Power is equal to
+     * fraction^^exponent.
      */
-    public function Power(easeIn:Number = .5, exponent:Number = 2)
+    override protected function easeIn(fraction:Number):Number
     {
-        this.easeIn = easeIn;
-        this.exponent = exponent;
+        return Math.pow(fraction, _exponent);
     }
-
+
     /**
      * @inheritDoc
      *
-     * Calculates the eased fraction value based on the easeIn and
-     * exponent properties. If the fraction is in the easeIn
-     * phase of the animation, this result is equal to
-     * x^^exponent, where x is the percentage elapsed in the
-     * easeIn phase. Otherwise, the motion is in the easing-out phase
-     * (1 - easeIn), and the result is equal to 1 - (1-x)^^exponent.
-     *
-     * @param fraction The elapsed fraction of the animation
-     * @return The eased fraction of the animation
+     * The easeOut calculation for Power is equal to
+     * 1 - ((1-fraction)^^exponent).
      */
-    public function ease(fraction:Number):Number
+    override protected function easeOut(fraction:Number):Number
     {
-        var easeOut:Number = 1 - easeIn;
-
-        if (fraction <= easeIn)
-            return Math.pow(fraction/easeIn, _exponent)*easeIn;
-        else
-            return 1 - Math.pow((1 - fraction)/easeOut, _exponent)*easeOut;
+        return 1 - Math.pow((1 - fraction), _exponent);
     }
-
 }
 }


MoviePlayer: don't track movies whose parents are also Movies

(This could previously happen when a Movie swaps in a new child Movie on
a keyframe)

--- runtime/src/main/as/flump/display/MoviePlayer.as
+++ runtime/src/main/as/flump/display/MoviePlayer.as
@@ -56,7 +56,9 @@
     protected function addMovies (disp :DisplayObject) :void {
         var movie :Movie = disp as Movie;
         if (movie != null) {
-            if (movie._playerData == null) {
+            // Add this movie to our list if it's not already in a MoviePlayer, and if its
+            // parent isn't a Movie (parent Movies control their children).
+            if (!(movie.parent is Movie) && movie._playerData == null) {
                 var node :MoviePlayerNode = new MoviePlayerNode(movie, this);
                 movie._playerData = node;

@@ -67,6 +69,9 @@
                 }
                 _head = node;
             }
+
+            // Stop searching when we find our first Movie; Movies update their children, so
+            // we only track top-level movies.
             return;
         }


Clarification in comments.

Clarification in comments.

--- driver/src/main/flex/org/postgresql/febe/FEBEConnection.as
+++ driver/src/main/flex/org/postgresql/febe/FEBEConnection.as
@@ -192,10 +192,10 @@
         private function handleError(msg:ErrorResponse):void {
         	// This approach (and the above for handleNotice) mean that there
         	// is no good way to hand query-related errors back to the connection;
-        	// we'll live with this for now. The other approach of always passing
+        	// we'll live with this for now. The other approach is to always pass
         	// the errors to the connection, whether or not there is an active query,
-        	// has the issue that there's no way if the query handler already "took
-        	// care of" the error
+        	// but this way there's no way to tell whether the query handler
+        	// already "took care of" the error when the connection sees it.
             if (_queryHandler) {
                 _queryHandler.handleError(msg.fields);
             } else {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19328
Author:   mhorn@adobe.com
Date:     2010-12-13T20:45:00.405533Z

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.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/mobiletheme/src/spark/skins/mobile/NavigationAngledButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TextSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderDataTip.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/mobiletheme/src/spark/skins/mobile/HSliderTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/SelectableButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/CheckBoxSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/RadioButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/NavigationButtonSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as
@@ -22,19 +22,28 @@

 public class VScrollBarSkin extends MobileSkin
 {
-
-	//--------------------------------------------------------------------------
-	//
-	//  Constructor
-	//
-	//--------------------------------------------------------------------------
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     *
+     */
     public function VScrollBarSkin()
     {
         super();

         useChromeColor = true;

-		// Depending on density set our measured width and height
+        // Depending on density set our measured width and height
         switch (authorDensity)
         {
             case DeviceDensity.PPI_240:
@@ -59,81 +68,81 @@
     //  Variables
     //
     //--------------------------------------------------------------------------
-	/**
-	 *  @copy spark.skins.spark.ApplicationSkin#hostComponent
-	 */
+    /**
+     *  @copy spark.skins.spark.ApplicationSkin#hostComponent
+     */
     public var hostComponent:VScrollBar;

-
+
     //--------------------------------------------------------------------------
     //
     //  Skin parts
     //
     //--------------------------------------------------------------------------
-	/**
-	 *  VScrollbar track skin part
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	public var track:Button;
+    /**
+     *  VScrollbar track skin part
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public var track:Button;

-	/**
-	 *  VScrollbar thumb skin part
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
+    /**
+     *  VScrollbar thumb skin part
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     public var thumb:Button;

-
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
-	/**
-	 *  @private
-	 */
+    /**
+     *  @private
+     */
     override protected function createChildren():void
     {
         // Create our skin parts if necessary: track and thumb.
-		if (!track)
-		{
-			// We don't want a visible track so we set the skin to MobileSkin
-	        track = new Button();
-	        track.setStyle("skinClass", spark.skins.mobile.supportClasses.MobileSkin);
-	        track.width = layoutMeasuredWidth;
-	        track.height = layoutMeasuredHeight;
-	        addChild(track);
-		}
-
+        if (!track)
+        {
+            // We don't want a visible track so we set the skin to MobileSkin
+            track = new Button();
+            track.setStyle("skinClass", spark.skins.mobile.supportClasses.MobileSkin);
+            track.width = layoutMeasuredWidth;
+            track.height = layoutMeasuredHeight;
+            addChild(track);
+        }
+
         if (!thumb)
-		{
-	        thumb = new Button();
-	        thumb.setStyle("skinClass", spark.skins.mobile.VScrollBarThumbSkin);
-	        thumb.width = layoutMeasuredWidth;
-	        thumb.height = layoutMeasuredWidth;
-	        addChild(thumb);
-		}
+        {
+            thumb = new Button();
+            thumb.setStyle("skinClass", spark.skins.mobile.VScrollBarThumbSkin);
+            thumb.width = layoutMeasuredWidth;
+            thumb.height = layoutMeasuredWidth;
+            addChild(thumb);
+        }
     }

-	/**
-	 *  @private
-	 */
+    /**
+     *  @private
+     */
     override protected function measure():void
     {
         measuredWidth = layoutMeasuredWidth;
         measuredHeight = layoutMeasuredHeight;
     }

-	/**
-	 *  @private
-	 */
+    /**
+     *  @private
+     */
     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
         setElementSize(track, unscaledWidth, unscaledHeight);


Transferred from the Adobe Open Source Subversion Repository

Revision: 16791
Author:   cframpto@adobe.com
Date:     2010-07-02T15:01:45.623336Z

Log Message:
-----------
The following changes apply to Spark DataGrid only.   Code reviews have been deferred until the implementation is closer to completion.

SDK-26855.  When the dataProvider changes the selection should be cleared and if requireSelection and at least 1 row and 1 column, either row 0 or cell 0,0 selected.  The dataProvider setter should not rely on either gridDimensions or gridSelection being set yet since it depends on the order they are all initialized when the skin is loaded.

Add FIXME to GridLayout - when scrolling may need to update the hover indices and the hover indicator if the pointer is over the grid when it is scrolled.

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

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
@@ -99,6 +99,9 @@
         super.scrollPositionChanged();

         // Only invalidate if we're clipping and scrollR extends outside validBounds
+
+        // FIXME: the hover indicator may need to be updated if the grid
+        // underneath the pointer scrolls.

         const scrollR:Rectangle = grid.scrollRect;
         if (scrollR && !visibleItemRenderersBounds.containsRect(scrollR))


Transferred from the Adobe Open Source Subversion Repository

Revision: 11909
Author:   rfrishbe@adobe.com
Date:     2009-11-17T21:38:09.638135Z

Log Message:
-----------
Updating OSMF to new flex4 branch.  We will eventually take a pre-built SWC from them as well, but for now we will continue building it.

With this update, some events that we dispatch change. This update also fixes several bugs for us.

I also got rid of a FIXME in VolumeBar around commitData in closeDropDown().

QE notes: -
Doc notes: -
Bugs: SDK-24192, SDK-24194, SDK-24289
Reviewer: Jason for the VolumeBar changes, Kevin for the rest
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
222 paths were modified

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

--- frameworks/projects/spark/src/spark/components/mediaClasses/VolumeBar.as
+++ frameworks/projects/spark/src/spark/components/mediaClasses/VolumeBar.as
@@ -376,18 +376,15 @@

      /**
      *  Closes the dropDown.
-     *
-     *  @param commit Flag indicating if the component should commit the selected
-     *  data from the dropDown.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function closeDropDown(commit:Boolean):void
-    {
-        dropDownController.closeDropDown(commit);
+    public function closeDropDown():void
+    {
+        dropDownController.closeDropDown(true);
     }

     //--------------------------------------------------------------------------
@@ -511,8 +508,8 @@
     {
         invalidateSkinState();

-        // FIXME (rfrishbe): Add logic to handle commitData
-        //if (event.isDefaultPrevented())
+        // the volume changed immediately, so no need to handle the case when
+        // commit==false and event.preventDefault() is called on this DropDownEvent

         dispatchEvent(event);
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3470
Author:   smgilson@adobe.com
Date:     2008-10-03T13:55:42.168230Z

Log Message:
-----------
Fix invalid HTML. Plus, ASDoc automatically inserts the default value of a method arg - no need to explicitly add it.

Checkin Test Passed: Yes
QA: No
Bug:
Doc: No

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as

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

--- frameworks/projects/framework/src/mx/controls/SWFLoader.as
+++ frameworks/projects/framework/src/mx/controls/SWFLoader.as
@@ -1403,8 +1403,8 @@
      *
Movie clips are stopped.

      *

      *
-     *  @param invokeGarbageCollector (default = true)
-     *   — Provides a hint to the garbage collector to run
+     *  @param invokeGarbageCollector
+     *  Provides a hint to the garbage collector to run
      *  on the child SWF objects (true) or not (false).
      *  If you are unloading many objects asynchronously, setting the
      *  gc parameter to false might improve application


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

--- frameworks/projects/framework/src/mx/events/ModuleEvent.as
+++ frameworks/projects/framework/src/mx/events/ModuleEvent.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-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.events
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11189
Author:   clucier@adobe.com
Date:     2009-10-27T19:33:04.160990Z

Log Message:
-----------
Adding better support for deferred instantiation and states. State overrides can now correctly override targets that are instantiated after a state change.  Moving the commitment of the initial state to earlier (during commit properties), this should avoid the secondary layout pass that used to occur after applicationComplete.  Removed creationComplete handler in UIComponent as it is no longer needed.  Fixing an issue in Group that was causing blendMode to be stuck as 'layered' when setting alpha to 0 then resetting it to a non zero value.

QE notes: None
Doc notes: None
Bugs: SDK-23105, SDK-23470, SDK-23790
Reviewer: Deepa, Glenn
Tests run: Full Cyclone, Checkin
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/AddItems.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/OverrideBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetEventHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/AddChild.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/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetProperty.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/RemoveChild.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/framework/src/mx/states/RemoveChild.as
+++ frameworks/projects/framework/src/mx/states/RemoveChild.as
@@ -51,7 +51,7 @@
  *  @playerversion AIR 1.1
  *  @productversion Flex 3
  */
-public class RemoveChild extends OverrideBase implements IOverride
+public class RemoveChild extends OverrideBase
 {
     include "../core/Version.as";

@@ -130,33 +130,19 @@
     //--------------------------------------------------------------------------

     /**
-     *  IOverride interface method; this class implements it as an empty method.
-     *
-     *  @copy IOverride#initialize()
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function initialize():void
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function apply(parent:UIComponent):void
     {
-    }
-
-    /**
-     *  @inheritDoc
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function apply(parent:UIComponent):void
-    {
+        parentContext = parent;
         removed = false;

         var obj:* = getOverrideContext(target, parent);
-
         if ((obj is DisplayObject) && obj.parent)
         {
             oldParent = obj.parent;
@@ -164,6 +150,18 @@
             oldParent.removeChild(obj);
             removed = true;
         }
+        else if (obj == null && !applied)
+        {
+            // Our target context is unavailable so we attempt to register
+            // a listener on our parent document to detect when/if it becomes
+            // valid.
+            addContextListener(target);
+        }
+
+        // Save state in case our value or target is changed while applied. This
+        // can occur when our value property is databound or when a target is
+        // deferred instantiated.
+        applied = true;
     }

     /**
@@ -174,10 +172,9 @@
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public function remove(parent:UIComponent):void
-    {
-        var obj:* = getOverrideContext(target, parent);
-
+    override public function remove(parent:UIComponent):void
+    {
+        var obj:* = getOverrideContext(target, parent);
         if (removed && (obj is DisplayObject))
         {
             oldParent.addChildAt(obj, oldIndex);
@@ -189,6 +186,17 @@

             removed = false;
         }
+        else if (obj == null)
+        {
+            // It seems our override is no longer active, but we were never
+            // able to successfully apply ourselves, so remove our context
+            // listener if applicable.
+            removeContextListener();
+        }
+
+        // Clear our flags and override context.
+        applied = false;
+        parentContext = null;
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17450
Author:   rfrishbe@adobe.com
Date:     2010-08-23T21:43:35.884406Z

Log Message:
-----------
- Modified the Scroller algorithm used in calculating the scrollAnchorPoint (the point where the scroll starts).  Now instead of using the mouseEvent coordinates where the threshold was crossed, we now calculate the threshold and use that instead.  In practice, a user probably wouldn't notice this much (unless there was a big delay between MouseMoves for some reason). However, this calculation is the right thing to do, and will help produce more consistent results with regards to QE and programatically faking the mouse events.

- Removed a FIXME that no longer applied since MobileIconItemRenderer.subText was already renamed to MobileIconItemRenderer.message.

- Modified GetTimerUtil for QE to use fakeTime instead of getTimerFunction().

QE notes: Modified GetTimerUtil so it now uses fakeTime instead of getTimerFunction()
Doc notes: None
Bugs: SDK-27546
Reviewer: Evtim
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/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/utils/GetTimerUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>

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

--- frameworks/projects/framework/src/mx/utils/GetTimerUtil.as
+++ frameworks/projects/framework/src/mx/utils/GetTimerUtil.as
@@ -15,6 +15,8 @@
 import flash.utils.getTimer;

 import mx.core.mx_internal;
+
+use namespace mx_internal;

 [ExcludeClass]

@@ -41,31 +43,29 @@
     /**
      *  @private
      */
-    private static var _getTimerFunction:Function = flash.utils.getTimer;
+    mx_internal static var fakeTimeValue:* = undefined;

     /**
      *  @private
-     *  The function to use when calculate the current time.  By default,
-     *  this is flash.utils.getTimer.  When run in a testing
+     *  The function to use when calculating the current time.
+     *
+     *
When run in a testing
      *  environment, one may change this function in order to get consistent
-     *  results when running tests.
+     *  results when running tests by modifying fakeTimeValue.
+     *  If fakeTimeValue is undefined, flash.utils.getTimer() is
+     *  used.  Otherwise, fakeTimeValue is returned.

      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    mx_internal static function get getTimerFunction():Function
+    mx_internal static function getTimer():int
     {
-        return _getTimerFunction;
-    }
-
-    /**
-     *  @private
-     */
-    mx_internal static function set getTimerFunction(value:Function):void
-    {
-        _getTimerFunction = value;
+        if (fakeTimeValue !== undefined)
+            return fakeTimeValue;
+
+        return flash.utils.getTimer();
     }
 }
 }


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

--- frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as
+++ frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as
@@ -0,0 +1,206 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-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.rpc.xml
+{
+
+import flash.xml.XMLNode;
+import flash.xml.XMLNodeType;
+import mx.collections.ArrayCollection;
+import mx.utils.ObjectProxy;
+
+/**
+ *  The SimpleXMLDecoder class deserialize XML into a graph of ActionScript objects.
+ * Use  this class when no schema information is available.
+ */
+public class SimpleXMLDecoder
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Class Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Converts an ActionScript object into a Number, Boolean, or String.
+     */
+    public static function simpleType(val:Object):Object
+    {
+        var result:Object = val;
+
+        if (val != null)
+        {
+            //return the value as a string, a boolean or a number.
+            //numbers that start with 0 are left as strings
+            //bForceObject removed since we'll take care of converting to a String or Number object later
+            if (val is String && String(val) == "")
+            {
+                result = val.toString();
+            }
+            else if (isNaN(Number(val)) || (val.charAt(0) == '0') || ((val.charAt(0) == '-') && (val.charAt(1) == '0')) || val.charAt(val.length -1) == 'E')
+            {
+                var valStr:String = val.toString();
+
+                //Bug 101205: Also check for boolean
+                var valStrLC:String = valStr.toLowerCase();
+                if (valStrLC == "true")
+                    result = true;
+                else if (valStrLC == "false")
+                    result = false;
+                else
+                    result = valStr;
+            }
+            else
+            {
+                result = Number(val);
+            }
+        }
+
+        return result;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Constructor.
+     */
+    public function SimpleXMLDecoder(makeObjectsBindable:Boolean = false)
+    {
+        super();
+
+        this.makeObjectsBindable = makeObjectsBindable;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Converts a tree of XMLNodes into a tree of ActionScript Objects.
+     */
+    public function decodeXML(dataNode:XMLNode):Object
+    {
+        var result:Object;
+        var isSimpleType:Boolean = false;
+
+        if (dataNode == null)
+            return null;
+
+        // Cycle through the subnodes
+        var children:Array = dataNode.childNodes;
+        if (children.length == 1 && children[0].nodeType == XMLNodeType.TEXT_NODE)
+        {
+            // If exactly one text node subtype, we must want a simple
+            // value.
+            isSimpleType = true;
+            result = SimpleXMLDecoder.simpleType(children[0].nodeValue);
+        }
+        else if (children.length > 0)
+        {
+            result = {};
+            if (makeObjectsBindable)
+                result = new ObjectProxy(result);
+
+            for (var i:uint = 0; i < children.length; i++)
+            {
+                var partNode:XMLNode = children[i];
+
+                // skip text nodes, which are part of mixed content
+                if (partNode.nodeType != XMLNodeType.ELEMENT_NODE)
+                {
+                    continue;
+                }
+
+                var partName:String = getLocalName(partNode);
+                var partObj:Object = decodeXML(partNode);
+
+                // Enable processing multiple copies of the same element (sequences)
+                var existing:Object = result[partName];
+                if (existing != null)
+                {
+                    if (existing is Array)
+                    {
+                        existing.push(partObj);
+                    }
+                    else if (existing is ArrayCollection)
+                    {
+                        existing.source.push(partObj);
+                    }
+                    else
+                    {
+                        existing = [existing];
+                        existing.push(partObj);
+
+                        if (makeObjectsBindable)
+                            existing = new ArrayCollection(existing as Array);
+
+                        result[partName] = existing;
+                    }
+                }
+                else
+                {
+                    result[partName] = partObj;
+                }
+            }
+        }
+
+        // Cycle through the attributes
+        var attributes:Object = dataNode.attributes;
+        for (var attribute:String in attributes)
+        {
+            if (attribute == "xmlns" || attribute.indexOf("xmlns:") != -1)
+                continue;
+
+            // result can be null if it contains no children.
+            if (result == null)
+            {
+                result = {};
+                if (makeObjectsBindable)
+                    result = new ObjectProxy(result);
+            }
+
+            // If result is not currently an Object (it is a Number, Boolean,
+            // or String), then convert it to be a ComplexString so that we
+            // can attach attributes to it.  (See comment in ComplexString.as)
+            if (isSimpleType && !(result is ComplexString))
+            {
+                result = new ComplexString(result.toString());
+                isSimpleType = false;
+            }
+
+            result[attribute] = SimpleXMLDecoder.simpleType(attributes[attribute]);
+        }
+
+        return result;
+    }
+
+    public static function getLocalName(xmlNode:XMLNode):String
+    {
+        var name:String = xmlNode.nodeName;
+        var myPrefixIndex:int = name.indexOf(":");
+        if (myPrefixIndex != -1)
+        {
+            name = name.substring(myPrefixIndex+1);
+        }
+        return name;
+    }
+
+    private var makeObjectsBindable:Boolean;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 19518
Author:   cframpto@adobe.com
Date:     2010-12-22T18:36:21.729644Z

Log Message:
-----------
invalidateTypicalItem() -> invalidateTypicalItemRenderer() per PARB

QE notes:
Doc notes:
Bugs:
Reviewer: Hans
Tests run: cyclone
Is noteworthy for integration: yes: API change

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -1950,7 +1950,7 @@
     public function invalidateTypicalItem():void
     {
         if (grid)
-            grid.invalidateTypicalItem();
+            grid.invalidateTypicalItemRenderer();
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 4946
Author:   gosmith@adobe.com
Date:     2009-02-13T02:54:47.865236Z

Log Message:
-----------
Integrated TLF Build 370.

The biggest change in the TLF APIs is that the ContainerFormat, ParagraphFormat, and CharacterFormat classes have been combined into a single TextLayoutFormat class.

The next biggest change is that some formats no longer inherit within a TextFlow, or from a host format to its TextFlow, unless you set their value to "inherit".

Also, the leadingBasis and leadingDirection formats have been combined into a single leadingModel format.

A cyclone build passes enough tests that QE has given the go-ahead to check in. The marginXXX formats are broken, but this seems to be a TLF problem and we'll work with the TLF team to get them fixed ASAP.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: TBD tomorrow

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_core.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_textField.swc</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/flex4/src/mx/styles/metadata/AdvancedParagraphFormatTextStyles.as</path>
<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/utils/TextUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_conversion.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_edit.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -15,6 +15,7 @@
 import flash.display.DisplayObjectContainer;
 import flash.geom.Rectangle;

+import flashx.textLayout.conversion.ITextImporter;
 import flashx.textLayout.conversion.TextFilter;
 import flashx.textLayout.elements.Configuration;
 import flashx.textLayout.elements.FlowElement;
@@ -22,9 +23,9 @@
 import flashx.textLayout.elements.SpanElement;
 import flashx.textLayout.elements.TextFlow;
 import flashx.textLayout.events.DamageEvent;
-import flashx.textLayout.formats.CharacterFormat;
-import flashx.textLayout.formats.ContainerFormat;
-import flashx.textLayout.formats.ParagraphFormat;
+import flashx.textLayout.formats.FormatValue;
+import flashx.textLayout.formats.TextLayoutFormat;
+import flashx.textLayout.tlf_internal;

 import mx.core.mx_internal;
 import mx.graphics.baseClasses.TextFlowComposer;
@@ -91,8 +92,8 @@
      *  @private
      *  Used for determining whitespace processing during import.
      */
-    private static var staticCharacterFormat:CharacterFormat =
-        new CharacterFormat();
+    private static var staticTextLayoutFormat:TextLayoutFormat =
+        new TextLayoutFormat();

     /**
      *  @private
@@ -134,23 +135,7 @@
      *  and is updated by createTextFlow() when the hostFormatsInvalid flag
      *  is true.
      */
-    private var hostCharacterFormat:CharacterFormat = new CharacterFormat();
-
-    /**
-     *  @private
-     *  This object is determined by the CSS styles of the TextGraphic
-     *  and is updated by createTextFlow() when the hostFormatsInvalid flag
-     *  is true.
-     */
-    private var hostParagraphFormat:ParagraphFormat = new ParagraphFormat();
-
-    /**
-     *  @private
-     *  This object is determined by the CSS styles of the TextGraphic
-     *  and is updated by createTextFlow() when the hostFormatsInvalid flag
-     *  is true.
-     */
-    private var hostContainerFormat:ContainerFormat = new ContainerFormat();
+    private var hostTextLayoutFormat:TextLayoutFormat = new TextLayoutFormat();

     /**
      *  @private
@@ -160,7 +145,7 @@
      *  when styleChanged() is called with a null argument, indicating that
      *  multiple styles have changed.
      */
-    private var hostFormatsInvalid:Boolean = false;
+    private var hostTextLayoutFormatInvalid:Boolean = false;

     /**
      *  @private
@@ -420,7 +405,7 @@
     {
         super.stylesInitialized();

-        hostFormatsInvalid = true;
+        hostTextLayoutFormatInvalid = true;
     }

     /**
@@ -438,9 +423,9 @@
         // property in either hostContainerFormat, hostParagraphFormat,
         // or hostCharacterFormat immediately.
         if (styleProp == null || styleProp == "styleName")
-            hostFormatsInvalid = true;
+            hostTextLayoutFormatInvalid = true;
         else
-            setHostFormat(styleProp);
+            setHostTextLayoutFormat(styleProp);

         stylesChanged = true;
     }
@@ -484,22 +469,17 @@
     /**
      *  @private
      */
-    private function setHostFormat(styleProp:String):void
-    {
-        var value:* = getStyle(styleProp);
-        if (styleProp == "tabStops" && value === undefined)
-            value = [];
-
-        var kind:String = TextUtil.FORMAT_MAP[styleProp];
-
-        if (kind == TextUtil.CONTAINER)
-            hostContainerFormat[styleProp] = value;
-
-        else if (kind == TextUtil.PARAGRAPH)
-            hostParagraphFormat[styleProp] = value;
-
-        else if (kind == TextUtil.CHARACTER)
-            hostCharacterFormat[styleProp] = value;
+    private function setHostTextLayoutFormat(styleProp:String):void
+    {
+        if (styleProp in hostTextLayoutFormat)
+		{
+			var value:* = getStyle(styleProp);
+
+			if (styleProp == "tabStops" && value === undefined)
+				value = [];
+
+			hostTextLayoutFormat[styleProp] = value;
+		}
     }

     /**
@@ -509,10 +489,16 @@
     {
         // The whiteSpaceCollapse format determines how whitespace
         // is processed when markup is imported.
-		staticCharacterFormat.whiteSpaceCollapse =
+		staticTextLayoutFormat.lineBreak = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingLeft = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingRight = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingTop = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingBottom = FormatValue.INHERIT;
+        staticTextLayoutFormat.verticalAlign = FormatValue.INHERIT;
+		staticTextLayoutFormat.whiteSpaceCollapse =
             getStyle("whiteSpaceCollapse");
-		staticConfiguration.textFlowInitialCharacterFormat =
-            staticCharacterFormat;
+		staticConfiguration.textFlowInitialFormat =
+            staticTextLayoutFormat;

         if (markup is String)
         {
@@ -562,9 +548,15 @@

         // The whiteSpaceCollapse format determines how whitespace
         // is processed when the children are set.
-        staticCharacterFormat.whiteSpaceCollapse =
+		staticTextLayoutFormat.lineBreak = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingLeft = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingRight = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingTop = FormatValue.INHERIT;
+        staticTextLayoutFormat.paddingBottom = FormatValue.INHERIT;
+        staticTextLayoutFormat.verticalAlign = FormatValue.INHERIT;
+        staticTextLayoutFormat.whiteSpaceCollapse =
             getStyle("whiteSpaceCollapse");
-        textFlow.hostCharacterFormat = staticCharacterFormat;
+        textFlow.hostTextLayoutFormat = staticTextLayoutFormat;

         textFlow.mxmlChildren = children;

@@ -621,18 +613,16 @@
         contentChanged = false;
         textChanged = false;

-        if (hostFormatsInvalid)
+        if (hostTextLayoutFormatInvalid)
         {
-            for each (var p:String in TextUtil.ALL_FORMAT_NAMES)
-            {
-                setHostFormat(p);
-            }
-            hostFormatsInvalid = false;
+            for (var p:String in TextLayoutFormat.tlf_internal::description)
+            {
+                setHostTextLayoutFormat(p);
+            }
+            hostTextLayoutFormatInvalid = false;
         }

-        textFlow.hostCharacterFormat = hostCharacterFormat;
-        textFlow.hostParagraphFormat = hostParagraphFormat;
-        textFlow.hostContainerFormat = hostContainerFormat;
+        textFlow.hostTextLayoutFormat = new TextLayoutFormat(hostTextLayoutFormat);

         return textFlow;
     }
@@ -665,13 +655,13 @@
         textFlowComposer.composeTextFlow(textFlow);

         textFlowComposer.addTextLines(DisplayObjectContainer(displayObject));
-
         // Just recomposed so reset.
         stylesChanged = false;

         // Listen for "damage" events in case the textFlow is
         // modified programatically.
         textFlow.addEventListener(DamageEvent.DAMAGE, textFlow_damageHandler);
+

         return textFlowComposer.isOverset;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19753
Author:   gruehle@adobe.com
Date:     2011-01-13T23:48:21.776944Z

Log Message:
-----------
Add text selection auto scrolling. When editable text is in selection mode - entered by long-tapping on the text and choosing "Select Text" - the scroll behavior is changed. Touch+drag events change the selection. If you drag to the edge of the view and there is still more text available, the text will auto-scroll into view. This works in both horizontal and vertical directions.

This behavior is only available on device. Text in adl does not distinguish between selection mode and non-selection mode, so it is always selectable and scrollable.

QE notes: Ready for testing.
Doc notes:
Bugs:
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration: Yes

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

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -15,10 +15,12 @@
 import flash.events.Event;
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
+import flash.events.TimerEvent;
 import flash.geom.Point;
 import flash.system.Capabilities;
 import flash.text.TextField;
 import flash.ui.Keyboard;
+import flash.utils.Timer;

 import mx.core.IInvalidating;
 import mx.core.IVisualElement;
@@ -1228,7 +1230,7 @@
     //  Touch scrolling methods
     //
     //--------------------------------------------------------------------------
-
+
     /**
      *  @private
      *  Add touch listeners
@@ -2004,7 +2006,7 @@

         touchScrollHelper.startScrollWatch(event);
     }
-
+
     /**
      *  @private
      */
@@ -2012,7 +2014,7 @@
     {
         var xMove:int = 0;
         var yMove:int = 0;
-
+
         if (scrollerLayout && scrollerLayout.canScrollHorizontally)
             xMove = dragX;

@@ -2048,7 +2050,7 @@
         // clamp the values here
         newHSP = Math.min(Math.max(newHSP, -viewportWidth), maxWidth+viewportWidth);
         newVSP = Math.min(Math.max(newVSP, -viewportHeight), maxHeight+viewportHeight);
-
+
         viewport.horizontalScrollPosition = newHSP;
         viewport.verticalScrollPosition = newVSP;
     }
@@ -2117,6 +2119,141 @@
         // scrollbars in overlay mode
         skin.invalidateDisplayList();
     }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Text selection auto scroll
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  When true, use the text selection scroll behavior instead of the
+	 *  typical "throw" behavior. This is only used when interactionMode="touch"
+	 */
+	mx_internal var textSelectionAutoScrollEnabled:Boolean = false;
+	private var textSelectionAutoScrollTimer:Timer;
+	private var minTextSelectionVScrollPos:int = 0;
+	private var maxTextSelectionVScrollPos:int = -1;
+	private var minTextSelectionHScrollPos:int = 0;
+	private var maxTextSelectionHScrollPos:int = -1;
+	private static const TEXT_SELECTION_AUTO_SCROLL_FPS:int = 10;
+
+	/**
+	 *  @private
+	 *  Change scroll behavior when selecting text.
+	 */
+	mx_internal function enableTextSelectionAutoScroll(enable:Boolean,
+					   minHScrollPosition:int = 0, maxHScrollPosition:int = -1,
+					   minVScrollPosition:int = 0, maxVScrollPosition:int = -1):void
+	{
+		if (getStyle("interactionMode") == InteractionMode.TOUCH)
+		{
+			this.textSelectionAutoScrollEnabled = enable;
+			this.minTextSelectionHScrollPos = minHScrollPosition;
+			this.maxTextSelectionHScrollPos = maxHScrollPosition;
+			this.minTextSelectionVScrollPos = minVScrollPosition;
+			this.maxTextSelectionVScrollPos = maxVScrollPosition;
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	mx_internal function setUpTextSelectionAutoScroll():void
+	{
+		if (!textSelectionAutoScrollTimer)
+		{
+			textSelectionAutoScrollTimer = new Timer(1000 / TEXT_SELECTION_AUTO_SCROLL_FPS);
+			textSelectionAutoScrollTimer.addEventListener(TimerEvent.TIMER,
+				textSelectionAutoScrollTimerHandler);
+
+			textSelectionAutoScrollTimer.start();
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	mx_internal function stopTextSelectionAutoScroll():void
+	{
+		if (textSelectionAutoScrollTimer)
+		{
+			textSelectionAutoScrollTimer.stop();
+			textSelectionAutoScrollTimer.removeEventListener(TimerEvent.TIMER,
+				textSelectionAutoScrollTimerHandler);
+			textSelectionAutoScrollTimer = null;
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	private function textSelectionAutoScrollTimerHandler(event:TimerEvent):void
+	{
+		const SLOW_SCROLL_THRESHOLD:int = 12;		// Distance from edge to trigger a slow scroll
+		const SLOW_SCROLL_SPEED:int = 20;			// Pixels per timer callback to scroll
+		const FAST_SCROLL_THRESHOLD:int = 3;		// Distance from edge to trigger a fast scroll
+		const FAST_SCROLL_DELTA:int = 30; 			// Added to SLOW_SCROLL_SPEED to determine fast speed
+
+		var newVSP:Number = viewport.verticalScrollPosition;
+		var newHSP:Number = viewport.horizontalScrollPosition;
+
+		if (scrollerLayout.canScrollHorizontally)
+		{
+			if (mouseX > width - SLOW_SCROLL_THRESHOLD)
+			{
+				newHSP += SLOW_SCROLL_SPEED;
+
+				if (mouseX > width - FAST_SCROLL_THRESHOLD)
+					newHSP += FAST_SCROLL_DELTA;
+
+				if (maxTextSelectionHScrollPos != -1 && newHSP > maxTextSelectionHScrollPos)
+					newHSP = maxTextSelectionHScrollPos;
+			}
+
+			if (mouseX < SLOW_SCROLL_THRESHOLD)
+			{
+				newHSP -= SLOW_SCROLL_SPEED;
+
+				if (mouseX < FAST_SCROLL_THRESHOLD)
+					newHSP -= FAST_SCROLL_DELTA;
+
+				if (newHSP < minTextSelectionHScrollPos)
+					newHSP = minTextSelectionHScrollPos;
+			}
+		}
+
+		if (scrollerLayout.canScrollVertically)
+		{
+			if (mouseY > height - SLOW_SCROLL_THRESHOLD)
+			{
+				newVSP += SLOW_SCROLL_SPEED;
+
+				if (mouseY > height - FAST_SCROLL_THRESHOLD)
+					newVSP += FAST_SCROLL_DELTA;
+
+				if (maxTextSelectionVScrollPos != -1 && newVSP > maxTextSelectionVScrollPos)
+					newVSP = maxTextSelectionVScrollPos;
+			}
+
+			if (mouseY < SLOW_SCROLL_THRESHOLD)
+			{
+				newVSP -= SLOW_SCROLL_SPEED;
+
+				if (mouseY < FAST_SCROLL_THRESHOLD)
+					newVSP -= FAST_SCROLL_DELTA;
+
+				if (newVSP < minTextSelectionVScrollPos)
+					newVSP = minTextSelectionVScrollPos;
+			}
+		}
+
+		if (newHSP != viewport.horizontalScrollPosition)
+			viewport.horizontalScrollPosition = newHSP;
+		if (newVSP != viewport.verticalScrollPosition)
+			viewport.verticalScrollPosition = newVSP;
+	}

 }

@@ -2570,6 +2707,12 @@
         // if we are scrolling (even if we just started scrolling)
         if (isScrolling)
         {
+			if (scroller.textSelectionAutoScrollEnabled)
+			{
+				scroller.setUpTextSelectionAutoScroll();
+				return;
+			}
+
             // calculate the delta
             var dx:Number = event.stageX - scrollGestureAnchorPoint.x;
             var dy:Number = event.stageY - scrollGestureAnchorPoint.y;
@@ -2648,7 +2791,15 @@
         // If we weren't already scrolling, then let's not start scrolling now
         if (!isScrolling)
             return;
-
+
+		// Don't throw if we're doing a text selection auto scroll
+		if (scroller.textSelectionAutoScrollEnabled)
+		{
+			scroller.stopTextSelectionAutoScroll();
+			endTouchScroll();
+			return;
+		}
+
         if (dragTimer)
         {
             if (dragScrollPending)