Transferred from the Adobe Open Source Subversion Repository

Revision: 20078
Author:   klin@adobe.com
Date:     2011-02-02T23:41:09.401228Z

Log Message:
-----------
Recommit 19979. Fixed missing parameter in TransformUtil's needAdvancedLayout call.

Refactoring shared transformation code in UIComponent, SpriteVisualElement, and UIMovieClip into a utility class, TransformUtil. The methods transformAround() and transformPointToParent() are now delegated to the new class. For transformAround, the components also pass in their AdvancedLayoutFeatures and initAdvancedLayoutFeatures() method so that TransformUtil can create and initialize the layout features object if necessary.

QE notes: No
Doc notes: No
Bugs: SDK-22637
Reviewer: Evtim
Tests run: cyclone server, checkintests
Is noteworthy for integration: Yes, possibly for FC

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/utils/TransformUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>

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

--- frameworks/projects/framework/src/mx/utils/TransformUtil.as
+++ frameworks/projects/framework/src/mx/utils/TransformUtil.as
@@ -0,0 +1,226 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 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.utils
+{
+import flash.display.DisplayObject;
+import flash.geom.Point;
+import flash.geom.Vector3D;
+
+import mx.core.AdvancedLayoutFeatures;
+
+[ExcludeClass]
+
+/**
+ *  @private
+ *  The TransformUtil class is for internal use only.
+ *  It is used for shared code between UIComponent, SpriteVisualElement, and
+ *  UIMovieClip.
+ */
+public final class TransformUtil
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Returns true if the parameters indicate that AdvancedLayoutFeatures is
+     *  needed.
+     */
+    private static function needAdvancedLayout(transformCenter:Vector3D,
+                                               scale:Vector3D,
+                                               rotation:Vector3D,
+                                               translation:Vector3D,
+                                               postLayoutScale:Vector3D,
+                                               postLayoutRotation:Vector3D,
+                                               postLayoutTranslation:Vector3D):Boolean
+    {
+        var needAdvancedLayout:Boolean =
+            (scale != null && ((!isNaN(scale.x) && scale.x != 1) ||
+                (!isNaN(scale.y) && scale.y != 1) ||
+                (!isNaN(scale.z) && scale.z != 1))) ||
+            (rotation != null && ((!isNaN(rotation.x) && rotation.x != 0) ||
+                (!isNaN(rotation.y) && rotation.y != 0) ||
+                (!isNaN(rotation.z) && rotation.z != 0))) ||
+            (translation != null && translation.z != 0 && !isNaN(translation.z)) ||
+            postLayoutScale != null ||
+            postLayoutRotation != null ||
+            (postLayoutTranslation != null &&
+                (translation == null ||
+                    postLayoutTranslation.x != translation.x ||
+                    postLayoutTranslation.y != translation.y ||
+                    postLayoutTranslation.z != translation.z));
+
+        return needAdvancedLayout;
+    }
+
+    private static var xformPt:Point;
+
+    /**
+     *  A utility method to update the rotation, scale, and translation of the
+     *  transform while keeping a particular point, specified in the component's
+     *  own coordinate space, fixed in the parent's coordinate space.
+     *  This function will assign the rotation, scale, and translation values
+     *  provided, then update the x/y/z properties as necessary to keep
+     *  the transform center fixed.
+     *
+     *  If layoutFeatures is specified, then we delegate the calculations to
+     *  layoutFeatures. If layoutFeatures is null and an initLayoutFeatures function
+     *  is specified, then we use the function to create the layoutFeatures object.
+     */
+    public static function transformAround(obj:DisplayObject,
+                                           transformCenter:Vector3D,
+                                           scale:Vector3D = null,
+                                           rotation:Vector3D = null,
+                                           translation:Vector3D = null,
+                                           postLayoutScale:Vector3D = null,
+                                           postLayoutRotation:Vector3D = null,
+                                           postLayoutTranslation:Vector3D = null,
+                                           layoutFeatures:AdvancedLayoutFeatures = null,
+                                           initLayoutFeatures:Function = null):void
+    {
+        var needAdvancedLayout:Boolean = (layoutFeatures ||
+                                          needAdvancedLayout(transformCenter,
+                                                             scale,
+                                                             rotation,
+                                                             translation,
+                                                             postLayoutScale,
+                                                             postLayoutRotation,
+                                                             postLayoutTranslation));
+
+        if (needAdvancedLayout)
+        {
+            // TODO (chaase): should provide a way to return to having no
+            // layoutFeatures if we call this later with a more trivial
+            // situation
+            if (!layoutFeatures && initLayoutFeatures != null)
+                layoutFeatures = initLayoutFeatures();
+
+            if (layoutFeatures)
+            {
+                layoutFeatures.transformAround(transformCenter, scale, rotation,
+                    translation, postLayoutScale, postLayoutRotation,
+                    postLayoutTranslation);
+            }
+            return;
+        }
+
+        if (translation == null && transformCenter != null)
+        {
+            if (xformPt == null)
+                xformPt = new Point();
+            xformPt.x = transformCenter.x;
+            xformPt.y = transformCenter.y;
+            var xformedPt:Point =
+                obj.transform.matrix.transformPoint(xformPt);
+        }
+        if (rotation != null && !isNaN(rotation.z))
+            obj.rotation = rotation.z;
+        if (scale != null)
+        {
+            obj.scaleX = scale.x;
+            obj.scaleY = scale.y;
+        }
+        if (transformCenter == null)
+        {
+            if (translation != null)
+            {
+                obj.x = translation.x;
+                obj.y = translation.y;
+            }
+        }
+        else
+        {
+            if (xformPt == null)
+                xformPt = new Point();
+            xformPt.x = transformCenter.x;
+            xformPt.y = transformCenter.y;
+            var postXFormPoint:Point =
+                obj.transform.matrix.transformPoint(xformPt);
+            if (translation != null)
+            {
+                obj.x += translation.x - postXFormPoint.x;
+                obj.y += translation.y - postXFormPoint.y;
+            }
+            else
+            {
+                obj.x += xformedPt.x - postXFormPoint.x;
+                obj.y += xformedPt.y - postXFormPoint.y;
+            }
+        }
+    }
+
+    /**
+     *  A utility method to transform a point specified in the local
+     *  coordinates of the specified object to its location in the object's parent's
+     *  coordinates. The pre-layout and post-layout result will be set on
+     *  the position and postLayoutPosition
+     *  parameters, if they are non-null.
+     *
+     *  If layoutFeatures is specified, then we delegate the calculations to
+     *  layoutFeatures.
+     *
+     *  @param obj The object whose local coordinates are used to transform the point.
+     *  @param localPosition The point to be transformed, specified in the
+     *  local coordinates of the object.
+     *  @param position A Vector3D point that will hold the pre-layout
+     *  result. If null, the parameter is ignored.
+     *  @param postLayoutPosition A Vector3D point that will hold the post-layout
+     *  result. If null, the parameter is ignored.
+     *  @param layoutFeatures The layoutFeatures object to delegate these calculations to.
+     */
+    public static function transformPointToParent(obj:DisplayObject,
+                                                  localPosition:Vector3D,
+                                                  position:Vector3D,
+                                                  postLayoutPosition:Vector3D,
+                                                  layoutFeatures:AdvancedLayoutFeatures):void
+    {
+        if (layoutFeatures)
+        {
+            layoutFeatures.transformPointToParent(true, localPosition,
+                position, postLayoutPosition);
+            return;
+        }
+
+        if (xformPt == null)
+            xformPt = new Point();
+        if (localPosition)
+        {
+            xformPt.x = localPosition.x;
+            xformPt.y = localPosition.y;
+        }
+        else
+        {
+            xformPt.x = 0;
+            xformPt.y = 0;
+        }
+        var tmp:Point = (obj.transform.matrix != null) ?
+            obj.transform.matrix.transformPoint(xformPt) :
+            xformPt;
+        if (position != null)
+        {
+            position.x = tmp.x;
+            position.y = tmp.y;
+            position.z = 0;
+        }
+        if (postLayoutPosition != null)
+        {
+            postLayoutPosition.x = tmp.x;
+            postLayoutPosition.y = tmp.y;
+            postLayoutPosition.z = 0;
+        }
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/mx/src/mx/skins/halo/ScrollArrowSkin.as
+++ frameworks/projects/mx/src/mx/skins/halo/ScrollArrowSkin.as
@@ -0,0 +1,439 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.skins.halo
+{
+
+import flash.display.GradientType;
+import flash.display.Graphics;
+import mx.controls.scrollClasses.ScrollBar;
+import mx.core.FlexVersion;
+import mx.skins.Border;
+import mx.styles.StyleManager;
+import mx.utils.ColorUtil;
+
+/**
+ *  The skin for all the states of the up or down button in a ScrollBar.
+ */
+public class ScrollArrowSkin extends Border
+{
+	include "../../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private static var cache:Object = {};
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Several colors used for drawing are calculated from the base colors
+	 *  of the component (themeColor, borderColor and fillColors).
+	 *  Since these calculations can be a bit expensive,
+	 *  we calculate once per color set and cache the results.
+	 */
+	private static function calcDerivedStyles(themeColor:uint,
+											  borderColor:uint,
+											  fillColor0:uint,
+											  fillColor1:uint):Object
+	{
+		var key:String = HaloColors.getCacheKey(themeColor, borderColor,
+												fillColor0, fillColor1);
+
+		if (!cache[key])
+		{
+			var o:Object = cache[key] = {};
+
+			// Cross-component styles.
+			HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
+
+			// ScrollArrow-specific styles
+			o.borderColorDrk1 = ColorUtil.adjustBrightness2(borderColor, -25);
+			o.borderColorDrk2 = ColorUtil.adjustBrightness2(borderColor, -50);
+		}
+
+		return cache[key];
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 */
+	public function ScrollArrowSkin()
+	{
+		super();
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+	//  measuredWidth
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function get measuredWidth():Number
+    {
+        return ScrollBar.THICKNESS;
+    }
+
+    //----------------------------------
+	//  measuredHeight
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function get measuredHeight():Number
+    {
+        return ScrollBar.THICKNESS;
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override protected function updateDisplayList(w:Number, h:Number):void
+	{
+		super.updateDisplayList(w, h);
+
+		// User-defined styles.
+		var backgroundColor:Number = getStyle("backgroundColor");
+		var borderColor:uint = getStyle("borderColor");
+		var fillAlphas:Array = getStyle("fillAlphas");
+		var fillColors:Array = getStyle("fillColors");
+		StyleManager.getColorNames(fillColors);
+		var highlightAlphas:Array = getStyle("highlightAlphas");
+		var themeColor:uint = getStyle("themeColor");
+
+		var upArrow:Boolean = (name.charAt(0) == 'u');
+
+		// Placeholder styles stub.
+		var arrowColor:uint = getStyle("iconColor");
+
+		// Derived styles.
+		var derStyles:Object = calcDerivedStyles(themeColor, borderColor,
+												 fillColors[0], fillColors[1]);
+
+		var horizontal:Boolean = parent &&
+								 parent.parent &&
+								 parent.parent.rotation != 0;
+
+		var borderColors:Array;
+		if (upArrow && !horizontal)
+			borderColors = [ borderColor, derStyles.borderColorDrk1 ];
+		else
+			borderColors = [ derStyles.borderColorDrk1,
+							 derStyles.borderColorDrk2 ];
+
+		//------------------------------
+		//  background
+		//------------------------------
+
+		var g:Graphics = graphics;
+		g.clear();
+
+		if (isNaN(backgroundColor))
+			backgroundColor = 0xFFFFFF;
+
+		// Opaque backing to force the scroll elements
+		// to match other components by default.
+		if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0 || name.indexOf("Disabled") == -1)
+		{
+			drawRoundRect(
+				0, 0, w, h, 0,
+				backgroundColor, 1);
+		}
+
+		switch (name)
+		{
+			case "upArrowUpSkin":
+			{
+				// shadow
+				if (!horizontal)
+				{
+					drawRoundRect(
+						1, h - 4, w - 2, 8, 0,
+						[ derStyles.borderColorDrk1,
+						  derStyles.borderColorDrk1 ], [ 1, 0 ],
+						verticalGradientMatrix(1, h - 4, w - 2, 8),
+						GradientType.LINEAR, null,
+						{ x: 1, y: h-4, w: w - 2, h: 4, r: 0 });
+				}
+
+				// intentionally fall through to the next case statement
+			}
+
+			case "downArrowUpSkin":
+			{
+   				var upFillColors:Array = [ fillColors[0], fillColors[1] ];
+   				var upFillAlphas:Array = [ fillAlphas[0], fillAlphas[1] ];
+
+				// border
+				drawRoundRect(
+					0, 0, w, h, 0,
+					borderColors, 1,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w, h) :
+					verticalGradientMatrix(0, 0, w, h),
+					GradientType.LINEAR, null,
+					{ x: 1, y: 1, w: w - 2, h: h - 2, r: 0 });
+
+				// fill
+				drawRoundRect(
+					1, 1, w - 2, h - 2, 0,
+					upFillColors, upFillAlphas,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w - 2, h - 2) :
+					verticalGradientMatrix(0, 0, w - 2, h - 2 / 2));
+
+				// top highlight
+				drawRoundRect(
+					1, 1, w - 2, h - 2 / 2, 0,
+					[ 0xFFFFFF, 0xFFFFFF ], highlightAlphas,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w - 2, h - 2) :
+					verticalGradientMatrix(0, 0, w - 2, h - 2 / 2));
+
+				break;
+			}
+
+			case "upArrowOverSkin":
+			{
+				// shadow
+				if (!horizontal)
+				{
+					drawRoundRect(
+						1, h - 4, w - 2, 8, 0,
+						[ derStyles.borderColorDrk1,
+						  derStyles.borderColorDrk1 ], [ 1, 0 ],
+						verticalGradientMatrix(1, h - 4, w - 2, 8),
+						GradientType.LINEAR, null,
+						{ x: 1, y: h-4, w: w - 2, h: 4, r: 0});
+				}
+
+				// intentionally fall through to the next case statement
+			}
+
+			case "downArrowOverSkin":
+			{
+				var overFillColors:Array;
+				if (fillColors.length > 2)
+					overFillColors = [ fillColors[2], fillColors[3] ];
+				else
+					overFillColors = [ fillColors[0], fillColors[1] ];
+
+				var overFillAlphas:Array;
+				if (fillAlphas.length > 2)
+					overFillAlphas = [ fillAlphas[2], fillAlphas[3] ];
+  				else
+					overFillAlphas = [ fillAlphas[0], fillAlphas[1] ];
+
+				// white backing to force the scroll elements
+				// to match other components by default
+				drawRoundRect(
+					0, 0, w, h, 0,
+					0xFFFFFF, 1);
+
+				// border
+				drawRoundRect(
+					0, 0, w, h, 0,
+					[ themeColor, derStyles.themeColDrk1 ], 1,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w, h) :
+					verticalGradientMatrix(0, 0, w, h),
+					GradientType.LINEAR, null,
+					{ x: 1, y: 1, w: w - 2, h: h - 2, r: 0});
+
+				// fill
+				drawRoundRect(
+					1, 1, w - 2, h - 2, 0,
+					overFillColors, overFillAlphas,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w - 2, h - 2) :
+					verticalGradientMatrix(0, 0, w - 2, h - 2));
+
+				// top highlight
+				drawRoundRect(
+					1, 1, w - 2, h -2 / 2, 0,
+					[ 0xFFFFFF, 0xFFFFFF ], highlightAlphas,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w - 2, h - 2) :
+					verticalGradientMatrix(0, 0, w - 2, h - 2 / 2));
+				break;
+			}
+
+			case "upArrowDownSkin":
+			{
+				// shadow
+				if (!horizontal)
+				{
+					drawRoundRect(
+						1, h - 4, w - 2, 8, 0,
+						[ derStyles.borderColorDrk1,
+						  derStyles.borderColorDrk1 ], [ 1, 0 ],
+						horizontal ?
+						horizontalGradientMatrix(1, h - 4, w - 2, 8) :
+						verticalGradientMatrix(1, h - 4, w - 2, 8),
+						GradientType.LINEAR, null,
+						{ x: 1, y: h - 4, w: w - 2, h: 4, r: 0 });
+				}
+
+				// intentionally fall through to the next case statement
+			}
+
+			case "downArrowDownSkin":
+			{
+				// border
+				drawRoundRect(
+					0, 0, w, h, 0,
+					[ themeColor, derStyles.themeColDrk1 ], 1,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w, h) :
+					verticalGradientMatrix(0, 0, w, h),
+					GradientType.LINEAR, null,
+					{ x: 1, y: 1, w: w - 2, h: h - 2, r: 0 });
+
+				// fill
+				drawRoundRect(
+					1, 1, w - 2, h - 2, 0,
+					[ derStyles.fillColorPress1,
+					  derStyles.fillColorPress2 ], 1,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w - 2, h - 2) :
+					verticalGradientMatrix(0, 0, w - 2, h - 2));
+
+				// top highlight
+				drawRoundRect(
+					1, 1, w - 2, h -2 / 2, 0,
+					[ 0xFFFFFF, 0xFFFFFF ], highlightAlphas,
+					horizontal ?
+					horizontalGradientMatrix(0, 0, w - 2, h - 2) :
+					verticalGradientMatrix(0, 0, w - 2, h - 2 / 2));
+				break;
+			}
+
+			case "upArrowDisabledSkin":
+			{
+				if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
+				{
+					// shadow
+					if (!horizontal)
+					{
+						drawRoundRect(
+							1, h - 4, w - 2, 8, 0,
+							[ derStyles.borderColorDrk1,
+							  derStyles.borderColorDrk1 ], [ .5, 0 ],
+							verticalGradientMatrix(1, h - 4, w - 2, 8),
+							GradientType.LINEAR, null,
+							{ x: 1, y: h-4, w: w - 2, h: 4, r: 0 });
+					}
+				}
+
+				// intentionally fall through to the next case statement
+			}
+
+			case "downArrowDisabledSkin":
+			{
+				if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
+				{
+	   				var disFillColors:Array = [ fillColors[0], fillColors[1] ];
+	   				var disFillAlphas:Array = [ fillAlphas[0] - 0.15, fillAlphas[1] - 0.15 ];
+
+					// border
+					drawRoundRect(
+						0, 0, w, h, 0,
+						borderColors, 0.5,
+						horizontal ?
+						horizontalGradientMatrix(0, 0, w, h) :
+						verticalGradientMatrix(0, 0, w, h),
+						GradientType.LINEAR, null,
+						{ x: 1, y: 1, w: w - 2, h: h - 2, r: 0 });
+
+					// fill
+					drawRoundRect(
+						1, 1, w - 2, h - 2, 0,
+						disFillColors, disFillAlphas,
+						horizontal ?
+						horizontalGradientMatrix(0, 0, w - 2, h - 2) :
+						verticalGradientMatrix(0, 0, w - 2, h - 2 / 2));
+
+					arrowColor = getStyle("disabledIconColor");
+				}
+				else
+				{
+					drawRoundRect(
+					0, 0, w, h, 0,
+					0xFFFFFF, 0);
+
+					return;
+				}
+				break;
+			}
+
+			default:
+			{
+				drawRoundRect(
+					0, 0, w, h, 0,
+					0xFFFFFF, 0);
+
+				return;
+				break;
+			}
+		}
+
+		// Draw up or down arrow
+		g.beginFill(arrowColor);
+		if (upArrow)
+		{
+			g.moveTo(w / 2, 6);
+			g.lineTo(w - 5, h - 6);
+			g.lineTo(5, h - 6);
+			g.lineTo(w / 2, 6);
+		}
+		else
+		{
+			g.moveTo(w / 2, h - 6);
+			g.lineTo(w - 5, 6);
+			g.lineTo(5, 6);
+			g.lineTo(w / 2, h - 6);
+		}
+		g.endFill();
+	}
+}
+
+}


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 4055
Author:   gosmith@adobe.com
Date:     2008-11-08T00:52:21.435941Z

Log Message:
-----------
FxTextArea now uses an FxScroller as an optional skin part to manage scrollbars. Previously, FxTextAreaSkin had two FxScrollBars.

Also, I've added 'editable', 'selectable', and 'imeMode' properties to TextView and FxTextBase, but they aren't functional yet.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: Hans

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxTextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxTextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxTextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>

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

--- frameworks/projects/spark/src/spark/components/TextInput.as
+++ frameworks/projects/spark/src/spark/components/TextInput.as
@@ -39,12 +39,12 @@

 [DefaultProperty("text")]

+[IconFile("FxTextInput.png")]
+
 /**
- *  The built-in set of states for the TextInput component.
+ *  The built-in set of states for the FxTextInput component.
  */
 [SkinStates("normal", "disabled")]
-
-[IconFile("FxTextInput.png")]

 /**
  *  Documentation is not currently available.
@@ -90,7 +90,7 @@
     private var widthInCharsChanged:Boolean = false;

     /**
-     *  The default width for the TextInput, measured in characters.
+     *  The default width for the FxTextInput, measured in characters.
      *  The width of the "0" character is used for the calculation,
      *  since in most fonts the digits all have the same width.
      *  So if you set this property to 5, it will be wide enough
@@ -125,7 +125,7 @@

     /**
      *  @private
-     *  Pushes various TextInput properties down into the TextView.
+     *  Pushes various FxTextInput properties down into the TextView.
      */
     override protected function commitProperties():void
     {
@@ -153,14 +153,6 @@
             textView.setStyle("lineBreak", "explicit");
         }
     }
-
-    /**
-     *  @private
-     */
-    override protected function getCurrentSkinState():String
-    {
-        return enabled ? "normal" : "disabled";
-    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18373
Author:   aharui@adobe.com
Date:     2010-10-29T19:02:14.988996Z

Log Message:
-----------
Hopefully last of prompt text bugs.  Add skin states for prompt states to SkinnableTextBase (and move old skin states from TI and TA to STB).

Handle disabledWithPrompt in ComboBoxSkin by disabling the internal TextInput

QE notes: update custom TI skins in mustella
Doc notes: new skin states
Bugs: SDK-28983, SDK-28328
Reviewer: Corey
Tests run: checkintests mustella gumbo/components/ComboBox, NumericStepper
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/ComboBoxSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/NumericStepperTextInputSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/wireframe/src/spark/skins/wireframe/NumericStepperTextInputSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/ComboBoxTextInputSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/TextInput.as
+++ frameworks/projects/spark/src/spark/components/TextInput.as
@@ -41,30 +41,6 @@
  *  @productversion Flex 4
  */
 [Event(name="enter", type="mx.events.FlexEvent")]
-
-//--------------------------------------
-//  Skin states
-//--------------------------------------
-
-/**
- *  Normal State
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[SkinState("normal")]
-
-/**
- *  Disabled State
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[SkinState("disabled")]

 //--------------------------------------
 //  Excluded APIs


Don't crash on transcodings with no rtmp support.

--- src/goplayer/StreamioTranscoding.as
+++ src/goplayer/StreamioTranscoding.as
@@ -11,7 +11,7 @@
     {
       // Always try port 443 first.  If this fails, the player will
       // fall back to trying all the standard ports and protocols.
-      return $rtmpURL.withPort(443)
+      return json.rtmp_base_uri ? $rtmpURL.withPort(443) : null
     }

     private function get $rtmpURL() : URL


Sending closing frame for some errors.

Sending closing frame for some errors.

--- flash-src/src/net/gimite/websocket/WebSocket.as
+++ flash-src/src/net/gimite/websocket/WebSocket.as
@@ -139,7 +139,13 @@
   }

   public function send(encData:String):int {
-    var data:String = decodeURIComponent(encData);
+    var data:String;
+    try {
+      data = decodeURIComponent(encData);
+    } catch (ex:URIError) {
+      logger.error("SYNTAX_ERR: URIError in send()");
+      return 0;
+    }
     var dataBytes:ByteArray = new ByteArray();
     dataBytes.writeUTFBytes(data);
     if (readyState == OPEN) {
@@ -158,23 +164,35 @@
     }
   }

-  public function close(isError:Boolean = false, byServer:Boolean = false):void {
+  public function close(code:int = 1000, reason:String = "",
+      isConnectionError:Boolean = false, byServer:Boolean = false):void {
+    var isError:Boolean = code != 1000 || isConnectionError;
+    if (!isConnectionError && code != 1000) {
+      logger.error("Fail connection: code=" + code + ", reason=" + reason);
+    }
     try {
-      if (readyState == OPEN && !isError) {
-        // TODO: send code and reason
+      if (readyState == OPEN && !isConnectionError) {
         var frame:WebSocketFrame = new WebSocketFrame();
         frame.opcode = OPCODE_CLOSE;
         frame.payload = new ByteArray();
+        if (code != 1000 && reason.length > 0) {
+          frame.payload.writeShort(code);
+          frame.payload.writeUTFBytes(reason);
+        }
         sendFrame(frame);
       }
       if (byServer || isError) {
         socket.close();
       }
-    } catch (ex:Error) { }
+    } catch (ex:Error) {
+      logger.error("Error: " + ex.message);
+    }
     if (byServer || isError) {
       logger.log("closed");
       readyState = CLOSED;
-      this.dispatchEvent(new WebSocketEvent(isError ? "error" : "close"));
+      var eventName:String =
+          (readyState != CONNECTING && isError) ? "error" : "close";
+      this.dispatchEvent(new WebSocketEvent(eventName));
     } else {
       logger.log("closing");
       readyState = CLOSING;
@@ -255,7 +273,7 @@
   private function onError(message:String):void {
     if (readyState == CLOSED) return;
     logger.error(message);
-    close(readyState != CONNECTING);
+    close(0, "", true);
   }

   private function onSocketData(event:ProgressEvent):void {
@@ -285,30 +303,38 @@
         if (frame) {
           removeBufferBefore(frame.length);
           pos = -1;
-          switch (frame.opcode) {
-            case OPCODE_CONTINUATION:
-              fatal("Received continuation frame, which is not implemented.");
-              break;
-            case OPCODE_TEXT:
-              var data:String = readUTFBytes(frame.payload, 0, frame.payload.length);
-              this.dispatchEvent(new WebSocketEvent("message", encodeURIComponent(data)));
-              break;
-            case OPCODE_BINARY:
-              fatal("Received binary data, which is not supported.");
-              break;
-            case OPCODE_CLOSE:
-              // TODO: extract code and reason string
-              logger.log("received closing frame");
-              close(false, true);
-              break;
-            case OPCODE_PING:
-              sendPong(frame.payload);
-              break;
-            case OPCODE_PONG:
-              break;
-            default:
-              fatal("Received unknown opcode: " + frame.opcode);
-              break;
+          if (frame.opcode >= 0x08 && frame.opcode <= 0x0f && frame.payload.length >= 126) {
+            close(1004, "Payload of control frame must be less than 126 bytes.");
+          } else {
+            switch (frame.opcode) {
+              case OPCODE_CONTINUATION:
+                close(1003, "Received continuation frame, which is not implemented.");
+                break;
+              case OPCODE_TEXT:
+                var data:String = readUTFBytes(frame.payload, 0, frame.payload.length);
+                try {
+                  this.dispatchEvent(new WebSocketEvent("message", encodeURIComponent(data)));
+                } catch (ex:URIError) {
+                  close(1007, "URIError while encoding the received data.");
+                }
+                break;
+              case OPCODE_BINARY:
+                close(1003, "Received binary data, which is not supported.");
+                break;
+              case OPCODE_CLOSE:
+                // TODO: extract code and reason string
+                logger.log("received closing frame");
+                close(1000, "", false, true);
+                break;
+              case OPCODE_PING:
+                sendPong(frame.payload);
+                break;
+              case OPCODE_PONG:
+                break;
+              default:
+                close(1002, "Received unknown opcode: " + frame.opcode);
+                break;
+            }
           }
         }
       }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20839
Author:   mhorn@adobe.com
Date:     2011-03-14T14:04:15.007456Z

Log Message:
-----------
merge 20790 and 20805

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColorStroke.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/Transform.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSCondition.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/BitmapFill.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientStroke.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/CompoundTransform.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ArrayList.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientBase.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodgeShader.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>

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

--- frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodgeShader.as
+++ frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodgeShader.as
@@ -26,6 +26,7 @@
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  *
  *  @includeExample examples/ColorDodgeShaderExample.mxml
  */


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

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

 package mx.effects.effectClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 9275
Author:   egeorgie@adobe.com
Date:     2009-08-13T19:05:09.180847Z

Log Message:
-----------
Fix bug: GraphicElement.getStrokeExtents needs ASDoc

Fix: Add comment, while at it, updated the API to return a Rectangle instead.

QE notes: None
Doc notes: None
Bugs: FLEXDOCS-1032
Reviewer: Deepa
Tests run: checkintests, spark/primitives, gumbo/layout/graphicElements
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Ellipse.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Rect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as
@@ -60,14 +60,6 @@
     {
         super();
     }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Variables
-    //
-    //--------------------------------------------------------------------------
-
-    static private var _strokeExtents:Point = new Point();

     //--------------------------------------------------------------------------
     //
@@ -225,16 +217,18 @@
     /**
      *  @private
      */
-    override protected function getStrokeExtents(postLayoutTransform:Boolean = true):Point
-    {
-        // FIXME (egeorgie): currently we take only scale into account,
+    override protected function getStrokeExtents(postLayoutTransform:Boolean = true):Rectangle
+    {
+        // TODO (egeorgie): currently we take only scale into account,
         // but depending on joint style, cap style, etc. we need to take
         // the whole matrix into account as well as examine every line segment...

         if (!stroke)
         {
-            _strokeExtents.x = 0;
-            _strokeExtents.y = 0;
+            _strokeExtents.x      = 0;
+            _strokeExtents.y      = 0;
+			_strokeExtents.width  = 0;
+			_strokeExtents.height = 0;
             return _strokeExtents;
         }

@@ -243,23 +237,27 @@
         var weight:Number = stroke.weight;
         if (weight == 0)
         {
-            _strokeExtents.x = 1;
-            _strokeExtents.y = 1;
-            return _strokeExtents;
-        }
-
+            _strokeExtents.width  = 1;
+            _strokeExtents.height = 1;
+			_strokeExtents.x      = -0.5;
+			_strokeExtents.y      = -0.5;
+            return _strokeExtents;
+        }
+
         var scaleMode:String = stroke.scaleMode;
         if (!scaleMode || scaleMode == LineScaleMode.NONE || !postLayoutTransform)
         {
-            _strokeExtents.x = weight;
-            _strokeExtents.y = weight;
+            _strokeExtents.width  = weight;
+            _strokeExtents.height = weight;
+			_strokeExtents.x = -weight * 0.5;
+			_strokeExtents.y = -weight * 0.5;
             return _strokeExtents;
         }

         var sX:Number = scaleX;
         var sY:Number = scaleY;

-        // FIXME (egeorgie): stroke thickness depends on all matrix components,
+        // TODO (egeorgie): stroke thickness depends on all matrix components,
         // not only on scale.
         if (scaleMode == LineScaleMode.NORMAL)
         {
@@ -267,21 +265,27 @@
                 weight *= sX;
             else
                 weight *= Math.sqrt(0.5 * (sX * sX + sY * sY));
-
-            _strokeExtents.x = weight;
-            _strokeExtents.y = weight;
+
+            _strokeExtents.width  = weight;
+            _strokeExtents.height = weight;
+			_strokeExtents.x      = weight * -0.5;
+			_strokeExtents.y      = weight * -0.5;
             return _strokeExtents;
         }
         else if (scaleMode == LineScaleMode.HORIZONTAL)
         {
-            _strokeExtents.x = weight * sX;
-            _strokeExtents.y = weight;
+            _strokeExtents.width  = weight * sX;
+            _strokeExtents.height = weight;
+			_strokeExtents.x      = weight * sX * -0.5;
+			_strokeExtents.y      = weight * -0.5;
             return _strokeExtents;
         }
         else if (scaleMode == LineScaleMode.VERTICAL)
         {
-            _strokeExtents.x = weight;
-            _strokeExtents.y = weight * sY;
+            _strokeExtents.width  = weight;
+            _strokeExtents.height = weight * sY;
+			_strokeExtents.x      = weight * -0.5;
+			_strokeExtents.y      = weight * sY * -0.5;
             return _strokeExtents;
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19392
Author:   smgilson@adobe.com
Date:     2010-12-15T18:57:46.381068Z

Log Message:
-----------
SDoc updates

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

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as
+++ frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as
@@ -31,7 +31,70 @@
 [DefaultProperty("navigators")]

 /**
+ *  The TabbedViewNavigatorApplication container defines an application
+ *  with multiple sections.
+ *  The TabbedViewNavigatorApplication container automatically creates
+ *  a TabbedMobileNavigator container.
+ *  The TabbedViewNavigator container creates the TabBar control to
+ *  support navigation among the sections of the application.
+ *
+ *
The only allowable child of the TabbedViewNavigatorApplication
+ *  container is ViewNavigator.
+ *  Define one ViewNavigator for each section of the application.

+ *
+ *
The TabbedViewNavigatorApplication container has the following
+ *  default characteristics:

+ *

+ *

+ *           Characteristic
+ *           Description
+ *

+ *

+ *           Default size
+ *           100% high and 100% wide to take up all available screen space.
+ *

+ *

+ *           Child layout
+ *           Defined by the individual View containers
+ *               that make up the views of the application.
+ *

+ *

+ *           Scroll bars
+ *           None. If you do add scroll bars, users can scroll the entire application.
+ *              That includes the ActionBar and TabBar area of the application.
+ *              Because you typically do not want those areas of the view to scroll,
+ *              add scroll bars to the individual View containers of the application,
+ *              rather than to the application container itself.
+ *

+ *

+ *           Default skin class
+ *           spark.skins.mobile.ViewNavigatorApplicationSkin
+ *

+ *

+ *
+ *  @mxml
+ *
+ *
The <s:TabbedViewNavigatorApplication> tag inherits all of the tag
+ *  attributes of its superclass and adds the following tag attributes:

+ *
+ *

+ *  <s:TabbedViewNavigatorApplication
+ *    Properties
+ *    creationPolicy="auto"
+ *    maintainNavigationStack="true"
+ *    navigators="null"
  *
+ *  />
+ *

+ *
+ *  @see spark.components.TabbedViewNavigator
+ *  @see spark.components.TabBar
+ *  @see spark.skins.mobile.TabbedViewNavigatorApplicationSkin
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 public class TabbedViewNavigatorApplication extends ViewNavigatorApplicationBase
 {
@@ -115,9 +178,9 @@
      */
     override mx_internal function get exitApplicationOnBackKey():Boolean
     {
-    	if (navigator)
-    		return navigator.exitApplicationOnBackKey;
-
+        if (navigator)
+            return navigator.exitApplicationOnBackKey;
+
         return super.exitApplicationOnBackKey;
     }

@@ -127,13 +190,20 @@
     private var _explicitCreationPolicy:String = ContainerCreationPolicy.AUTO;

     /**
+     *
TabbedViewNavigatorApplication cannot have visual elements
+     *  added to it, so the creation policy concept use by the framework
+     *  does not necessarily apply.
+     *  Instead, this property controls whether the application's child
+     *  view navigators create their children when the application initializes.

+     *
      *  @inheritDoc
      *
-     *
TabbedViewNavigatorApplication can not have visual elements
-     *  added to it, so the creationPolicy concept use by the framework
-     *  doesn't necessarily make sense.  Instead, this property repurposed to
-     *  control whether the application's child navigators create their children
-     *  when the application initializes.

+     *  @default "auto"
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     override public function get creationPolicy():String
     {
@@ -159,9 +229,7 @@
     //  navigators
     //----------------------------------
     /**
-     *  The list of navigators that are being managed by the application.
-     *  Each navigator in the list will be represented by a item on the tab
-     *  bar.
+     *  @copy TabbedViewNavigator#navigators
      *
      *  @default null
      *
@@ -192,11 +260,7 @@
     //  maintainNavigationStack
     //----------------------------------
     /**
-     *  This property indicates whether the navigation stack of the view
-     *  should remain intact when the navigator is deactivated by its
-     *  parent navigator.  If set to true, when reactivated the view history
-     *  will remain the same.  If false, the navigator will display the
-     *  first view in its navigation stack.
+     *  @copy spark.components.TabbedViewNavigator#maintainNavigationStack
      *
      *  @default true
      *
@@ -270,11 +334,11 @@
      */
     override protected function backKeyUpHandler(event:KeyboardEvent):void
     {
-		super.backKeyUpHandler(event);
-
-		if (viewMenuOpen)
-			viewMenuOpen = false;
-		else if (navigator)
+        super.backKeyUpHandler(event);
+
+        if (viewMenuOpen)
+            viewMenuOpen = false;
+        else if (navigator)
             navigator.backKeyUpHandler();
     }

@@ -346,7 +410,7 @@

         if (instance == navigator)
         {
-        	// Always want to save the navigation stack
+            // Always want to save the navigation stack
             var newNavigatorProperties:Object = {navigationStack: navigator.navigationStack};

             if (maintainNavigationStackPropSet)


avoid binding serialization when DrawCall is disabled: nice performance boost with frustum culling!

--- src/aerys/minko/render/DrawCall.as
+++ src/aerys/minko/render/DrawCall.as
@@ -80,6 +80,8 @@
 		private var _invalidDepth		: Boolean							= false;
 		private var _localToWorld		: Matrix4x4							= null;
 		private var _worldToScreen		: Matrix4x4							= null;
+
+        private var _changes            : Object                           = {};

 		public function get vertexComponents() : Vector.<VertexComponent>
 		{
@@ -127,6 +129,13 @@
 		public function set enabled(value : Boolean) : void
 		{
 			_enabled = value;
+
+            if (value)
+                for each (var bindingName : String in _changes)
+                {
+                    setParameter(bindingName, _changes[bindingName]);
+                    delete _changes[bindingName];
+                }
 		}

 		public function get depth() : Number
@@ -171,6 +180,8 @@
 		public function unsetBindings(meshBindings	: DataBindings,
 									  sceneBindings	: DataBindings) : void
 		{
+            _changes = {};
+
 			for (var parameter : String in _bindings)
 			{
 				meshBindings.removeCallback(parameter, parameterChangedHandler);
@@ -337,8 +348,12 @@

 		public function setParameter(name : String, value : Object) : void
 		{
-//			if (!_enabled)
-//				return ;
+			if (!_enabled)
+            {
+                _changes[name] = value;
+
+				return ;
+            }

 			var binding : IBinder = _bindings[name] as IBinder;


fix Mesh.initializeMesh() to stop using static reference to a default material to avoid memory leak: by default Mesh will now have a null material if none is provided

--- src/aerys/minko/scene/node/Mesh.as
+++ src/aerys/minko/scene/node/Mesh.as
@@ -29,8 +29,6 @@
 	 */
 	public class Mesh extends AbstractVisibleSceneNode implements ITaggable
 	{
-		public static const DEFAULT_MATERIAL	: Material	= new BasicMaterial();
-
 		private var _ctrl				: MeshController;
 		private var _properties			: DataProvider;
 		private var _material			: Material;
@@ -234,7 +232,7 @@
 				this.name = name;

 			this.geometry	= geometry;
-			this.material	= material || DEFAULT_MATERIAL;
+			this.material	= material;
 			_tag			= tag;
 		}


Added TouchEvents bubbling to the Viewport

--- src/aerys/minko/render/Viewport.as
+++ src/aerys/minko/render/Viewport.as
@@ -27,6 +27,7 @@
 	import flash.display3D.Context3DRenderMode;
 	import flash.events.Event;
 	import flash.events.MouseEvent;
+	import flash.events.TouchEvent;
 	import flash.geom.Point;
 	import flash.utils.Dictionary;
 	import flash.utils.getTimer;
@@ -435,30 +436,37 @@
 				stage.addEventListener(Event.RESIZE, stageResizeHandler);
 				stage.addEventListener(Event.ADDED_TO_STAGE, displayObjectAddedToStageHandler);
 				stage.addEventListener(Event.REMOVED_FROM_STAGE, displayObjectRemovedFromStageHandler);
-				stage.addEventListener(MouseEvent.CLICK, stageMouseHandler);
-				stage.addEventListener(MouseEvent.DOUBLE_CLICK, stageMouseHandler);
-				stage.addEventListener(MouseEvent.MOUSE_DOWN, stageMouseHandler);
-				stage.addEventListener(MouseEvent.MOUSE_MOVE, stageMouseHandler);
-				stage.addEventListener(MouseEvent.MOUSE_OUT, stageMouseHandler);
-				stage.addEventListener(MouseEvent.MOUSE_OVER, stageMouseHandler);
-				stage.addEventListener(MouseEvent.MOUSE_WHEEL, stageMouseHandler);
-				stage.addEventListener(MouseEvent.ROLL_OUT, stageMouseHandler);
-				stage.addEventListener(MouseEvent.ROLL_OVER, stageMouseHandler);
+				stage.addEventListener(MouseEvent.CLICK, stageEventHandler);
+				stage.addEventListener(MouseEvent.DOUBLE_CLICK, stageEventHandler);
+				stage.addEventListener(MouseEvent.MOUSE_DOWN, stageEventHandler);
+				stage.addEventListener(MouseEvent.MOUSE_MOVE, stageEventHandler);
+				stage.addEventListener(MouseEvent.MOUSE_OUT, stageEventHandler);
+				stage.addEventListener(MouseEvent.MOUSE_OVER, stageEventHandler);
+				stage.addEventListener(MouseEvent.MOUSE_WHEEL, stageEventHandler);
+				stage.addEventListener(MouseEvent.ROLL_OUT, stageEventHandler);
+				stage.addEventListener(MouseEvent.ROLL_OVER, stageEventHandler);
+				stage.addEventListener(TouchEvent.TOUCH_BEGIN, stageEventHandler);
+				stage.addEventListener(TouchEvent.TOUCH_END, stageEventHandler);
+				stage.addEventListener(TouchEvent.TOUCH_MOVE, stageEventHandler);
+
 			}
 			else
 			{
 				stage.removeEventListener(Event.RESIZE, stageResizeHandler);
 				stage.removeEventListener(Event.ADDED_TO_STAGE, displayObjectAddedToStageHandler);
 				stage.removeEventListener(Event.REMOVED_FROM_STAGE, displayObjectRemovedFromStageHandler);
-				stage.removeEventListener(MouseEvent.CLICK, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.DOUBLE_CLICK, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.MOUSE_DOWN, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.MOUSE_MOVE, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.MOUSE_OUT, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.MOUSE_OVER, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.MOUSE_WHEEL, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.ROLL_OUT, stageMouseHandler);
-				stage.removeEventListener(MouseEvent.ROLL_OVER, stageMouseHandler);
+				stage.removeEventListener(MouseEvent.CLICK, stageEventHandler);
+				stage.removeEventListener(MouseEvent.DOUBLE_CLICK, stageEventHandler);
+				stage.removeEventListener(MouseEvent.MOUSE_DOWN, stageEventHandler);
+				stage.removeEventListener(MouseEvent.MOUSE_MOVE, stageEventHandler);
+				stage.removeEventListener(MouseEvent.MOUSE_OUT, stageEventHandler);
+				stage.removeEventListener(MouseEvent.MOUSE_OVER, stageEventHandler);
+				stage.removeEventListener(MouseEvent.MOUSE_WHEEL, stageEventHandler);
+				stage.removeEventListener(MouseEvent.ROLL_OUT, stageEventHandler);
+				stage.removeEventListener(MouseEvent.ROLL_OVER, stageEventHandler);
+				stage.removeEventListener(TouchEvent.TOUCH_BEGIN, stageEventHandler);
+				stage.removeEventListener(TouchEvent.TOUCH_END, stageEventHandler);
+				stage.removeEventListener(TouchEvent.TOUCH_MOVE, stageEventHandler);
 			}
 		}

@@ -467,7 +475,7 @@
 			updateRectangle();
 		}

-		private function stageMouseHandler(event : MouseEvent) : void
+		private function stageEventHandler(event : Object) : void
 		{
 			if (!_alwaysOnTop || event.target == this)
 				return ;


commit

commit

git-svn-id: 864080e30cc358c5edb906449bbf014f90258007@40 96db6a20-122f-0410-8d9f-89437bbe4005

--- src/com/rails2u/net/JSONPLoader.as
+++ src/com/rails2u/net/JSONPLoader.as
@@ -6,34 +6,55 @@
     import flash.events.TimerEvent;
     import flash.events.IOErrorEvent;
     import flash.utils.Timer;
+    import flash.system.Security;

+    /**
+     * How to use:
+     *   // JSONPLoader.allowCurrentDomain(); // Allow show browsing url's domain.
+     *   var loader:JSONPLoader = new JSONPLoader();
+     *   loader.addEventListener(Event.COMPLETE, function(e:Event):void {
+     *       log(e.target.data);
+     *   });
+     *   loader.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void {
+     *       log('error!');
+     *   });
+     *   // loader.callbackQueryName = 'callback'; // Default name is "callback"
+     *   loader.load('http://del.icio.us/feeds/json/url/data?hash=46efc577b7ddef30d1c6fd13311b371e');
+     */
     public class JSONPLoader extends EventDispatcher {
-        public static var callbackObjects:Object = {};
-
-        public var url:String;
         public var encoding:String = 'UTF-8';
         public var callbackQueryName:String = 'callback';
         public var data:Object;
         public var timeout:Number = 30;
+        protected var nowCallbackFuncName:String;

+        public static var callbackObjects:Object = {};
         public static var inited:Boolean = false;

-        public function JSONPLoader(url:String = ''):void {
+        public function JSONPLoader(url:String = undefined):void {
             if (!ExternalInterface.available) throw (new IllegalOperationError('ExternalInterface.available should be true.'));
             if (!inited) init();
-
-            this.url = url;
+            if (url) load(url);
         }

-        private function init():void {
+        public static function allowCurrentDomain():void {
+            var domain:String = execExternalInterface('return location.host.split(":", 2)[0]');
+            Security.allowDomain(domain);
+        }
+
+        protected static function init():void {
             inited = true;
             ExternalInterface.addCallback('jsonpCallbacks', jsonpCallbacks);

         }

-        public function load(url:String = undefined):void {
-            url ||= this.url;
+        public function load(url:String):void {
+            if (observeTimer) {
+                jsRemoveCallback(nowCallbackFuncName);
+                clearObserveTimer();
+            }
             var callbackFuncName:String = '_' + (new Date()).getTime().toString();
+            nowCallbackFuncName = callbackFuncName;
             jsAddCallback(callbackFuncName);

             var loadURL:String = url + ((url.indexOf('?') > 0) ?  '&' : '?') +
@@ -43,7 +64,7 @@
             createScriptElement(loadURL);
         }

-        private function createScriptElement(loadURL:String):void {
+        protected function createScriptElement(loadURL:String):void {
             var js:Array = [];
             js.push("var script = document.createElement('script');");
             js.push("script.charset = '" + encoding + "';");
@@ -53,49 +74,57 @@
             execExternalInterface(js.join("\n"));
         }

-        private static function jsonpCallbacks(callbackFuncName:String, obj:Object):void {
+        protected static function jsonpCallbacks(callbackFuncName:String, obj:Object):void {
             var target:JSONPLoader = callbackObjects[callbackFuncName] as JSONPLoader;
             if (target) {
                 target.data = obj;
                 target.dispatchEvent(new Event(Event.COMPLETE));
+                target.clearObserveTimer();
+            } else {
+                new Error("Don't found callback(" + callbackFuncName + ").");
             }
         }

-        private static function execExternalInterface(cmd:String):* {
+        protected static function execExternalInterface(cmd:String):* {
             cmd = "(function() {" + cmd + ";})";
             return ExternalInterface.call(cmd);
         }

-        private function jsAddCallback(callbackFuncName:String):void {
+        protected function jsAddCallback(callbackFuncName:String):void {
             var js:String = 'if (!window.as3callbacks) window.as3callbacks = {};window.as3callbacks["' + callbackFuncName +
-                '"] = function(obj) { document.getElementById("' +
-                ExternalInterface.objectID + '").jsonpCallbacks("' + callbackFuncName + '",obj) };';
+                '"] = function(obj) { document.getElementsByName("' +
+                ExternalInterface.objectID + '")[0].jsonpCallbacks("' + callbackFuncName + '",obj) };';
             execExternalInterface(js);
         }

-        private function jsRemoveCallback(callbackFuncName:String):void {
+        protected function jsRemoveCallback(callbackFuncName:String):void {
             var js:String = 'if (window.as3callbacks) window.as3callbacks["' + callbackFuncName + '"] = function() {};';
             execExternalInterface(js);
         }

-        private var observeTimer:Timer;
-        private function observeTimeout(sec:Number, callbackFuncName:String):void
+        protected var observeTimer:Timer;
+        protected function observeTimeout(sec:Number, callbackFuncName:String):void
         {
             observeTimer = new Timer(sec * 1000, 1);
             observeTimer.addEventListener(TimerEvent.TIMER, timeoutErrorHandlerBind(callbackFuncName), false, 1, true);
             observeTimer.start();
         }

-        private function timeoutErrorHandlerBind(callbackFuncName:String):Function {
+        protected function timeoutErrorHandlerBind(callbackFuncName:String):Function {
             return function(e:TimerEvent):void {
                 jsRemoveCallback(callbackFuncName);
                 timeoutErrorHandler(e);
             }
         }

-        private function timeoutErrorHandler(e:TimerEvent):void
+        protected function timeoutErrorHandler(e:TimerEvent):void
         {
             dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, 'Request timeout'));
+            clearObserveTimer();
+        }
+
+        // FIXME: Public namespace should be protected.
+        public function clearObserveTimer():void {
             observeTimer.removeEventListener(TimerEvent.TIMER, timeoutErrorHandler);
             observeTimer.stop();
             observeTimer = null;


OFC-305 Replace blanks in row with */- doesn't work on attributes contained in single entities

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/ContextMenuBuilder.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/ContextMenuBuilder.as
@@ -201,7 +201,9 @@
 			var owner:InteractiveObject = event.contextMenuOwner;
 			if(owner is InputField) {
 				var field:InputField = InputField(owner);
+				var attrDefn:AttributeDefinitionProxy = field.attributeDefinition;
 				var parentEntity:EntityProxy = field.parentEntity;
+				var parentEntityDefn:EntityDefinitionProxy = attrDefn.parent;
 				currentInputField = field;
 				switch(event.target) {
 					case BLANK_ON_FORM_MENU_ITEM:
@@ -217,10 +219,10 @@
 						remarksPopUpPresenter.openPopUp(field, true);
 						break;
 					case REPLACE_BLANKS_WITH_DASH_MENU_ITEM:
-						setSymbolInBlankChildren(parentEntity, FieldSymbol.DASH_ON_FORM);
+						setSymbolInBlankChildren(parentEntity, parentEntityDefn, FieldSymbol.DASH_ON_FORM);
 						break;
 					case REPLACE_BLANKS_WITH_STAR_MENU_ITEM:
-						setSymbolInBlankChildren(parentEntity, FieldSymbol.BLANK_ON_FORM);
+						setSymbolInBlankChildren(parentEntity, parentEntityDefn, FieldSymbol.BLANK_ON_FORM);
 						break;
 					case DELETE_ATTRIBUTE_MENU_ITEM:
 						AlertUtil.showConfirm("global.confirmDelete", [field.attributeDefinition.getLabelText()], "global.confirmAlertTitle", performDeleteAttribute);
@@ -235,7 +237,7 @@
 						field.applySymbol(FieldSymbol.CONFIRMED);
 						break
 					case APPROVE_MISSING_VALUES_IN_ROW_MENU_ITEM:
-						setSymbolInBlankChildren(parentEntity, FieldSymbol.CONFIRMED);
+						setSymbolInBlankChildren(parentEntity, parentEntityDefn, FieldSymbol.CONFIRMED);
 						break;
 				}
 			}
@@ -267,11 +269,23 @@
 			ClientFactory.dataClient.updateActiveRecord(req);
 		}

-		protected static function setSymbolInBlankChildren(entity:EntityProxy, symbol:FieldSymbol):void {
+		protected static function setSymbolInBlankChildren(entity:EntityProxy, entityDefn:EntityDefinitionProxy, symbol:FieldSymbol):void {
+			var operations:ArrayCollection = new ArrayCollection();
+			var req:UpdateRequest = new UpdateRequest();
+			var updatedFields:ArrayCollection = new ArrayCollection();
+			appendApplySymbolInChildrenOperations(operations, updatedFields, entity, entityDefn, symbol);
+			req.operations = operations;
+			if(CollectionUtil.isNotEmpty(req.operations)) {
+				var token:UpdateRequestToken = new UpdateRequestToken(UpdateRequestToken.TYPE_UPDATE_SYMBOL);
+				token.updatedFields = updatedFields;
+				token.symbol = symbol;
+				ClientFactory.dataClient.updateActiveRecord(req, token);
+			}
+		}
+
+		protected static function appendApplySymbolInChildrenOperations(operations:ArrayCollection, updatedFields:ArrayCollection,
+								entity:EntityProxy, entityDefn:EntityDefinitionProxy, symbol:FieldSymbol):void {
 			var children:IList = entity.getChildren();
-			var req:UpdateRequest = new UpdateRequest();
-			req.operations = new ArrayCollection();
-			var updatedFields:ArrayCollection = new ArrayCollection();
 			for each (var child:NodeProxy in children) {
 				if(child is AttributeProxy) {
 					var a:AttributeProxy = AttributeProxy(child);
@@ -287,19 +301,18 @@
 							o.remarks = field.remarks;
 							o.value = field.value != null ? field.value.toString(): null;
 							o.symbol = symbol;
-							req.operations.addItem(o);
+							operations.addItem(o);
 							updatedFields.addItem(field);
 						}
 					}
-				}
-			}
-			if(CollectionUtil.isNotEmpty(req.operations)) {
-				var token:UpdateRequestToken = new UpdateRequestToken(UpdateRequestToken.TYPE_UPDATE_SYMBOL);
-				token.updatedFields = updatedFields;
-				token.symbol = symbol;
-				ClientFactory.dataClient.updateActiveRecord(req, token);
-			}
-		}
-
+				} else if(child is EntityProxy) {
+					var childEntiy:EntityProxy = EntityProxy(child);
+					var childEntiyDefn:EntityDefinitionProxy = EntityDefinitionProxy(entityDefn.getChildDefinition(child.name));
+					if(! childEntiyDefn.multiple) {
+						appendApplySymbolInChildrenOperations(operations, updatedFields, childEntiy, childEntiyDefn, symbol);
+					}
+				}
+			}
+		}
 	}
 }


removed useless local "worldToLocal" variable in Group.cast()

--- src/aerys/minko/scene/node/Group.as
+++ src/aerys/minko/scene/node/Group.as
@@ -298,9 +298,8 @@

 			for (var i : uint = 0; i < numMeshes; ++i)
 			{
-				var mesh 			: Mesh		= meshes[i] as Mesh;
-				var worldToLocal	: Matrix4x4	= mesh.worldToLocal;
-				var hitDepth		: Number	= mesh.geometry.boundingBox.testRay(
+				var mesh 		: Mesh		= meshes[i] as Mesh;
+				var hitDepth	: Number	= mesh.geometry.boundingBox.testRay(
 					ray,
 					mesh.worldToLocal,
 					maxDistance


MethodQueue -> DelayUtil.

MethodQueue -> DelayUtil.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@5981 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/presents/client/Client.as
+++ src/as/com/threerings/presents/client/Client.as
@@ -26,8 +26,8 @@

 import flash.utils.Timer;

+import com.threerings.util.DelayUtil;
 import com.threerings.util.Log;
-import com.threerings.util.MethodQueue;
 import com.threerings.util.Throttle;

 import com.threerings.presents.client.InvocationService_ConfirmListener;
@@ -113,7 +113,7 @@

     public function callLater (fn :Function, args :Array = null) :void
     {
-        MethodQueue.callLater(fn, args);
+        DelayUtil.delayFrame(fn, args);
     }

     public function getHostname () :String


update basic/Player.as and set stage

update basic/Player.as and set stage

--- src/org/mangui/basic/Player.as
+++ src/org/mangui/basic/Player.as
@@ -1,7 +1,6 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
 package org.mangui.basic {
     import org.mangui.hls.HLS;
     import org.mangui.hls.event.HLSEvent;
@@ -9,14 +8,13 @@
     import flash.display.Sprite;
     import flash.media.Video;

-
     public class Player extends Sprite {
         private var hls : HLS = null;
         private var video : Video = null;

         public function Player() {
             hls = new HLS();
-
+            hls.stage = this.stage;
             video = new Video(640, 480);
             addChild(video);
             video.x = 0;
@@ -28,7 +26,7 @@
         }

         public function manifestHandler(event : HLSEvent) : void {
-            hls.stream.play();
+            hls.stream.play(null, -1);
         };
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19832
Author:   chiedozi@adobe.com
Date:     2011-01-20T18:35:05.286293Z

Log Message:
-----------
Fixed RTE when saving persistence data.

QE notes:
Doc notes:
Bugs: SDK-29139
Reviewer: Ryan
Tests run:
Is noteworthy for integration: No

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
@@ -558,7 +558,11 @@
         label = value.label;

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

     /**


set player id in test.as

set player id in test.as

--- assets/scripts/test.as
+++ assets/scripts/test.as
@@ -13,7 +13,7 @@
     light l(glm::vec3(-4.f, 4.f, 2.f), glm::vec3(1), 20);
     light l2(glm::vec3(10.f, 2.f, -2.f), glm::vec3(0.f, 0.3f, 1.0f), 20);
     player p(glm::vec3(-3.f, 2.f, -14.f), glm::quat(glm::radians(90), glm::vec3(0, 1, 0)), glm::vec3(1), "meshes/human.msh", "anims/human.skl");
-    p.impl().get_state_component().change_state("run");
+    player_id = p.id();
     directional_light dl(glm::vec3(1, 0.3, 1), glm::vec3(1), 1, true);
     c.follow(p.id());
     c.impl().get_camera_follow_component().initial_position(glm::vec3(0,0,0));


try to upgrade to not using lastHeight and using sizeToContent instead

--- frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
+++ frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
@@ -20,7 +20,9 @@
 {
 	import org.apache.flex.core.IBeadLayout;
 	import org.apache.flex.core.IContainer;
+    import org.apache.flex.core.ILayoutParent;
 	import org.apache.flex.core.IMeasurementBead;
+    import org.apache.flex.core.IParent;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
@@ -88,22 +90,19 @@
 			_numColumns = value;
 		}

-        private var lastWidth:Number = 0;
-        private var lastHeight:Number = 0;
-
         /**
          * @copy org.apache.flex.core.IBeadLayout#layout
          */
 		public function layout():Boolean
 		{
             var host:UIBase = UIBase(_strand);
+            var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
+            var contentView:IParent = layoutParent.contentView;
 			var sw:Number = host.width;
 			var sh:Number = host.height;

-            var hostWidth:* = ValuesManager.valuesImpl.getValue(host, "width");
-            var hasWidth:Boolean = (hostWidth !== undefined) && hostWidth != lastWidth;
-            var hostHeight:* = ValuesManager.valuesImpl.getValue(host, "height");
-            var hasHeight:Boolean = (hostHeight !== undefined) && hostHeight != lastHeight;
+            var hasWidth:Boolean = host.isWidthSizedToContent();
+            var hasHeight:Boolean = host.isHeightSizedToContent();
 			var e:IUIBase;
 			var i:int;
 			var col:int = 0;
@@ -184,19 +183,13 @@
 					curx = 0;
 				}
 			}
-			if (!hasWidth && n > 0 && !isNaN(maxWidth) &&
-                (!(ValuesManager.valuesImpl.getValue(host, "left") !== undefined) &&
-                  (ValuesManager.valuesImpl.getValue(host, "right") !== undefined)))
+			if (!hasWidth && n > 0 && !isNaN(maxWidth))
             {
-                lastWidth = maxWidth;
-                host.setWidth(maxWidth, true);
+                UIBase(contentView).setWidth(maxWidth, true);
             }
-            if (!hasHeight && n > 0 && !isNaN(maxHeight) &&
-                (!(ValuesManager.valuesImpl.getValue(host, "top") !== undefined) &&
-                    (ValuesManager.valuesImpl.getValue(host, "bottom") !== undefined)))
+            if (!hasHeight && n > 0 && !isNaN(maxHeight))
             {
-                lastHeight = maxHeight;
-                host.setHeight(maxHeight, true);
+                UIBase(contentView).setHeight(maxHeight, true);
             }
 			return true;
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10464
Author:   rfrishbe@adobe.com
Date:     2009-09-21T17:40:30.663638Z

Log Message:
-----------
Removing support in Flex framework for compatibility version < 3.  We won't support compatibility-version 2 or 2.01 anymore.  We only keep compatibility-version for one full release, so for Flex 4, we only support compatibility-version = 3.x.

This should reduce our code-size some as we no longer need this old code.  I didn't clean up the compiler's support for compatibility-versioning as it didn't seem worth the effort.

QE notes: -
Doc notes: -
Bugs: SDK-15360
Reviewer: Kevin
Tests run: checkintests, Joan ran all mustella tests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/accordionClasses/AccordionHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/CanvasLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/AccordionHeaderSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Alert.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeaderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.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/framework/src/mx/containers/FormItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DateChooserYearArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuBarItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PanelSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/Flex.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>

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

--- frameworks/projects/mx/src/mx/controls/Button.as
+++ frameworks/projects/mx/src/mx/controls/Button.as
@@ -861,31 +861,6 @@
      */
     override public function get baselinePosition():Number
     {
-        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-        {
-            var t:String = label;
-            if (!t)
-                t = "Wj";
-
-            // If we're dirty, force a relayout here
-            // so that our internal text field is positioned first;
-            // otherwise we get a stale value.
-            validateNow();
-
-            // If we havent specified a label and the placement is either top
-            // or bottom, we will set the baseline to less that half the height.
-            if (!label &&
-                (labelPlacement == ButtonLabelPlacement.TOP ||
-                 labelPlacement == ButtonLabelPlacement.BOTTOM))
-            {
-                var lineMetrics:TextLineMetrics = measureText(t);
-                return (measuredHeight - lineMetrics.height) / 2 +
-                       lineMetrics.ascent;
-            }
-
-            return textField.y + measureText(t).ascent;
-        }
-
         if (!validateBaselinePosition())
             return NaN;

@@ -1421,16 +1396,9 @@

             invalidateDisplayList();

-            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-            {
-                 if (toggle)
-                    dispatchEvent(new Event(Event.CHANGE));
-            }
-            else
-            {
-                if (toggle && !isProgrammatic)
-                    dispatchEvent(new Event(Event.CHANGE));
-            }
+            if (toggle && !isProgrammatic)
+                dispatchEvent(new Event(Event.CHANGE));
+
             dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
         }
     }
@@ -1625,113 +1593,12 @@
             toggleChanged = false;
         }
     }
-
-    /**
-     *  @private
-     *  Old version of the measure function
-     */
-    private function previousVersion_measure():void
-    {
-        super.measure();
-
-        var textWidth:Number = 0;
-        var textHeight:Number = 0;
-
-        if (label)
-        {
-            var lineMetrics:TextLineMetrics = measureText(label);
-            textWidth = lineMetrics.width;
-            textHeight = lineMetrics.height;
-
-            var paddingLeft:Number = getStyle("paddingLeft");
-            var paddingRight:Number = getStyle("paddingRight");
-            var paddingTop:Number = getStyle("paddingTop");
-            var paddingBottom:Number = getStyle("paddingBottom");
-
-            textWidth += paddingLeft + paddingRight + getStyle("textIndent");
-            textHeight += paddingTop + paddingBottom;
-        }
-
-        // If the current skin defines a borderMetrics property,
-        // then use it; otherwise, use a default value.
-        var bm:EdgeMetrics;
-        try
-        {
-            bm = currentSkin["borderMetrics"];
-        }
-        catch(e:Error)
-        {
-            bm = new EdgeMetrics(3, 3, 3, 3);
-        }

-        var tempCurrentIcon:IFlexDisplayObject = getCurrentIcon();
-        var iconWidth:Number = tempCurrentIcon ? tempCurrentIcon.width : 0;
-        var iconHeight:Number = tempCurrentIcon ? tempCurrentIcon.height : 0;
-
-        var w:Number = 0;
-        var h:Number = 0;
-
-        if (labelPlacement == ButtonLabelPlacement.LEFT ||
-            labelPlacement == ButtonLabelPlacement.RIGHT)
-        {
-            w = textWidth + iconWidth;
-            if (iconWidth != 0)
-            {
-                var horizontalGap:Number = getStyle("horizontalGap");
-                w += (horizontalGap - 2 );
-            }
-            h = Math.max(textHeight, iconHeight + 6);
-        }
-        else
-        {
-            w = Math.max(textWidth, iconWidth);
-            h = textHeight + iconHeight;
-            if (iconHeight != 0)
-                h += getStyle("verticalGap");
-        }
-
-        if (bm)
-        {
-            w += bm.left + bm.right;
-            h += bm.top + bm.bottom
-        }
-
-        // Pad with additional spacing, but only if we have a label.
-        if (label && label.length != 0)
-            w += extraSpacing;
-        else
-            w += 6;
-
-        // Use the larger of the measured sizes and the skin's preferred sizes.
-        // Each skin should override measure() with their measuredWidth
-        // and measuredHeight.
-        if (currentSkin && (isNaN(skinMeasuredWidth) || isNaN(skinMeasuredHeight)))
-        {
-            skinMeasuredWidth = currentSkin.measuredWidth;
-            skinMeasuredHeight = currentSkin.measuredHeight;
-        }
-
-        if (!isNaN(skinMeasuredWidth))
-            w = Math.max(skinMeasuredWidth, w);
-
-        if (!isNaN(skinMeasuredHeight))
-            h = Math.max(skinMeasuredHeight, h);
-
-        measuredMinWidth = measuredWidth = w;
-        measuredMinHeight = measuredHeight = h;
-    }
-
     /**
      *  @private
      */
     override protected function measure():void
     {
-        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-        {
-            previousVersion_measure();
-            return;
-        }
-
         super.measure();

         var textWidth:Number = 0;
@@ -2241,257 +2108,6 @@

         return newIcon;
     }
-
-    private function previousVersion_layoutContents(unscaledWidth:Number,
-                                        unscaledHeight:Number,
-                                        offset:Boolean):void
-    {
-        var labelWidth:Number = 0;
-        var labelHeight:Number = 0;
-
-        var labelX:Number = 0;
-        var labelY:Number = 0;
-
-        var iconWidth:Number = 0;
-        var iconHeight:Number = 0;
-
-        var iconX:Number = 0;
-        var iconY:Number = 0;
-
-        var horizontalGap:Number = 2;
-        var verticalGap:Number = 2;
-
-        var paddingLeft:Number = getStyle("paddingLeft");
-        var paddingRight:Number = getStyle("paddingRight");
-        var paddingTop:Number = getStyle("paddingTop");
-        var paddingBottom:Number = getStyle("paddingBottom");
-
-        var textWidth:Number = 0;
-        var textHeight:Number = 0;
-
-        var lineMetrics:TextLineMetrics;
-
-        if (label)
-        {
-            lineMetrics = measureText(label);
-            if (lineMetrics.width > 0)
-            {
-                textWidth = paddingLeft + paddingRight +
-                            getStyle("textIndent") +  lineMetrics.width;
-            }
-            textHeight = lineMetrics.height;
-        }
-        else
-        {
-            lineMetrics = measureText("Wj");
-            textHeight = lineMetrics.height;
-        }
-
-        var n:Number = offset ? buttonOffset : 0;
-
-        var textAlign:String = getStyle("textAlign");
-        // Map new Spark values that might be set in a selector
-		// affecting both Halo and Spark components.
-        if (textAlign == "start")
-            textAlign = TextFormatAlign.LEFT;
-        else if (textAlign == "end")
-            textAlign = TextFormatAlign.RIGHT;
-
-        var bm:EdgeMetrics = currentSkin &&
-                             currentSkin is IRectangularBorder ?
-                             IRectangularBorder(currentSkin).borderMetrics :
-                             null;
-
-        var viewWidth:Number = unscaledWidth;
-        var viewHeight:Number = unscaledHeight - paddingTop - paddingBottom;
-
-        if (bm)
-        {
-            viewWidth -= bm.left + bm.right;
-            viewHeight -= bm.top + bm.bottom;
-        }
-
-        if (currentIcon)
-        {
-            iconWidth = currentIcon.width;
-            iconHeight = currentIcon.height;
-        }
-
-        if (labelPlacement == ButtonLabelPlacement.LEFT ||
-            labelPlacement == ButtonLabelPlacement.RIGHT)
-        {
-            horizontalGap = getStyle("horizontalGap");
-
-            if (iconWidth == 0 || textWidth == 0)
-                horizontalGap = 0;
-
-            if (textWidth > 0)
-            {
-                textField.width = labelWidth = Math.max(viewWidth - iconWidth - horizontalGap -
-                    paddingLeft - paddingRight, 0);
-            }
-            else
-            {
-                textField.width = labelWidth = 0;
-            }
-            textField.height = labelHeight =
-                Math.min(viewHeight + 2, textHeight + UITextField.TEXT_HEIGHT_PADDING);
-
-            if (labelPlacement == ButtonLabelPlacement.RIGHT)
-            {
-                labelX = iconWidth + horizontalGap;
-
-                if (centerContent)
-                {
-                    if (textAlign == "left")
-                    {
-                        labelX += paddingLeft;
-                    }
-                    else if (textAlign == "right")
-                    {
-                        labelX += (viewWidth - labelWidth -
-                                   iconWidth - horizontalGap - paddingLeft);
-                    }
-                    else // "center" -- default value
-                    {
-                        var disp:Number = (viewWidth - labelWidth -
-                                   iconWidth - horizontalGap) / 2;
-                        labelX += Math.max(disp, paddingLeft);
-                    }
-                }
-
-                iconX = labelX - (iconWidth + horizontalGap);
-
-                if (!centerContent)
-                    labelX += paddingLeft;
-            }
-            else
-            {
-                labelX = viewWidth - labelWidth - iconWidth - horizontalGap -
-                         paddingRight;
-
-                if (centerContent)
-                {
-                    if (textAlign == "left")
-                        labelX = 2;
-                    else if (textAlign == "right")
-                        labelX -= 1;
-                    else if (labelX > 0) // "center" -- default value
-                        labelX = labelX / 2;
-                }
-
-                iconX  = labelX + labelWidth + horizontalGap;
-            }
-
-            iconY  = labelY = 0;
-
-            if (centerContent)
-            {
-                iconY  = Math.round((viewHeight - iconHeight) / 2) +
-                    paddingTop;
-                labelY = Math.round((viewHeight - labelHeight) / 2) +
-                    paddingTop;
-            }
-            else
-            {
-                labelY += Math.max(0, (viewHeight - labelHeight) / 2) +
-                    paddingTop;
-                iconY += Math.max(0, (viewHeight - iconHeight) / 2 - 1) +
-                    paddingTop;
-            }
-        }
-        else
-        {
-            verticalGap = getStyle("verticalGap");
-
-            if (iconHeight == 0 || textHeight == 0)
-                verticalGap = 0;
-
-            if (textWidth > 0)
-            {
-                textField.width = labelWidth =
-                    Math.min(viewWidth, textWidth + UITextField.TEXT_WIDTH_PADDING);
-                textField.height = labelHeight =
-                    Math.min(viewHeight - iconHeight + 1, textHeight + 5);
-            }
-            else
-            {
-                textField.width = labelWidth = 0;
-                textField.height = labelHeight = 0;
-            }
-
-            labelX = (viewWidth - labelWidth) / 2;
-
-            iconX = (viewWidth - iconWidth) / 2;
-
-            if (labelPlacement == ButtonLabelPlacement.TOP)
-            {
-                labelY = viewHeight - labelHeight - iconHeight - verticalGap;
-
-                if (centerContent && labelY > 0)
-                    labelY = labelY / 2;
-
-                labelY += paddingTop;
-
-                iconY = labelY + labelHeight + verticalGap - 3;
-            }
-            else
-            {
-                labelY = iconHeight + verticalGap + paddingTop;
-
-                if (centerContent)
-                {
-                    labelY += (viewHeight - labelHeight -
-                               iconHeight - verticalGap) / 2 + 1;
-                }
-
-                iconY = labelY - iconHeight - verticalGap + 3;
-            }
-
-        }
-        var buffX:Number = n;
-        var buffY:Number = n;
-
-        if (bm)
-        {
-            buffX += bm.left;
-            buffY += bm.top;
-        }
-
-        textField.x = labelX + buffX;
-        textField.y = labelY + buffY;
-
-        if (currentIcon)
-        {
-            iconX += buffX;
-            iconY += buffY;
-
-            // dispatch a move on behalf of the icon
-            // the focus system uses that to adjust
-            // focus rectangles
-            var moveEvent:MoveEvent = new MoveEvent(MoveEvent.MOVE);
-            moveEvent.oldX = currentIcon.x;
-            moveEvent.oldY = currentIcon.y;
-
-            currentIcon.x = Math.round(iconX);
-            currentIcon.y = Math.round(iconY);
-            currentIcon.dispatchEvent(moveEvent);
-        }
-
-        // The skins and icons get created on demand as the user interacts
-        // with the Button, and as they are created they become the
-        // frontmost child.
-        // Here we ensure that the textField is the frontmost child,
-        // with the current icon behind it and the current skin behind that.
-        // Any other skins and icons are left behind these three,
-        // with arbitrary layering.
-        if (currentSkin)
-            setChildIndex(DisplayObject(currentSkin), numChildren - 1);
-        if (currentIcon)
-            setChildIndex(DisplayObject(currentIcon), numChildren - 1);
-        if (textField)
-            setChildIndex(DisplayObject(textField), numChildren - 1);
-    }

    /**
      *  @private
@@ -2502,12 +2118,6 @@
                                         unscaledHeight:Number,
                                         offset:Boolean):void
     {
-        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-        {
-            previousVersion_layoutContents(unscaledWidth, unscaledHeight, offset);
-            return;
-        }
-
         var labelWidth:Number = 0;
         var labelHeight:Number = 0;

@@ -2736,7 +2346,7 @@
         checkedDefaultSkin = false;
         defaultSkinUsesStates = false;

-        if (initialized && FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
+        if (initialized)
         {
             viewSkin();
             invalidateSize();


A Mac file system alias that is broken will cause the File object to have an invalid date and results in an exception

git-svn-id: 7d913817b0a978d84de757191e4bce372605a781@1412324 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/airframework/src/mx/controls/FileSystemDataGrid.as
+++ frameworks/projects/airframework/src/mx/controls/FileSystemDataGrid.as
@@ -1605,7 +1605,17 @@
         if (!item.exists) // item may have been deleted
             return "";

-        return dateFormatter.format(item.creationDate);
+		var s:String;
+		try
+		{
+	        s = dateFormatter.format(item.creationDate);
+		}
+		catch (e:Error)
+		{
+			// a bad alias on mac will not have a valid creation date
+			s = "";
+		}
+		return s;
     }

     /**
@@ -1617,7 +1627,17 @@
         if (!item.exists) // item may have been deleted
             return "";

-        return dateFormatter.format(item.modificationDate);
+		var s:String;
+		try
+		{
+        	s = dateFormatter.format(item.modificationDate);
+		}
+		catch (e:Error)
+		{
+			// a bad alias on mac will not have a valid mod date
+			s = "";
+		}
+		return s;
     }

     /**


Fixed addItemAt location to sorted list (i.e. must be at the end) and the location of added item to a sorted filtered list (even when filtered it needs to be the sort location otherwise it can be out of order).

--- frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -593,8 +593,12 @@

         var listIndex:int = index;

-        // if we're sorted addItemAt is meaningless, just add to the end
-		if (localIndex && filterFunction != null)
+		// if we're sorted addItemAt is meaningless, just add to the end
+		if (localIndex && sort)
+        {
+            listIndex = list.length;
+        }
+		else if (localIndex && filterFunction != null)
 		{
 			// if end of filtered list, put at end of source list
 			if (listIndex == localIndex.length)
@@ -604,10 +608,6 @@
 			else
 				listIndex = list.getItemIndex(localIndex[index]);
 		}
-		else if (localIndex && sort)
-        {
-            listIndex = list.length;
-        }
 		// List is sorted or filtered but refresh has not been called
 		// Just add to end of list
 		else if (localIndex)
@@ -1158,7 +1158,11 @@
 				{
 					if (filterFunction(item))
 					{
-						loc = getFilteredItemIndex(item);
+						if (sort)
+							loc = findItem(item, Sort.ANY_INDEX_MODE, true);
+						else
+							loc = getFilteredItemIndex(item);
+
 						if (firstOne)
 						{
 							addLocation = loc;