Transferred from the Adobe Open Source Subversion Repository

Revision: 3451
Author:   egreenfi@adobe.com
Date:     2008-10-02T05:10:18.410127Z

Log Message:
-----------
- UIComponents, GraphicElements's matrix used for layout calculations, and set by the parent layouts, is now decoupled from the actual layout used by the flash player for rendering.
- Both UIComponents an d GraphicElements can be handed a TransformOffset object. The transformOffset allows developers to specify adjustments to the transform as defined by the compoennts parent layout.
- 3D properties on components and graphic elements are now supported.  Setting a 3D property or a 3D matrix on a component or element will affect it visually, but the 2D layouts will continue to lay out as though only the 2D portion of their layout is applied.
- transformX,Y,Z now fully supported on components and elements.  For layouts that don't try and set the post transform bounds (i.e., absolute layout without constraints), the layout scale and rotation will be centered on this point.  The offset transform will also be centered around this point.
- layering is now decoupled from item order.  By default, components now render in order based on the value of their 'layer' property.  All components' layers default to 0.  components with the same layer render in the order they appear in their parent group's item list.
- setting transform.matrix on UIComponent is now supported, and is roughly the same as setting the convenience layout properties on the component.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/.flexProperties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/utilities/build.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/ITransformable.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/.actionScriptProperties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/frameworkSwcExceptionsList.txt</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/haloclassic/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/LayoutItemUIC.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/framework/.actionScriptProperties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4/.flexLibProperties</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom</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/flex/graphics/Parser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/framework/.flexLibProperties</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4/.actionScriptProperties</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/geom/Transform.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/flex/geom/Transform.as" copyfrom-rev="3342" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/Transform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TransformUtil.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/TransformOffset.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/fxg-manifest.xml</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -10,10 +10,11 @@
 import flash.events.IEventDispatcher;
 import flash.geom.ColorTransform;
 import flash.geom.Matrix;
+import flash.geom.Matrix3D;
 import flash.geom.Point;
 import flash.geom.Transform;

-import flex.geom.Transform;
+import mx.geom.Transform;
 import flex.graphics.IDisplayObjectElement;
 import flex.graphics.IGraphicElement;
 import flex.graphics.IGraphicElementHost;
@@ -23,7 +24,9 @@

 import mx.core.IConstraintClient;
 import mx.core.IInvalidating;
+import mx.core.TransformOffset;
 import mx.core.UIComponentGlobals;
+import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
 import mx.events.PropertyChangeEvent;
@@ -32,12 +35,15 @@
 import mx.filters.IBitmapFilter;
 import mx.graphics.IStroke;
 import mx.managers.ILayoutManagerClient;
+import mx.core.IVisualItem;
+import flash.utils.Dictionary;
+

 use namespace mx_internal;

 public class GraphicElement extends EventDispatcher
     implements IGraphicElement, ILayoutItem, IConstraintClient,
-    IDisplayObjectElement, IInvalidating
+    IDisplayObjectElement, IInvalidating, IVisualItem
 {
     include "../../core/Version.as";

@@ -87,6 +93,9 @@
     public function GraphicElement()
     {
         super();
+        xformOffsets = new TransformOffset();
+		xformOffsets.userVisible = false;
+		xformOffsets.addEventListener(Event.CHANGE,transformOffsetsChangedHandler);
     }

     //--------------------------------------------------------------------------
@@ -94,17 +103,6 @@
     //  Variables
     //
     //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Storage for the transform property.
-     */
-    private var _matrix:Matrix;
-
-    /**
-     *  @private
-     */
-    private var matrixChanged:Boolean;

     /**
      *  @private
@@ -121,6 +119,11 @@
      */
     private var isMaskInElementSpace:Boolean;

+    /**
+     *  @private
+     */
+	private var _layer:Number = 0;
+
     /**
      *  @private
      *  Whether this element needs to have its
@@ -142,12 +145,62 @@
      */
     mx_internal var invalidateDisplayListFlag:Boolean = false;

+
+    /**
+     *  Documentation is not currently available.
+     */
+	protected var xformOffsets:TransformOffset;
     //--------------------------------------------------------------------------
     //
     //  Properties: IGraphicElement
     //
     //--------------------------------------------------------------------------
-
+
+    [Bindable("propertyChange")]
+	public function get offsets():TransformOffset
+	{
+		return (xformOffsets != null && xformOffsets.userVisible == true)? xformOffsets:null;
+	}
+	public function set offsets(userValue:TransformOffset):void
+	{
+		var oldValue:TransformOffset = xformOffsets;
+		var value:TransformOffset = userValue;
+
+		if(value == null)
+		{
+			value = new TransformOffset();
+			value.userVisible = false;
+		}
+
+		if(value != null && oldValue != null)
+			value.initFrom(oldValue);
+
+		if(xformOffsets != null)
+			xformOffsets.removeEventListener(Event.CHANGE,transformOffsetsChangedHandler);
+		xformOffsets = value;
+		if(xformOffsets != null)
+			xformOffsets.addEventListener(Event.CHANGE,transformOffsetsChangedHandler);
+
+        dispatchPropertyChangeEvent("offsets", oldValue, userValue);
+	}
+
+
+	protected function invalidateTransform(changeInvalidatesLayering:Boolean = true,triggerLayout:Boolean = true):void
+	{
+        if(changeInvalidatesLayering)
+        	notifyElementLayerChanged();
+        if(triggerLayout)
+        {
+    	    invalidateParentSizeAndDisplayList();
+        }
+        xformOffsets.updatePending = true;
+	}
+
+    private function transformOffsetsChangedHandler(e:Event):void
+	{
+		invalidateTransform();
+	}
+
     //----------------------------------
     //  alpha
     //----------------------------------
@@ -517,6 +570,7 @@

     [Bindable("propertyChange")]
     [Inspectable(category="General")]
+    [PercentProxy("percentHeight")]

     /**
      *  The height of the graphic element.
@@ -531,6 +585,7 @@
     /**
      *  @private
      */
+
     public function set height(value:Number):void
     {
         explicitHeight = value;
@@ -1089,16 +1144,6 @@
     //  rotation
     //----------------------------------

-    /**
-     *  @private
-     *  Storage for the rotation property.
-     */
-    private var _rotation:Number = 0;
-
-    /**
-     *  @private
-     */
-    private var rotationChanged:Boolean;

     [Bindable("propertyChange")]
     [Inspectable(category="General")]
@@ -1107,43 +1152,97 @@
      *  Indicates the rotation of the element, in degrees,
      *  from the transform point.
      */
+    public function get rotationX():Number
+    {
+        return xformOffsets.layoutRotationX;
+    }
+
+    /**
+     *  @private
+     */
+    public function set rotationX(value:Number):void
+    {
+        var oldValue:Number = xformOffsets.layoutRotationX;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutRotationX = value;
+        dispatchPropertyChangeEvent("rotationX", oldValue, value);
+		invalidateTransform();
+    }
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Indicates the rotation of the element, in degrees,
+     *  from the transform point.
+     */
+    public function get rotationY():Number
+    {
+        return xformOffsets.layoutRotationY;
+    }
+
+    /**
+     *  @private
+     */
+    public function set rotationY(value:Number):void
+    {
+        var oldValue:Number = xformOffsets.layoutRotationY;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutRotationY = value;
+        dispatchPropertyChangeEvent("rotationY", oldValue, value);
+		invalidateTransform();
+    }
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Indicates the rotation of the element, in degrees,
+     *  from the transform point.
+     */
+    public function get rotationZ():Number
+    {
+        return xformOffsets.layoutRotationZ;
+    }
+
+    /**
+     *  @private
+     */
+    public function set rotationZ(value:Number):void
+    {
+        var oldValue:Number = xformOffsets.layoutRotationZ;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutRotationZ = value;
+        dispatchPropertyChangeEvent("rotationZ", oldValue, value);
+        dispatchPropertyChangeEvent("rotation", oldValue, value);
+		invalidateTransform();
+    }
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Indicates the rotation of the element, in degrees,
+     *  from the transform point.
+     */
     public function get rotation():Number
     {
-        return _rotation;
-    }
-
-    /**
-     *  @private
-     */
+        return xformOffsets.layoutRotationZ;
+    }
     public function set rotation(value:Number):void
     {
-        if (_rotation == value)
-            return;
-
-        var oldValue:Number = _rotation;
-        _rotation = value;
-        dispatchPropertyChangeEvent("rotation", oldValue, value);
-
-        rotationChanged = true;
-        notifyElementLayerChanged();
-        invalidateProperties();
-        invalidateParentSizeAndDisplayList();
+    	rotationZ = value;
     }

     //----------------------------------
     //  scaleX
     //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the scaleX property.
-     */
-    mx_internal var _scaleX:Number = 1.0;
-
-    /**
-     *  @private
-     */
-    private var scaleXChanged:Boolean;

     [Bindable("propertyChange")]
     [Inspectable(category="General")]
@@ -1154,7 +1253,7 @@
      */
     public function get scaleX():Number
     {
-        return _scaleX;
+        return xformOffsets.layoutScaleX;
     }

     /**
@@ -1162,34 +1261,18 @@
      */
     public function set scaleX(value:Number):void
     {
-        if (_scaleX == value)
-            return;
-
-        var oldValue:Number = _scaleX;
-        _scaleX = value;
+        var oldValue:Number = xformOffsets.layoutScaleX;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutScaleX = value;
         dispatchPropertyChangeEvent("scaleX", oldValue, value);
-
-        scaleXChanged = true;
-        notifyElementLayerChanged();
-        invalidateProperties();
-        // Parent layout takes transform into account
-        invalidateParentSizeAndDisplayList();
+		invalidateTransform();
     }

     //----------------------------------
     //  scaleY
     //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the scaleY property.
-     */
-    mx_internal var _scaleY:Number = 1.0;
-
-    /**
-     *  @private
-     */
-    private var scaleYChanged:Boolean;

     [Bindable("propertyChange")]
     [Inspectable(category="General")]
@@ -1200,7 +1283,7 @@
      */
     public function get scaleY():Number
     {
-        return _scaleY;
+        return xformOffsets.layoutScaleY;
     }

     /**
@@ -1208,18 +1291,43 @@
      */
     public function set scaleY(value:Number):void
     {
-        if (_scaleY == value)
-            return;
-
-        var oldValue:Number = _scaleY;
-        _scaleY = value;
+        var oldValue:Number = xformOffsets.layoutScaleY;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutScaleY = value;
         dispatchPropertyChangeEvent("scaleY", oldValue, value);
-
-        scaleYChanged = true;
-        notifyElementLayerChanged();
-        invalidateProperties();
-        // Parent layout takes transform into account
-        invalidateParentSizeAndDisplayList();
+		invalidateTransform();
+    }
+
+    //----------------------------------
+    //  scaleZ
+    //----------------------------------
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  The z scale (percentage) of the element
+     *  as applied from the transform point.
+     */
+    public function get scaleZ():Number
+    {
+        return xformOffsets.layoutScaleZ;
+    }
+
+    /**
+     *  @private
+     */
+    public function set scaleZ(value:Number):void
+    {
+        var oldValue:Number = xformOffsets.layoutScaleZ;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutScaleZ = value;
+        dispatchPropertyChangeEvent("scaleZ", oldValue, value);
+		invalidateTransform();
     }

     //----------------------------------
@@ -1282,8 +1390,8 @@
     public function set transform(value:flash.geom.Transform):void
     {
         // Clean up the old event listeners
-        var oldTransform:flex.geom.Transform =
-            _transform as flex.geom.Transform;
+        var oldTransform:mx.geom.Transform =
+            _transform as mx.geom.Transform;
         if (oldTransform)
         {
             oldTransform.removeEventListener(
@@ -1291,108 +1399,95 @@
                 transformPropertyChangeHandler);
         }

-        var newTransform:flex.geom.Transform = value as flex.geom.Transform;
+        var newTransform:mx.geom.Transform = value as mx.geom.Transform;

         if (newTransform)
         {
             newTransform.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
                                           transformPropertyChangeHandler);
-            _matrix = value.matrix.clone(); // Make sure it is a copy
+			if(value.matrix != null)
+			{
+				xformOffsets.layoutMatrix = value.matrix;
+			}
+			else if (value.matrix3D != null)
+			{
+				xformOffsets.layoutMatrix3D = value.matrix3D;
+			}
+            _colorTransform = value.colorTransform;
+        }
+        _transform = value;
+        invalidateTransform();
+    }
+
+	/**
+	 * Documentation is not currently available.  the matrix of a component is the transform matrix used to calculate its layout
+	 * relative to its siblings. This matrix is modified by the values of the offset property to determine its final, computed matrix.
+	 */
+	public function get matrix():Matrix
+	{
+		return xformOffsets.layoutMatrix;
+	}
+
+	/**
+	 * @private
+	 */
+	public function set matrix(value:Matrix):void
+	{
+		xformOffsets.matrix = value;
+		invalidateTransform();
+	}
+
+	/**
+	 * Documentation is not currently available.  the matrix of a component is the transform matrix used to calculate its layout
+	 * relative to its siblings. This matrix is modified by the values of the offset property to determine its final, computed matrix.
+	 */
+	public function set matrix3D(value:Matrix3D):void
+	{
+		xformOffsets.matrix3D = value;
+		invalidateTransform();
+	}
+
+	/**
+	 * @private
+	 */
+	public function get matrix3D():Matrix3D
+	{
+		return xformOffsets.layoutMatrix3D;
+	}
+
+    //----------------------------------
+    //  transformX
+    //----------------------------------
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  The x position transform point of the element.
+     */
+    public function get transformX():Number
+    {
+        return xformOffsets.transformX;
+    }
+
+    /**
+     *  @private
+     */
+    public function set transformX(value:Number):void
+    {
+        var oldValue:Number = xformOffsets.transformX;
+        if ( oldValue == value)
+            return;

-            // If the matrix is a delta identity matrix (ie translation only),
-            // grab the translation values out of it, but don't hold on to
-            // the matrix itself.
-            if (TransformUtil.isDeltaIdentity(_matrix))
-            {
-                if (_matrix.tx != _x)
-                {
-                    _x = _matrix.tx;
-                    xChanged = true;
-                }
-
-                if (_matrix.ty != _y)
-                {
-                    _y = _matrix.ty;
-                    yChanged = true;
-                }
-
-                _matrix = null;
-            }
-            else
-            {
-                matrixChanged = true;
-            }
-
-            clearTransformProperties();
-            _colorTransform = value.colorTransform;
-        }
-
-        _transform = value;
-        notifyElementLayerChanged();
-        invalidateProperties();
-        // Parent layout takes transform into account
-        invalidateParentSizeAndDisplayList();
-    }
-
-    //----------------------------------
-    //  transformX
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the transformX property.
-     */
-    private var _transformX:Number = 0;
-
-    /**
-     *  @private
-     */
-    private var transformXChanged:Boolean;
-
-    [Bindable("propertyChange")]
-    [Inspectable(category="General")]
-
-    /**
-     *  The x position transform point of the element.
-     */
-    public function get transformX():Number
-    {
-        return _transformX;
-    }
-
-    /**
-     *  @private
-     */
-    public function set transformX(value:Number):void
-    {
-        if (_transformX == value)
-            return;
-
-        var oldValue:Number = _transformX;
-        _transformX = value;
+        xformOffsets.transformX = value;
         dispatchPropertyChangeEvent("transformX", oldValue, value);
-
-        transformXChanged = true;
-        notifyElementLayerChanged();
-        invalidateProperties();
-        // Parent layout takes transform into account
-        invalidateParentSizeAndDisplayList();
+		invalidateTransform(false);
     }

     //----------------------------------
     //  transformY
     //----------------------------------

-    /**
-     *  @private
-     *  Storage for the transformY property.
-     */
-    private var _transformY:Number = 0;
-
-    /**
-     *  @private
-     */
-    private var transformYChanged:Boolean;

     [Bindable("propertyChange")]
     [Inspectable(category="General")]
@@ -1402,7 +1497,7 @@
      */
     public function get transformY():Number
     {
-        return _transformY;
+        return xformOffsets.transformY;
     }

     /**
@@ -1410,17 +1505,41 @@
      */
     public function set transformY(value:Number):void
     {
-        if (_transformY == value)
-            return;
-        var oldValue:Number = _transformY;
-        _transformY = value;
+        var oldValue:Number = xformOffsets.transformY;
+        if (oldValue == value)
+            return;
+        xformOffsets.transformY = value;
         dispatchPropertyChangeEvent("transformY", oldValue, value);
-
-        transformYChanged = true;
-        notifyElementLayerChanged();
-        invalidateProperties();
-        // Parent layout takes transform into account
-        invalidateParentSizeAndDisplayList();
+		invalidateTransform(false);
+    }
+
+    //----------------------------------
+    //  transformZ
+    //----------------------------------
+
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  The y position transform point of the element.
+     */
+    public function get transformZ():Number
+    {
+        return xformOffsets.transformZ;
+    }
+
+    /**
+     *  @private
+     */
+    public function set transformZ(value:Number):void
+    {
+        var oldValue:Number = xformOffsets.transformZ;
+        if (oldValue == value)
+            return;
+        xformOffsets.transformZ = value;
+        dispatchPropertyChangeEvent("transformZ", oldValue, value);
+		invalidateTransform();
     }

     //----------------------------------
@@ -1471,6 +1590,7 @@

     [Bindable("propertyChange")]
     [Inspectable(category="General")]
+    [PercentProxy("percentWidth")]

     /**
      *  The width of the graphic element.
@@ -1504,19 +1624,25 @@
     }

     //----------------------------------
+    //  layer
+    //----------------------------------
+	public function get layer():Number
+	{
+		return xformOffsets.layer;
+	}
+
+	public function set layer(value:Number):void
+	{
+		if(value == layer)
+			return;
+		 xformOffsets.layer = value;
+		if(_host != null && _host is UIComponent)
+			(_host as UIComponent).invalidateLayering();
+	}
+
+    //----------------------------------
     //  x
     //----------------------------------
-    /**
-     *  @private
-     *  Storage for the x property.
-     */
-    private var _x:Number = 0;
-
-    /**
-     *  @private
-     */
-    private var xChanged:Boolean;
-
     [Bindable("propertyChange")]
     [Inspectable(category="General")]

@@ -1525,7 +1651,7 @@
      */
     public function get x():Number
     {
-        return _x;
+        return xformOffsets.layoutX;
     }

     /**
@@ -1533,32 +1659,18 @@
      */
     public function set x(value:Number):void
     {
-        if (_x == value)
-            return;
-
-        var oldValue:Number = _x;
-        _x = value;
+        var oldValue:Number = xformOffsets.layoutX;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutX = value;
         dispatchPropertyChangeEvent("x", oldValue, value);
-
-        xChanged = true;
-        invalidateProperties();
-        // Parent layout takes transform into account
-        invalidateParentSizeAndDisplayList();
+        invalidateTransform(false);
     }

     //----------------------------------
     //  y
     //----------------------------------
-    /**
-     *  @private
-     *  Storage for the y property.
-     */
-    private var _y:Number = 0;
-
-    /**
-     *  @private
-     */
-    private var yChanged:Boolean;

     [Bindable("propertyChange")]
     [Inspectable(category="General")]
@@ -1568,7 +1680,7 @@
      */
     public function get y():Number
     {
-        return _y;
+        return xformOffsets.layoutY;
     }

     /**
@@ -1576,17 +1688,42 @@
      */
     public function set y(value:Number):void
     {
-        if (_y == value)
-            return;
-
-        var oldValue:Number = _y;
-        _y = value;
+        var oldValue:Number = xformOffsets.layoutY;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutY = value;
         dispatchPropertyChangeEvent("y", oldValue, value);
-
-        yChanged = true;
-        invalidateProperties();
-        // Parent layout takes transform into account
-        invalidateParentSizeAndDisplayList();
+		invalidateTransform(false);
+    }
+
+    //----------------------------------
+    //  z
+    //----------------------------------
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  The y position of the graphic element.
+     */
+    public function get z():Number
+    {
+        return xformOffsets.layoutZ;
+    }
+
+    /**
+     *  @private
+     */
+    public function set z(value:Number):void
+    {
+        var oldValue:Number = xformOffsets.layoutZ;
+        if (oldValue == value)
+            return;
+
+        xformOffsets.layoutZ = value;
+        dispatchPropertyChangeEvent("z", oldValue, value);
+		invalidateTransform();
     }

     //----------------------------------
@@ -1672,6 +1809,12 @@
             return;

         var oldValue:DisplayObject = _displayObject;
+
+		//esg: matrix3D's are owned by a DO, so we need to reclaim any
+		// matrix3D we might have assigned.
+		if(oldValue != null)
+			oldValue.transform.matrix3D = null;
+
         _displayObject = value;
         dispatchPropertyChangeEvent("displayObject", oldValue, value);

@@ -1698,9 +1841,7 @@
      */
     public function get actualPosition():Point
     {
-        var xPos:Number = measuredX + (_matrix ? _matrix.tx : _x);
-        var yPos:Number = measuredY + (_matrix ? _matrix.ty : _y);
-        var vec:Point = new Point(xPos, yPos);
+        var topLeft:Point = new Point(measuredX, measuredY);

         // Account for transform
         var m:Matrix = computeMatrix(true /*actualMatrix*/);
@@ -1708,21 +1849,22 @@
         {
             // Calculate the vector from pre-transform top-left to
             // post-transform top-left:
-            TransformUtil.transformBounds(new Point(_width, _height), m, vec);
-
-            // Subtract it from (xPos, yPos):
-            vec.x = xPos - vec.x;
-            vec.y = yPos - vec.y;
+            TransformUtil.transformBounds(new Point(_width, _height), m, topLeft);
+        }
+        else
+        {
+        	topLeft.x += xformOffsets.layoutX;
+        	topLeft.y += xformOffsets.layoutY;
         }

         // Take stroke into account:
         // TODO EGeorgie: We assume that the stroke extents are even on both sides.
         // and that's not necessarily true.
         var strokeExtents:Point = getStrokeExtents();
-        vec.x -= strokeExtents.x * 0.5;
-        vec.y -= strokeExtents.y * 0.5;
-
-        return vec;
+        topLeft.x -= strokeExtents.x * 0.5;
+        topLeft.y -= strokeExtents.y * 0.5;
+
+        return topLeft;
     }

     //----------------------------------
@@ -1748,7 +1890,10 @@
     {
         // Draw position depends upon which coordinate space we are located in.
         // TODO!!! We need to apply all of the transforms of our ancestors
-        return displayObject ? 0 : sharedDisplayObject && sharedDisplayObject != elementHost ? x - sharedDisplayObject.x : x;
+    	if(displayObject != null)
+    		return 0;
+    	var result:Number = xformOffsets.layoutX + xformOffsets.x;
+        return sharedDisplayObject && sharedDisplayObject != elementHost ? result - sharedDisplayObject.x : result;
     }

     //----------------------------------
@@ -1762,7 +1907,10 @@
     {
         // Draw position depends upon which coordinate space we are located in.
         // TODO!!! We need to apply all of the transforms of our ancestors
-        return displayObject ? 0 : sharedDisplayObject && sharedDisplayObject != elementHost ? y - sharedDisplayObject.y : y;
+    	if(displayObject != null)
+    		return 0;
+    	var result:Number = xformOffsets.layoutY + xformOffsets.y;
+        return sharedDisplayObject && sharedDisplayObject != elementHost ? result - sharedDisplayObject.y : result;
     }

     //----------------------------------
@@ -1893,16 +2041,22 @@
      */
     public function get needsDisplayObject():Boolean
     {
-        if ((_filters && _filters.length > 0) ||
-            _blendMode != BlendMode.NORMAL || _mask ||
-            _scaleX != 1 || _scaleY != 1 ||
-            _rotation != 0 || _alpha != 1 || _transform ||
-            _transformX != 0 || _transformY != 0)
-        {
-            return true;
-        }
-        else
-            return false;
+    	if ((_filters && _filters.length > 0) ||
+    		_blendMode != BlendMode.NORMAL || _mask ||
+    		xformOffsets.layoutScaleX != 1 || xformOffsets.layoutScaleY != 1 || xformOffsets.layoutScaleZ != 1 ||
+    		xformOffsets.layoutRotationX != 0 || xformOffsets.layoutRotationY != 0 || xformOffsets.layoutRotationZ != 0 ||
+    		xformOffsets.layoutZ  != 0 ||
+    		xformOffsets.scaleX != 1 || xformOffsets.scaleY != 1 || xformOffsets.scaleZ != 1 ||
+    		xformOffsets.rotationX != 0 || xformOffsets.rotationY != 0 || xformOffsets.rotationZ != 0 ||
+    		xformOffsets.z  != 0 ||
+    		_colorTransform != null ||
+    		_alpha != 1 ||
+    		_layer != 0)
+    	{
+			return true;
+    	}
+    	else
+    		return false;
     }

     public function get nextSiblingNeedsDisplayObject():Boolean
@@ -2002,18 +2156,6 @@
                 displayObject.cacheAsBitmap = true;
             }
         }
-    }
-
-    /**
-     *  Documentation is not currently available.
-     */
-    protected function clearTransformProperties():void
-    {
-        scaleXChanged = false;
-        scaleYChanged = false;
-        xChanged = false;
-        yChanged = false;
-        rotationChanged = false;
     }

     /**
@@ -2178,6 +2320,7 @@
     protected function commitProperties():void
     {
         //trace("GraphicElement.commitProperties displayObject",displayObject,"this",this);
+    	var updateTransform:Boolean = false;
         if (displayObject)
         {
             if (alphaChanged)
@@ -2226,16 +2369,7 @@
                 displayObject.visible = _visible;
             }

-            if (matrixChanged || scaleXChanged || scaleYChanged ||
-                rotationChanged || transformXChanged || transformYChanged ||
-                displayObjectChanged)
-            {
-                commitScaleAndRotation();
-            }
-
-            if (xChanged || yChanged || displayObjectChanged)
-                commitXY();
-
+			updateTransform = true;
             displayObjectChanged = false;
         }
         else
@@ -2248,6 +2382,11 @@
                 // to change visibility.
                 invalidateDisplayList();
             }
+        }
+        if (xformOffsets.updatePending ||
+            updateTransform)
+        {
+            commitTransform();
         }
     }

@@ -2374,8 +2513,16 @@
             return; */
         invalidateDisplayListFlag = false;

-        if (visible)
-            updateDisplayList(_width, _height);
+		// we commit our transform in two places. First, during commit properties, because our size depends on it,
+		// and our parent will most likely take it into account during layout. Secondly, here, because our parent will likely
+		// change our xform as a result of layout, and we need to commit it before we end up on screen.
+        if (xformOffsets.updatePending)
+        {
+            commitTransform();
+        }
+
+		if (visible)
+        	updateDisplayList(_width, _height);

         // If we aren't doing any more invalidation, send out an UpdateComplete event
         if (!invalidatePropertiesFlag && !invalidateSizeFlag && !invalidateDisplayListFlag)
@@ -2441,8 +2588,8 @@
     {
         if (!displayObject)
             return null;
-
-        var m:Matrix = displayObject.transform.matrix;
+
+        var m:Matrix = xformOffsets.layoutMatrix;
         return TransformUtil.isDeltaIdentity(m) ? null : m;
     }

@@ -2456,7 +2603,7 @@
         var size:Point = new Point(width, height);
         var m:Matrix = computeMatrix(actualMatrix);
         if (m)
-            size = TransformUtil.transformBounds(size, m);
+            size = TransformUtil.transformSize(size, m);

         // Take stroke into account
         var strokeExtents:Point = getStrokeExtents();
@@ -2488,23 +2635,6 @@
      */
     public function setActualPosition(x:Number, y:Number):void
     {
-        //trace("GraphicElement.setActualPosition x",x,"y",y,"this",this);
-        x -= measuredX;
-        y -= measuredY;
-
-        // Handle arbitrary 2d transform
-        var m:Matrix = computeMatrix(true /*actualMatrix*/);
-        if (m)
-        {
-            // Calculate the vector from pre-transform top-left to
-            // post-transform top-left:
-            var vec:Point = new Point();
-            TransformUtil.transformBounds(new Point(_width, _height), m, vec);
-
-            // Add it to (x,y):
-            x += vec.x;
-            y += vec.y;
-        }

         // Take stroke into account:
         // TODO EGeorgie: We assume that the stroke extents are even on both sides.
@@ -2513,24 +2643,36 @@
         x += strokeExtents.x * 0.5;
         y += strokeExtents.y * 0.5;

-        // Finally commit x & y property changes:
-        var changed:Boolean = false;
-        if (_x != x)
-        {
-            _x = x;
-            changed = true;
-        }
-
-        if (_y != y)
-        {
-            _y = y;
-            changed = true;
-        }
-
-        if (displayObject)
-            commitXY();
-        else if (changed)
+        // Handle arbitrary 2d transform
+        var m:Matrix = computeMatrix(true /*actualMatrix*/);
+        if (m)
+        {
+            // Calculate the origin of the element after transformation before our changes are applied.
+            var origin:Point = new Point(measuredX,measuredY);
+            TransformUtil.transformBounds(new Point(_width, _height), m, origin);
+
+            // now adjust our tx/ty values based on the difference between our current transformed position and
+            // where we want to end up.
+            x = x - origin.x + xformOffsets.layoutX;
+            y = y - origin.y + xformOffsets.layoutY;
+        }
+        else
+        {
+	        x -= measuredX;
+    	    y -= measuredY;
+        }
+
+
+       	if(x != xformOffsets.layoutX || y != xformOffsets.layoutY)
+       	{
+			xformOffsets.layoutX = x;
+			xformOffsets.layoutY = y;
+			// note that we don't want to call invalidateTransform, because
+			// this is in the middle of an update pass. Instead, we just note that the
+			// transform has an update pending, so we can apply it later.
+			xformOffsets.updatePending = true;
             invalidateDisplayList();
+        }
     }

     /**
@@ -2650,67 +2792,26 @@
     }

     /**
-     *  Applies _x and _y properties to the display object.
-     */
-    protected function commitXY():void
-    {
-        if (!displayObject)
-            return;
-
-        beginCommitTransformProps();
-
-        /*
-        TransformUtil.applyTransforms(displayObject, null, _x, _y);
-        _x = displayObject.x;
-        _y = displayObject.y;
-        */
-        displayObject.x = _x;
-        displayObject.y = _y;
-
-        xChanged = false;
-        yChanged = false;
-
-        endCommitTransformProps();
-
-        // TODO EGeorgie: if the drawing depends on x & y, we need to
-        // invalidateDisplayList();
-    }
-
-    /**
-     *  Applies _scaleX and _scaleY properties to the display object.
-     */
-    protected function commitScaleAndRotation():void
-    {
-        if (!displayObject)
-            return;
-
-        beginCommitTransformProps();
-
-        var rot:Number = rotationChanged ? _rotation : NaN;
-
-        TransformUtil.applyTransforms(displayObject, _matrix, NaN, NaN,
-                                      _scaleX, _scaleY, rot,
-                                      _transformX, _transformY);
-
-        _scaleX = displayObject.scaleX;
-        _scaleY = displayObject.scaleY;
-        _rotation = displayObject.rotation;
-
-        // Pull the x and y backing vars only if we have a matrix.
-        if (_matrix)
-        {
-            _x = displayObject.x;
-            _y = displayObject.y;
-        }
-
-        matrixChanged = false;
-        scaleXChanged = false;
-        scaleYChanged = false;
-        rotationChanged = false;
-
-        endCommitTransformProps();
-    }
-
+     *  Applies the transform to the display object.
+     */
+    protected function commitTransform():void
+    {
+        xformOffsets.updatePending = false;
+
+        if(displayObject == null)
+        	return;
+
+		if(xformOffsets.computedIs3D)
+		{
+			displayObject.transform.matrix3D = xformOffsets.computedMatrix3D;
+		}
+		else
+		{
+			displayObject.transform.matrix = xformOffsets.computedMatrix;
+			//race("updating transform");
+		}
+    }
+
     /**
      *  @private
      */
@@ -2744,20 +2845,20 @@
         // not only on scale.
         if (scaleMode == LineScaleMode.NORMAL)
         {
-            if (_scaleX == _scaleY)
-                weight *= _scaleX;
+            if (xformOffsets.layoutScaleX == xformOffsets.layoutScaleY)
+                weight *= xformOffsets.layoutScaleX;
             else
-                weight *= Math.sqrt(0.5 * (_scaleX * _scaleX + _scaleY * _scaleY));
+                weight *= Math.sqrt(0.5 * (xformOffsets.layoutScaleX * xformOffsets.layoutScaleX + xformOffsets.layoutScaleY * xformOffsets.layoutScaleY));

             return new Point(weight, weight);
         }
         else if (scaleMode == LineScaleMode.HORIZONTAL)
         {
-            return new Point(weight * _scaleX, weight);
+            return new Point(weight * xformOffsets.layoutScaleX, weight);
         }
         else if (scaleMode == LineScaleMode.VERTICAL)
         {
-            return new Point(weight, weight * _scaleY);
+            return new Point(weight, weight * xformOffsets.layoutScaleY);
         }

         return null;
@@ -2812,14 +2913,8 @@
                 // Apply matrix
                 if (_transform)
                 {
-                    _matrix = _transform.matrix.clone();
-                    matrixChanged = true;
-
-                    clearTransformProperties();
-                    notifyElementLayerChanged();
-                    invalidateProperties();
-                    // Parent layout takes transform into account
-                    invalidateParentSizeAndDisplayList();
+                    xformOffsets.layoutMatrix = _transform.matrix.clone();
+					invalidateTransform();
                 }
             }
             else if (event.property == "colorTransform")


Transferred from the Adobe Open Source Subversion Repository

Revision: 6449
Author:   egeorgie@adobe.com
Date:     2009-05-01T02:27:23.422873Z

Log Message:
-----------
Fix bug: http://bugs.adobe.com/jira/browse/SDK-20719

Fix: make sure we invalidate the GraphicElement when includeInLayout is set to false.

QE Notes: None
Doc Notes: None
Bugs: SDK-20719
Reviewer: Ryan
tests: checkintests, mustella layout

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -2375,7 +2375,7 @@
     {
         return _includeInLayout;
     }
-
+
     /**
      *  @private
      */
@@ -2384,9 +2384,12 @@
         if (_includeInLayout == value)
             return;

+        // Temporarily set includeInLayout to true so that
+        // invalidating the parent doesn't return early.
+        _includeInLayout = true;
+        invalidateParentSizeAndDisplayList();
+
         _includeInLayout = value;
-
-        invalidateParentSizeAndDisplayList();
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 2672
Author:   egeorgie@adobe.com
Date:     2008-07-30T22:52:27.741630Z

Log Message:
-----------
Remove GraphicElement.bounds APIs in favor of measure

Reviewed by Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Ellipse.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Rect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/graphics/GraphicTags_checkintests.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElementHostImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Line.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/BitmapGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextGraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -80,6 +80,70 @@
 	//--------------------------------------------------------------------------

 	//----------------------------------
+	//  measuredWidth
+	//----------------------------------
+
+    private var _measuredWidth:Number = 0;
+
+    public function get measuredWidth():Number
+    {
+        return _measuredWidth;
+    }
+
+    public function set measuredWidth(value:Number):void
+    {
+        _measuredWidth = value;
+    }
+
+	//----------------------------------
+	//  measuredHeight
+	//----------------------------------
+
+    private var _measuredHeight:Number = 0;
+
+    public function get measuredHeight():Number
+    {
+        return _measuredHeight;
+    }
+
+    public function set measuredHeight(value:Number):void
+    {
+        _measuredHeight = value;
+    }
+
+	//----------------------------------
+	//  measuredX
+	//----------------------------------
+
+    private var _measuredX:Number = 0;
+
+    public function get measuredX():Number
+    {
+        return _measuredX;
+    }
+
+    public function set measuredX(value:Number):void
+    {
+        _measuredX = value;
+    }
+
+	//----------------------------------
+	//  measuredY
+	//----------------------------------
+
+    private var _measuredY:Number = 0;
+
+    public function get measuredY():Number
+    {
+        return _measuredY;
+    }
+
+    public function set measuredY(value:Number):void
+    {
+        _measuredY = value;
+    }
+
+	//----------------------------------
 	//  alpha
 	//----------------------------------
 	private var _alpha:Number = 1;
@@ -181,17 +245,6 @@
 		dispatchPropertyChangeEvent("bottom", oldValue, value);

 		invalidateParentSizeAndDisplayList();
-	}
-
-	//----------------------------------
-	//  bounds
-	//----------------------------------
-    /**
-     *  @inheritDoc
-     */
-	public function get bounds():Rectangle
-	{
-		return new Rectangle();
 	}

 	//----------------------------------
@@ -1338,33 +1391,33 @@

     /**
      *  @private
-     *  Whether this component needs to have its
+     *  Whether this element needs to have its
      *  commitProperties() method called.
      */
     mx_internal var invalidatePropertiesFlag:Boolean = false;

     /**
      *  @private
-     *  Whether this component needs to have its
+     *  Whether this element needs to have its
      *  measure() method called.
      */
     mx_internal var invalidateSizeFlag:Boolean = false;

     /**
      *  @private
-     *  Whether this component needs to be have its
+     *  Whether this element needs to be have its
      *  updateDisplayList() method called.
      */
     mx_internal var invalidateDisplayListFlag:Boolean = false;

 	/**
-	 *  Calling this method results in a call to the component's
+	 *  Calling this method results in a call to the elements's
 	 *  validateProperties() method
 	 *  before the display list is rendered.
 	 *
-	 *
For components that extend UIComponent, this implies
-	 *  that commitProperties() is called.

+	 *
Subclasses should do their work in
+	 *  commitProperties().

 	 */
 	public function invalidateProperties():void
 	{
@@ -1378,14 +1431,15 @@
 	}

 	/**
-	 *  Calling this method results in a call to the component's
+	 *  Calling this method results in a call to the elements's
 	 *  validateSize() method
 	 *  before the display list is rendered.
 	 *
-	 *
For components that extend UIComponent, this implies
-	 *  that measure() is called, unless the component
-	 *  has both explicitWidth and explicitHeight
-	 *  set.

+	 *
Subclasses should override and do their measurement in
+	 *  measure().
+	 *  By default when explicitWidth and explicitHeight
+	 *  are set, measure() will not be called. To override this
+	 *  default behavior subclasses should override skipMeasure().

 	 */
 	public function invalidateSize():void
 	{
@@ -1416,12 +1470,12 @@
 	}

 	/**
-	 *  Calling this method results in a call to the component's
+	 *  Calling this method results in a call to the elements's
 	 *  validateDisplayList() method
 	 *  before the display list is rendered.
 	 *
-	 *
For components that extend UIComponent, this implies
-	 *  that updateDisplayList() is called.

+	 *
Subclasses should override and do their work in
+	 *  updateDisplayList().

 	 */
 	public function invalidateDisplayList():void
 	{
@@ -1442,23 +1496,6 @@
      *  by immediately calling validateProperties(),
 	 *  validateSize(), and validateDisplayList(),
 	 *  if necessary.
-     *
-     *
When properties are changed, the new values do not usually have
-	 *  an immediate effect on the component.
-	 *  Usually, all of the application code that needs to be run
-	 *  at that time is executed. Then the LayoutManager starts
-	 *  calling the validateProperties(),
-	 *  validateSize(), and validateDisplayList()
-	 *  methods on components, based on their need to be validated and their
-	 *  depth in the hierarchy of display list objects.

-	 *
-     *
For example, setting the width property is delayed, because
-	 *  it may require recalculating the widths of the object's children
-	 *  or its parent.
-     *  Delaying the processing also prevents it from being repeated
-     *  multiple times if the application code sets the width property
-	 *  more than once.
-     *  This method lets you manually override this behavior.

      */
     public function validateNow():void
     {
@@ -1481,22 +1518,20 @@
     }

     /**
-     *  Processes the properties set on the component.
+     *  Processes the properties set on the element.
      *  This is an advanced method that you might override
-     *  when creating a subclass of UIComponent.
+     *  when creating a subclass.
      *
      *
You do not call this method directly.
      *  Flex calls the commitProperties() method when you
-     *  use the addChild() method to add a component to a container,
-     *  or when you call the invalidateProperties() method of the component.
+     *  use the addItem() method to add an element to the group,
+     *  or when you call the invalidateProperties() method of the element.
      *  Calls to the commitProperties() method occur before calls to the
      *  measure() method. This lets you set property values that might
      *  be used by the measure() method.

      *
-     *
Some components have properties that affect the number or kinds
-     *  of child objects that they need to create, or have properties that
-     *  interact with each other, such as the horizontalScrollPolicy
-     *  and horizontalScrollPosition properties.
+     *
Some elements have properties that
+     *  interact with each other.
      *  It is often best at startup time to process all of these
      *  properties at one time to avoid duplicating work.

      */
@@ -1520,65 +1555,76 @@
         // Our size has changed, parent has to resize and run layout code
         invalidateParentSizeAndDisplayList();
     }
+
+    /**
+     *  @return Returns true when the measureSizes() code can skip the call to
+     *  measure(). For example this is usually true when both explicitWidth and
+     *  explicitHeight are set. For path, this is true when the bounds of the path
+     *  have not changed.
+     */
+    protected function skipMeasure():Boolean
+    {
+        return !isNaN(explicitWidth) && !isNaN(explicitHeight);
+    }

     /**
      *  @private
      */
     private function measureSizes():Boolean
     {
-        var changed:Boolean = false;
-
-        // TODO EGeorgie: Optimize. We don't always need to
-        // call measure() when we have explicit sizes.
-        measure();
-
-        // TODO EGeorgie: Optimize. Detect when the size has changed.
-        changed = true;
-        return changed;
-    }
-
-    /**
-     *  Calculates the default size, and optionally the default minimum size,
-     *  of the component. This is an advanced method that you might override when
-     *  creating a subclass of UIComponent.
+        var oldWidth:Number = preferredWidthPreTransform();
+        var oldHeight:Number = preferredHeightPreTransform();
+        var oldX:Number = measuredX;
+        var oldY:Number = measuredY;
+
+        if (!skipMeasure())
+            measure();
+
+        // Did measure() have effect on preferred size?
+        if (oldWidth != preferredWidthPreTransform() ||
+            oldHeight != preferredHeightPreTransform() ||
+            oldX != measuredX ||
+            oldY != measuredY)
+        {
+            // Preferred size has changed, layout will be affected.
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     *  Calculates the default size of the element. This is an advanced
+     *  method that you might override when creating a subclass of GraphicElement.
      *
      *
You do not call this method directly. Flex calls the
-     *  measure() method when the component is added to a container
-     *  using the addChild() method, and when the component's
+     *  measure() method when the element is added to a group
+     *  using the addItem() method, and when the element's
      *  invalidateSize() method is called.

      *
-     *
When you set a specific height and width of a component,
+     *
By default you set both explicit height and explicit width of an element,
      *  Flex does not call the measure() method,
      *  even if you explicitly call the invalidateSize() method.
-     *  That is, Flex only calls the measure() method if
-     *  the explicitWidth property or the explicitHeight
-     *  property of the component is NaN.

+     *  To override this behavior, override skipMeasure() method.

      *
      *
In your override of this method, you must set the
      *  measuredWidth and measuredHeight properties
      *  to define the default size.
-     *  You may optionally set the measuredMinWidth and
-     *  measuredMinHeight properties to define the default
-     *  minimum size.

+     *  You may optionally set the measuredX and
+     *  measuredY properties to define the default measured bounds
+     *  top-left corner relative to the origin of the element.

      *
-     *
Most components calculate these values based on the content they are
-     *  displaying, and from the properties that affect content display.
-     *  A few components simply have hard-coded default values.

-     *
-     *
The conceptual point of measure() is for the component to provide
-     *  its own natural or intrinsic size as a default. Therefore, the
+     *
The conceptual point of measure() is for the element to
+     *  provide its own natural or intrinsic bounds as a default. Therefore, the
      *  measuredWidth and measuredHeight properties
      *  should be determined by factors such as:

      *

      *
The amount of text the component needs to display.

-     *
The styles, such as fontSize, for that text.

      *
The size of a JPEG image that the component displays.

-     *
The measured or explicit sizes of the component's children.

-     *
Any borders, margins, and gaps.

      *

      *
      *
In some cases, there is no intrinsic way to determine default values.
-     *  For example, a simple GreenCircle component might simply set
+     *  For example, a simple GreenCircle element might simply set
      *  measuredWidth = 100 and measuredHeight = 100 in its measure() method to
      *  provide a reasonable default size. In other cases, such as a TextArea,
      *  an appropriate computation (such as finding the right width and height
@@ -1587,16 +1633,15 @@
      *
      *
The default implementation of measure()
      *  sets measuredWidth, measuredHeight,
-     *  measuredMinWidth, and measuredMinHeight
+     *  measuredX, measuredY
      *  to 0.

      */
     protected function measure():void
     {
-        // TODO EGeorgie:
-//        measuredMinWidth = 0;
-//        measuredMinHeight = 0;
-//        measuredWidth = 0;
-//        measuredHeight = 0;
+        measuredWidth = 0;
+        measuredHeight = 0;
+        measuredX = 0;
+        measuredY = 0;
     }

     /**
@@ -1612,32 +1657,18 @@
     }

     /**
-     *  Draws the object and/or sizes and positions its children.
+     *  Draws the element and/or sizes and positions its content.
      *  This is an advanced method that you might override
-     *  when creating a subclass of UIComponent.
+     *  when creating a subclass of GraphicElement.
      *
      *
You do not call this method directly. Flex calls the
-     *  updateDisplayList() method when the component is added to a container
-     *  using the addChild() method, and when the component's
+     *  updateDisplayList() method when the component is added
+     *  to a group using the addItem() method, and when the element's
      *  invalidateDisplayList() method is called.

      *
-     *
If the component has no children, this method
-     *  is where you would do programmatic drawing
-     *  using methods on the component's Graphics object
+     *
This method is where you would do programmatic drawing
+     *  using methods on the elements's displayObject
      *  such as graphics.drawRect().

-     *
-     *
If the component has children, this method is where
-     *  you would call the move() and setActualSize()
-     *  methods on its children.

-     *
-     *
Components may do programmatic drawing even if
-     *  they have children. In doing either, you should use the
-     *  component's unscaledWidth and unscaledHeight
-     *  as its bounds.

-     *
-     *
It is important to use unscaledWidth and
-     *  unscaledHeight instead of the width
-     *  and height properties.

      *
      *  @param unscaledWidth Specifies the width of the component, in pixels,
      *  in the component's coordinates, regardless of the value of the
@@ -1696,6 +1727,16 @@
         size.y += strokeExtents.y;
         return size;
     }
+
+    private function preferredWidthPreTransform():Number
+    {
+        return isNaN(explicitWidth) ? measuredWidth : explicitWidth;
+    }
+
+    private function preferredHeightPreTransform():Number
+    {
+        return isNaN(explicitHeight) ? measuredHeight: explicitHeight;
+    }

     /**
      *  Indicates whether to layout should ignore this item or not.
@@ -1712,7 +1753,9 @@
      */
     public function get preferredSize():Point
     {
-    	return transformSizeForLayout(bounds.width, bounds.height, false /*actualMatrix*/);
+    	return transformSizeForLayout(preferredWidthPreTransform(),
+    	                              preferredHeightPreTransform(),
+    	                              false /*actualMatrix*/);
     }

     /**
@@ -1755,8 +1798,8 @@
      */
     public function get actualPosition():Point
     {
-    	var xPos:Number = bounds.left + (_matrix ? _matrix.tx : _x);
-    	var yPos:Number = bounds.top + (_matrix ? _matrix.ty : _y);
+    	var xPos:Number = measuredX + (_matrix ? _matrix.tx : _x);
+    	var yPos:Number = measuredY + (_matrix ? _matrix.ty : _y);
         var vec:Point = new Point(xPos, yPos);

         // Account for transform
@@ -1788,8 +1831,8 @@
      */
     public function setActualPosition(x:Number, y:Number):void
     {
-        x -= bounds.left;
-        y -= bounds.top;
+        x -= measuredX;
+        y -= measuredY;

         // Handle arbitrary 2d transform
         var m:Matrix = computeMatrix(true /*actualMatrix*/);
@@ -1866,7 +1909,8 @@
                height -= strokeExtents.y;

             var newSize:Point = TransformUtil.fitBounds(width, height, m,
-                                                        bounds.width, bounds.height,
+                                                        preferredWidthPreTransform(),
+                                                        preferredHeightPreTransform(),
                                                         minWidth, minHeight,
                                                         maxWidth, maxHeight);
             if (newSize)


Fix an off-by-one error due to the way flex deals with dates. Thanks to Bill Bailey for pointing this out :)

--- src/org/jivesoftware/xiff/data/Message.as
+++ src/org/jivesoftware/xiff/data/Message.as
@@ -246,7 +246,7 @@
 			//CCYYMMDDThh:mm:ss
 			//20020910T23:41:07
 			t.setUTCFullYear(stamp.slice(0, 4)); //2002
-			t.setUTCMonth(stamp.slice(4, 6)); //09
+			t.setUTCMonth(Number(stamp.slice(4, 6)) - 1); //09
 			t.setUTCDate(stamp.slice(6, 8)); //10
 											 //T
 			t.setUTCHours(stamp.slice(9, 11)); //23


Use `video_id' instead of `movie_id' in stats API call.

--- src/goplayer/StreamioAPI.as
+++ src/goplayer/StreamioAPI.as
@@ -45,7 +45,7 @@
       const result : Object = new Object

       result.tracker_id = trackerID
-      result.movie_id = movieID
+      result.video_id = movieID
       result.event = event

       for (var name : String in parameters)


Transferred from the Adobe Open Source Subversion Repository

Revision: 21808
Author:   jasonsj@adobe.com
Date:     2011-08-04T01:30:11.972874Z

Log Message:
-----------
Callout visual review: drop shadow, content shadow tweaking.
New Callout skin for SplitViewNavigator that disables the content shadow and mask.

QE notes:
Doc notes:
Bugs:
Reviewer: chiedozi
Tests run: checkintests, mustella-mobile
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutViewNavigatorSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorCalloutSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SplitViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/SplitViewNavigatorSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/SplitViewNavigatorSkin.as
@@ -12,7 +12,6 @@
 package spark.skins.mobile
 {
 import spark.components.Callout;
-import spark.components.CalloutPosition;
 import spark.components.Group;
 import spark.components.SplitViewNavigator;
 import spark.layouts.HorizontalLayout;
@@ -102,14 +101,14 @@
         // Create the callout but don't add it to display list
         viewNavigatorCallout = new Callout();
         viewNavigatorCallout.id = "viewNavigatorCallout";
+
+        // TODO (jasonsj): move sizing to SplitViewNavigator?
         viewNavigatorCallout.height = 500;
-        viewNavigatorCallout.setStyle("color", 0x000000);
-        viewNavigatorCallout.setStyle("contentBackgroundAlpha", 0);
     }

-	/**
-	 *  @private
-	 */
+    /**
+     *  @private
+     */
     override protected function measure():void
     {
         super.measure();


removing proxy column tasks on dispose

removing proxy column tasks on dispose

--- WeaveData/src/weave/data/DataSources/AbstractDataSource.as
+++ WeaveData/src/weave/data/DataSources/AbstractDataSource.as
@@ -157,8 +157,10 @@
 		public function getAttributeColumn(metadata:Object):IAttributeColumn
 		{
 			var proxyColumn:ProxyColumn = newDisposableChild(this, ProxyColumn);
-			proxyColumn.setMetadata(metadata);
-			WeaveAPI.ProgressIndicator.addTask(proxyColumn, proxyColumn, (WeaveAPI.globalHashMap.getName(this) || debugId(this)) + " pending column request");
+			proxyColumn.setMetadata(metadata);
+			var description:String = (WeaveAPI.globalHashMap.getName(this) || debugId(this)) + " pending column request";
+			WeaveAPI.ProgressIndicator.addTask(proxyColumn, this, description);
+			WeaveAPI.ProgressIndicator.addTask(proxyColumn, proxyColumn, description);
 			handlePendingColumnRequest(proxyColumn);
 			return proxyColumn;
 		}
@@ -212,6 +214,8 @@
 		 */
 		public function dispose():void
 		{
+			for (var column:Object in _proxyColumns)
+				WeaveAPI.ProgressIndicator.removeTask(column);
 			_initializeCalled = false;
 			_proxyColumns = null;
 		}


Language lookup function for labels working

--- Arguments/src/classes/Language.as
+++ Arguments/src/classes/Language.as
@@ -16,9 +16,9 @@
 		//by default, the language is EN-US

 		public static const GERMAN:String = "GER";
-		public static const EN_US:String = "EN-US";
+		public static const ENGLISH:String = "EN-US";
 		public static const RUSSIAN:String = "RUS";
-		public static var language:String = EN_US;
+		public static var language:String = ENGLISH;

 		public function Language()
@@ -45,12 +45,15 @@
 		{
 			xml=XML(event.target.data);
 			trace("XML loaded.");
-			lookup("Label");
 		}

-		public static function lookup(label:String):void{
+		public static function lookup(label:String):String{
 			trace("Now looking up:" + label);
-			trace(xml.descendants(label));
+			var lbl:XMLList = xml.descendants(label);
+			var lang:XMLList = lbl.descendants(language);
+			var output:String = lang.attribute("text");
+			trace("Output is: " + output);
+			return output;
 		}

 	}


Delayed message time stamp parsing fix.

Delayed message time stamp parsing fix.

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

--- src/org/igniterealtime/xiff/data/Message.as
+++ src/org/igniterealtime/xiff/data/Message.as
@@ -236,21 +236,25 @@
 		{
 			myThreadNode = replaceTextNode(getNode(), myThreadNode, "thread", value);
 		}
-
+		/**
+		 * Time of the message in case of a delay. Used only for messages
+		 * which were sent while user was offline.
+		 * @see http://xmpp.org/extensions/xep-0203.html
+		 */
 		public function get time():Date
 		{
 			if(myTimeStampNode == null) return null;
 			var stamp:String = myTimeStampNode.attributes.stamp;

-			// CCYYMMDDThh:mm:ss
-			var t:Date = new Date();
-			t.setUTCFullYear(stamp.slice(0, 4));
-			t.setUTCMonth(Number(stamp.slice(4, 6)) - 1);
-			t.setUTCDate(stamp.slice(6, 8));
-			t.setUTCHours(stamp.slice(9, 11));
-			t.setUTCMinutes(stamp.slice(12, 14));
-			t.setUTCSeconds(stamp.slice(15, 17));
-			return t;
+			// CCYY-MM-DDThh:mm:ssZ
+			var value:Date = new Date();
+			value.setUTCFullYear(stamp.substr(0, 4));
+			value.setUTCMonth(parseInt(stamp.substr(5, 2)) - 1);
+			value.setUTCDate(stamp.substr(8, 2));
+			value.setUTCHours(stamp.substr(11, 2));
+			value.setUTCMinutes(stamp.substr(14, 2));
+			value.setUTCSeconds(stamp.substr(17, 2));
+			return value;
 		}
 		public function set time( value:Date ): void
 		{


make Thumbnails extensible

make Thumbnails extensible

--- src/ru/kutu/grindplayer/config/AppConfig.as
+++ src/ru/kutu/grindplayer/config/AppConfig.as
@@ -19,6 +19,7 @@
 	import ru.kutu.grind.config.PlayerConfiguration;
 	import ru.kutu.grind.config.ResourceProvider;
 	import ru.kutu.grind.media.GrindMediaFactoryBase;
+	import ru.kutu.grind.utils.Thumbnails;
 	import ru.kutu.grind.views.api.IAlternateMenuButton;
 	import ru.kutu.grind.views.api.IBufferInfo;
 	import ru.kutu.grind.views.api.IControlBarMenuButtonHide;
@@ -74,6 +75,7 @@

 			injector.map(LocalSettings).asSingleton();
 			injector.map(JavaScriptBridgeBase).toSingleton(JavaScriptBridge);
+			injector.map(Thumbnails).asSingleton();

 			mediatorMap.map(IMainView).toMediator(MainViewBaseMediator);


Prefix public member variable access with 'this.'

--- runtime/src/main/as/flump/display/Movie.as
+++ runtime/src/main/as/flump/display/Movie.as
@@ -400,7 +400,7 @@

             if (_labels[frameIdx] != null) {
                 for each (var label :String in _labels[frameIdx]) {
-                    labelPassed.emit(label);
+                    this.labelPassed.emit(label);
                     if (_pendingGoToFrame != NO_FRAME) {
                         break;
                     }


fix CloneOptions to ignore the TransformController

--- src/aerys/minko/type/clone/CloneOptions.as
+++ src/aerys/minko/type/clone/CloneOptions.as
@@ -2,6 +2,7 @@
 {
 	import aerys.minko.scene.controller.AbstractController;
 	import aerys.minko.scene.controller.AnimationController;
+	import aerys.minko.scene.controller.TransformController;
 	import aerys.minko.scene.controller.camera.CameraController;
 	import aerys.minko.scene.controller.mesh.VisibilityController;
 	import aerys.minko.scene.controller.mesh.skinning.SkinningController;
@@ -35,8 +36,15 @@
 		{
 			var cloneOptions : CloneOptions = new CloneOptions();

-			cloneOptions._clonedControllerTypes.push(AnimationController, SkinningController);
-			cloneOptions._ignoredControllerTypes.push(VisibilityController, CameraController);
+			cloneOptions._clonedControllerTypes.push(
+				AnimationController,
+				SkinningController
+			);
+			cloneOptions._ignoredControllerTypes.push(
+				VisibilityController,
+				CameraController,
+				TransformController
+			);
 			cloneOptions._defaultControllerAction = ControllerCloneAction.REASSIGN;

 			return cloneOptions;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/charts/src/mx/charts/series/renderData/PieSeriesRenderData.as
+++ frameworks/projects/charts/src/mx/charts/series/renderData/PieSeriesRenderData.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.charts.series.renderData
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 16529
Author:   egeorgie@adobe.com
Date:     2010-06-10T23:48:35.607669Z

Log Message:
-----------
Fix for SDK-26688.

The problem was that the constraints parsing code assumed that Strings are always complex constraints "col3:50". Added a check for cases like left = String('50');

QE notes: Small change that potentially affects BasicLayout, FormLayout, ConstraintLayout
Doc notes: None
Bugs: SDK-26688
Reviewer: Jason
Tests run: Checkin, Mustella Cyclone Assist job 206
Is noteworthy for integration: Yes, integration blocker

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as
@@ -85,6 +85,11 @@
         // Split the string into an array
         var args:Array = temp.split(/\s+/);

+        // If the val was a String object representing a single number (i.e. "100"),
+        // then we'll hit this case:
+        if (args.length == 1)
+            return args;
+
         // Return [offset, boundary]
         return [args[1], args[0]];
     }


- fixed a bug, where the shadow property could not be reset

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@830 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/css/propertyparsers/Filters.as
+++ src/reprise/css/propertyparsers/Filters.as
@@ -76,6 +76,17 @@
 			var res : CSSParsingResult = new CSSParsingResult();

 			var parts : Array = val.split(' ');
+
+			if (parts.length == 1 && parts[0] == 'none')
+			{
+				var prop : CSSProperty = new CSSProperty();
+				prop.setSpecifiedValue(null);
+				prop.setImportant(obj.important);
+				prop.setCSSFile(file);
+				res.addPropertyForKey(prop, name + 'ShadowColor');
+				return res;
+			}
+
 			var counter : int = 0;
 			var part : String = parts[counter++];
 			if (CSSParsingHelper.valueIsColor(part))


Precalculate the holding orientation and set it explicitly when picking up fuses. Set the default orientation when placing a fuse in a slot.


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

--- frameworks/projects/framework/src/mx/core/DeferredInstanceFromClass.as
+++ frameworks/projects/framework/src/mx/core/DeferredInstanceFromClass.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2006 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: 19722
Author:   egeorgie@adobe.com
Date:     2011-01-12T00:53:24.336848Z

Log Message:
-----------
Fix popups/tooltips and scaling bugs:
Slider tooltip renders far above under 2.0 scaling - http://bugs.adobe.com/jira/browse/SDK-28833
Mobile HSliderSkin dataTip sometimes stops following the thumb all the way to the right edge - http://bugs.adobe.com/jira/browse/SDK-28762
When the app is scaled, DropDownList shows the list at wrong place - http://bugs.adobe.com/jira/browse/SDK-28818

In this change:
- update popup/tooltip positioning code to work with scaling.

QE notes:  make another test pass on tooltips/pop-ups
Doc notes:
Bugs: SDK-28833, SDK-28762, SDK-28818
Reviewer: Alex
Tests run: full mustella cyclone
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/DragManagerImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/utils/BitmapUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/utils/PopUpUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/utils/MatrixUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/mx/controls/dataGridClasses/FTEDataGridItemRenderer.as</path>

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

--- frameworks/projects/mx/src/mx/controls/listClasses/ListItemRenderer.as
+++ frameworks/projects/mx/src/mx/controls/listClasses/ListItemRenderer.as
@@ -15,6 +15,7 @@
 import flash.display.DisplayObject;
 import flash.geom.Point;
 import flash.geom.Rectangle;
+
 import mx.core.IDataRenderer;
 import mx.core.IFlexDisplayObject;
 import mx.core.IFlexModuleFactory;
@@ -28,6 +29,7 @@
 import mx.events.InterManagerRequest;
 import mx.events.ToolTipEvent;
 import mx.managers.ISystemManager;
+import mx.utils.PopUpUtil;

 use namespace mx_internal;

@@ -509,24 +511,16 @@
     protected function toolTipShowHandler(event:ToolTipEvent):void
     {
         var toolTip:IToolTip = event.toolTip;
-
-        // Calculate global position of label.
-        var sm:ISystemManager = systemManager.topLevelSystemManager;
-        var sbRoot:DisplayObject = sm.getSandboxRoot();
-        var screen:Rectangle = sm.getVisibleApplicationRect(null, true);;
-        var pt:Point = new Point(0, 0);
-        pt = label.localToGlobal(pt);
-        pt = sbRoot.globalToLocal(pt);
-
-        toolTip.move(pt.x, pt.y + (height - toolTip.height) / 2);
-
-        var screenRight:Number = screen.x + screen.width;
-        pt.x = toolTip.x;
-        pt.y = toolTip.y;
-        pt = sbRoot.localToGlobal(pt);
-        if (pt.x + toolTip.width > screenRight)
-            toolTip.move(toolTip.x - (pt.x + toolTip.width - screenRight), toolTip.y);
-
+
+        // We need to position the tooltip at same x coordinate,
+        // center vertically and make sure it doesn't overlap the screen.
+        // Call the helper function to handle this for us.
+        var pt:Point = PopUpUtil.positionOverComponent(DisplayObject(label),
+                                                       systemManager,
+                                                       toolTip.width,
+                                                       toolTip.height,
+                                                       height / 2);
+        toolTip.move(pt.x, pt.y);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/mx/src/mx/controls/videoClasses/CuePointManager.as
+++ frameworks/projects/mx/src/mx/controls/videoClasses/CuePointManager.as
@@ -30,6 +30,11 @@
  *  manage the cue points associated with the VideoDisplay control.
  *
  *  @see mx.controls.VideoDisplay
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class CuePointManager
 {
@@ -80,6 +85,11 @@
      *
      *  @param owner The VideoPlayer instance that is the parent of this CuePointManager.
      *  @param id This parameter is ignored; it is provided only for backwards compatibility.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function CuePointManager(owner:VideoPlayer, id:uint = 0)
     {
@@ -151,6 +161,11 @@
      *

      *
      *  @throws mx.controls.videoClasses.VideoError If the arguments are invalid.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function addCuePoint(cuePoint:Object):Object
     {
@@ -236,6 +251,11 @@
      *
      *  @return An object representing the cue point removed. If there was no
      *  matching cue point, then it returns null.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function removeCuePoint(cuePoint:Object):Object
     {
@@ -723,6 +743,11 @@
      *
index - the index into the Array for the
      *    returned cue point.

      *

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function getCuePointByName(name:String):Object
     {
@@ -736,6 +761,11 @@
      *  Each cue point object describes the cue
      *  point, and contains the properties name:String
      *  and time:Number (in seconds).
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function getCuePoints():Array
     {
@@ -744,6 +774,11 @@

     /**
      *  Removes all cue points.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function removeAllCuePoints():void
     {
@@ -762,6 +797,11 @@
      *  Each cue point object describes the cue
      *  point. It must contain the properties name:String
      *  and time:Number (in seconds).
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function setCuePoints(cuePointArray:Array):void
     {


Changed the framerate to 30 fps

Changed the framerate to 30 fps

--- src/Main.as
+++ src/Main.as
@@ -11,7 +11,7 @@
 	{
 		public function Main():void
 		{
-			super(640, 480);
+			super(640, 480, 30);
 		}

 		override public function init():void


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 12325
Author:   dloverin@adobe.com
Date:     2009-12-01T16:08:46.987638Z

Log Message:
-----------
Merge Revision 12301 into the trunk.

 * Move the removeInitSystemManagerCompleteListener() code before we unload because the contentLoaderInfo is destroyed by the time we get the unload message.
 * Fixup some whitespace.

QE notes: None.
Doc notes: None.
Bugs: SDK-18076
Reviewer: Alex
Tests run: checkintests, components/SWFLoader
Is noteworthy for integration: no

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

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

--- frameworks/projects/framework/src/mx/controls/SWFLoader.as
+++ frameworks/projects/framework/src/mx/controls/SWFLoader.as
@@ -1633,6 +1633,7 @@
                     }

                     contentHolder.removeEventListener(Event.ADDED, contentHolder_addedHandler);
+                    removeInitSystemManagerCompleteListener(contentLoader.contentLoaderInfo);

                     if (useUnloadAndStop)
                         contentLoader.unloadAndStop(unloadAndStopGC);
@@ -2298,13 +2299,15 @@

     /**
-     * If we are loading a swf, listen for a message from the swf telling us it was loading
-     * into an application domain where it needs to use a sandbox bridge to communicate.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 9
-         *  @playerversion AIR 1.1
-         *  @productversion Flex 3
+     *  @private
+     *
+     *  If we are loading a swf, listen for a message from the swf telling us it was loading
+     *  into an application domain where it needs to use a sandbox bridge to communicate.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     private function addInitSystemManagerCompleteListener(loaderInfo:LoaderInfo):void
     {
@@ -2312,12 +2315,14 @@
         {
                 var bridge:EventDispatcher = loaderInfo.sharedEvents;
                 bridge.addEventListener(SWFBridgeEvent.BRIDGE_NEW_APPLICATION,
-                                                          initSystemManagerCompleteEventHandler);
+                                        initSystemManagerCompleteEventHandler);
         }
     }

     /**
-     * Remove the listener after the swf is loaded.
+     *  @private
+     *
+     *  Remove the listener after the swf is loaded.
      *
      *  @langversion 3.0
      *  @playerversion Flash 9
@@ -2358,7 +2363,7 @@
             dispatchEvent(event);

         if (contentHolder is Loader)
-                        removeInitSystemManagerCompleteListener(Loader(contentHolder).contentLoaderInfo);
+            removeInitSystemManagerCompleteListener(Loader(contentHolder).contentLoaderInfo);

     }

@@ -2403,7 +2408,7 @@
         dispatchEvent(event);

         if (contentHolder is Loader)
-                        removeInitSystemManagerCompleteListener(Loader(contentHolder).contentLoaderInfo);
+            removeInitSystemManagerCompleteListener(Loader(contentHolder).contentLoaderInfo);
     }

     /**
@@ -2428,13 +2433,6 @@
             mp.removeChildBridge(_swfBridge);
             _swfBridge = null;
         }
-
-        if (contentHolder is Loader)
-        {
-            var contentLoaderInfo:LoaderInfo = Loader(contentHolder).contentLoaderInfo
-            removeInitSystemManagerCompleteListener(contentLoaderInfo);
-        }
-
     }

     /**
@@ -2475,9 +2473,9 @@
     }

     /**
-     *      @private
+     *  @private
      *
-     *      Message dispatched from System Manager. This gives us the child bridge
+     *  Message dispatched from System Manager. This gives us the child bridge
      *  of the application we loaded.
      */
     private function initSystemManagerCompleteEventHandler(event:Event):void


Transferred from the Adobe Open Source Subversion Repository

Revision: 18391
Author:   cframpto@adobe.com
Date:     2010-11-01T14:55:22.574274Z

Log Message:
-----------
Show the caret if the focus is either on the grid or the columnHeaderBar and use the SELECT_ALL event to detect the platform specific accelerator for selectAll (ie ctrl-A on Windows and cmd-A on Mac).

QE notes:
Doc notes:  selectAll is ctrl-A and cmd-A on Mac, ctrl-A on Windows provided selectionMode is other than GridSelectionMode.NONE
Bugs: SDK-28358, SDK-28207
Reviewer:  Hans
Tests run: cyclone
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -468,6 +468,8 @@
     public function DataGrid()
     {
         super();
+
+        addEventListener(Event.SELECT_ALL, selectAllHandler);
     }

     //--------------------------------------------------------------------------
@@ -1784,20 +1786,11 @@
         if (!grid || event.isDefaultPrevented())
             return;

-        // Caret is not required for ctrl-A selectAll operation.
+        // Ctrl-A only comes thru on Mac.  On Windows it is a SELECT_ALL
+        // event.
         if (event.keyCode == Keyboard.A && event.ctrlKey)
-        {
-            if (selectionMode == GridSelectionMode.MULTIPLE_CELLS ||
-                selectionMode == GridSelectionMode.MULTIPLE_ROWS)
-            {
-                commitInteractiveSelection(
-                    GridSelectionEventKind.SELECT_ALL,
-                    0, 0, dataProvider.length, columns.length);
-
-                grid.anchorRowIndex = 0;
-                grid.anchorColumnIndex = 0;
-                commitCaretPosition(-1, -1);
-            }
+        {
+            selectAllFromKeyboard();
             return;
         }

@@ -1877,6 +1870,39 @@

         // Was some other navigation key hit?
         adjustSelectionUponNavigation(event);
+    }
+
+    /**
+     *  @private
+     *  New event in FP10 dispatched when the user activates the platform
+     *  specific accelerator key combination for a select all operation.
+     *  On Windows this is ctrl-A and on Mac this is cmd-A.
+     */
+    protected function selectAllHandler(event:Event):void
+    {
+        if (!grid || event.isDefaultPrevented())
+            return;
+
+        selectAllFromKeyboard();
+    }
+
+    /**
+     *  @private
+     */
+    private function selectAllFromKeyboard():void
+    {
+        // Caret is not required for selectAll operation.
+        if (selectionMode == GridSelectionMode.MULTIPLE_CELLS ||
+            selectionMode == GridSelectionMode.MULTIPLE_ROWS)
+        {
+            commitInteractiveSelection(
+                GridSelectionEventKind.SELECT_ALL,
+                0, 0, dataProvider.length, columns.length);
+
+            grid.anchorRowIndex = 0;
+            grid.anchorColumnIndex = 0;
+            commitCaretPosition(-1, -1);
+        }
     }

     /**
@@ -3932,10 +3958,18 @@
      */
     protected function dataGrid_focusHandler(event:FocusEvent):void
     {
-        if (event.target == this && grid && (grid.layout is GridLayout))
+        if (!grid || !(grid.layout is GridLayout))
+            return;
+
+        // Show the caret if the focus is either on the DataGrid or the
+        // columnHeaderBar.
+
+        if (event.target == this ||
+            (columnHeaderGroup && event.target == columnHeaderGroup))
         {
-            GridLayout(grid.layout).showCaret = (event.type == FocusEvent.FOCUS_IN &&
-                                                (selectionMode != GridSelectionMode.NONE));
+            GridLayout(grid.layout).showCaret =
+                event.type == FocusEvent.FOCUS_IN &&
+                selectionMode != GridSelectionMode.NONE;
         }
     }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package spark.components
 {