Transferred from the Adobe Open Source Subversion Repository

Revision: 2791
Author:   rfrishbe@adobe.com
Date:     2008-08-08T23:17:58.563914Z

Log Message:
-----------
Changes based on Skinning Architecture spec.  In SkinnableComponent, made _skinObject getter/setter private (rather than protected).  Also cleaned up some documentation in there.  Renamed attachBehaviors()/removeBehaviors() to skinLoaded()/unloadingSkin().  Out of this rename, I had to touch a few other files and found a few small bugs, like forgetting to call super.unloadingSkin(), forgetting to remove event listeners, and putting code in skinLoaded()/unloadingSkin() rather than partAdded()/partRemoved().

QE: Yes
Doc: No
Bugs: -
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/SkinnableComponent.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as
@@ -211,25 +211,6 @@
     }

     /**
-     *  Adds an eventListener for the updateComplete event so
-     *  that TrackBase will correctly position the thumb.
-     */
-    override protected function attachBehaviors():void
-    {
-        super.attachBehaviors();
-        track.addEventListener("updateComplete", track_updateCompleteHandler);
-    }
-
-    /**
-     *  Removes the updateComplete event handler.
-     */
-    override protected function removeBehaviors():void
-    {
-        super.removeBehaviors();
-        track.removeEventListener("updateComplete", track_updateCompleteHandler);
-    }
-
-    /**
      *  Adds event handlers to the track and thumb for mouse events.
      */
     override protected function partAdded(partName:String, instance:*):void
@@ -244,6 +225,9 @@
         {
             track.addEventListener(MouseEvent.MOUSE_DOWN,
                                    track_mouseDownHandler);
+            track.addEventListener("updateComplete",
+                                   track_updateCompleteHandler);
+
         }

         enableSkinParts(enabled);
@@ -263,6 +247,8 @@
         {
             track.removeEventListener(MouseEvent.MOUSE_DOWN,
                                       track_mouseDownHandler);
+            track.removeEventListener("updateComplete",
+                                      track_updateCompleteHandler);
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3973
Author:   rfrishbe@adobe.com
Date:     2008-10-30T20:30:13.007923Z

Log Message:
-----------
Adding IVisualContainer interface.  Group, FxContainer, and FxScroller implement this interface now.  Added owner and parent to IVisualItem.  GraphicElement and UIComponent implement this interface--work had to be done in GraphicElement to do this.  In doing so, elementHost is going to be renamed to parent.  For now, I added parent in GraphicElement and left elementHost in there; however, it is removed from IGraphicElement.  I’ve removed all references to elementHost in our code; however, I think mustella needs to be updated as do mustella tests, so I’m not going to remove elementHost until later.

Most of the changes here are name changes dealing with "elementHost" -> "parent".  If we decide that Gumbo components only support IVisualItems, we should clean up some of the code, but for now, I kept any assumptions that were in the original code (meaning we may be able to support DisplayObjects and old definitions of UIComponents/IUIComponents that aren’t IVisualItems).

I ran checkin tests, Group mustella tests, DataGroup mustella tests, FxContainer mustella tests, graphic tags tests, and all effects Mustella tests.

QE Notes: We will need to update mustella and mustella tests to use elementHost rather than parent.  We can also update mustella to use IVisualContainer rather than what it's doing now.  However, let's wait on these changes for now.  I'll send out an email when we're ready to make these changes and remove elementHost from GraphicElement.
Doc Notes: None
Bugs: -
Reviewer: Chet

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/IVisualContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/RemoveActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxFadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxFade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IUIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/IGraphicElement.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/flex4/src/mx/effects/effectClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
@@ -100,19 +100,11 @@
                 alphaTo = propChanges.end["parent"] ? origAlpha : 0;
                 restoreAlpha = true;
                 if (alphaFrom == 0)
-                    target.alpha = 0;
-            }
-            else if (propChanges && propChanges.end["elementHost"] !== undefined)
-            {
-                alphaFrom = propChanges.start["elementHost"] ? origAlpha : 0;
-                alphaTo = propChanges.end["elementHost"] ? origAlpha : 0;
-                if (alphaFrom == 0)
                 {
                     target.alpha = 0;
-                    if (GraphicElement(target).elementHost)
-                        Group(GraphicElement(target).elementHost).validateNow();
+                    if (target.parent is Group)
+                        target.parent.validateNow();
                 }
-                restoreAlpha = true;
             }
             else
             {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11447
Author:   chaase@adobe.com
Date:     2009-11-05T00:12:40.026724Z

Log Message:
-----------
Fix to 3 unrelated bugs.
- Auto-fading logic was clobbering the state-specified value of alpha in some situations (and the logic was way complex and fragile, so a refactoring was needed).
- Animation now handles sorting of Resize animations to be processed first in each frame, to improve some of the Resize/transform-effect interaction.
- Post-layout translation animations were being automatically created in some situations, ignoring any startDelays set on the real translation animations. The fix was to pick up the real translation animation info to pre-populate the post-layout animations.

QE notes: None
Doc notes:  None
Bugs:  sdk-23399, sdk-22563, sdk-24010, sdk-23252
Reviewer: Kevin
Tests run: checkintests, Mustella spark/effects
Is noteworthy for integration: Yes - some fixes requested by Tools

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/FadeInstance.as
@@ -109,103 +109,69 @@
      */
     override public function play():void
     {
-        // FIXME chaase: clean up this logic and make it simpler to decide whether
-        // and object is appearing or disappearing, then set the starting/ending
-        // values appropriately. Also, reuse the lazy-evaluation code for
-        // animations by supplying NaNs for values to be filled in with
-        // state values from propChanges later
-
-        // Remember the original value of the target object's alpha
-        origAlpha = target.alpha;
-        var propChanges:PropertyChanges = propertyChanges;
-
-        // If nobody assigned a value, make this a "show" effect.
-        if (isNaN(alphaFrom) && isNaN(alphaTo))
+        var fromValue:Number = alphaFrom;
+        var toValue:Number = alphaTo;
+        if (propertyChanges)
         {
-            var startAlpha:Number = origAlpha;
-            var endAlpha:Number = origAlpha;
-            if (propChanges && propChanges.end["alpha"] !== undefined &&
-                propChanges.end["alpha"] != propChanges.start["alpha"])
+            if (isNaN(fromValue))
+                fromValue =
+                    (propertyChanges.start["alpha"] !== undefined) ?
+                    propertyChanges.start["alpha"] : target.alpha;
+            if (isNaN(toValue))
+                toValue =
+                    (propertyChanges.end["alpha"] !== undefined) ?
+                    propertyChanges.end["alpha"] : target.alpha;
+            var visibleChange:Boolean =
+                propertyChanges.end["visible"] !== undefined &&
+                propertyChanges.end["visible"] != propertyChanges.start["visible"];
+            var parentChange:Boolean =
+                propertyChanges.end["parent"] !== undefined &&
+                propertyChanges.end["parent"] != propertyChanges.start["parent"];
+            if (visibleChange || parentChange)
             {
-                endAlpha = propChanges.end["alpha"];
-            }
-            if (propChanges && propChanges.end["visible"] !== undefined &&
-                propChanges.end["visible"] != propChanges.start["visible"])
-            {
-                alphaFrom = propChanges.start["visible"] ? startAlpha : 0;
-                alphaTo = propChanges.end["visible"] ? endAlpha : 0;
-                // Force target to be visible at effect
-                restoreAlpha = !propChanges.end["visible"];
-            }
-            else if (propChanges && propChanges.end["parent"] !== undefined &&
-                propChanges.end["parent"] != propChanges.start["parent"])
-            {
-                alphaFrom = propChanges.start["parent"] ? startAlpha : 0;
-                alphaTo = propChanges.end["parent"] ? endAlpha : 0;
-                restoreAlpha = !propChanges.end["parent"];
-                if (alphaFrom == 0)
+                var fadeIn:Boolean = (visibleChange && propertyChanges.end["visible"]) ||
+                    (parentChange && propertyChanges.end["parent"]);
+                if (fadeIn)
                 {
-                    target.alpha = 0;
-                    // FIXME (chaase): is Group or is UIComponent?
-                    if (target.parent is Group)
-                        target.parent.validateNow();
+                    if (isNaN(alphaFrom))
+                        alphaFrom = 0;
+                    alphaTo = toValue;
+                    if ("visible" in target)
+                        target.visible = true;
+                }
+                else if (isNaN(alphaTo)) // fade out
+                {
+                    alphaTo = 0;
+                    restoreAlpha = true;
+                    origAlpha = propertyChanges.end["alpha"] !== undefined ?
+                        propertyChanges.end["alpha"] :
+                        target.alpha;
+                    if (visibleChange)
+                        makeInvisible = true;
                 }
             }
-            else
+        }
+        if ("visible" in target && !target.visible)
+        {
+            // Extra logic to handle making the object visible if we're supposed
+            // to be fading it in
+            if (isNaN(fromValue))
+                fromValue = target.alpha;
+            if (isNaN(toValue))
+                toValue = target.alpha;
+            if (fromValue == 0 && toValue != 0)
             {
-                alphaFrom = startAlpha;
-                alphaTo = endAlpha;
+                target.alpha = 0;
+                target.visible = true;
             }
         }
-        else if (isNaN(alphaFrom))
-        {
-            // FIXME chaase: why anything but origAlpha here?
-            alphaFrom = (alphaTo == 0) ? origAlpha : 0;
-        }
-        else if (isNaN(alphaTo))
-        {
-            if (propChanges && propChanges.end["alpha"] !== undefined &&
-                propertyChanges.end["alpha"] != propertyChanges.start["alpha"])
-            {
-                alphaTo = propChanges.end["alpha"];
-            }
-            else
-            {
-                // FIXME chaase: why anything but origAlpha here?
-                alphaTo = (alphaFrom == 0) ? origAlpha : 0;
-            }
-        }
-
-        // Extra logic to handle making the object visible if we're supposed
-        // to be fading it in
-        if ("visible" in target && !target.visible &&
-            alphaFrom == 0 && alphaTo != 0 &&
-            (!propertyChanges ||
-             (propChanges.end["visible"] !== undefined &&
-                propChanges.end["visible"] != propChanges.start["visible"])))
-        {
-            target.alpha = 0;
-            target.visible = true;
-        }
-        // And logic to make the object invisible at the end if we're
-        // fading it out
-        // FIXME (chaase): simplify logic of which variables we are
-        // side-effecting and what we should reset at the end
-        if ("visible" in target && target.visible &&
-            alphaFrom != 0 && alphaTo == 0 &&
-            propChanges && propChanges.end["visible"] !== undefined &&
-            propertyChanges.end["visible"] != propertyChanges.start["visible"])
-        {
-            makeInvisible = true;
-        }
-
         motionPaths = new <MotionPath>[new MotionPath("alpha")];
         motionPaths[0].keyframes = new <Keyframe>[new Keyframe(0, alphaFrom),
             new Keyframe(duration, alphaTo)];

         super.play();
     }
-
+
     /**
      *  Handle any cleanup from this effect, such as setting the target to
      *  be visible (or not) or removed (or not).


Transferred from the Adobe Open Source Subversion Repository

Revision: 5924
Author:   chaase@adobe.com
Date:     2009-04-03T23:23:45.166425Z

Log Message:
-----------
This fixes the use of constraints in effects. Basically, it removes the 'adjustConstraints' property that was added in Flex4 and adds a new 'disableConstraints' flag which disables constraints during the effect (default false).

QE Notes: Issues in spark/effects/AnimateTransform* directories, rename-related, Matt chasing down
Doc Notes: none
Bugs:
Reviewer: Glenn
tests: checkintests, mustella spark/effects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/RotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Animate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Rotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/MoveInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/MoveInstance.as
@@ -10,18 +10,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package spark.effects.supportClasses
 {
-import flash.events.Event;
-
-import spark.components.Application;
-import mx.core.Container;
-import mx.core.IUIComponent;
 import spark.effects.AnimationProperty;
-import spark.effects.animation.Animation;
-import spark.events.AnimationEvent;
-import mx.events.EffectEvent;
-import mx.events.TweenEvent;
-import spark.core.IGraphicElement;
-import mx.styles.IStyleClient;

 public class MoveInstance extends AnimateInstance
 {
@@ -30,7 +19,6 @@
     public function MoveInstance(target:Object)
     {
         super(target);
-        affectsConstraints = true;
     }

     //--------------------------------------------------------------------------
@@ -139,7 +127,6 @@
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
-
     /**
      *  @private
      */
@@ -149,6 +136,20 @@
             [new AnimationProperty("x", xFrom, xTo, duration, xBy),
              new AnimationProperty("y", yFrom, yTo, duration, yBy)];

+        // Also animate any position-related constraints that change between
+        // transition states
+        if (propertyChanges && !disableConstraints)
+        {
+            setupConstraintAnimation("left");
+            setupConstraintAnimation("right");
+            setupConstraintAnimation("top");
+            setupConstraintAnimation("bottom");
+            setupConstraintAnimation("percentWidth");
+            setupConstraintAnimation("percentHeight");
+            setupConstraintAnimation("horizontalCenter");
+            setupConstraintAnimation("verticalCenter");
+            // TODO (chaase): also deal with baseline when it works in BasicLayout
+        }
         // TODO (chaase): The Flex3 version of Move had logic for forcing clipping
         // off during the effect. We probably need something like this
         // in this version as well, but the implementation is TBD with the


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

--- frameworks/projects/framework/src/mx/core/ISpriteInterface.as
+++ frameworks/projects/framework/src/mx/core/ISpriteInterface.as
@@ -1,4 +1,18 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 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.
+//
+////////////////////////////////////////////////////////////////////////////////

+/*
+ *  The ISprite interface defines the basic set of APIs
+ *  for web version of flash.display.Sprite
+ */

 import flash.display.DisplayObject;
 import flash.display.Sprite;


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


Transferred from the Adobe Open Source Subversion Repository

Revision: 7502
Author:   jszeto@adobe.com
Date:     2009-06-03T00:34:08.950238Z

Log Message:
-----------
Fixed RadialGradientStroke rotation bug

http://bugs.adobe.com/jira/browse/SDK-18372 -  RadialGradientStroke transform does not rotate

Copied the logic from RadialGradient to RadialGradientStroke. The createGradientBox function doesn’t do what we want because it rotates first and then scales. We want to scale first and then rotate.

Added constant for the width and height of the untransformed gradient to all of the gradient classes.

QE Notes: Test RadialGradientStroke rotation
Doc Notes: None
Bugs: SDK-18372
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradient.as</path>

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 6727
Author:   jszeto@adobe.com
Date:     2009-05-07T22:51:06.562435Z

Log Message:
-----------
SDK-20898 - DropDownList dropDown height varies when a horizontal scroll bar is used
SDK-20895 - DropDownList has floating horizontal scroll bar when only one line is present in dropDown
SDK-19879 - Spark DropDownList control with custom TileLayout skin is incorrectly sized and doesnt show all items first time dropdown is opened

Changed the sizing logic in PopUpAnchor so that we only explicitly set the width or height if the respective autoSizePopUpWidth or autoSizePopUpHeight properties are set to true. When either width or height aren’t explicitly set, the popUp will automatically resize that dimension if the measured size has changed.

Additional Change:
Added a new spark.core.RelativePosition enum class for the PopUpAnchor.popUpPosition property. Possible values include “left”, “right”, “above”, “below”, “center” and “exact”.

QE Notes: none
Doc Notes: none
Bugs: SDK-20898, SDK-20895, SDK-19879
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/RelativePosition.as</path>

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

--- frameworks/projects/spark/src/spark/components/PopUpAnchor.as
+++ frameworks/projects/spark/src/spark/components/PopUpAnchor.as
@@ -13,24 +13,23 @@
 {

 import flash.display.DisplayObject;
+import flash.display.Graphics;
 import flash.events.Event;
 import flash.geom.Matrix;
 import flash.geom.Point;
-
+import flash.geom.Rectangle;
+
+import mx.core.IFactory;
+import mx.core.IFlexDisplayObject;
 import mx.core.ITransientDeferredInstance;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.managers.PopUpManager;
-import flash.display.Graphics;
-
-import mx.core.IFlexDisplayObject;
-import mx.core.IFactory;
-
-import flash.geom.Rectangle;
 import mx.utils.MatrixUtil;

+import spark.core.RelativePosition;
+
 use namespace mx_internal;
-

 [DefaultProperty("popUp")]

@@ -243,13 +242,16 @@
     //  popUpPosition
     //----------------------------------

-	private var _popUpPosition:String = "exact";
+	private var _popUpPosition:String = RelativePosition.EXACT;

 	/**
 	 *  Position of the popUp when it is opened.
 	 *  Possible values are "left", "right", "above", "below", "center", and "exact"
 	 *
-	 *  @default "exact"
+	 *
+	 *  @default RelativePosition.EXACT
+	 *
+	 *  @see spark.core.RelativePosition
 	 *
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10
@@ -336,21 +338,21 @@
 		{
 			switch(popUpPosition)
 			{
-				case "below" :
+				case RelativePosition.BELOW :
 					if (popUpBounds.bottom > screen.bottom)
-						adjustedPosition = "above";
+						adjustedPosition = RelativePosition.ABOVE;
 					break;
-				case "above" :
+				case RelativePosition.ABOVE :
 					if (popUpBounds.top < screen.top)
-						adjustedPosition = "below";
+						adjustedPosition = RelativePosition.BELOW;
 					break;
-				case "left" :
+				case RelativePosition.LEFT :
 					if (popUpBounds.left < screen.left)
-						adjustedPosition = "right";
+						adjustedPosition = RelativePosition.RIGHT;
 					break;
-				case "right" :
+				case RelativePosition.RIGHT :
 					if (popUpBounds.right > screen.right)
-						adjustedPosition = "left";
+						adjustedPosition = RelativePosition.LEFT;
 					break;
 			}
 		}
@@ -369,19 +371,19 @@
 				// then revert to the original position.
 				switch(adjustedPosition)
 				{
-					case "below" :
+					case RelativePosition.BELOW :
 						if (popUpBounds.bottom > screen.bottom)
 							adjustedPosition = null;
 						break;
-					case "above" :
+					case RelativePosition.ABOVE :
 						if (popUpBounds.top < screen.top)
 							adjustedPosition = null;
 						break;
-					case "left" :
+					case RelativePosition.LEFT :
 						if (popUpBounds.left < screen.left)
 							adjustedPosition = null;
 						break;
-					case "right" :
+					case RelativePosition.RIGHT :
 						if (popUpBounds.right > screen.right)
 							adjustedPosition = null;
 						break;
@@ -471,27 +473,27 @@
 	{
 		switch(placement)
 		{
-			case "below":
+			case RelativePosition.BELOW:
 				registrationPoint.x = 0;
 				registrationPoint.y = unscaledHeight;
 				break;
-			case "above":
+			case RelativePosition.ABOVE:
 				registrationPoint.x = 0;
 				registrationPoint.y = -popUpHeight;
 				break;
-			case "left":
+			case RelativePosition.LEFT:
 				registrationPoint.x = -popUpWidth;
 				registrationPoint.y = 0;
 				break;
-			case "right":
+			case RelativePosition.RIGHT:
 				registrationPoint.x = unscaledWidth;
 				registrationPoint.y = 0;
 				break;
-			case "center":
+			case RelativePosition.CENTER:
 				registrationPoint.x = (unscaledWidth - popUpWidth) / 2;
 				registrationPoint.y = (unscaledHeight - popUpHeight) / 2;
 				break;
-			case "exact":
+			case RelativePosition.EXACT:
 				// already 0,0
 				break;
 		}
@@ -521,13 +523,12 @@

 		var m:Matrix = $transform.concatenatedMatrix;

-		var popUpWidth:Number = autoSizePopUpWidth ? unscaledWidth : popUp.getPreferredBoundsWidth(false);
-		var popUpHeight:Number = autoSizePopUpHeight ? unscaledHeight : popUp.getPreferredBoundsHeight(false);
-
 		// Set the dimensions explicitly because UIComponents always set themselves to their
 		// measured / explicit dimensions if they are parented by the SystemManager.
-		popUp.width = popUpWidth;
-		popUp.height = popUpHeight;
+		if (autoSizePopUpWidth)
+			popUp.width = unscaledWidth;
+		if (autoSizePopUpHeight)
+			popUp.height = unscaledHeight;

 		var popUpPoint:Point = positionPopUp();


Transferred from the Adobe Open Source Subversion Repository

Revision: 11080
Author:   clucier@adobe.com
Date:     2009-10-22T13:37:39.524431Z

Log Message:
-----------
To cover cases where there are filters in the ancestry chain, we have to use our MatrixUtils sledgehammer to acquire the correct concatenated matrix.

QE notes: None
Doc notes: None
Bugs: SDK-23155
Reviewer: Chet
Tests run: Checkin
Is noteworthy for integration: No

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as

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

--- frameworks/projects/spark/src/spark/components/PopUpAnchor.as
+++ frameworks/projects/spark/src/spark/components/PopUpAnchor.as
@@ -535,7 +535,7 @@
         // and subtract out the popUp parent's concatenatedMatrix
         var matrix:Matrix = systemManager.getSandboxRoot().transform.concatenatedMatrix;
         matrix.invert();
-        matrix.concat($transform.concatenatedMatrix);
+        matrix.concat(MatrixUtil.getConcatenatedMatrix(this));

         return matrix;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17192
Author:   klin@adobe.com
Date:     2010-08-04T22:46:24.590196Z

Log Message:
-----------
Fixed a few bugs in FormItemLayout and ConstraintLayout.

-ConstraintLayout's measure() doesn't set the actual sizes of the columns and rows anymore. Instead, measureColumns and measureRows return a vector of the calculated column and row sizes. These are used to calculate the correct measuredWidth and measuredHeight of the target without altering the columns or rows.
-Added two protected methods, setColumnWidths() and setRowHeights(), for setting the actual sizes for columns and rows. FormItemLayout uses setColumnWidths to set the layout sizes it gets from FormLayout.
-Removed setColumnWidths() from FormItemLayout.
-The Group that wraps the indicatorDisplay is now not included in the layout since we size and position it through binding.

QE notes: No
Doc notes: No
Bugs: SDK-27205, SDK-27206
Reviewer: Jason
Tests run: checkintests, Form
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/FormItemLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/ConstraintLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/FormItemSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/layouts/FormItemLayout.as
+++ frameworks/projects/spark/src/spark/layouts/FormItemLayout.as
@@ -104,22 +104,5 @@
         target.invalidateDisplayList();
     }

-    /**
-     *  @private
-     *  Sets the column widths to the provided values.
-     */
-    private function setColumnWidths(value:Vector.<Number>):void
-    {
-        var constraintColumns:Vector.<ConstraintColumn> = this.constraintColumns;
-        var numCols:int = constraintColumns.length;
-        var totalWidth:Number = 0;
-
-        for (var i:int = 0; i < numCols; i++)
-        {
-            constraintColumns[i].setActualWidth(value[i]);
-            constraintColumns[i].x = totalWidth;
-            totalWidth += value[i];
-        }
-    }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 9225
Author:   egeorgie@adobe.com
Date:     2009-08-11T18:36:09.811287Z

Log Message:
-----------
Fix bug: Rows disappear in Spark List when using negative gap in layout and using virtualization

Fix: Change H/V layouts first-visible-element lookup logic to accommodate negative gaps.

QE notes: None
Doc notes: None
Bugs: SDK-22497
Reviewer: Hans
Tests run: checkintests,
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -1467,7 +1467,13 @@
         var maxVisibleY:Number = minVisibleY + layoutTarget.height;

         updateLLV(layoutTarget);
-        var startIndex:int = llv.indexOf(minVisibleY + gap);
+
+		// Find the index of the first visible item. Since the item's bounds includes the gap
+		// that follows it, we want to avoid looking at an item that has only a portion of
+		// its gap intersecting with the visible region.
+		// We have to also be careful, as gap could be negative and in that case, we should
+		// simply start from minVisibleY - SDK-22497.
+        var startIndex:int = llv.indexOf(Math.max(0, minVisibleY + gap));
         if (startIndex == -1)
             return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8409
Author:   jszeto@adobe.com
Date:     2009-07-06T23:14:07.565441Z

Log Message:
-----------
BitmapImage bug fix

http://bugs.adobe.com/jira/browse/SDK-21808 - titleIcon is one pixel too wide, resulting in part of the left edge of the image reappearing on the right

The fix is to always force the image to be drawn on a pixel boundary.

QE Notes: Need some tests with BitmapImage on non-pixel boundaries
Doc Notes: None
Bugs: SDK-21808
Reviewer: Glenn

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/BitmapImage.as

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

--- frameworks/projects/spark/src/spark/primitives/BitmapImage.as
+++ frameworks/projects/spark/src/spark/primitives/BitmapImage.as
@@ -26,7 +26,6 @@
 import flash.geom.Rectangle;
 import flash.net.URLRequest;
 import flash.system.LoaderContext;
-import flash.utils.getDefinitionByName;

 import spark.primitives.supportClasses.GraphicElement;

@@ -446,6 +445,8 @@
         var repeatBitmap:Boolean = false;
         var fillScaleX:Number = 1;
         var fillScaleY:Number = 1;
+        var roundedDrawX:Number = Math.round(drawX);
+        var roundedDrawY:Number = Math.round(drawY);

         switch(_resizeMode)
         {
@@ -472,11 +473,13 @@
             isNaN(_scaleGridLeft) ||
             isNaN(_scaleGridRight))
         {
+
+
             matrix.identity();
             matrix.scale(fillScaleX, fillScaleY);
-            matrix.translate(drawX, drawY);
+            matrix.translate(roundedDrawX, roundedDrawY);
             g.beginBitmapFill(_bitmapData, matrix, repeatBitmap, smooth);
-            g.drawRect(drawX, drawY, unscaledWidth, unscaledHeight);
+            g.drawRect(roundedDrawX, roundedDrawY, unscaledWidth, unscaledHeight);
             g.endFill();
         }
         else
@@ -539,11 +542,11 @@
                     // Translate based on the difference between the source and destination coordinates,
                     // making sure to account for the new scale.
                     matrix.translate(destSection.x - sourceSection.x * matrix.a, destSection.y - sourceSection.y * matrix.d);
-                    matrix.translate(drawX, drawY);
+                    matrix.translate(roundedDrawX, roundedDrawY);

                     // Draw the bitmap for the current section
                     g.beginBitmapFill(_bitmapData, matrix);
-                    g.drawRect(destSection.x + drawX, destSection.y + drawY, destSection.width, destSection.height);
+                    g.drawRect(destSection.x + roundedDrawX, destSection.y + roundedDrawY, destSection.width, destSection.height);
                     g.endFill();
                  }
             }


change video count from number to string in order to match payload_info schema

--- snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/Tracker.as
+++ snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/Tracker.as
@@ -831,7 +831,7 @@
 			// Build out the rest of the request
 			payload.add(Parameter.VIEWPORT, detectViewport());
 			payload.add(Parameter.DOCUMENT_SIZE, detectDocumentSize());
-			payload.add(Parameter.VISIT_COUNT, cookieVisitCount);
+			payload.add(Parameter.VISIT_COUNT, cookieVisitCount.toString());
 			payload.add(Parameter.DOMAIN_USER_ID, cookieDomainUserId); // Set to our local variable
 			payload.add(Parameter.USER_FINGERPRINT, cookieUserFingerprint);
 			payload.add(Parameter.UID, businessUserId);


广告文本样式修改

广告文本样式修改

--- project/PinkPlayer/src/com/fenhongxiang/ADPlayer.as
+++ project/PinkPlayer/src/com/fenhongxiang/ADPlayer.as
@@ -273,7 +273,7 @@

 			if (_adLb)
 			{
-				_adLb.htmlText = "广告剩余" + leftCount +"秒";
+				_adLb.htmlText = "广告剩余 " + leftCount +" 秒";
 			}

 			if (onPlaying != null)
@@ -297,7 +297,7 @@

 			//显示广告时间的文本框
 			_adLb = new TextField();
-			_adLb.width = 103;
+			_adLb.width = 110;
 			_adLb.x = this.width - _adLb.width - 30;
 			_adLb.y = 10;
 			_adLb.mouseEnabled = false;


fixed minor coding style issues

fixed minor coding style issues

--- src/aerys/minko/type/loader/parser/ParserOptions.as
+++ src/aerys/minko/type/loader/parser/ParserOptions.as
@@ -26,87 +26,87 @@
 		private var _indexStreamUsage			: uint		= 0;
 		private var _parser						: Class		= null;

-		public function get parser():Class
+		public function get parser() : Class
 		{
 			return _parser;
 		}

-		public function set parser(value:Class):void
+		public function set parser(value : Class) : void
 		{
 			_parser = value;
 		}

-		public function get indexStreamUsage():uint
+		public function get indexStreamUsage() : uint
 		{
 			return _indexStreamUsage;
 		}

-		public function set indexStreamUsage(value:uint):void
+		public function set indexStreamUsage(value : uint) : void
 		{
 			_indexStreamUsage = value;
 		}

-		public function get vertexStreamUsage():uint
+		public function get vertexStreamUsage() : uint
 		{
 			return _vertexStreamUsage;
 		}

-		public function set vertexStreamUsage(value:uint):void
+		public function set vertexStreamUsage(value : uint) : void
 		{
 			_vertexStreamUsage = value;
 		}

-		public function get effect():Effect
+		public function get effect() : Effect
 		{
 			return _meshEffect;
 		}

-		public function set effect(value:Effect):void
+		public function set effect(value : Effect) : void
 		{
 			_meshEffect = value;
 		}

-		public function get mipmapTextures():Boolean
+		public function get mipmapTextures() : Boolean
 		{
 			return _mipmapTextures;
 		}

-		public function set mipmapTextures(value:Boolean):void
+		public function set mipmapTextures(value : Boolean) : void
 		{
 			_mipmapTextures = value;
 		}

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

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

-		public function get loadDependencies():Boolean
+		public function get loadDependencies() : Boolean
 		{
 			return _loadDependencies;
 		}

-		public function set loadDependencies(value:Boolean):void
+		public function set loadDependencies(value : Boolean) : void
 		{
 			_loadDependencies = value;
 		}

-        public function get loadSkin():Boolean
+        public function get loadSkin() : Boolean
         {
             return _loadSkin;
         }

-        public function set loadSkin(value:Boolean):void
+        public function set loadSkin(value : Boolean) : void
         {
             _loadSkin = value;
         }

-		public function clone(): ParserOptions
+		public function clone() : ParserOptions
 		{
 			return new ParserOptions(
 				_loadDependencies,
@@ -120,14 +120,14 @@
 			);
 		}

-		public function ParserOptions(loadDependencies			: Boolean = false,
-									  dependencyLoaderClosure	: Function = null,
-                                      loadSkin                  : Boolean = true,
-									  mipmapTextures			: Boolean = true,
-									  meshEffect				: Effect = null,
-									  vertexStreamUsage			: uint = 0,
-									  indexStreamUsage			: uint = 0,
-									  parser					: Class = null)
+		public function ParserOptions(loadDependencies			: Boolean 	= false,
+									  dependencyLoaderClosure	: Function 	= null,
+                                      loadSkin                  : Boolean 	= true,
+									  mipmapTextures			: Boolean 	= true,
+									  meshEffect				: Effect 	= null,
+									  vertexStreamUsage			: uint 		= 0,
+									  indexStreamUsage			: uint 		= 0,
+									  parser					: Class 	= null)
 		{
 			_loadDependencies			= loadDependencies;
 			_dependencyLoaderClosure	= dependencyLoaderClosure || _dependencyLoaderClosure;


FLEX-33159 FLEX-33158 Fix addSortField method so it preserves custom sorting and keeps internal sort fields in sync

--- frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
+++ frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGridBaseEx.as
@@ -6091,11 +6091,8 @@
         if (!column.sortable)
             return;

-         var headerInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(column);
-         if(headerInfo && headerInfo.internalLabelFunction != null && column.sortCompareFunction == null)
-             return;
-
          var desc:Boolean = column.sortDescending;
+		 var fields:Array;

          var singleColumnSort:Boolean = false;
          if (!collection.sort || !collection.sort.fields)
@@ -6129,14 +6126,18 @@
         }

         column.sortDescending = desc;
-        var field:ISortField = new SortField(columnName); // name
+        var field:ISortField = new SortField(columnName);
         field.sortCompareType = column.sortCompareType;
         field.descending = desc;

-//        field.name = column.dataField;
         if (column.sortCompareFunction != null)
             field.compareFunction = column.sortCompareFunction;
-        collection.sort.fields.push(field);
+
+		fields = collection.sort.fields;
+		if (fields == null)
+			fields = [];
+		fields.push(field);
+		collection.sort.fields = fields;
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 8530
Author:   jszeto@adobe.com
Date:     2009-07-13T18:17:46.547231Z

Log Message:
-----------
Change Slider and NumericStepper default value

http://bugs.adobe.com/jira/browse/SDK-18380 - FxHSlider and FxVSlider have default max of 100, should be 10

Changed the default value for Slider by setting the value to 10 in the constructor. I changed NumericStepper’s implementation to match Slider. The problem with NumericStepper’s previous implementation was that it wasn’t calling Range’s maximum setter. Thus there was some important logic in Range.commitProperties that wasn’t called.

QE Notes: Update tests with new default
Doc Notes: Update docs with new default
Bugs: SDK-18380
Reviewer: Hans

Modified Paths:
--------------
<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/NumericStepper.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
@@ -146,6 +146,7 @@
     public function Slider():void
     {
         super();
+        maximum = 10;
     }

     //--------------------------------------------------------------------------
@@ -249,6 +250,29 @@
      */
     public var dataTipPrecision:int = 2;

+    //---------------------------------
+    // maximum
+    //---------------------------------
+
+    /**
+     *  Number which represents the maximum value possible for
+     *  value. If the values for either
+     *  minimum or value are greater
+     *  than maximum, they will be changed to
+     *  reflect the new maximum
+     *
+     *  @default 10
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    override public function get maximum():Number
+    {
+        return super.maximum;
+    }
+
     //---------------------------------
     // showDataTip
     //---------------------------------


Apache license 2.0 added.

Apache license 2.0 added.

--- tui_flashdevelop3/lib/touchAll/draw2Dmodel3D/Draw2Dmodel3D.as
+++ tui_flashdevelop3/lib/touchAll/draw2Dmodel3D/Draw2Dmodel3D.as
@@ -1,3 +1,20 @@
+/*
+ * Tangible User Interfacer (former TouchAll) misc code.
+ *
+ * Copyright 2016 Gonçalo Amador <g.n.p.amador@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package touchAll.draw2Dmodel3D
 {

@@ -598,4 +615,4 @@
 			}
 		}
 	}
-}+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/collections/IGroupingCollection2.as
+++ frameworks/projects/advancedgrids/src/mx/collections/IGroupingCollection2.as
@@ -0,0 +1,141 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+
+/**
+ *  The IGroupingCollection2 interface defines the interface required
+ *  to create grouped data from flat data.
+ *
+ *  @see mx.collections.GroupingCollection2
+ *  @see mx.controls.AdvancedDataGrid
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+public interface IGroupingCollection2 extends IHierarchicalData
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  grouping
+    //----------------------------------
+
+    /**
+     *  The Grouping object applied to the source data.
+     *  Setting this property does not automatically refresh the view;
+     *  therefore, you must call the refresh() method
+     *  after setting this property.
+     *
+     *
Note: The Flex implementations of IGroupingCollection2 retrieve all
+     *  items from a remote location before executing grouping.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    function get grouping():Grouping;
+
+    /**
+     *  @private
+     */
+    function set grouping(value:Grouping):void;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Applies the grouping to the collection.
+     *  The collection does not detect changes to a group
+     *  automatically, so you must call the refresh()
+     *  method to update the collection after setting the grouping,
+     *  source, or summaries properties.
+     *  You also call the refresh() method when you modify
+     *  a GroupingField of the collection, such as by changing the
+     *  caseInsensitive, compareFunction,
+     *  or groupingFunction properties.
+     *
+     *
The refresh() method can be applied synchronously
+     *  or asynchronously.

+     *
+     *
When refresh() is called synchronously,
+     *  all groups and summaries are updated together before the method returns.
+     *  That means your application cannot perform other processing operations
+     *  for the duration of the call.
+     *  A client should wait for a CollectionEvent event
+     *  with the value of the kind property set
+     *  to CollectionEventKind.REFRESH
+     *  to ensure that the refresh() method completed.

+     *
+     *
In asynchronous refresh, all groups and summaries are updated individually.
+     *  The refresh() method returns before the groups and summaries
+     *  are updated so that your application can continue execution.
+     *  Also, the control is updated during the refresh so that the
+     *  user can continue to interact with it.

+     *
+     *
The overhead of updating groups and summaries individually,
+     *  rather than all at once, makes an asynchronous refresh take longer
+     *  than a synchronous one.
+     *  However, for large data sets, your application continues
+     *  to operate during the refresh.

+     *
+     *  @param async If true, defines the refresh to be asynchronous.
+     *  By default it is false denoting synchronous refresh.
+     *
+     *  @param dispatchCollectionEvents If true, events are
+     *  dispatched when groups are formed.
+     *  For better performance, set it to false.
+     *  If true, then events are dispatched as groups and summaries are calculated
+     *  synchronously to update the control.
+     *  Note: If async is true,
+     *  the dispatchCollectionEvents is always set to true.
+     *  By default it is false denoting no events will be dispatched.
+     *
+     *  @return true if the refresh() method completed,
+     *  and false if the refresh is incomplete,
+     *  which can mean that items are still pending.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 3
+     */
+    function refresh(async:Boolean = false, dispatchCollectionEvents:Boolean = false):Boolean;
+
+    /**
+     *  If the refresh is performed asynchronously,
+     *  cancels the refresh operation and stops the building of the groups.
+     *
+     *  This method only cancels the refresh
+     *  if it is initiated by a call to the refresh() method
+     *  with an asynch argument of true, corresponding to an asynchronous refresh.
+     *
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 3
+     */
+    function cancelRefresh():void;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 13022
Author:   gosmith@adobe.com
Date:     2009-12-17T01:20:19.923578Z

Log Message:
-----------
Added ASDoc for the Spark TextBaseAccImpl and RichEditableTextAccImpl, based on the opensource specs.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/TextBaseAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/RichEditableTextAccImpl.as</path>

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

--- frameworks/projects/spark/src/spark/accessibility/RichEditableTextAccImpl.as
+++ frameworks/projects/spark/src/spark/accessibility/RichEditableTextAccImpl.as
@@ -25,8 +25,88 @@
 use namespace mx_internal;

 /**
- *  RichEditableTextBaseAccImpl is a subclass of AccessibilityImplementation
- *  which implements accessibility for the RichEditableTextBaseClass class.
+ *  RichEditableTextAccImpl is the accessibility implementation class
+ *  for spark.components.RichEditableText.
+ *
+ *
When a Spark RichEditableText is created,
+ *  its accessibilityImplementation property
+ *  is set to an instance of this class.
+ *  The Flash Player then uses this class to allow MSAA clients
+ *  such as screen readers to see and manipulate the RichEditableText.
+ *  See the mx.accessibility.AccImpl and
+ *  flash.accessibility.AccessibilityImplementation classes
+ *  for background information about accessibility implementation
+ *  classes and MSAA.

+ *
+ *
Children

+ *
+ *
A RichEditableText has no MSAA children.

+ *
+ *
Role

+ *
+ *
The MSAA Role of a RichEditableText is ROLE_SYSTEM_TEXT.

+ *
+ *
Name

+ *
+ *
The MSAA Name of a RichEditableText is, by default, the empty string.
+ *  When wrapped in a FormItem element, the Name is the FormItem's label.
+ *  To override this behavior,
+ *  set the RichEditableText's accessibilityName property.

+ *
+ *
When the Name changes,
+ *  a RichEditableText dispatches the MSAA event EVENT_OBJECT_NAMECHANGE.

+ *
+ *
Description

+ *
+ *
The MSAA Description of a RichEditableText is, by default,
+ *  the empty string, but you can set the RichEditableText's
+ *  accessibilityDescription property.

+ *
+ *
State

+ *
+ *
The MSAA State of a RichEditableText is a combination of:
+ *

+ *
STATE_SYSTEM_UNAVAILABLE (when enabled is false)

+ *
STATE_SYSTEM_FOCUSABLE (when enabled is true)

+ *
STATE_SYSTEM_FOCUSED
+ *    (when enabled is true and the RichEditableText has focus)

+ *
STATE_SYSTEM_PROTECTED (when displayAsPassword is true)

+ *
STATE_SYSTEM_READONLY (when editable is false)

+ *

+ *
+ *
When the State changes,
+ *  a RichEditableText dispatches the MSAA event EVENT_OBJECT_STATECHANGE.

+ *
+ *
Value

+ *
+ *
The MSAA Value of a RichEditableText is equal to
+ *  its text property.

+ *
+ *
When the Value changes,
+ *  a RichEditableText dispatches the MSAA event EVENT_OBJECT_VALUECHANGE.

+ *
+ *
Location

+ *
+ *
The MSAA Location of a RichEditableText is its bounding rectangle.

+ *
+ *
Default Action

+ *
+ *
A RichEditableText does not have an MSAA DefaultAction.

+ *
+ *
Focus

+ *
+ *
A RichEditableText accepts focus.
+ *  When it does so it dispatches the MSAA event EVENT_OBJECT_FOCUS.

+ *
+ *
Selection

+ *
+ *
A RichEditableText does not support selection in the MSAA sense,
+ *  and text selection is not part of Microsoft's IAccessibility COM interface.
+ *  But, in Player 10.1 and later, screen readers can determine
+ *  the currently selected text range via the GetSelection() method
+ *  in Adobe's ISimpleTextSelection COM interface, which calls the
+ *  selectionAnchorIndex and selectionActiveIndex
+ *  getters in this class.

  *
  *  @langversion 3.0
  *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 18188
Author:   dloverin@adobe.com
Date:     2010-10-16T03:11:51.820813Z

Log Message:
-----------
DataGrid editor PARB changes and more.

Don't open a cell editor on double click.

QE notes: Ready for testing.
Doc notes: None.
Bugs:
Reviewer: Hans
Tests run: cyclone server
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/IGridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/GridItemEditorEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/TextGridItemEditor.mxml" copyfrom-rev="18150" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DefaultGridItemEditor.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/TextGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/ComboBoxGridItemEditor.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
@@ -21,15 +21,19 @@
 {
 import flash.display.DisplayObjectContainer;
 import flash.display.DisplayObject;
+import flash.display.InteractiveObject;
 import flash.events.Event;
 import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
+import flash.events.TimerEvent;
 import flash.geom.Point;
 import flash.geom.Rectangle;
 import flash.ui.Keyboard;
 import flash.utils.describeType;
-
+import flash.utils.Timer;
+
+import mx.core.ClassFactory;
 import mx.core.EventPriority;
 import mx.core.IFactory;
 import mx.core.IFlexModuleFactory;
@@ -39,12 +43,14 @@
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
 import mx.core.mx_internal;
-import mx.core.UIComponent;
-import mx.controls.listClasses.IDropInListItemRenderer;
+import mx.events.FlexEvent;
 import mx.events.SandboxMouseEvent;
 import mx.managers.FocusManager;
 import mx.managers.IFocusManager;
 import mx.managers.IFocusManagerComponent;
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+import mx.utils.StringUtil;

 import spark.components.supportClasses.CellPosition;
 import spark.components.supportClasses.GridColumn;
@@ -55,6 +61,7 @@
 import spark.components.IGridItemRenderer;
 import spark.events.GridEvent;
 import spark.events.GridItemEditorEvent;
+import flash.debugger.enterDebugger;

 use namespace mx_internal;

@@ -88,6 +95,24 @@
     //--------------------------------------------------------------------------
     /**
      *  @private
+     *  Timer used to cancel edits it a double click occurs.
+     */
+    private var doubleClickTimer:Timer;
+
+    /**
+     *  @private
+     *  True if we have received double click event since the last click.
+     */
+    private var gotDoubleClickEvent:Boolean;
+
+    /**
+     *  @private
+     *  True if we have received a FlexEvent.ENTER.
+     */
+    private var gotFlexEnterEvent:Boolean;
+
+    /**
+     *  @private
      *  The state of the grid selection at the last selection snapshot. Used in
      *  row selection mode.
      */
@@ -106,6 +131,27 @@
      */
     private var lastEvent:Event;

+    /**
+     *  @private
+     *  Position of the last item renderer that was clicked.
+     */
+    private var lastItemClickedPosition:Object;
+
+    /**
+     *  @private
+     *  Used to make sure the mouse up is on the same item
+     *  renderer as the mouse down.
+     */
+    private var lastItemDown:IVisualElement;
+
+    /**
+     *  @private
+     *  the last editedItemPosition and the last
+     *  position where editing was attempted if editing
+     *  was cancelled.  We restore editing
+     *  to this point if we get focus from the TAB key
+     */
+    private var lastEditedItemPosition:*;

     /**
      *  @private
@@ -163,48 +209,7 @@
     /**
      *  @private
      */
-    private var bEditedItemPositionChanged:Boolean = false;
-
-    /**
-     *  @private
-     *  undefined means we've processed it
-     *  null means don't put up an editor
-     *  {} is the coordinates for the editor
-     */
-    private var _proposedEditedItemPosition:*;
-
-    /**
-     *  @private
-     *
-     *  Used to make sure the mouse up is on the same item
-     *  renderer as the mouse down.
-     */
-    private var lastItemDown:IVisualElement;
-
-    /**
-     *  @private
-     */
-    private var lastItemFocused:DisplayObject;
-
-    /**
-     *  @private
-     *  the last editedItemPosition and the last
-     *  position where editing was attempted if editing
-     *  was cancelled.  We restore editing
-     *  to this point if we get focus from the TAB key
-     */
-    private var lastEditedItemPosition:*;
-
-    /**
-     *  @private
-     */
     private var _editedItemPosition:Object;
-
-    /**
-     *  @private
-     */
-    private var itemEditorPositionChanged:Boolean = false;
-

     /**
      *  The column and row index of the item renderer for the
@@ -257,10 +262,6 @@
      */
     private function setEditedItemPosition(coord:Object):void
     {
-//            bEditedItemPositionChanged = true;
-//            _proposedEditedItemPosition = coord;
-//            dataGrid.invalidateDisplayList();
-
         commitEditedItemPosition(coord);
     }

@@ -402,6 +403,7 @@
         grid.addEventListener(MouseEvent.MOUSE_DOWN, grid_mouseDownHandler, false, 1000);
         grid.addEventListener(GridEvent.GRID_MOUSE_DOWN, grid_gridMouseDownHandler);
         grid.addEventListener(GridEvent.GRID_MOUSE_UP, grid_gridMouseUpHandler);
+        grid.addEventListener(GridEvent.GRID_DOUBLE_CLICK, grid_gridDoubleClickHandler);
     }

     /**
@@ -417,6 +419,7 @@
         grid.removeEventListener(MouseEvent.MOUSE_DOWN, grid_mouseDownHandler);
         grid.removeEventListener(GridEvent.GRID_MOUSE_DOWN, grid_gridMouseDownHandler);
         grid.removeEventListener(GridEvent.GRID_MOUSE_UP, grid_gridMouseUpHandler);
+        grid.removeEventListener(GridEvent.GRID_DOUBLE_CLICK, grid_gridDoubleClickHandler);
     }

     /**
@@ -451,13 +454,14 @@
             if (itemEditorInstance)
                 itemEditorInstance.discard();

-            var o:DisplayObject = (itemEditorInstance ?
-                                  itemEditorInstance : editedItemRenderer) as DisplayObject;
-
-            o.removeEventListener(KeyboardEvent.KEY_DOWN, itemEditorInstance_keyDownHandler);
-            o.removeEventListener(FocusEvent.FOCUS_OUT, itemEditorInstance_focusOutHandler);
-            o.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
-
+            var o:IVisualElement = (itemEditorInstance ?
+                                    itemEditorInstance : editedItemRenderer);
+
+            o.removeEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
+            o.removeEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
+            o.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler);
+            addRemoveFlexEventEnterListener(DisplayObject(o), false);
+
             if (grid.focusManager)
                 grid.focusManager.defaultButtonEnabled = true;

@@ -493,14 +497,7 @@
      *
This method sets the editor instance as the
      *  itemEditorInstance property.

      *
-     *
You may only call this method from within the event listener
-     *  for the itemEditBegin event.
-     *  To create an editor at other times, set the
-     *  editedItemPosition property to generate
-     *  the itemEditBegin event.

-     *
      *  @param rowIndex The row index in the data provider of the item to be edited.
-     *
      *  @param columnIndex The column index in the data provider of the item to be edited.
      *
      *  @langversion 3.0
@@ -520,7 +517,7 @@

         // convert the row origin from the grid to the editor layer.
         var globalCellOrigin:Point = grid.localToGlobal(new Point(cellBounds.x, cellBounds.y));
-        var localCellOrigin:Point = cellBounds.topLeft; //DisplayObject(dataGrid.itemEditorLayer).globalToLocal(globalCellOrigin);
+        var localCellOrigin:Point = cellBounds.topLeft;

         _editedItemRenderer = item;

@@ -529,9 +526,6 @@
         saveDataGridHasFocusableChildren = dataGrid.hasFocusableChildren;
         dataGrid.hasFocusableChildren = true;

-//        saveGridHasFocusableChildren = grid.hasFocusableChildren;
-//        grid.hasFocusableChildren = true;
-
         if (dataGrid.scroller)
         {
             saveScrollerHasFocusableChildren = dataGrid.scroller.hasFocusableChildren;
@@ -540,58 +534,37 @@

         if (!col.rendererIsEditable)
         {
-            // if this isn't implemented, use an input control as editor
-            if (!itemEditorInstance)
+            // First use the column's itemEditor.
+            // If that is unspecified try the dataGrid's itemEditor.
+            // If that is unspecified then use the default itemEditor
+            // set on the column.
+            var itemEditor:IFactory = col.itemEditor;
+            if (!itemEditor)
+                itemEditor = dataGrid.itemEditor;
+            if (!itemEditor)
+                itemEditor = GridColumn.defaultItemEditorFactory;
+
+            if (itemEditor == GridColumn.defaultItemEditorFactory)
             {
-                // First use the column's itemEditor.
-                // If that is unspecified try the dataGrid's itemEditor.
-                // If that is unspecified then use the default itemEditor
-                // set on the column.
-                var itemEditor:IFactory = col.itemEditor;
-                if (!itemEditor)
-                    itemEditor = dataGrid.itemEditor;
-                if (!itemEditor)
-                    itemEditor = GridColumn.defaultItemEditorFactory;
-
-
-                //                if (itemEditor == DataGridColumn.defaultItemEditorFactory)
-                //                {
-                //                    // if it is the default factory, see if someone
-                //                    // overrode it with this style
-                //                    var c:Class = getStyle("defaultDataGridItemEditor");
-                //                    if (c)
-                //                    {
-                //                        var fontName:String =
-                //                            StringUtil.trimArrayElements(col.getStyle("fontFamily"), ",");
-                //                        var fontWeight:String = col.getStyle("fontWeight");
-                //                        var fontStyle:String = col.getStyle("fontStyle");
-                //                        var bold:Boolean = (fontWeight == "bold");
-                //                        var italic:Boolean = (fontStyle == "italic");
-                //
-                //                        var flexModuleFactory:IFlexModuleFactory =
-                //                            getFontContext(fontName, bold, italic);
-                //
-                //                        itemEditor = col.itemEditor = new ContextualClassFactory(
-                //                            c, flexModuleFactory);
-                //                    }
-                //                }
-
-                itemEditorInstance = itemEditor.newInstance();
-                itemEditorInstance.owner = dataGrid;
-                itemEditorInstance.data = IGridItemRenderer(item).data;
-                itemEditorInstance.rowIndex = rowIndex;
-                itemEditorInstance.columnIndex = columnIndex;
-                itemEditorInstance.column = col;
-                if (itemEditorInstance.data && col.dataField)
-                    itemEditorInstance.value = itemEditorInstance.data[col.dataField];
-                else
-                    itemEditorInstance.value = null;
-
-                itemEditorInstance.hasFocusableChildren = true;
-
-                UIComponent(itemEditorInstance).styleName = item;
-                grid.addElement(itemEditorInstance);
+                // if it is the default factory, see if someone
+                // overrode it with this style
+                var c:Class = dataGrid.getStyle("defaultDataGridItemEditor");
+                if (c)
+                {
+                    itemEditor = col.itemEditor = new ClassFactory(c);
+                }
             }
+
+            itemEditorInstance = itemEditor.newInstance();
+            itemEditorInstance.owner = dataGrid;
+            itemEditorInstance.rowIndex = rowIndex;
+            itemEditorInstance.column = col;
+            itemEditorInstance.hasFocusableChildren = true;
+            if (itemEditorInstance is ISimpleStyleClient)
+                ISimpleStyleClient(itemEditorInstance).styleName = item;
+            itemEditorInstance.data = IGridItemRenderer(item).data;
+
+            grid.addElement(itemEditorInstance);

             // position the editor over the cell with the same size as the cell.
             itemEditorInstance.width = cellBounds.width;
@@ -605,11 +578,12 @@
             itemEditorInstance.prepare();
             itemEditorInstance.visible = true;

-            itemEditorInstance.addEventListener(FocusEvent.FOCUS_OUT, itemEditorInstance_focusOutHandler);
+            itemEditorInstance.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);

             // listen for keyStrokes on the itemEditorInstance (which lets the grid supervise for ESC/ENTER)
-            itemEditorInstance.addEventListener(KeyboardEvent.KEY_DOWN, itemEditorInstance_keyDownHandler);
-            itemEditorInstance.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 1000);
+            itemEditorInstance.addEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
+            itemEditorInstance.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler, false, 1000);
+            addRemoveFlexEventEnterListener(DisplayObject(itemEditorInstance), true);
         }
         else
         {
@@ -654,14 +628,21 @@
                 fm.fauxFocus = null;

                 if (found)
+                {
                     fm.setFocus(IFocusManagerComponent(o));
+
+                    // Since we may have gotton here with the F2 key show the focus
+                    // indicator to make it obvious which control has focus.
+                    fm.showFocus();
+                }

-                editedItemRenderer.addEventListener(FocusEvent.FOCUS_OUT, itemEditorInstance_focusOutHandler);
+                editedItemRenderer.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);

                 // listen for keyStrokes on the itemEditorInstance (which lets the grid supervise for ESC/ENTER)
-                editedItemRenderer.addEventListener(KeyboardEvent.KEY_DOWN, itemEditorInstance_keyDownHandler);
-                editedItemRenderer.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 1000);
-
+                editedItemRenderer.addEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
+                editedItemRenderer.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler, false, 1000);
+                addRemoveFlexEventEnterListener(DisplayObject(editedItemRenderer), true);
+
                 // It would be nice to hide the selection on the cell while it is
                 // being edited to provide better contrast for the focus rect
                 // around the controls.
@@ -703,12 +684,12 @@
     public function startItemEditorSession(rowIndex:int, columnIndex:int):Boolean
     {

-        dataGrid.addEventListener(GridItemEditorEvent.START_GRID_ITEM_EDITOR_SESSION,
+        dataGrid.addEventListener(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING,
                                   dataGrid_startItemEditorSessionHandler,
                                   false, EventPriority.DEFAULT_HANDLER);

         var dataGridEvent:GridItemEditorEvent =
-            new GridItemEditorEvent(GridItemEditorEvent.START_GRID_ITEM_EDITOR_SESSION, false, true);
+            new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING, false, true);

         // The START_GRID_ITEM_EDITOR_SESSION event is cancelable
         dataGridEvent.rowIndex = Math.min(rowIndex, grid.dataProvider.length - 1);
@@ -724,7 +705,7 @@
             dataGrid.grid.caretColumnIndex = columnIndex;
         }

-        dataGrid.removeEventListener(GridItemEditorEvent.START_GRID_ITEM_EDITOR_SESSION,
+        dataGrid.removeEventListener(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING,
                                      dataGrid_startItemEditorSessionHandler);

         return editorStarted;
@@ -768,7 +749,6 @@
         if (itemEditorInstance)
         {
             // send the cancel event and tear down the editor.
-            itemEditorInstance.cancel();
             dispatchCancelEvent();
             destroyItemEditor();
         }
@@ -790,7 +770,7 @@
     private function dispatchCancelEvent():void
     {
         var dataGridEvent:GridItemEditorEvent =
-            new GridItemEditorEvent(GridItemEditorEvent.CANCEL_GRID_ITEM_EDITOR_SESSION);
+            new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_CANCEL);

         dataGridEvent.columnIndex = editedItemPosition.columnIndex;
         dataGridEvent.column = itemEditorInstance.column;
@@ -832,7 +812,7 @@
         }

         var dataGridEvent:GridItemEditorEvent =
-            new GridItemEditorEvent(GridItemEditorEvent.SAVE_GRID_ITEM_EDITOR_SESSION, false, true);
+            new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_SAVE, false, true);

         // SAVE_GRID_ITEM_EDITOR_SESSION events are cancelable
         dataGridEvent.columnIndex = itemPosition.columnIndex;
@@ -919,7 +899,7 @@

         // Notify event that a new editor is starting.
         var dataGridEvent:GridItemEditorEvent =
-            new GridItemEditorEvent(GridItemEditorEvent.OPEN_GRID_ITEM_EDITOR_SESSION);
+            new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_START);

         dataGridEvent.columnIndex = editedItemPosition.columnIndex;
         dataGridEvent.column = column;
@@ -978,8 +958,35 @@

     /**
      *  @private
+     *  Start an editor session in the next editable cell.
+     *
+     *  @param rowIndex zero-based row index to start search from, inclusive.
+     *  @param columnIndex zero-based column index to start search from, not inclusive.
+     *  @param backward - if true move backward column by column and then row by row.
+     *  If false, then move forward column by column, row by row.
+     *
+     */
+    private function openEditorInNextEditableCell(rowIndex:int, columnIndex:int, backward:Boolean):void
+    {
+        var nextCell:Point = new Point(rowIndex, columnIndex);
+        var openedEditor:Boolean = false;
+
+        do
+        {
+            nextCell = getNextEditableCell(nextCell.x, nextCell.y, backward);
+
+            if (nextCell)
+                openedEditor = startItemEditorSession(nextCell.x, nextCell.y);
+        } while (nextCell && !openedEditor);
+
+    }
+
+    /**
+     *  @private
      *  Find the next editable cell.
      *
+     *  @param rowIndex zero-based row index to start search from, inclusive.
+     *  @param columnIndex zero-based column index to start search from, not inclusive.
      *  @param backward - if true move backward column by column and then row by row.
      *  If false, then move forward column by column, row by row.
      *
@@ -1054,6 +1061,45 @@

         return false;
     }
+
+    /**
+     *  @private
+     *
+     *  Add a FlexEvent.ENTER listener to all child IVisualElements.
+     *
+     *  @param element add listener to element and its children.
+     *  @param addListener if true add a listener, otherwise remove a listener.
+     */
+    private function addRemoveFlexEventEnterListener(element:DisplayObject, addListener:Boolean):void
+    {
+        if (addListener)
+            element.addEventListener(FlexEvent.ENTER, editor_enterHandler);
+        else
+            element.removeEventListener(FlexEvent.ENTER, editor_enterHandler);
+
+        if (element is DisplayObjectContainer)
+        {
+            var container:DisplayObjectContainer = DisplayObjectContainer(element);
+            var n:int = container.numChildren;
+            for (var i:int = 0; i < n; i++)
+            {
+                var child:DisplayObject = container.getChildAt(i);
+
+                if (child is DisplayObjectContainer)
+                {
+                    addRemoveFlexEventEnterListener(child, addListener);
+                }
+                else
+                {
+                    if (addListener)
+                        child.addEventListener(FlexEvent.ENTER, editor_enterHandler);
+                    else
+                        child.removeEventListener(FlexEvent.ENTER, editor_enterHandler);
+                }
+            }
+        }
+
+    }

     //--------------------------------------------------------------------------
     //
@@ -1071,6 +1117,9 @@
         if (!dataGrid.editable)
             return;

+        if (event.isDefaultPrevented())
+            return;
+
         lastEvent = event;

         if (event.keyCode == dataGrid.editKey)
@@ -1079,23 +1128,21 @@
             if (itemEditorInstance)
                 return;

-            // Edit the last column edited. If now last column then try to
+            // Edit the last column edited. If no last column then try to
             // edit the first column.
             var nextCell:Point = null;
             if (dataGrid.isRowSelectionMode())
             {
                 var lastColumn:int = lastEditedItemPosition ? lastEditedItemPosition.columnIndex : 0;
-                nextCell = getNextEditableCell(dataGrid.grid.caretRowIndex,
-                    lastColumn - 1,
-                    false);
+                openEditorInNextEditableCell(dataGrid.grid.caretRowIndex,
+                                                        lastColumn - 1,
+                                                        false);
+                return;
             }
             else
             {
-                nextCell = new Point(grid.caretRowIndex, grid.caretColumnIndex);
+                startItemEditorSession(grid.caretRowIndex, grid.caretColumnIndex);
             }
-
-            if (nextCell)
-                startItemEditorSession(nextCell.x, nextCell.y);
         }
     }

@@ -1135,6 +1182,10 @@
      */
     private function grid_gridMouseDownHandler(event:GridEvent):void
     {
+        //trace("grid_gridMouseDownHandler");
+
+        gotDoubleClickEvent = false;
+
         if (!dataGrid.editable || editorOwnsClick(event))
             return;

@@ -1177,13 +1228,15 @@
      */
     private function grid_gridMouseUpHandler(event:GridEvent):void
     {
+        //trace("grid_gridMouseUpHandler");
+
         if (!dataGrid.editable)
             return;

         lastEvent = event;

-        const eventRowIndex:int = event.rowIndex; //gridDimensions.getRowIndexAt(eventGridXY.x, eventGridXY.y);
-        const eventColumnIndex:int = event.columnIndex; //gridDimensions.getColumnIndexAt(eventGridXY.x, eventGridXY.y);
+        const eventRowIndex:int = event.rowIndex;
+        const eventColumnIndex:int = event.columnIndex;

         // Only start an edit if the row is the only selected row.
         // Only start editing when one row is selected.
@@ -1193,24 +1246,55 @@
         const rowIndex:int = eventRowIndex;
         var columnIndex:int = eventColumnIndex;

-        var r:IVisualElement = event.itemRenderer; // grid.getItemRendererAt(rowIndex, eventColumnIndex);
+        var r:IVisualElement = event.itemRenderer;
         //trace("grid_gridMouseUpHandler: itemRenderer = " + event.itemRenderer);
         if (r && r != editedItemRenderer &&
             (lastItemDown == r || (lastItemDown && grid.contains(DisplayObject(lastItemDown)))))
         {
             // if lastItemDown != r, we clicked in one cell and dragged to another.
-            // if lastItemFocused is in that cell, then we give lastItemDown the
-            // edit session
             if (lastItemDown != r)
                 r = lastItemDown;
-
-            lastItemFocused = null;

             if (columnIndex >= 0 && dataGrid.editable && !dontEdit)
             {
                 if (grid.columns.getItemAt(columnIndex).editable)
                 {
-                    startItemEditorSession(rowIndex, columnIndex);
+                    // Check if clicking again on the same item
+                    if (doubleClickTimer)
+                    {
+                        if (rowIndex == lastItemClickedPosition.rowIndex &&
+                            columnIndex == lastItemClickedPosition.columnIndex)
+                        {
+                            // Clicked on the same item again and we
+                            // already have a timer. Wait on the existing timer.
+                            lastItemDown == null;
+                            return;
+                        }
+                        else
+                        {
+                            // Clicked on a different item. Stop the timer and start a new one
+                            doubleClickTimer.stop();
+                            doubleClickTimer = null;
+                        }
+                    }
+
+                    lastItemClickedPosition = { columnIndex: columnIndex, rowIndex: rowIndex};
+
+                    // If double click is not enabled or we want a double click to open an
+                    // editor, then open the editor directly now. Otherwise start a timer
+                    // and wait to see if a double click comes in that will cancel the edit.
+                    if (dataGrid.editOnDoubleClick ||
+                        InteractiveObject(lastItemDown).doubleClickEnabled == false)
+                    {
+                        // we don't need to wait on the time since editting double click is ok.
+                        startItemEditorSession(rowIndex, columnIndex);
+                    }
+                    else
+                    {
+                        doubleClickTimer = new Timer(dataGrid.doubleClickTime, 1);
+                        doubleClickTimer.addEventListener(TimerEvent.TIMER, doubleClickTimerHandler);
+                        doubleClickTimer.start();
+                    }
                 }
                 else
                     // if the item is not editable, set lastPosition to it anyways
@@ -1224,7 +1308,40 @@
             {
                 if (grid.columns.getItemAt(columnIndex).editable)
                 {
-                    startItemEditorSession(rowIndex, columnIndex);
+                    // Check if clicking again on the same item
+                    if (doubleClickTimer)
+                    {
+                        if (rowIndex == lastItemClickedPosition.rowIndex &&
+                            columnIndex == lastItemClickedPosition.columnIndex)
+                        {
+                            // click on the same item again and we already have a timer
+                            // do, wait on the timer
+                            lastItemDown == null;
+                            return;
+                        }
+                        else
+                        {
+                            // click on a different item. Stop the timer and start a new one
+                            doubleClickTimer.stop();
+                            doubleClickTimer = null;
+                        }
+                    }
+
+                    lastItemClickedPosition = { columnIndex: columnIndex, rowIndex: rowIndex};
+
+                    // start timer to make sure a double click does not cancel the edit.
+                    if (dataGrid.editOnDoubleClick ||
+                        InteractiveObject(lastItemDown).doubleClickEnabled == false)
+                    {
+                        // we don't need to wait on the time since editting double click is ok.
+                        startItemEditorSession(rowIndex, columnIndex);
+                    }
+                    else
+                    {
+                        doubleClickTimer = new Timer(dataGrid.doubleClickTime, 1);
+                        doubleClickTimer.addEventListener(TimerEvent.TIMER, doubleClickTimerHandler);
+                        doubleClickTimer.start();
+                    }
                 }
                 else
                     // if the item is not editable, set lastPosition to it anyways
@@ -1235,30 +1352,44 @@

         lastItemDown = null;
     }
-
-   /**
-     *  @private
-     *  Closes the itemEditorInstance if the foucs is outside of the dataGrid.
-     */
-    private function itemEditorInstance_focusOutHandler(event:FocusEvent):void
-    {
-        //trace("itemEditorInstance_focusOutHandler " + event.relatedObject);
-        if (event.relatedObject &&
-           ((itemEditorInstance && DisplayObjectContainer(itemEditorInstance).contains(event.relatedObject)) ||
-           (editedItemRenderer && DisplayObjectContainer(editedItemRenderer).contains(event.relatedObject))) ||
-            dataGrid.contains(event.relatedObject))
-            return;
-
-        // ignore textfields losing focus on mousedowns
-        if (!event.relatedObject)
-            return;
-
-        if (itemEditorInstance || editedItemRenderer)
-            dataGrid.endItemEditorSession();
-        else
-            destroyItemEditor();
-
-    }
+
+    /**
+     *  @private
+     *
+     *  If clicked on a the same cell as mouse down then start editing the cell.
+     */
+    private function grid_gridDoubleClickHandler(event:GridEvent):void
+    {
+        //trace("grid_gridDoubleClickHandler: got double click");
+
+        if (!dataGrid.editable)
+            return;
+
+        lastEvent = event;
+
+        gotDoubleClickEvent = true;
+    }
+
+    /**
+     *  @private
+     *
+     *  Timer for double click events.
+     */
+    private function doubleClickTimerHandler(event:TimerEvent):void
+    {
+        //trace("doubleClickTimerHandler");
+
+        doubleClickTimer.removeEventListener(TimerEvent.TIMER, doubleClickTimerHandler);
+        doubleClickTimer = null;
+
+        if (!gotDoubleClickEvent)
+        {
+            dataGrid.startItemEditorSession(lastItemClickedPosition.rowIndex, lastItemClickedPosition.columnIndex);
+        }
+
+        gotDoubleClickEvent = false;
+    }
+

     /**
      *  @private
@@ -1296,12 +1427,60 @@

     /**
      *  @private
+     *  Closes the itemEditorInstance if the foucs is outside of the dataGrid.
+     */
+    private function editor_focusOutHandler(event:FocusEvent):void
+    {
+        //trace("editor_focusOutHandler " + event.relatedObject);
+        if (event.relatedObject &&
+            ((itemEditorInstance && DisplayObjectContainer(itemEditorInstance).contains(event.relatedObject)) ||
+                (editedItemRenderer && DisplayObjectContainer(editedItemRenderer).contains(event.relatedObject))) ||
+            dataGrid.contains(event.relatedObject))
+            return;
+
+        // ignore textfields losing focus on mousedowns
+        if (!event.relatedObject)
+            return;
+
+        if (itemEditorInstance || editedItemRenderer)
+            dataGrid.endItemEditorSession();
+        else
+            destroyItemEditor();
+
+    }
+
+    /**
+     *  @private
+     *  Handle the ENTER event by closing the editor.
+     */
+    private function editor_enterHandler(event:FlexEvent):void
+    {
+        //trace("FlexEvent" );
+        gotFlexEnterEvent = true;
+    }
+
+    /**
+     *  @private
      *
      *  Handle keys on the editor to stop the editing session.
      */
-    private function itemEditorInstance_keyDownHandler(event:KeyboardEvent):void
+    private function editor_keyDownHandler(event:KeyboardEvent):void
     {
         //trace("keyboard event = " + event);
+        if (event.isDefaultPrevented())
+        {
+            // Special case the ENTER key since TextArea cancels the ENTER when it
+            // doesn't use it but instead if dispatched an FlexEvent.ENTER.
+            // The problem is the ENTER event does not have the control and
+            // shift key flags we need.
+            if (!(event.charCode == Keyboard.ENTER && gotFlexEnterEvent))
+            {
+                gotFlexEnterEvent = false;
+                return;
+            }
+        }
+
+        gotFlexEnterEvent = false;

         // ESC just kills the editor, no new data
         if (event.keyCode == Keyboard.ESCAPE)
@@ -1315,10 +1494,6 @@
         else if (event.charCode == Keyboard.ENTER && event.keyCode != 229)
         {
             if (!_editedItemPosition)
-                return;
-
-            // multiline editors can take the enter key.
-            if (itemEditorInstance && itemEditorInstance.editorUsesEnterKey)
                 return;

             // Enter closes the editor.
@@ -1342,18 +1517,45 @@

                     // If we have a valid next row, then start another editor.
                     if (lastRow >= 0 && lastRow < dataGrid.dataProvider.length)
-                    {
-                        var nextCell:Point = getNextEditableCell(lastRow,
-                                                                 lastColumn - 1,
-                                                                 false);
-                        if (nextCell)
-                            startItemEditorSession(nextCell.x, nextCell.y);
-                    }
+                        openEditorInNextEditableCell(lastRow, lastColumn - 1, false);
                 }
             }
         }
     }

+    /**
+     *  @private
+     *  handle focus changes generated from keyboard keys.
+     */
+    private function editor_keyFocusChangeHandler(event:FocusEvent):void
+    {
+        // if we tabbed out of the edit then prevent the tab and
+        // save the edit. Next start up a new edit session in the
+        // next cell.
+        //trace("editor_editor_keyFocusChangeHandler");
+
+        if (itemEditorInstance || editedItemRenderer)
+        {
+            if (event.isDefaultPrevented())
+                return;
+
+            var nextObject:IFocusManagerComponent = grid.focusManager.getNextFocusManagerComponent(event.shiftKey);
+            if (nextObject == itemEditorInstance ||
+                (itemEditorInstance && !DisplayObjectContainer(itemEditorInstance).contains(DisplayObject(nextObject))) ||
+                (!itemEditorInstance &&
+                    (nextObject == editedItemRenderer ||
+                        (editedItemRenderer && !DisplayObjectContainer(editedItemRenderer).contains(DisplayObject(nextObject))))))
+            {
+                event.preventDefault();
+                dataGrid.endItemEditorSession();
+
+                openEditorInNextEditableCell(lastEditedItemPosition.rowIndex,
+                    lastEditedItemPosition.columnIndex,
+                    event.shiftKey);
+            }
+        }
+    }
+
     /**
      *  @private
      */
@@ -1404,37 +1606,6 @@
         return false;
     }

-    /**
-     *  @private
-     *  handle focus changes generated from keyboard keys.
-     */
-    private function keyFocusChangeHandler(event:FocusEvent):void
-    {
-        // if we tabbed out of the edit then prevent the tab and
-        // save the edit. Next start up a new edit session in the
-        // next cell.
-        //trace("keyFocusChangeHandler");
-
-        if (itemEditorInstance || editedItemRenderer)
-        {
-            var nextObject:IFocusManagerComponent = grid.focusManager.getNextFocusManagerComponent(event.shiftKey);
-            if (nextObject == itemEditorInstance ||
-                (itemEditorInstance && !DisplayObjectContainer(itemEditorInstance).contains(DisplayObject(nextObject))) ||
-                (!itemEditorInstance &&
-                (nextObject == editedItemRenderer ||
-                (editedItemRenderer && !DisplayObjectContainer(editedItemRenderer).contains(DisplayObject(nextObject))))))
-            {
-                event.preventDefault();
-                dataGrid.endItemEditorSession();
-
-                var nextCellPosition:Point = getNextEditableCell(lastEditedItemPosition.rowIndex,
-                                                                 lastEditedItemPosition.columnIndex,
-                                                                 event.shiftKey);
-                if (nextCellPosition)
-                    startItemEditorSession(nextCellPosition.x, nextCellPosition.y);
-            }
-        }
-    }

 }
 }