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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -15,19 +15,22 @@
 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
 import flash.display.GradientType;
-import flash.display.Graphics;
 import flash.display.InteractiveObject;
 import flash.display.Loader;
 import flash.display.Sprite;
 import flash.display.Stage;
+import flash.display.Graphics;
 import flash.events.Event;
 import flash.events.EventPhase;
 import flash.events.FocusEvent;
 import flash.events.IEventDispatcher;
 import flash.events.KeyboardEvent;
+import flash.geom.Vector3D;
+import flash.geom.Matrix3D;
 import flash.geom.Matrix;
 import flash.geom.Point;
 import flash.geom.Rectangle;
+
 import flash.text.TextLineMetrics;
 import flash.utils.getQualifiedClassName;

@@ -48,6 +51,7 @@
 import mx.events.ValidationResultEvent;
 import mx.filters.BaseFilter;
 import mx.filters.IBitmapFilter;
+import mx.geom.Transform;
 import mx.graphics.RoundedRectangle;
 import mx.managers.CursorManager;
 import mx.managers.ICursorManager;
@@ -76,6 +80,9 @@
 import mx.utils.StringUtil;
 import mx.validators.IValidatorListener;
 import mx.validators.ValidationResult;
+import __AS3__.vec.Vector;
+import flash.geom.Transform;
+import mx.events.PropertyChangeEventKind;

 use namespace mx_internal;

@@ -852,7 +859,7 @@
     IDeferredInstantiationUIComponent, IFlexDisplayObject, IFlexModule,
     IInvalidating, ILayoutManagerClient, IPropertyChangeNotifier,
     IRepeaterClient, IStateClient, IStyleClient, IToolTipManagerClient,
-    IUIComponent, IValidatorListener
+    IUIComponent, IValidatorListener, IVisualItem
 {
     include "../core/Version.as";

@@ -1343,6 +1350,19 @@
      */
     private var cachedEmbeddedFont:EmbeddedFont = null;

+    /**
+     * @private
+     *
+     * storage for advanced layout and transform properties.
+     */
+	private var _xformOffsets:TransformOffset;
+
+    /**
+     * @private
+     *
+     * storage for the modified Transform object that can dispatch change events correctly.
+     */
+    private var _transform:flash.geom.Transform;
     //--------------------------------------------------------------------------
     //
     //  Variables: Styles
@@ -1516,7 +1536,7 @@
      */
     override public function get x():Number
     {
-        return super.x;
+    	return (_xformOffsets == null)? super.x:_xformOffsets.layoutX;
     }

     /**
@@ -1524,15 +1544,192 @@
      */
     override public function set x(value:Number):void
     {
-        if (super.x == value)
+        if (x == value)
             return;

-        super.x = value;
+        if(_xformOffsets == null)
+	        super.x  = value;
+	   	else
+	   	{
+	   		_xformOffsets.layoutX = value;
+	   		invalidateTransform();
+	   	}

         invalidateProperties();

         dispatchEvent(new Event("xChanged"));
     }
+
+    [Bindable("zChanged")]
+    /**
+     *  @inheritDoc
+     */
+    override public function get z():Number
+    {
+    	return (_xformOffsets == null)? super.z:_xformOffsets.layoutZ;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set z(value:Number):void
+    {
+        if (z == value)
+            return;
+		if(_xformOffsets == null) allocateOffsets();
+   		_xformOffsets.layoutZ = value;
+   		invalidateTransform();
+        dispatchEvent(new Event("zChanged"));
+    }
+
+	/**
+	 *
+	 */
+	public function get transformX():Number
+	{
+    	return (_xformOffsets == null)? 0:_xformOffsets.transformX;
+	}
+    /**
+     *  @private
+     */
+    public function set transformX(value:Number):void
+    {
+        if (transformX == value)
+            return;
+		if(_xformOffsets == null) allocateOffsets();
+   		_xformOffsets.transformX = value;
+   		invalidateTransform();
+   		invalidateParentSizeAndDisplayList();
+    }
+
+	/**
+	 *
+	 */
+	public function get transformY():Number
+	{
+    	return (_xformOffsets == null)? 0:_xformOffsets.transformY;
+	}
+    /**
+     *  @private
+     */
+    public function set transformY(value:Number):void
+    {
+        if (transformY == value)
+            return;
+		if(_xformOffsets == null) allocateOffsets();
+   		_xformOffsets.transformY = value;
+   		invalidateTransform();
+   		invalidateParentSizeAndDisplayList();
+    }
+
+	/**
+	 *
+	 */
+	public function get transformZ():Number
+	{
+    	return (_xformOffsets == null)? 0:_xformOffsets.transformZ;
+	}
+    /**
+     *  @private
+     */
+    public function set transformZ(value:Number):void
+    {
+        if (transformZ == value)
+            return;
+		if(_xformOffsets == null) allocateOffsets();
+   		_xformOffsets.transformZ = value;
+   		invalidateTransform();
+   		invalidateParentSizeAndDisplayList();
+    }
+
+	/**
+	 * Documentation is not currently available
+	 */
+	override public function get rotation():Number
+	{
+		return (_xformOffsets == null)? super.rotation:_xformOffsets.layoutRotationZ;
+	}
+
+	/**
+	 * @private
+	 */
+    override public function set rotation(value:Number):void
+    {
+        if (rotation == value)
+            return;
+
+        // trace("set scaleX:" + this + "value = " + value);
+        if(_xformOffsets == null)
+	        super.rotation = value;
+	   	else
+	   	{
+			invalidateTransform();
+	   		_xformOffsets.layoutRotationZ = value;
+	   		invalidateTransform();
+	   	}
+
+   		invalidateParentSizeAndDisplayList();
+    }
+
+	/**
+	 * Documentation is not currently available
+	 */
+	override public function get rotationZ():Number
+	{
+		return rotation;
+	}
+    /**
+     *  @private
+     */
+    override public function set rotationZ(value:Number):void
+    {
+    	rotation = value;
+    }
+
+	/**
+	 * Documentation is not currently available
+	 */
+    override public function get rotationX():Number
+    {
+    	return (_xformOffsets == null)? super.rotationX:_xformOffsets.layoutRotationX;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set rotationX(value:Number):void
+    {
+        if (rotationX == value)
+            return;
+
+		if(_xformOffsets == null) allocateOffsets();
+   		_xformOffsets.layoutRotationX = value;
+   		invalidateTransform();
+   		invalidateParentSizeAndDisplayList();
+    }
+
+	/**
+	 * Documentation is not currently available
+	 */
+    override public function get rotationY():Number
+    {
+    	return (_xformOffsets == null)? super.rotationY:_xformOffsets.layoutRotationY;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set rotationY(value:Number):void
+    {
+        if (rotationY == value)
+            return;
+
+		if(_xformOffsets == null) allocateOffsets();
+   		_xformOffsets.layoutRotationY = value;
+   		invalidateTransform();
+   		invalidateParentSizeAndDisplayList();
+    }
+

     //----------------------------------
     //  y
@@ -1558,7 +1755,7 @@
      */
     override public function get y():Number
     {
-        return super.y;
+    	return (_xformOffsets == null)? super.y:_xformOffsets.layoutY;
     }

     /**
@@ -1566,10 +1763,16 @@
      */
     override public function set y(value:Number):void
     {
-        if (super.y == value)
+        if (y == value)
             return;

-        super.y = value;
+        if(_xformOffsets == null)
+	        super.y  = value;
+	   	else
+	   	{
+	   		_xformOffsets.layoutY = value;
+	   		invalidateTransform();
+	   	}

         invalidateProperties();

@@ -1719,8 +1922,6 @@
      *  @private
      *  Storage for the scaleX property.
      */
-    private var _scaleX:Number = 1.0;
-
     [Bindable("scaleXChanged")]
     [Inspectable(category="Size", defaultValue="1.0")]

@@ -1741,22 +1942,35 @@
      */
     override public function get scaleX():Number
     {
-        return _scaleX;
-    }
-
-    /**
-     *  @private
-     */
+    	return ((_xformOffsets == null)? super.scaleX:_xformOffsets.layoutScaleX);
+    }
     override public function set scaleX(value:Number):void
     {
-        if (_scaleX == value)
+    	var prevValue:Number = (_xformOffsets == null)? scaleX:_xformOffsets.layoutScaleX;
+        if (prevValue == value)
             return;

         // trace("set scaleX:" + this + "value = " + value);
-        _scaleX = value;
-
-        invalidateProperties();
-        invalidateSize();
+        if(_xformOffsets == null)
+	        super.scaleX = value;
+	   	else
+	   	{
+	   		_xformOffsets.layoutScaleX = value;
+	   		invalidateTransform();
+	   	}
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+	        invalidateProperties();
+        	invalidateSize();
+        }
+        else
+        {
+                // If we're not compatible with Flex3 (measuredWidth is pre-scale always)
+                // and scaleX is changing we need to invalidate parent size and display list
+                // since we are not going to detect a change in measured sizes during measure.
+        	invalidateParentSizeAndDisplayList();
+        }

         dispatchEvent(new Event("scaleXChanged"));
     }
@@ -1769,7 +1983,6 @@
      *  @private
      *  Storage for the scaleY property.
      */
-    private var _scaleY:Number = 1.0;

     [Bindable("scaleYChanged")]
     [Inspectable(category="Size", defaultValue="1.0")]
@@ -1791,23 +2004,64 @@
      */
     override public function get scaleY():Number
     {
-        return _scaleY;
-    }
-
-    /**
-     *  @private
-     */
+    	return ((_xformOffsets == null)? super.scaleY:_xformOffsets.layoutScaleY);
+    }
+
     override public function set scaleY(value:Number):void
     {
-        if (_scaleY == value)
+    	var prevValue:Number = (_xformOffsets == null)? scaleY:_xformOffsets.layoutScaleY;
+        if (prevValue == value)
             return;

-        _scaleY = value;
-
-        invalidateProperties();
-        invalidateSize();
+        if(_xformOffsets == null)
+	        super.scaleY = value;
+	   	else
+	   	{
+	   		_xformOffsets.layoutScaleY = value;
+	   		invalidateTransform();
+	   	}
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+        {
+	        invalidateProperties();
+        	invalidateSize();
+        }
+        else
+        {
+                // If we're not compatible with Flex3 (measuredWidth is pre-scale always)
+                // and scaleX is changing we need to invalidate parent size and display list
+                // since we are not going to detect a change in measured sizes during measure.
+        	invalidateParentSizeAndDisplayList();
+        }

         dispatchEvent(new Event("scaleYChanged"));
+    }
+
+   //----------------------------------
+    //  scaleZ
+    //----------------------------------
+
+    [Bindable("scaleZChanged")]
+    [Inspectable(category="Size", defaultValue="1.0")]
+	/**
+	 * Documentation is not currently available
+	 */
+    override public function get scaleZ():Number
+    {
+    	return ((_xformOffsets == null)? super.scaleZ:_xformOffsets.layoutScaleZ);
+    }
+
+	/**
+	 * @private
+	 */
+    override public function set scaleZ(value:Number):void
+    {
+        if (scaleZ == value)
+            return;
+		if(_xformOffsets == null) allocateOffsets();
+   		_xformOffsets.layoutScaleZ = value;
+   		invalidateTransform();
+        dispatchEvent(new Event("scaleZChanged"));
     }

     /**
@@ -5571,7 +5825,25 @@
                 UIComponentGlobals.layoutManager.invalidateDisplayList(this);
         }
     }
-
+
+	private function invalidateTransform():void
+	{
+		if(_xformOffsets && _xformOffsets.updatePending == false)
+		{
+			_xformOffsets.updatePending = true;
+			if(isOnDisplayList() && UIComponentGlobals.layoutManager &&
+			invalidateDisplayListFlag == false)
+			{
+				UIComponentGlobals.layoutManager.invalidateDisplayList(this);
+			}
+		}
+	}
+
+    private function transformOffsetsChangedHandler(e:Event):void
+    {
+    	invalidateTransform();
+    }
+
     private function isOnDisplayList():Boolean
     {
     	var p:DisplayObjectContainer;
@@ -5801,11 +6073,12 @@
      */
     protected function commitProperties():void
     {
-        if (_scaleX != oldScaleX)
+    	var sX:Number = scaleX;
+        if (sX != oldScaleX)
         {
             if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
             {
-                var scalingFactorX:Number = Math.abs(_scaleX / oldScaleX);
+                var scalingFactorX:Number = Math.abs(scaleX / oldScaleX);
                 if (!isNaN(explicitMinWidth))
                     explicitMinWidth *= scalingFactorX;
                 if (!isNaN(explicitWidth))
@@ -5815,22 +6088,16 @@

                 _width *= scalingFactorX;
             }
-            else if (invalidateSizeFlag)
-            {
-                // If we're not compatible with Flex3 (measuredWidth is pre-scale always)
-                // and scaleX is changing we need to invalidate parent size and display list
-                // since we are not going to detect a change in measured sizes during measure.
-                invalidateParentSizeAndDisplayList();
-            }
-
-            super.scaleX = oldScaleX = _scaleX;
-        }
-
-        if (_scaleY != oldScaleY)
+
+            oldScaleX = scaleX;
+        }
+
+    	var sY:Number = scaleY;
+        if (sY != oldScaleY)
         {
             if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
             {
-                var scalingFactorY:Number = Math.abs(_scaleY / oldScaleY);
+                var scalingFactorY:Number = Math.abs(scaleY / oldScaleY);
                 if (!isNaN(explicitMinHeight))
                     explicitMinHeight *= scalingFactorY;
                 if (!isNaN(explicitHeight))
@@ -5840,15 +6107,8 @@

                 _height *= scalingFactorY;
             }
-            else if (invalidateSizeFlag)
-            {
-                // If we're not compatible with Flex3 (measuredHeight is pre-scale always)
-                // and scaleX is changing we need to invalidate parent size and display list
-                // since we are not going to detect a change in measured sizes during measure.
-                invalidateParentSizeAndDisplayList();
-            }

-            super.scaleY = oldScaleY = _scaleY;
+			oldScaleY = sY;
         }

         if (x != oldX || y != oldY)
@@ -5862,7 +6122,7 @@
             errorStringChanged = false;
             setBorderColorForErrorString();
         }
-
+
     }

     //--------------------------------------------------------------------------
@@ -6331,6 +6591,11 @@
      */
     public function validateDisplayList():void
     {
+        if(_xformOffsets != null && _xformOffsets.updatePending == true)
+        {
+         	validateTransform();
+        }
+
         if (invalidateDisplayListFlag)
         {
             // Check if our parent is the top level system manager
@@ -6660,23 +6925,32 @@
     public function move(x:Number, y:Number):void
     {
         var changed:Boolean = false;
-
-        if (x != super.x)
-        {
-            super.x = x;
+
+        if (x != this.x)
+        {
+	        if(_xformOffsets == null)
+		        super.x  = x;
+		else
+        		_xformOffsets.layoutX = x;
             dispatchEvent(new Event("xChanged"));
             changed = true;
         }

-        if (y != super.y)
-        {
-            super.y = y;
+        if (y != this.y)
+        {
+	        if(_xformOffsets == null)
+		        super.y  = y;
+		else
+        		_xformOffsets.layoutY = y;
             dispatchEvent(new Event("yChanged"));
             changed = true;
         }

         if (changed)
+        {
+      	    invalidateTransform();
             dispatchMoveEvent();
+        }
     }

     /**
@@ -7608,6 +7882,7 @@
                _inheritingStyles[styleProp] :
                _nonInheritingStyles[styleProp];
     }
+

     /**
      *  Sets a style property on this component instance.
@@ -9122,6 +9397,241 @@
             return super.mouseY;
         return globalToLocal(new Point(0, root[fakeMouseY])).y;
     }
+
+
+	/**
+	 * Documentation is not currently available
+	 */
+	protected function allocateOffsets():void
+	{
+		var at:TransformOffset = new TransformOffset();
+		at.addEventListener(Event.CHANGE,transformOffsetsChangedHandler)
+		at.userVisible = false;
+		at.layoutScaleX = scaleX;
+		at.layoutScaleY = scaleY;
+		at.layoutScaleZ = scaleZ;
+		at.layoutRotationX = rotationX;
+		at.layoutRotationY = rotationY;
+		at.layoutRotationZ = rotation;
+		at.layoutX = x;
+		at.layoutY = y;
+		at.layoutZ = z;
+		_xformOffsets = at;
+		invalidateTransform();
+	}
+
+
+
+    private function setTransform(value:flash.geom.Transform):void
+    {
+        // Clean up the old event listeners
+        var oldTransform:mx.geom.Transform = _transform as mx.geom.Transform;
+        if (oldTransform)
+        {
+            oldTransform.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
+        }
+
+        var newTransform:mx.geom.Transform = value as mx.geom.Transform;
+
+        if (newTransform)
+        {
+            newTransform.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
+        }
+
+        _transform = value;
+    }
+
+    private function assignTransformMatrices():void
+    {
+			var m:Matrix = _transform.matrix;
+			var m3:Matrix3D =  _transform.matrix3D;
+			if(m != null)
+				matrix = m.clone();
+			else if(m3 != null)
+				matrix3D = m3.clone();
+
+			invalidateSize();
+    }
+
+	/**
+	 * Documentation is not currently available
+	 */
+    public function get $transform():flash.geom.Transform
+    {
+    	return super.transform;
+    }
+
+	/**
+	 * Documentation is not currently available
+	 */
+    override public function get transform():flash.geom.Transform
+    {
+    	if(_transform == null)
+    	{
+    		setTransform(new mx.geom.Transform(this));
+    	}
+    	return _transform;
+    }
+
+    override public function set transform(value:flash.geom.Transform):void
+    {
+    	setTransform(value);
+
+        assignTransformMatrices();
+        super.transform.colorTransform = value.colorTransform;
+    }
+
+
+
+    private function transformPropertyChangeHandler(event:PropertyChangeEvent):void
+    {
+        if (event.kind == PropertyChangeEventKind.UPDATE)
+        {
+            if (event.property == "matrix" || event.property == "matrix3D")
+            {
+            	assignTransformMatrices();
+            }
+            else if (event.property == "colorTransform")
+            {
+            	super.transform.colorTransform = _transform.colorTransform;
+            }
+        }
+    }
+
+	/**
+	 * Documentation is not currently available
+	 */
+ 	public function set offsets(value:TransformOffset):void
+	{
+		if(value == null && _xformOffsets != null)
+		{
+			value = new TransformOffset();
+			value.userVisible = false;
+			value.initFrom(_xformOffsets);
+		}
+		else if (value != null)
+		{
+			if(_xformOffsets != null)
+				value.initFrom(_xformOffsets);
+		}
+		if(_xformOffsets != null)
+			_xformOffsets.removeEventListener(Event.CHANGE,transformOffsetsChangedHandler);
+		_xformOffsets = value;
+		if(_xformOffsets != null)
+			_xformOffsets.addEventListener(Event.CHANGE,transformOffsetsChangedHandler);
+	}
+
+	/**
+	 * @private
+	 */
+	public function get offsets():TransformOffset
+	{
+		return (_xformOffsets != null && _xformOffsets.userVisible == true)? _xformOffsets:null;
+	}
+
+	/**
+	 * 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
+	{
+		if(_xformOffsets != null)
+		{
+			return _xformOffsets.layoutMatrix;
+		}
+		else
+		{
+			return super.transform.matrix;
+		}
+	}
+
+	/**
+	 * @private
+	 */
+	public function set matrix(value:Matrix):void
+	{
+		if(_xformOffsets == null)
+		{
+			super.transform.matrix = value;
+            invalidateSize();
+		}
+		else
+		{
+			_xformOffsets.matrix = value;
+	   		invalidateTransform();
+	   		invalidateParentSizeAndDisplayList();
+  		}
+	}
+
+	/**
+	 * 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
+	{
+		if(_xformOffsets == null) allocateOffsets();
+		_xformOffsets.matrix3D = value;
+		invalidateTransform();
+   		invalidateParentSizeAndDisplayList();
+	}
+
+	/**
+	 * @private
+	 */
+	public function get matrix3D():Matrix3D
+	{
+		if(_xformOffsets == null) allocateOffsets();
+		return _xformOffsets.layoutMatrix3D;
+	}
+
+
+	/**
+	 * Documentation is not currently available
+	 */
+	public function get layer():Number
+	{
+		return (_xformOffsets == null)? 0:_xformOffsets.layer;
+	}
+
+	[Bindable("layerChange")]
+	/**
+	 * @private
+	 */
+	public function set layer(value:Number):void
+	{
+		if(value == layer)
+			return;
+		if(_xformOffsets == null) allocateOffsets();
+		_xformOffsets.layer = value;
+		dispatchEvent(new FlexEvent("layerChange"));
+		if(parent != null && parent is UIComponent)
+			(parent as UIComponent).invalidateLayering();
+	}
+
+	/**
+	 * Documentation is not currently available.
+	 */
+    public function invalidateLayering():void
+    {
+
+    }
+
+	/**
+	 * Documentation is not currently available.
+	 * Commits the computed transform stored in the xformOffsets object to the flash displayObject's transform.
+	 */
+	protected function validateTransform():void
+	{
+		_xformOffsets.updatePending = false;
+		if(_xformOffsets.computedIs3D)
+		{
+			super.transform.matrix3D = _xformOffsets.computedMatrix3D;
+		}
+		else
+		{
+			super.transform.matrix = _xformOffsets.computedMatrix;
+		}
+	}

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 13763
Author:   smgilson@adobe.com
Date:     2010-01-25T20:53:28.454349Z

Log Message:
-----------
ASDoc bug fixes

QE notes:
Doc notes:
Bugs: FLEXDOCS-1207, FLEXDOCS-1199, FLEXDOCS-1215
Reviewer:
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/olap/OLAPAttribute.as</path>

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

--- frameworks/projects/mx/src/mx/containers/TabNavigator.as
+++ frameworks/projects/mx/src/mx/containers/TabNavigator.as
@@ -314,8 +314,6 @@
  *

  *  <mx:TabNavigator
  *    Styles
- *    fillAlphas="[0.60, 0.40, 0.75, 0.65]"
- *    fillColors="[0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE]"
  *    firstTabStyleName="Value of the tabStyleName property"
  *    focusAlpha="0.4"
  *    focusRoundedCorners="tl tr bl br"


FLEX-25906 only reset text when there's an existing data provider

--- frameworks/projects/spark/src/spark/components/ComboBox.as
+++ frameworks/projects/spark/src/spark/components/ComboBox.as
@@ -344,7 +344,8 @@
 		if (dataProvider === value)
 			return;

-		selectedItem = null;
+		if (dataProvider != null)
+			selectedItem = null;
 		super.dataProvider = value;
 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 18199
Author:   klin@adobe.com
Date:     2010-10-19T06:15:05.005815Z

Log Message:
-----------
Add support for column sorting in DataGrid. Added basic support for interactively sorting the dataProvider by clicking on the column headers. Note that sorting currently only works if the dataProvider is an ICollectionView. We also provide the visibleSortIndicatorIndices property on the ColumnHeaderBar for developers to manually display the sort arrows. I've also changed the ColumnHeaderBarLayout to call prepare and discard on the allocated and created header renderers.

Notable added API include:

-In DataGrid, the sortableColumns property which toggles interactive sorting and sortByColumns() method which sorts the dataProvider by the provided column indices.
-In ColumnHeaderBar, the visibleSortIndicatorIndices allow the header renderers to determine whether to display their sort arrows.
-In GridColumn, the sortDescending property, the sortCompareFunction which has an additional parameter of the current GridColumn, and a read-only sortField property which constructs a SortField based on the current GridColumn.

QE notes: Can start testing column sorting
Doc notes: No
Bugs: No
Reviewer: Hans
Tests run: cyclone server
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridHeaderRenderer.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ColumnHeaderBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DataGridSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ColumnHeaderBarLayout.as</path>

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -11,24 +11,22 @@

 package spark.components
 {
-import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.events.EventPhase;
 import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
-import flash.geom.Point;
 import flash.geom.Rectangle;
 import flash.ui.Keyboard;

+import mx.collections.ICollectionView;
 import mx.collections.IList;
+import mx.collections.Sort;
+import mx.collections.SortField;
 import mx.core.IFactory;
 import mx.core.IIMESupport;
-import mx.core.IToolTip;
-import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
-import mx.events.PropertyChangeEvent;
 import mx.managers.CursorManager;
 import mx.managers.CursorManagerPriority;
 import mx.managers.IFocusManagerComponent;
@@ -48,7 +46,6 @@
 import spark.events.GridSelectionEvent;
 import spark.events.GridSelectionEventKind;

-
 use namespace mx_internal;

 //--------------------------------------
@@ -161,7 +158,6 @@
  *  @productversion Flex 4.5
  */
 [Event(name="gridMouseDown", type="spark.events.GridEvent")]
-

 /**
  *  Dispatched by the grid skin part after a GRID_MOUSE_DOWN event if the mouse moves before the button is released.
@@ -355,17 +351,13 @@
 //  Other metadata
 //--------------------------------------

+[AccessibilityClass(implementation="spark.accessibility.DataGridAccImpl")]
+
 [DefaultProperty("dataProvider")]

 [DiscouragedForProfile("mobileDevice")]

 [IconFile("DataGrid.png")]
-
-//--------------------------------------
-//  Other metadata
-//--------------------------------------
-
-[AccessibilityClass(implementation="spark.accessibility.DataGridAccImpl")]

 /**
  *  TBD(hmuller)
@@ -398,7 +390,7 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 2.4
+     *  @playerversion AIR 2.0
      *  @productversion Flex 4.5
      */
     public function DataGrid()
@@ -1539,6 +1531,47 @@
         if (setGridProperty("showDataTips", value))
             dispatchChangeEvent("showDataTipsChanged");
     }
+
+    //----------------------------------
+    //  sortableColumns
+    //----------------------------------
+
+    private var _sortableColumns:Boolean = true;
+
+    [Bindable("sortableColumnsChanged")]
+    [Inspectable(category="General")]
+
+    /**
+     *  A flag that indicates whether the user can interactively sort columns.
+     *  If true, the user can sort the dataProvider by the
+     *  dataField of a column by clicking on the column's header.
+     *  If true, individual columns must have their
+     *  sortable properties set to false to
+     *  prevent the user from sorting by a particular column.
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function get sortableColumns():Boolean
+    {
+        return _sortableColumns;
+    }
+
+    /**
+     *  @private
+     */
+    public function set sortableColumns(value:Boolean):void
+    {
+        if (_sortableColumns == value)
+            return;
+
+        _sortableColumns = value;
+        dispatchChangeEvent("sortableColumnsChanged");
+    }

     //----------------------------------
     //  typicalItem delegates to (delegates to grid.typicalItem)
@@ -1878,6 +1911,7 @@
             if (grid)
                 columnHeaderBar.dataGrid = this;

+            columnHeaderBar.addEventListener(GridEvent.GRID_CLICK, columnHeaderBar_clickHandler);
             columnHeaderBar.addEventListener(GridEvent.SEPARATOR_ROLL_OVER, separator_rollOverHandler);
             columnHeaderBar.addEventListener(GridEvent.SEPARATOR_ROLL_OUT, separator_rollOutHandler);
             columnHeaderBar.addEventListener(GridEvent.SEPARATOR_MOUSE_DOWN, separator_mouseDownHandler);
@@ -1974,6 +2008,7 @@
         if (instance == columnHeaderBar)
         {
             columnHeaderBar.dataGrid = null;
+            columnHeaderBar.removeEventListener(GridEvent.GRID_CLICK, columnHeaderBar_clickHandler);
             columnHeaderBar.removeEventListener(GridEvent.SEPARATOR_ROLL_OVER, separator_rollOverHandler);
             columnHeaderBar.removeEventListener(GridEvent.SEPARATOR_ROLL_OUT, separator_rollOutHandler);
             columnHeaderBar.removeEventListener(GridEvent.SEPARATOR_MOUSE_DOWN, separator_mouseDownHandler);
@@ -2965,6 +3000,117 @@
     mx_internal function createEditor():DataGridEditor
     {
         return new DataGridEditor(this);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Sorting Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Sort the DataGrid by one or more columns and refresh the display.
+     *
+     *  If the dataProvider is an ICollectionView, then it's sort property will be
+     *  set to a value based on each column's dataField, sortCompareFunction,
+     *  and sortDescending flag, and then the dataProvider's refresh() method will be called.
+     *
+     *  If the dataProvider is not an ICollectionView, then this method has no effect.
+     *
+     *  @param columnIndices The indices of the columns by which to sort the dataProvider.
+     *
+     *  @return true if the dataProvider can be sorted with the provided column indices.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function sortByColumns(columnIndices:Vector.<int>):Boolean
+    {
+        const dataProvider:ICollectionView = this.dataProvider as ICollectionView;
+        if (!dataProvider)
+            return false;
+
+        var sort:Sort = dataProvider.sort;
+        if (sort)
+            sort.compareFunction = null;
+        else
+            sort = new Sort();
+
+        var sortFields:Array = createSortFields(columnIndices, sort.fields);
+        if (!sortFields)
+            return false;
+
+        sort.fields = sortFields;
+
+        dataProvider.sort = sort;
+        dataProvider.refresh();
+        return true;
+    }
+
+    /**
+     *  @priavte
+     *  This function builds an array of SortFields based on the column
+     *  indices given. The direction is based on the current value of
+     *  sortDescending from the column.
+     */
+    private function createSortFields(columnIndices:Vector.<int>, previousFields:Array):Array
+    {
+        if (columnIndices.length == 0)
+            return null;
+
+        var fields:Array = new Array();
+
+        for each (var columnIndex:int in columnIndices)
+        {
+            var col:GridColumn = this.getColumnAt(columnIndex);
+
+            // columns all must either have a dataField or a labelFunction
+            if (!col || (col.dataField == null && col.labelFunction == null))
+                return null;
+
+            var sortField:SortField = null;
+            var sortDescending:Boolean = col.sortDescending;
+            var i:int;
+
+            // Check if we just sorted this column.
+            for (i = 0; i < fields.length; i++)
+            {
+                if (fields[i].name == col.dataField)
+                {
+                    // just sorted this column, so flip sortDescending.
+                    sortDescending = !fields[i].descending;
+                }
+            }
+
+            // If we haven't sorted by this column yet, check if
+            // we've sorted by this column in the previous sort.
+            if (!sortField && previousFields)
+            {
+                for (i = 0; i < previousFields.length; i++)
+                {
+                    if (previousFields[i].name == col.dataField)
+                    {
+                        // sortField exists in previous sort, so flip sortDescending.
+                        sortField = previousFields[i];
+                        sortDescending = !sortField.descending;
+                        break;
+                    }
+                }
+            }
+
+            // Create a SortField from the column.
+            if (!sortField)
+                sortField = col.sortField;
+
+            col.sortDescending = sortDescending;
+            sortField.descending = sortDescending;
+
+            fields.push(sortField);
+        }
+
+        return fields;
     }

     //--------------------------------------------------------------------------
@@ -3582,6 +3728,21 @@
     /**
      *  @private
      */
+    protected function columnHeaderBar_clickHandler(event:GridEvent):void
+    {
+        const column:GridColumn = event.column;
+        if (!enabled || !sortableColumns || !column || !column.sortable)
+            return;
+
+        const columnIndices:Vector.<int> = Vector.<int>([column.columnIndex]);
+
+        if (sortByColumns(columnIndices))
+            columnHeaderBar.visibleSortIndicatorIndices = columnIndices;
+    }
+
+    /**
+     *  @private
+     */
     protected function separator_mouseDownHandler(event:GridEvent):void
     {
         const column:GridColumn = event.column;


Transferred from the Adobe Open Source Subversion Repository

Revision: 2622
Author:   gosmith@adobe.com
Date:     2008-07-24T23:13:32.982076Z

Log Message:
-----------
TextBox and TextGraphic now call applyDisplayObjectProperties() at the end of their draw() method, like all other GraphicElements. This method handles setting the visibiliy of the GraphicElement's DisplayObject, among other things.

Note: We should make it unnecessary for each GraphicElement subclass to have to call applyDisplayObjectProperties() at the end of draw(). The GraphicElement base class should ensure that this gets called at the appropriate time.

Group now calls draw() on graphic elements even if they are invisible, because otherwise applyDisplayObjectProperties() never gets called and the TextLines stay visible. Group was assuming that the only visible stuff in a GraphicElement is drawn with Graphics calls, which isn't the case.

This change is OK for now because every GraphicElement currently has its own DisplayObject, but it will need to be rethought when GraphicElements share DisplayObjects.

Reviewer: Chet
Bug: MXMLG-206 ("Setting visible property on TextGraphic does nothing")
QA: Peter, please add a Mustella test case for the 'visible property of TextBox and TextGraphic
Doc: No

Modified Paths:
--------------
<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/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>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -590,6 +590,8 @@
 		super.draw(g);

 		compose(drawWidth, drawHeight);
+
+		applyDisplayObjectProperties();
 	}

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 2980
Author:   hmuller@adobe.com
Date:     2008-08-25T19:15:40.952630Z

Log Message:
-----------
Updated BasicLayout per the "Group as Viewport" feature.

BasicLayout now sets (Group) layoutTarget's contentWidth,Height
properties in BasicLayout::measure() and updates the layoutTarget's
scrollRect in BasicLayout::updateDisplayList().

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/BasicLayout.as

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

--- frameworks/projects/spark/src/spark/layouts/BasicLayout.as
+++ frameworks/projects/spark/src/spark/layouts/BasicLayout.as
@@ -15,6 +15,7 @@
 import flex.intf.ILayout;
 import flex.intf.ILayoutItem;
 import flash.geom.Point;
+import flash.geom.Rectangle;

 import flex.core.Group;

@@ -137,6 +138,8 @@
         layoutTarget.measuredHeight = Math.max(height, minHeight);
         layoutTarget.measuredMinWidth = minWidth;
         layoutTarget.measuredMinHeight = minHeight;
+        layoutTarget.contentWidth = layoutTarget.measuredWidth;
+        layoutTarget.contentHeight = layoutTarget.measuredHeight;
     }

     public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
@@ -206,6 +209,19 @@
             // Set position
             layoutItem.setActualPosition(childX, childY);
         }
+        var r:Rectangle = layoutTarget.scrollRect;
+        if (r != null)
+        {
+            r.width = unscaledWidth;
+            r.height = unscaledHeight;
+            layoutTarget.scrollRect = r;
+        }
+        else
+        {
+        	var rx:Number = layoutTarget.horizontalScrollPosition;
+        	var ry:Number = layoutTarget.verticalScrollPosition;
+        	layoutTarget.scrollRect = new Rectangle(rx, ry, unscaledWidth, unscaledHeight);
+        }
     }
 }


Fikset ticket:45. Feil i formatteringen av nummer som sendes til WS.

--- app/src/no/makingwaves/cust/dss/code/TravelExpenceCalculator.as
+++ app/src/no/makingwaves/cust/dss/code/TravelExpenceCalculator.as
@@ -378,7 +378,11 @@
 						if (!added) {
 							var allowance:RateVO = new RateVO();
 							allowance.rate = dailyAllowance;
-							allowance.num = (travelPeriode.total_24hours > 0) ? 1 : travelPeriode.total_hours;
+							if (!travelPeriode.overnight) {
+								allowance.num = travelPeriode.total_hours;
+							} else {
+								allowance.num = 1;
+							}
 							allowance.amount = dailyAllowance;
 							allowancesInternational.addItem(allowance);
 						}


Modify resource manager

Modify resource manager

--- krew-framework/krewfw/core_internal/KrewResourceManager.as
+++ krew-framework/krewfw/core_internal/KrewResourceManager.as
@@ -12,14 +12,11 @@
     //------------------------------------------------------------
     public class KrewResourceManager {

-        private var _urlScheme:String;
         private var _globalScopeAssets:AssetManager;
         private var _sceneScopeAssets :AssetManager;

         //------------------------------------------------------------
         public function KrewResourceManager() {
-            _urlScheme = KrewConfig.ASSET_URL_SCHEME;
-
             _globalScopeAssets = new KrewConfig.ASSET_MANAGER_CLASS;
             _sceneScopeAssets  = new KrewConfig.ASSET_MANAGER_CLASS;

@@ -172,15 +169,20 @@
             return _sceneScopeAssets.getObject(fileName);
         }

+        /**
+         * 現環境におけるアセットファイルの URL を取得する
+         */
+        public function getURL(fileName:String):String {
+            return KrewConfig.ASSET_URL_SCHEME + KrewConfig.ASSET_BASE_PATH + fileName;
+        }
+
         //------------------------------------------------------------
         // private
         //------------------------------------------------------------
         private function _mapToSuitablePath(fileNameList:Array):Array {
             var suitablePathList:Array = [];
             for each (var fileName:String in fileNameList) {
-                suitablePathList.push(
-                    _urlScheme + KrewConfig.ASSET_BASE_PATH + fileName
-                );
+                suitablePathList.push(getURL(fileName));
             }
             return suitablePathList;
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18641
Author:   chiedozi@adobe.com
Date:     2010-11-17T01:26:13.734827Z

Log Message:
-----------
Updated MobileApplication api names.

MobileApplicationBase
backKeyHandler renamed to backKeyUpHandler
menuKeyHandler renamed to menuKeyUpHandler
sessionCachingEnabled renamed to persistNavigatorState
persistApplicationState() renamed to saveNavigatorState
restoreApplicationSate() renamed to loadNavigatorState
registerPersistenceClassAliases removed
nativeApplication_invokeHandler() renamed to invokeHandler()
nativeApplication_deactivateHandler() renamed to deactivateHandler()

PersistenceManager
flush() renamed to save() and return success boolean
initialize() renamed to load() and return success boolean
The applicationVersion shared object property was renamed to versionNumber.

View
deserializePersistedData() renamed to deserializeData()

ViewNavigatorBase
restoreViewData() renamed loadViewData()

Events
APPLICATION_PERSIST and APPLICATION_RESTORE removed from the framework
APPLICATION_PERSISTING renamed to NAVIGATOR_STATE_SAVING
APPLICATION_RESTORING renamed to NAVIGATOR_STATE_LOADING

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers/IPersistenceManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers/PersistenceManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/View.as
+++ frameworks/projects/mobilecomponents/src/spark/components/View.as
@@ -886,7 +886,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public function deserializePersistedData(value:Object):Object
+    public function deserializeData(value:Object):Object
     {
         return value;
     }


playback fixes for non-standart chunk with trash-bytes

--- HLSPlugin/src/org/denivip/osmf/net/httpstreaming/hls/HTTPHLSStreamSource.as
+++ HLSPlugin/src/org/denivip/osmf/net/httpstreaming/hls/HTTPHLSStreamSource.as
@@ -590,6 +590,16 @@
 						{
 							_endFragment = (_downloader != null && _downloader.isOpen && _downloader.isComplete && !_downloader.hasData);
 							_hasErrors = (_downloader != null && _downloader.hasErrors);
+
+							// stuck fix
+							if(_downloader.isOpen && _downloader.isComplete && _downloader.hasData){
+								CONFIG::LOGGING{
+									logger.warn("Trying to fix the stuck issue");
+								}
+								input = _downloader.getBytes(_downloader.totalAvailableBytes);
+								input.readBytes(new ByteArray());
+								_endFragment = true;
+							}
 						}
 					}


more view helper cleanup

more view helper cleanup

--- vendor/ras3r/ras3r/controls/Image.as
+++ vendor/ras3r/ras3r/controls/Image.as
@@ -14,8 +14,7 @@
 		// >>> PUBLIC PROPERTIES
 		override public function set source (s:Object) :void
 		{
-			Logger.info('Image#source: ' + s);
-			if (s is String) s = ReactionController.asset_host + '/' + s.toString();
+			if (s is String) s = ReactionController.url_for(s.toString());
 			super.source = s;
 		}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.controls
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19952
Author:   clucier@adobe.com
Date:     2011-01-26T14:49:30.426061Z

Log Message:
-----------
Animate will now no longer attempt to reapply cached constraint values after the effect is complete.

QE notes: None
Doc notes: None
Bugs: SDK-28817
Reviewer: Jason S.
Tests run: Full Cyclone
Is noteworthy for integration: Yes

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

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/AnimateInstance.as
@@ -735,9 +735,12 @@
             setupParentLayout(false);
             cacheConstraints();
         }
-        if (disabledConstraintsMap && !disableLayout)
+        else if (disabledConstraintsMap)
+        {
             for (var constraint:String in disabledConstraintsMap)
                 cacheConstraint(constraint);
+            disabledConstraintsMap = null;
+        }

         finalizeValues();
     }
@@ -785,12 +788,11 @@

     private function animationCleanup():void
     {
-        if (disableLayout || disabledConstraintsMap)
+        if (disableLayout)
         {
             reenableConstraints();
             if (disableLayout)
                 setupParentLayout(true);
-            disabledConstraintsMap = null;
         }
     }


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 5220
Author:   chaase@adobe.com
Date:     2009-03-10T15:55:06.496289Z

Log Message:
-----------
New Transform effects to handle correctly doing Move, Rotate, and Scale operations simultaneously. Also, added keyframe capabilities to new effects system (necessary for the transform effects, shouldn't affect operation of other effects). Fixed various issues with effects/transition infrastructure as necessary. Added transform utility functions to UIComponent, AdvancedLayoutFeatures, and GraphicElement.

QE Notes: This will break existing new effects tests due to changes in core Animation and AnimationEvent classes, QE is disabling them for now and will add them back in as changes are made.
Doc Notes: None
Bugs:
Reviewer: Ely (transform utilities) and Jason (the rest)
tests: checkintests, Mustella tests/Effects, tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/CompositeEffect.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/PropertyChanges.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate3D.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/baseClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/AnimationEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AnimationProperty.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/spark/src/spark/effects/AnimateTransform.as
+++ frameworks/projects/spark/src/spark/effects/AnimateTransform.as
@@ -0,0 +1,719 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.effects
+{
+import flash.geom.Vector3D;
+import flash.utils.Dictionary;
+
+import mx.core.mx_internal;
+import mx.effects.Effect;
+import mx.effects.FxAnimate;
+import mx.effects.IEffectInstance;
+import mx.events.EffectEvent;
+import mx.styles.IStyleClient;
+
+import spark.effects.effectClasses.AnimateTransformInstance;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="repeatCount", kind="property")]
+[Exclude(name="repeatBehavior", kind="property")]
+[Exclude(name="repeatDelay", kind="property")]
+
+/**
+ * This effect controls all transform-related animations on target
+ * objects. Transform operations, e.g., translation, scale, and
+ * rotation, must be combined into single operations that act
+ * together in order to avoid clobbering overlapping values. Therefore,
+ * this effect works by combining all current transform effects
+ * (AnimateTransform and any subclasses) on a particular target into one
+ * single global instance for that target.
+ *
+ *
The transform is controlled by animating the properties of
+ * translation (translationX, translationY, and translationZ),
+ * rotation (rotationX, rotationY,
+ * and rotationZ), and scale (scaleX, scaleY, scaleZ). If any of
+ * these properties are not provided in the set of MotionPath objects
+ * for this effect, then it is assumed that these properties can
+ * be derived from the object and are not changing during the course
+ * of this effect.

+ *
+ *
It is important to note that the translation properties
+ * (translationX, translationY, and translationZ)
+ * specify how much the transformCenter moves during
+ * the animation, not the absolute locations of the x, y, and z
+ * coordinate of the target object. Typically, these mean the same thing
+ * because the transformCenter of the object is at (0, 0). But if
+ * the autoCenterTransform property is set, this changes.
+ * For example, an object doing a simple rotation around its center will
+ * have different (x, y) coordinates at the start and end, even though
+ * the center of the object has not been translated. By specifying
+ * that translationX/Y/Z act on the transformCenter instead, we can
+ * correctly specify an animation with rotation only and no translation
+ * and get the desired result.

+ *
+ *
This combination of multiple transform effects happens
+ * internally and the caller of the effects need not be aware of it,
+ * but it does force certain constraints that should be considered:
+ * (1) the transformCenter for the target object (either set on the object
+ * itself or set indirectly through the autoCenterTransform
+ * or transformX, transformY,
+ * or transformZ properties in this effect) will be
+ * globally applied to all transform effects on that target, so they
+ * should all use the same values, (2) these transform effects ignore
+ * repeat parameters, since the effects of any single Transform effect
+ * will impact all other Transform effects running on the same target
+ * (effects can still be repeated by encapsulating them in
+ * CompositeEffects which repeat), (3) the subclasses of AnimateTransform provide an
+ * easy way for simple manipulations of the transform effect, but for
+ * full control and fine-grained manipulation of the underlying keyframe
+ * times and values, use the AnimateTransform effect directly.

+ *
+ * An additional constraint of this effect and its subclasses is that
+ * the target must be of type UIComponent or GraphicElement (or a subclass
+ * of those classes), or any other object which has similarly
+ * defined and implemented transformAround() and
+ * transformPointToParent() functions.
+ */
+public class AnimateTransform extends FxAnimate
+{
+    include "../../mx/core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructor.
+     */
+    public function AnimateTransform(target:Object=null)
+    {
+        super(target);
+        instanceClass = AnimateTransformInstance;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    // TODO (chaase): Is weak Dictionary sufficient to hold these values and then
+    // dispense with them appropriately? What if we get interrupted before we
+    // clear the map?
+    /**
+     * @private
+     *
+     * Stores the single instance for the current transform effect on a given target.
+     * There can be only one instance per target at any given time, so we store
+     * that instance in the map and insert new effect values into it before playing
+     * it, rather than creating new instances for each new effect. The instance
+     * is cleared out when the effect is played because we cannot add new information
+     * to the effect after it has already been started.
+     */
+    static protected var transformInstancePerTarget:Dictionary = new Dictionary(true);
+
+    /**
+     * @private
+     * These maps hold information about whether values have already been applied
+     * to a target as a part of the
+     */
+    static protected var appliedStartValuesPerTarget:Dictionary = new Dictionary(true);
+    static protected var appliedEndValuesPerTarget:Dictionary = new Dictionary(true);
+
+    /**
+     * @private
+     * Helper structures to hold values used in applyValues()
+     */
+    private static var scale:Vector3D = new Vector3D();
+    private static var rotation:Vector3D = new Vector3D();
+    private static var position:Vector3D = new Vector3D();
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  autoCenterTransform
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     * This flag controls whether the transform effect will occur
+     * around the center of the target, (width/2, height/2).
+     * If the flag is not set, the transform center is determined by
+     * the transform center of the object (transformX, transformY,
+     * transformZ) and the transformX, transformY,
+     * transformZ properties in this effect. That is, the
+     * transform center is the transform center of the target object,
+     * where any of the transformX, transformY,
+     * transformZ properties are overriden by those
+     * values in the effect, if set.
+     *
+     * @default false
+     * @see mx.core.UIComponent#transformX
+     * @see mx.core.UIComponent#transformY
+     * @see mx.core.UIComponent#transformZ
+     * @see #transformX
+     * @see #transformY
+     * @see #transformZ
+     */
+    public var autoCenterTransform:Boolean = false;
+
+    //----------------------------------
+    //  transformX
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="NaN")]
+
+    /**
+     * Sets the x coordinate for the transform center, unless overriden
+     * by the autoCenterTransform property.
+     *
+     *
If autoCenterTransform is not true, the transform
+     * center will be determined by the transformX,
+     * transformY, and transformZ properties
+     * of the target object, but each of those properties can be
+     * overriden by setting the respective properties in this effect.

+     *
+     * @see mx.core.UIComponent#transformX
+     * @see #autoCenterTransform
+     */
+    public var transformX:Number;
+
+    //----------------------------------
+    //  transformY
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="NaN")]
+
+    /**
+     * Sets the y coordinate for the transform center, unless overriden
+     * by the autoCenterTransform property.
+     *
+     *
If autoCenterTransform is not true, the transform
+     * center will be determined by the transformX,
+     * transformY, and transformZ properties
+     * of the target object, but each of those properties can be
+     * overriden by setting the respective properties in this effect.

+     *
+     * @see mx.core.UIComponent#transformY
+     * @see #autoCenterTransform
+     */
+    public var transformY:Number;
+
+    //----------------------------------
+    //  transformZ
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="NaN")]
+
+    /**
+     * Sets the z coordinate for the transform center, unless overriden
+     * by the autoCenterTransform property.
+     *
+     *
If autoCenterTransform is not true, the transform
+     * center will be determined by the transformX,
+     * transformY, and transformZ properties
+     * of the target object, but each of those properties can be
+     * overriden by setting the respective properties in this effect.

+     *
+     * @see mx.core.UIComponent#transformZ
+     * @see #autoCenterTransform
+     */
+    public var transformZ:Number;
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Creates the instance for this effect. Unlike other effects which operate
+     * autonomously, this effect uses only a single effect instance per target.
+     * So all objects of type AnimateTransform or its subclasses will share this
+     * one global instance. If there is already an instance created for the effect,
+     * the values from the new effect will be inserted as animation values into
+     * the existing instance.
+     */
+    override public function createInstance(target:Object = null):IEffectInstance
+    {
+        if (!target)
+            target = this.target;
+
+        if (!transformInstancePerTarget[target])
+        {
+            // TODO (chaase): need to clear out this entry once the effect
+            // starts (stops?) because we don't want it hanging around for
+            // future runs
+            var newInstance:IEffectInstance = super.createInstance(target);
+            transformInstancePerTarget[target] = newInstance;
+            return newInstance;
+        }
+        else
+        {
+            var instance:AnimateTransformInstance =
+                AnimateTransformInstance(transformInstancePerTarget[target]);
+            initInstance(instance);
+            return instance;
+        }
+    }
+
+    /**
+     * @private
+     *
+     * We handle this event in order to remove the single effect instance per
+     * target. We cannot correctly add values to a playing effect, so we only
+     * allow combining values into the single instance before that instance
+     * begins.
+     */
+    override protected function effectStartHandler(event:EffectEvent):void
+    {
+        super.effectStartHandler(event);
+        delete transformInstancePerTarget[event.effectInstance.target];
+        delete appliedStartValuesPerTarget[event.effectInstance.target];
+        delete appliedEndValuesPerTarget[event.effectInstance.target];
+    }
+
+    /**
+     * @private
+     * Used internally to grab the values of the relevant properties. Note
+     * that some properties are fake - translationX, translationY,
+     * and translationZ do not exist on the targets,
+     * but are manufactured from a combination of the object position
+     * and the transform center.
+     */
+    override mx_internal function captureValues(propChanges:Array,
+                                       setStartValues:Boolean):Array
+    {
+        propChanges = super.captureValues(propChanges,setStartValues);
+        var valueMap:Object;
+        var i:int;
+        var n:int;
+        var target:Object;
+
+        n = propChanges.length;
+        for (i = 0; i < n; i++)
+        {
+            target = propChanges[i].target;
+            valueMap = setStartValues ? propChanges[i].start : propChanges[i].end;
+            if (targets.indexOf(target) >= 0 &&
+                (valueMap.translationX === undefined ||
+                 valueMap.translationY === undefined ||
+                 valueMap.translationZ === undefined))
+            {
+                // TODO (chaase): do we really need this?
+                propChanges[i].stripUnchangedValues = false;
+
+                var computedTransformCenter:Vector3D =
+                    computeTransformCenterForTarget(target);
+                var position:Vector3D = new Vector3D();
+                target.transformPointToParent(computedTransformCenter, position,
+                    new Vector3D());
+                valueMap.translationX = position.x;
+                valueMap.translationY = position.y;
+                valueMap.translationZ = position.z;
+            }
+        }
+        return propChanges;
+    }
+
+    /**
+     * @private
+     *
+     * Calculates the transformCenter used by the effect instance for this
+     * target. The center is calculated as:
+     * - if autoCenterTransform, center around the target's x/y center
+     * - else if none of transformX, transformY, transformZ are set on the
+     * effect, return null. This will result in the effect simply using
+     * the target's transform center
+     * - else get the transformXYZ properties in the target and override
+     * these values by the effects transformXYZ properties
+     */
+    private function computeTransformCenterForTarget(target:Object):Vector3D
+    {
+        var computedTransformCenter:Vector3D;
+
+        if (autoCenterTransform)
+        {
+            computedTransformCenter = new Vector3D(target.width/2,target.height/2,0);
+        }
+        else
+        {
+            if(!isNaN(transformX) || !isNaN(transformY) || !isNaN(transformZ))
+            {
+                computedTransformCenter = new Vector3D(target.transformX,
+                    target.transformY, target.transformZ);
+                if(!isNaN(transformX))
+                    computedTransformCenter.x = transformX;
+                if(!isNaN(transformY))
+                    computedTransformCenter.y = transformY;
+                if(!isNaN(transformZ))
+                    computedTransformCenter.z = transformZ;
+            }
+        }
+        return computedTransformCenter;
+    }
+
+    /**
+     * @private
+     *
+     * Utility function called by applyStartValues() and
+     * applyEndValues(). We override these functions from Effect
+     * because we need to apply all transform-related properties
+     * at the same time, rather than one by one, because they are
+     * all interdependent.
+     */
+    private function applyValues(propChanges:Array, targets:Array,
+        start:Boolean):void
+    {
+        var appliedValuesPerTarget:Dictionary =
+            start ?
+            appliedStartValuesPerTarget :
+            appliedEndValuesPerTarget;
+        var n:int = propChanges.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            var m:int;
+            var j:int;
+
+            var target:Object = propChanges[i].target;
+            var apply:Boolean = false;
+
+            if (appliedValuesPerTarget[target])
+                continue;
+
+            m = targets.length;
+            for (j = 0; j < m; j++)
+            {
+                if (targets[j] == target)
+                {
+                    apply = filterInstance(propChanges, target);
+                    break;
+                }
+            }
+
+            if (apply)
+            {
+                var effectProps:Array = relevantProperties;
+                var valueMap:Object = start ? propChanges[i].start : propChanges[i].end;
+                var transitionValues:Object = {
+                    rotationX:NaN, rotationY:NaN, rotation:NaN,
+                    scaleX:NaN, scaleY:NaN, scaleZ:NaN,
+                    translationX:NaN, translationY:NaN, translationZ:NaN
+                };
+
+                // Walk the properties in the target
+                m = effectProps.length;
+                for (j = 0; j < m; j++)
+                {
+                    if (effectProps[j] in valueMap)
+                    {
+                        transitionValues[effectProps[j]] = valueMap[effectProps[j]];
+                    }
+                }
+                // Now transform it
+                var xformCenter:Vector3D = computeTransformCenterForTarget(target);
+                var tmpScale:Vector3D;
+                var tmpPosition:Vector3D;
+                var tmpRotation:Vector3D;
+                if (!isNaN(transitionValues.scaleX) ||
+                    !isNaN(transitionValues.scaleY) ||
+                    !isNaN(transitionValues.scaleZ))
+                {
+                    scale.x = !isNaN(transitionValues.scaleX) ?
+                        transitionValues.scaleX : target["scaleX"];
+                    scale.y = !isNaN(transitionValues.scaleY) ?
+                        transitionValues.scaleY : target["scaleY"];
+                    scale.z = !isNaN(transitionValues.scaleY) ?
+                        transitionValues.scaleZ : target["scaleZ"];
+                    tmpScale = scale;
+                }
+
+                if (!isNaN(transitionValues.rotationX) ||
+                    !isNaN(transitionValues.rotationY) ||
+                    !isNaN(transitionValues.rotationZ))
+                {
+                    rotation.x = !isNaN(transitionValues.rotationX) ?
+                        transitionValues.rotationX : target["rotationX"];
+                    rotation.y = !isNaN(transitionValues.rotationY) ?
+                        transitionValues.rotationY : target["rotationY"];
+                    rotation.z = !isNaN(transitionValues.rotationZ) ?
+                        transitionValues.rotationZ : target["rotationZ"];
+                    tmpRotation = rotation;
+                }
+
+                position.x = transitionValues.translationX;
+                position.y = transitionValues.translationY;
+                position.z = transitionValues.translationZ;
+                if (isNaN(position.x) || isNaN(position.y) || isNaN(position.z))
+                {
+                    var xformPosition:Vector3D = new Vector3D();
+                    var postLayoutPosition:Vector3D = new Vector3D();
+                    target.transformPointToParent(xformCenter,
+                        xformPosition, postLayoutPosition);
+                    if (isNaN(position.x))
+                        position.x = xformPosition.x;
+                    if (isNaN(position.y))
+                        position.y = xformPosition.y;
+                    if (isNaN(position.z))
+                        position.z = xformPosition.z;
+                }
+                target.transformAround(xformCenter, tmpScale, tmpRotation,
+                    position);
+                appliedValuesPerTarget[target] = true;
+            }
+        }
+    }
+
+    /**
+     * @private
+     *
+     * Applies the start values found in the array of PropertyChanges
+     * to the relevant targets. Overriding because we need to set
+     * transform-related properties together, not one-by-one.
+     */
+    mx_internal override function applyStartValues(propChanges:Array,
+                                    targets:Array):void
+    {
+        applyValues(propChanges, targets, true);
+        super.mx_internal::applyStartValues(propChanges, targets);
+    }
+
+    /**
+     * @private
+     *
+     * Applies the end values found in the array of PropertyChanges
+     * to the relevant targets. Overriding because we need to set
+     * transform-related properties together, not one-by-one.
+     */
+    mx_internal override function applyEndValues(propChanges:Array,
+                                    targets:Array):void
+    {
+        // For now, only new Flex4 effects will apply end values when transitions
+        // are over, to preserve the previous behavior of Flex3 effects
+        if (applyTransitionEndProperties)
+        {
+            applyValues(propChanges, targets, false);
+            super.mx_internal::applyEndValues(propChanges, targets);
+        }
+    }
+
+    /**
+     * @private
+     *
+     * Called by Effect.applyStartValues() and Effect.applyEndValues(). Overriding
+     * to noop some property setting
+     */
+    override protected function applyValueToTarget(target:Object, property:String,
+                                          value:*, props:Object):void
+    {
+        // We've already set these properties in applyStartValues() or
+        // applyEndValues() override; don't set them again here
+        if (property == "translationX" || property == "translationY" ||
+            property == "translationY" || property == "rotationX" ||
+            property == "rotationY" || property == "rotationZ" ||
+            property == "scaleX" || property == "scaleY" ||
+            property == "scaleZ")
+        {
+            return;
+        }
+        else
+        {
+            super.applyValueToTarget(target, property, value, props);
+        }
+    }
+
+    override public function getAffectedProperties():Array /* of String */
+    {
+        return ["translationX", "translationY", "translationZ",
+            "rotationX", "rotationY", "rotationZ",
+            "scaleX", "scaleY", "scaleZ"];
+    }
+
+    /**
+     * Inserts a keyframe into an existing set of keyframes according to
+     * its time. Keyframes are sorted in increasing time order.
+     */
+    private function insertKeyframe(keyframes:Array, newKF:KeyFrame):void
+    {
+        for (var i:int = 0; i < keyframes.length; i++)
+        {
+            if (keyframes[i].time > newKF.time)
+            {
+                keyframes.splice(i, 0, newKF);
+                return;
+            }
+        }
+        keyframes.push(newKF);
+    }
+
+    /**
+     * Adds a MotionPath object to the transform effect with the
+     * given parameters. If a MotionPath
+     * on the same property already exists, adds the keyframes from the
+     * new MotionPath object into the existing MotionPath object, sorted
+     * by the time values.
+     */
+    protected function addMotionPath(property:String,
+        valueFrom:Number = NaN, valueTo:Number = NaN, valueBy:Number = NaN):void
+    {
+        // First, nail down the from value with to/by, if possible
+        if (isNaN(valueFrom))
+        {
+            if (!isNaN(valueTo) && !isNaN(valueBy))
+                valueFrom = valueTo - valueBy;
+        }
+        // Now create a MotionPath from the result
+        var mp:MotionPath = new MotionPath(property);
+        mp.keyframes = [new KeyFrame(0, valueFrom),
+            new KeyFrame(duration, valueTo, valueBy)];
+
+        // Finally, integrate this MotionPath in with the existing
+        // MotionPath objects, if there are any
+        if (animationProperties)
+        {
+            var n:int = animationProperties.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                var prop:MotionPath = MotionPath(animationProperties[i]);
+                if (prop.property == mp.property)
+                {
+                    for (var j:int = 0; j < mp.keyframes.length; j++)
+                    {
+                        insertKeyframe(prop.keyframes, mp.keyframes[j]);
+                    }
+                    return;
+                }
+            }
+        }
+        else
+        {
+            animationProperties = [];
+        }
+        animationProperties.push(mp);
+    }
+
+    // TODO (chaase): This function appears in multiple places. Maybe
+    // put it in some util class instead?
+    /**
+     * @private
+     *
+     * Utility function to determine whether a given value is 'valid',
+     * which means it's either a Number and it's not NaN, or it's not
+     * a Number and it's not null
+     */
+    private function isValidValue(value:Object):Boolean
+    {
+        return ((value is Number && !isNaN(Number(value))) ||
+            (!(value is Number) && value !== null));
+    }
+
+    /**
+     * @private
+     *
+     * This is where we create the single instance and/or feed extra
+     * MotionPath information (from othe transform-related effects) into the
+     * single transform effect instance.
+     */
+    override protected function initInstance(instance:IEffectInstance):void
+    {
+        var i:int;
+
+        var target:Object = instance.target;
+
+        var transformInstance:AnimateTransformInstance =
+            AnimateTransformInstance(instance);
+
+        // Feed startDelay directly into keyframe times
+        if (animationProperties)
+        {
+            var instanceAnimProps:Array = [];
+            for (i = 0; i < animationProperties.length; ++i)
+                instanceAnimProps[i] = animationProperties[i].clone();
+            if (startDelay != 0)
+            {
+                for (i = 0; i < animationProperties.length; ++i)
+                {
+                    var mp:MotionPath = MotionPath(instanceAnimProps[i]);
+                    if (mp.keyframes)
+                    {
+                        for (var j:int = 0; j < mp.keyframes.length; ++j)
+                        {
+                            var kf:KeyFrame = KeyFrame(mp.keyframes[j]);
+                            kf.time += startDelay;
+                        }
+                    }
+                }
+            }
+            var globalStartTime:Number = getGlobalStartTime();
+            for (i = 0; i < instanceAnimProps.length; ++i)
+                transformInstance.addMotionPath(instanceAnimProps[i], globalStartTime);
+        }
+        // Multiple effects can feed into this one instance, so only init
+        // it once
+        if (transformInstance.initialized)
+            return;
+        transformInstance.initialized = true;
+
+        transformInstance.transformCenter =
+            computeTransformCenterForTarget(instance.target);
+
+        // Need to hide these properties from the superclass, as they are
+        // already handled in our single instance. But restore them afterwards
+        // so that they are still available for reuse upon re-playing the effect
+        var tmpStartDelay:Number = startDelay;
+        startDelay = 0;
+        var tmpAnimProps:Array = animationProperties;
+        animationProperties = null;
+        super.initInstance(instance);
+        startDelay = tmpStartDelay;
+        animationProperties = tmpAnimProps;
+    }
+
+    /**
+     * @private
+     *
+     * Utility method used by subclasses which returns the time,
+     * in milliseconds, when this effect starts, relative to
+     * the outermost CompositeEffect. This value does not include the
+     * startDelay on the effect itself (which should be figured
+     * into the effect's start time locally), but does include that delay
+     * on any parent effects. This global start time is needed by AnimateTransform
+     * and subclass effects which need to calculate the times in their keyframes
+     * according to when they happen relative to each other (because of the
+     * single-instance-per-target nature of this effect).
+     */
+    private function getGlobalStartTime():Number
+    {
+        var globalStartTime:Number = 0;
+        var parent:Effect = mx_internal::parentCompositeEffect;
+        while (parent)
+        {
+            globalStartTime += parent.startDelay;
+            parent = parent.mx_internal::parentCompositeEffect;
+        }
+        return globalStartTime;
+    }
+
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 7836
Author:   chaase@adobe.com
Date:     2009-06-15T14:37:21.379918Z

Log Message:
-----------
PARB changes for effects. This includes various property renames, a couple of class renames, moving 3 classes to a sub-package, and various doc cleanups. This also includes changing a handful of Array properties to typed Vectors.

QE: This breaks Mustella due to the renames
Doc: Docs will need to be updated to reflect the changes as well
Bugs: None
Reviewer: Jason
Tests: checkintests, Thermo's transitionbug test

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/utils/BitmapUtil.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/EasingFraction.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/RGBInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/HSBInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CallAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/RepeatBehavior.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/IInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/NumberInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/CallActionInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SimpleMotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Rotate.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTransitionInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateShaderTransitionInstance.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransitionShaderInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/ArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CrossFade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SimpleMotionPath.as" copyfrom-rev="7748" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/SimpleMotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/HSBColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/IAnimationTarget.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/ResizeInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Keyframe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/CrossFade.pbk</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/WipeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>

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

--- frameworks/projects/spark/src/spark/effects/interpolation/MultiValueInterpolator.as
+++ frameworks/projects/spark/src/spark/effects/interpolation/MultiValueInterpolator.as
@@ -88,19 +88,6 @@
     }

     /**
-     *  The data type of the elements of the Array.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get interpolatedType():Class
-    {
-        return Array;
-    }
-
-    /**
      * @inheritDoc
      *
      * Interpolation for ArrayInterpolator consists of running a separate


Added selection feedback to WebSocketDataSource.

--- WeaveASJS/src/weavejs/data/source/WebSocketDataSource.as
+++ WeaveASJS/src/weavejs/data/source/WebSocketDataSource.as
@@ -18,6 +18,7 @@
 	import weavejs.WeaveAPI;
 	import weavejs.api.core.ILinkableHashMap;
 	import weavejs.api.core.ILinkableVariable;
+	import weavejs.api.data.IKeySet;
 	import weavejs.api.data.Aggregation;
 	import weavejs.api.data.ColumnMetadata;
 	import weavejs.api.data.DataType;
@@ -37,6 +38,7 @@
 	import weavejs.data.hierarchy.ColumnTreeNode;
 	import weavejs.data.ColumnUtils;
 	import weavejs.data.DataSourceUtils;
+	import weavejs.data.key.DynamicKeyFilter;
 	import weavejs.util.JS;
 	import weavejs.util.StandardLib;

@@ -49,27 +51,44 @@

 		public function WebSocketDataSource()
 		{
+			this.selectionFilter.targetPath = ["defaultSelectionKeySet"];
 		}

 		public const keyType:LinkableString = Weave.linkableChild(this, LinkableString);
 		public const keyProperty:LinkableString = Weave.linkableChild(this, LinkableString);
 		public const keepLast:LinkableNumber = Weave.linkableChild(this, LinkableNumber, onKeepLastChange);
+		public const selectionFilter:DynamicKeyFilter = Weave.linkableChild(this, DynamicKeyFilter, onSelectionFilterChange);
 		//public const selectionFeedback:LinkableBoolean = Weave.linkableChild(this, LinkableBoolean);
 		public const url:LinkableString = Weave.linkableChild(this, LinkableString, onUrlChange);

+		private function onSelectionFilterChange():void
+		{
+			if (_socket && _socket.readyState == 1)
+			{
+				var ks:IKeySet = selectionFilter.getInternalKeyFilter() as IKeySet;
+				_socket.send(JSON.stringify(ks.keys.map(function (key:IQualifiedKey, idx:int, a:Array):String {
+					return key.localName;
+				})));
+			}
+		}
+
 		private var _socket:Object = null;
 		private function onUrlChange():void
 		{
+			reconnect();
+
+			records = [];
+			propertyNames.clear();
+		}
+
+		public function reconnect():void /* To be called from UI reconnect button. */
+		{
 			if (_socket && _socket.readyState < 2)
 			{
 				_socket.close(1000, "No longer needed.");
 				_socket = null;
 			}
-
-			records = [];
-			propertyNames.clear();
-

 			_socket = new JS.global.WebSocket(url.value);

@@ -86,6 +105,7 @@
 		private function onError(event:Object):void
 		{
 			JS.error(event);
+			/* Should we automatically retry here? */
 			_socket = null;
 		}