Migrated Signal to use new Slot class. Mostly copied and pasted code from DeluxeSignal. Next step is to try to have DeluxeSignal extend Signal.

--- src/org/osflash/signals/Signal.as
+++ src/org/osflash/signals/Signal.as
@@ -23,9 +23,8 @@
 	public class Signal implements ISignalOwner, IDispatcher
 	{
 		protected var _valueClasses:Array;		// of Class
-		protected var listeners:Array;			// of Function
-		protected var onceListeners:Dictionary;	// of Function
-		protected var listenersNeedCloning:Boolean = false;
+		protected var slots:Array;			// of Slot
+		protected var slotsNeedCloning:Boolean = false;

 		/**
 		 * Creates a Signal instance to dispatch value objects.
@@ -40,8 +39,7 @@
 		 */
 		public function Signal(...valueClasses)
 		{
-			listeners = [];
-			onceListeners = new Dictionary();
+			slots = [];
 			// Cannot use super.apply(null, valueClasses), so allow the subclass to call super(valueClasses).
 			if (valueClasses.length == 1 && valueClasses[0] is Array)
 				valueClasses = valueClasses[0];
@@ -68,7 +66,7 @@
 		}

 		/** @inheritDoc */
-		public function get numListeners():uint { return listeners.length; }
+		public function get numListeners():uint { return slots.length; }

 		/** @inheritDoc */
 		//TODO: @throws
@@ -88,15 +86,13 @@
 		/** @inheritDoc */
 		public function remove(listener:Function):Function
 		{
-			const index:int = listeners.indexOf(listener);
-			if (index == -1) return listener;
-			if (listenersNeedCloning)
-			{
-				listeners = listeners.slice();
-				listenersNeedCloning = false;
-			}
-			listeners.splice(index, 1);
-			delete onceListeners[listener];
+			if (indexOfListener(listener) == -1) return listener;
+			if (slotsNeedCloning)
+			{
+				slots = slots.slice();
+				slotsNeedCloning = false;
+			}
+			slots.splice(indexOfListener(listener), 1);
 			return listener;
 		}

@@ -104,9 +100,11 @@
 		public function removeAll():void
 		{
 			// Looping backwards is more efficient when removing array items.
-			for (var i:uint = listeners.length; i--; )
-			{
-				remove(listeners[i] as Function);
+			for (var i:uint = slots.length; i--; )
+			{
+				// This is the "proper" type-safe way, but perhaps not the fastest.
+				// TODO: Test for speed.
+				remove(Slot(slots[i]).listener);
 			}
 		}

@@ -133,40 +131,55 @@
 					+ '> is not an instance of <' + valueClass + '>.');
 			}

-			if (!listeners.length) return;
-
 			//// Call listeners.
-
-			// During a dispatch, add() and remove() should clone listeners array instead of modifying it.
-			listenersNeedCloning = true;
-			var listener:Function;
-			switch (valueObjects.length)
-			{
-				case 0:
-					for each (listener in listeners)
-					{
-						if (onceListeners[listener]) remove(listener);
-						listener();
-					}
-					break;
-
-				case 1:
-					const singleValue:Object = valueObjects[0];
-					for each (listener in listeners)
-					{
-						if (onceListeners[listener]) remove(listener);
-						listener(singleValue);
-					}
-					break;
-
-				default:
-					for each (listener in listeners)
-					{
-						if (onceListeners[listener]) remove(listener);
-						listener.apply(null, valueObjects);
-					}
-			}
-			listenersNeedCloning = false;
+			if (slots.length)
+			{
+				// During a dispatch, add() and remove() should clone listeners array instead of modifying it.
+				slotsNeedCloning = true;
+				var slot:Slot;
+				switch (valueObjects.length)
+				{
+					case 0:
+						for each (slot in slots)
+						{
+							slot.execute0();
+						}
+						break;
+
+					case 1:
+						const singleValue:Object = valueObjects[0];
+						for each (slot in slots)
+						{
+							slot.execute1(singleValue);
+						}
+						break;
+
+					case 2:
+						const value1:Object = valueObjects[0];
+						const value2:Object = valueObjects[1];
+						for each (slot in slots)
+						{
+							slot.execute2(value1, value2);
+						}
+						break;
+
+					default:
+						for each (slot in slots)
+						{
+							slot.execute(valueObjects);
+						}
+				}
+				slotsNeedCloning = false;
+			}
+		}
+
+		protected function indexOfListener(listener:Function):int
+		{
+			for (var i:int = slots.length; i--; )
+			{
+				if (Slot(slots[i]).listener == listener) return i;
+			}
+			return -1;
 		}

 		protected function registerListener(listener:Function, once:Boolean = false):void
@@ -178,23 +191,25 @@
 				throw new ArgumentError('Listener has '+listener.length+' '+argumentString+' but it needs at least '+_valueClasses.length+' to match the given value classes.');
 			}

+			const slot:Slot = new Slot(listener, once, this);
 			// If there are no previous listeners, add the first one as quickly as possible.
-			if (!listeners.length)
-			{
-				listeners[0] = listener;
-				if (once) onceListeners[listener] = true;
+			if (!slots.length)
+			{
+				slots[0] = slot;
 				return;
 			}

-			if (listeners.indexOf(listener) >= 0)
+			var prevListenerIndex:int = indexOfListener(listener);
+			if (prevListenerIndex >= 0)
 			{
 				// If the listener was previously added, definitely don't add it again.
 				// But throw an exception in some cases, as the error messages explain.
-				if (onceListeners[listener] && !once)
+				var prevSlot:Slot = Slot(slots[prevListenerIndex]);
+				if (prevSlot.once && !once)
 				{
 					throw new IllegalOperationError('You cannot addOnce() then add() the same listener without removing the relationship first.');
 				}
-				else if (!onceListeners[listener] && once)
+				else if (!prevSlot.once && once)
 				{
 					throw new IllegalOperationError('You cannot add() then addOnce() the same listener without removing the relationship first.');
 				}
@@ -202,15 +217,14 @@
 				return;
 			}

-			if (listenersNeedCloning)
-			{
-				listeners = listeners.slice();
-				listenersNeedCloning = false;
+			if (slotsNeedCloning)
+			{
+				slots = slots.slice();
+				slotsNeedCloning = false;
 			}

 			// Faster than push().
-			listeners[listeners.length] = listener;
-			if (once) onceListeners[listener] = true;
+			slots[slots.length] = slot;
 		}
 	}
 }


Updated try..catch to be clearer

Updated try..catch to be clearer

--- as3/src/asunit4/runners/TestRunner.as
+++ as3/src/asunit4/runners/TestRunner.as
@@ -82,18 +82,15 @@
 			methodIsExecuting = true;

 			if (currentMethod.expects) {
-                // TODO: [luke] Added try..catch here b/c I had a bad class name in my expects
-                // is the catch here written correctly?
                 try {
                     var errorClass:Class = getDefinitionByName(currentMethod.expects) as Class;
-                }
-                catch(definitionError:ReferenceError) {
-                    recordFailure(new Error('Could not find Reference for: ' + currentMethod.expects));
-                    methodIsExecuting = false;
-                }
-				try {
 					Assert.assertThrows(errorClass, currentMethod.value);
 				}
+                catch(definitionError:ReferenceError) {
+                    // NOTE: [luke] Added ReferenceError catch here b/c I had a bad class name in my expects.
+                    // Does this look right?
+                    recordFailure(new Error('Could not find Reference for: ' + currentMethod.expects));
+                }
 				catch (error:Error) {
 					recordFailure(error);
 				}


Extracted multiple interfaces from Layoutable

--- src/laml/display/Layoutable.as
+++ src/laml/display/Layoutable.as
@@ -9,15 +9,8 @@
 	import laml.layout.ILayout;
 	import laml.tween.ITweenAdapter;

-	public interface Layoutable extends IEventDispatcher {
+	public interface Layoutable extends Identifiable, Composable, Styleable, IEventDispatcher {

-		/**
-		 * Globally unique identifier for this instance.
-		 * The provided id must be unique for any tree that
-		 * this instance is added to.
-		 */
-		function set id(id:String):void;
-		function get id():String;
 		function set name(name:String):void; // TODO: remove me
 		function get name():String; // TODO: remove me

@@ -35,93 +28,6 @@
 		function get x():int;
 		function set y(y:int):void;
 		function get y():int;
-
-		/* Scaleable */
-		function set width(width:Number):void;
-		function get width():Number;
-		function set height(height:Number):void;
-		function get height():Number;
-		function get fixedWidth():Number;
-		function get fixedHeight():Number;
-		function set actualWidth(width:Number):void;
-		function get actualWidth():Number;
-		function set actualHeight(height:Number):void;
-		function get actualHeight():Number;
-		function set excludeFromLayout(exclude:Boolean):void;
-		function get excludeFromLayout():Boolean;
-		function set percentWidth(width:Number):void;
-		function get percentWidth():Number;
-		function set percentHeight(height:Number):void;
-		function get percentHeight():Number;
-		function set preferredWidth(width:Number):void;
-		function get preferredWidth():Number;
-		function set preferredHeight(height:Number):void;
-		function get preferredHeight():Number;
-
-		function set maxWidth(max:Number):void;
-		function get maxWidth():Number;
-		function set maxHeight(max:Number):void;
-		function get maxHeight():Number;
-		function set minWidth(min:Number):void;
-		function get minWidth():Number;
-		function set minHeight(min:Number):void;
-		function get minHeight():Number;
-
-		/* Styleable */
-		function set backgroundColor(color:uint):void;
-		function get backgroundColor():uint;
-		function set backgroundAlpha(alpha:Number):void;
-		function get backgroundAlpha():Number;
-		function set backgroundImage(image:DisplayObject):void;
-		function get backgroundImage():DisplayObject;
-		function set cornerRadius(radius:uint):void;
-		function get cornerRadius():uint;
-
-		function set borderColor(color:uint):void;
-		function get borderColor():uint;
-		function set borderAlpha(alpha:Number):void;
-		function get borderAlpha():Number;
-		function set borderSize(size:uint):void;
-		function get borderSize():uint;
-		function set borderStyle(style:String):void;
-		function get borderStyle():String;
-
-		function set css(css:String):void;
-		function get css():String;
-
-		function set gutter(gutter:int):void;
-		function get gutter():int;
-
-		function set horizontalAlign(align:String):void;
-		function get horizontalAlign():String;
-		function set verticalAlign(align:String):void;
-		function get verticalAlign():String;
-
-		function get horizontalPadding():int;
-		function get verticalPadding():int;
-
-		function set padding(padding:int):void;
-		function get padding():int;
-
-		function set paddingTop(padding:int):void;
-		function get paddingTop():int;
-		function set paddingLeft(padding:int):void;
-		function get paddingLeft():int;
-		function set paddingRight(padding:int):void;
-		function get paddingRight():int;
-		function set paddingBottom(padding:int):void;
-		function get paddingBottom():int;
-
-		function set skin(skin:ISkin):void;
-		function get skin():ISkin;
-
-		// TODO: Should this change to 'styles' and get handled
-		// in the parser?
-		function set styleNames(names:String):void;
-		function get styleNames():String;
-
-		function set visible(visible:Boolean):void;
-		function get visible():Boolean;

 		/* Utilities */
 		function set layout(layout:ILayout):void;
@@ -156,21 +62,5 @@
 		function show(milliseconds:Number=0, callback:Function=null):void;
 		function toggle():void;

-		/* Composable */
-		function get numChildren():int;
-		function set parent(parent:Layoutable):void;
-		function get parent():Layoutable;
-		function get path():String;
-		function get root():Layoutable;
-
-		function addChild(child:Layoutable):void;
-		function getChildAt(index:int):Layoutable;
-		function getChildById(id:String):Layoutable;
-		function removeAllChildren():void;
-		function removeChild(child:Layoutable):void;
-		function every(callback:Function, thisObject:* = null):Boolean;
-		function filter(callback:Function, thisObject:* = null):Array;
-		function forEach(callback:Function, thisObject:* = null):void;
-		function map(callback:Function, thisObject:* = null):Array;
 	}
 }


Fixed a null ref bug in ScreenManager where a load progress was null.

--- src/engine/tetragon/view/ScreenManager.as
+++ src/engine/tetragon/view/ScreenManager.as
@@ -50,7 +50,6 @@
 	import com.hexagonstar.signals.Signal;
 	import com.hexagonstar.tween.Tween;
 	import com.hexagonstar.tween.TweenVars;
-	import com.hexagonstar.util.debug.Debug;
 	import com.hexagonstar.util.string.TabularText;

 	import flash.display.DisplayObjectContainer;
@@ -896,7 +895,7 @@
 		 */
 		private function onScreenLoadProgress(progress:BulkProgress):void
 		{
-			Debug.trace(progress.dump());
+			if (!progress) return;
 			if (!_loadProgressDisplay) return;
 			_loadProgressDisplay.update(progress);
 		}


Fix editor UI resolution detection for whether to lay out the status text on 1 or 2 rows.

--- bin/Data/Scripts/Editor/EditorView.as
+++ bin/Data/Scripts/Editor/EditorView.as
@@ -1266,7 +1266,7 @@

     if(viewportMode != VIEWPORT_COMPACT)
     {
-	if (graphics.width >= editorModeText.size.x + renderStatsText.size.x + 45)
+	if (ui.root.width >= editorModeText.size.x + renderStatsText.size.x + 45)
 	{
             SetupStatsBarText(editorModeText, font, 35, 64, HA_LEFT, VA_TOP);
             SetupStatsBarText(renderStatsText, font, -4, 64, HA_RIGHT, VA_TOP);


change Emitter default protocol back to HTTP

--- snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/emitter/Emitter.as
+++ snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/emitter/Emitter.as
@@ -38,9 +38,9 @@
 		 * Create an Emitter instance with a collector URL and HttpMethod to send requests.
 		 * @param URI The collector URL. Don't include "http://" - this is done automatically.
 		 * @param httpMethod The HTTP request method. If GET, BufferOption is set to Instant.
-		 * @param protocol The protocol for the call. Either http or https. Defaults to https.
+		 * @param protocol The protocol for the call. Either http or https. Defaults to http.
 		 */
-		public function Emitter(uri:String, httpMethod:String = URLRequestMethod.GET, protocol:String = "https") {
+		public function Emitter(uri:String, httpMethod:String = URLRequestMethod.GET, protocol:String = "http") {

 			if (httpMethod == URLRequestMethod.GET) {
 				_uri = new URI(protocol + "://" + uri + "/i");


fix initial pid value, should be undefined (-1)

--- src/com/mangui/HLS/muxing/TS.as
+++ src/com/mangui/HLS/muxing/TS.as
@@ -25,13 +25,13 @@

 		/** Packet ID of the AAC audio stream. **/
-		private var _aacId:Number = 257;
+		private var _aacId:Number = -1;
 		/** List with audio frames. **/
 		public var audioTags:Vector.<Tag> = new Vector.<Tag>();
 		/** List of packetized elementary streams with AAC. **/
 		private var _audioPES:Vector.<PES> = new Vector.<PES>();
 		/** Packet ID of the video stream. **/
-		private var _avcId:Number = 256;
+		private var _avcId:Number = -1;
 		/** PES packet that contains the first keyframe. **/
 		private var _firstKey:Number = -1;
 		/** Packet ID of the MP3 audio stream. **/


Transferred from the Adobe Open Source Subversion Repository

Revision: 19498
Author:   jasonsj@adobe.com
Date:     2010-12-21T02:16:56.447761Z

Log Message:
-----------
Initial mobile theme ButtonBar and iOS ActionBar Button skins.
Removed DiscouragedForProfile metadata from ButtonBar and HSlider.
Fixed line endings in FXG files.
Removed unnecessary winding="evenOdd" in FXG.

QE notes: Use styleName="ios" in ActionBar buttons in navigationContent and actionContent.
Doc notes:
Bugs:
Reviewer: jszeto
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
106 paths were modified

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as
@@ -32,6 +32,7 @@

 use namespace mx_internal;

+// FIXME (jasonsj): do we need blendMode handling like Group?
 // FIXME (jasonsj): B-feature for IFocusColorSkin may be removed
 /**
  *  ActionScript-based skin for mobile applications. This skin is the
@@ -54,6 +55,10 @@
     // Used for gradient background
     protected static var matrix:Matrix = new Matrix();

+    protected static const MOBILE_THEME_DARK_COLOR:uint = 0x484848;
+
+    protected static const MOBILE_THEME_LIGHT_COLOR:uint = 0xCCCCCC;
+
     /**
      * An array of color distribution ratios.
      * This is used in the chrome color fill.
@@ -262,7 +267,7 @@
      *  @private
      */
     override public function setCurrentState(stateName:String,
-                                    playTransition:Boolean = true):void
+                                             playTransition:Boolean = true):void
     {
         currentState = stateName;
     }
@@ -324,6 +329,38 @@
             }
         }
     }
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Apply a color transform on a DisplayObject
+     *
+     *  @param displayObject
+     *  @param tintColor
+     *  @param originalColor
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function applyColorTransform(displayObject:DisplayObject, originalColor:uint, tintColor:uint):void
+    {
+        // FIXME (jasonsj): track what's already been tinted
+        // FIXME (jasonsj): track previous color transform to bypass initialization
+        if (originalColor == tintColor)
+            return;
+
+        colorTransform.redOffset = ((tintColor & (0xFF << 16)) >> 16) - ((originalColor & (0xFF << 16)) >> 16);
+        colorTransform.greenOffset = ((tintColor & (0xFF << 8)) >> 8) - ((originalColor & (0xFF << 8)) >> 8);
+        colorTransform.blueOffset = (tintColor & 0xFF) - (originalColor & 0xFF);
+        colorTransform.alphaMultiplier = alpha;
+
+        displayObject.transform.colorTransform = colorTransform;
+    }

     /**
      *  Use beginFill or beginGradientFill to specify
@@ -390,7 +427,7 @@
     {
         chromeColorGraphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
     }
-
+
     /**
      *  A helper method to position children elements of this component.
      *
@@ -432,7 +469,7 @@
             element.y = y;
         }
     }
-
+
     /**
      *  A helper method to size children elements of this component.
      *
@@ -577,6 +614,7 @@
     private static var exclusionAlphaValues:Array;

     private static var oldContentBackgroundAlpha:Number;
+
     private static var contentBackgroundAlphaSetLocally:Boolean;

     /**
@@ -716,7 +754,7 @@
         }

         exclusionAlphaValues = null;
-
+
         if (!isNaN(oldContentBackgroundAlpha))
         {
             if (contentBackgroundAlphaSetLocally)
@@ -726,7 +764,7 @@
             needRedraw = true;
             oldContentBackgroundAlpha = NaN;
         }
-
+
         return needRedraw;
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 5288
Author:   rfrishbe@adobe.com
Date:     2009-03-13T01:44:49.712909Z

Log Message:
-----------
A bunch of small bug fixes.

- DataGroup bug around a visualelement being moved to another datagroup (SDK-19680)

- Added removeAllElements method to IVisualElementContainer (SDK-19424)

- Fix up ASDoc/RTE messages for Group/DataGroup/FxContainer when calling addChild(), removeChild(), etc... (SDK-19582)

- Added an mx_internal method, specifically for automation, so mouse event listeners can get added to a Container without adding a mouseshield and changing the behavior of the component (SDK-18864)

- When both skinClass and skinFactory are set, the skin doesn't get reloaded properly when skinFactory changes when it's a non-ClassFactory (SDK-19450)

- autoLayout and typicalItem properties weren't getting proxied properly on FxDataContainer (SDK-19799)

- Tabbing through two focusable items, when one of those items is partially "offscreen", starts the tab loop with the second item instead of the first (SDK-17283)

- Add Icon file for FxVideoDisplay and VideoElement.

- Also fixed up some ASDoc versioning info for stuff that was added in the Flex 4 timeframe but was actually added to the framework project and not the flex4 project.

- Also renaming Group.setMxmlContent -> Group.setMXMLContent to follow proper naming conventions.

QE Notes: I'll update the bug files and let you know which ones we need to add tests for
Doc Notes: -
Bugs: SDK-19680, SDK-19424, SDK-19582, SDK-18864, SDK-19450, SDK-19799, SDK-17283
Reviewer: Jason reviewed most of the changes, Alex reviewed the FocusManager change
tests: checkintests, mustella Group, DataGroup, FxComponent

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/bundles/en_US/components.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElementContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVideoDisplay.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVideoDisplay.png</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/VideoElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/VideoElement.png</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -66,6 +66,13 @@
 [Exclude(name="focusBlendMode", kind="style")]
 [Exclude(name="focusThickness", kind="style")]
 [Exclude(name="themeColor", kind="style")]
+[Exclude(name="addChild", kind="method")]
+[Exclude(name="addChildAt", kind="method")]
+[Exclude(name="removeChild", kind="method")]
+[Exclude(name="removeChildAt", kind="method")]
+[Exclude(name="setChildIndex", kind="method")]
+[Exclude(name="swapChildren", kind="method")]
+[Exclude(name="swapChildrenAt", kind="method")]

 //--------------------------------------
 //  Other metadata
@@ -215,10 +222,12 @@
         if (_skin)
         {
             var factory:Object = getStyle("skinFactory");
-
-            var newSkinClass:Class = (factory && factory is ClassFactory) ?
-                ClassFactory(factory).generator :
-                getStyle("skinClass");
+            var newSkinClass:Class;
+
+            if (factory)
+                newSkinClass = (factory is ClassFactory) ? ClassFactory(factory).generator : null;
+            else
+                newSkinClass = getStyle("skinClass");

             skipReload = newSkinClass &&
                 getQualifiedClassName(newSkinClass) == getQualifiedClassName(_skin);


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

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

 package spark.effects.supportClasses
 {


Try ignoring the error...

Try ignoring the error...

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

--- src/as/com/threerings/presents/client/Communicator.as
+++ src/as/com/threerings/presents/client/Communicator.as
@@ -286,7 +286,12 @@
         // total failure
         Log.getLog(this).warning("socket error: " + event);
         Log.dumpStack();
-        shutdown(new Error("socket closed unexpectedly."));
+        if (_socket.connected) {
+            Log.getLog(this).info("Things seem ok. Ignoring.");
+
+        } else {
+            shutdown(new Error("socket closed unexpectedly."));
+        }
     }

     /**


Added animation playback in viewer.

Added animation playback in viewer.

--- tools/viewers/flash/src/AWDViewer.as
+++ tools/viewers/flash/src/AWDViewer.as
@@ -1,11 +1,22 @@
 package
 {
+	import away3d.animators.SkeletonAnimator;
+	import away3d.animators.data.SkeletonAnimation;
+	import away3d.animators.data.SkeletonAnimationSequence;
+	import away3d.animators.data.SkeletonAnimationState;
+	import away3d.animators.skeleton.Skeleton;
+	import away3d.arcane;
 	import away3d.containers.View3D;
 	import away3d.controllers.HoverController;
+	import away3d.core.base.Geometry;
+	import away3d.core.base.SkinnedSubGeometry;
+	import away3d.core.base.SubGeometry;
 	import away3d.entities.Mesh;
 	import away3d.events.AssetEvent;
 	import away3d.events.LoaderEvent;
+	import away3d.library.AssetLibrary;
 	import away3d.library.assets.AssetType;
+	import away3d.library.utils.AssetLibraryIterator;
 	import away3d.loaders.Loader3D;
 	import away3d.loaders.misc.AssetLoaderContext;
 	import away3d.loaders.parsers.AWD2Parser;
@@ -18,6 +29,8 @@
 	import flash.geom.Vector3D;
 	import flash.net.URLRequest;

+	use namespace arcane;
+
 	[SWF(width="800", height="600")]
 	public class AWDViewer extends Sprite
 	{
@@ -27,6 +40,9 @@
 		private var _hoverCtrl : HoverController;
 		private var _prevMouseX : Number;
 		private var _prevMouseY : Number;
+
+		private var _skeleton : Skeleton;
+		private var _animator : SkeletonAnimator;

 		public function AWDViewer()
 		{
@@ -58,10 +74,10 @@
 		private function load(url : String) : void
 		{
 			Loader3D.enableParser(AWD2Parser);
-			_loader = new Loader3D(false);
+			_loader = new Loader3D(true);
 			_loader.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
 			_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
-			_loader.load(new URLRequest(url), new AssetLoaderContext(false));
+			_loader.load(new URLRequest(url));
 		}

@@ -77,6 +93,9 @@
 				if (mesh.material == null || (texMat && texMat.texture == null))
 					mesh.material = new ColorMaterial(Math.random() * 0xffffff);
 			}
+			else if (ev.asset.assetType == AssetType.SKELETON) {
+				_skeleton = Skeleton(ev.asset);
+			}
 		}

@@ -86,6 +105,47 @@
 			var max : Vector3D;
 			var min : Vector3D;
 			var d : Vector3D;
+
+			if (_skeleton) {
+				var it : AssetLibraryIterator;
+				var mesh : Mesh;
+				var geom : Geometry;
+				var jpv : int;
+
+				it = AssetLibrary.createIterator(AssetType.MESH);
+				while (mesh = Mesh(it.next())) {
+					if (mesh.geometry && mesh.geometry.subGeometries.length > 0) {
+						var sub : SkinnedSubGeometry = mesh.geometry.subGeometries[0] as SkinnedSubGeometry;
+						if (sub != null) {
+							geom = mesh.geometry;
+							jpv = sub.jointIndexData.length / sub.numVertices;
+							break;
+						}
+					}
+				}
+
+				if (geom) {
+					var seq : SkeletonAnimationSequence;
+					var name : String;
+					var state : SkeletonAnimationState;
+
+					geom.animation = new SkeletonAnimation(_skeleton, jpv, true);
+					state = SkeletonAnimationState(mesh.animationState);
+
+					_animator = new SkeletonAnimator(state);
+					_animator.updateRootPosition = false;
+
+					it = AssetLibrary.createIterator(AssetType.ANIMATION);
+					while (seq = SkeletonAnimationSequence(it.next())) {
+						_animator.addSequence(seq);
+
+						if (!name)
+							name = seq.name;
+					}
+
+					_animator.play(name);
+				}
+			}

 			max = new Vector3D(_loader.maxX, _loader.maxY, _loader.maxZ);
 			min = new Vector3D(_loader.minX, _loader.minY, _loader.minZ);


Conditional Syllogism statement bug:

Conditional Syllogism statement bug:

--- Arguments/src/Controller/logic/ConditionalSyllogism.as
+++ Arguments/src/Controller/logic/ConditionalSyllogism.as
@@ -8,7 +8,10 @@
 	import components.DynamicTextArea;
 	import components.Inference;

+	import flash.utils.Dictionary;
+
 	import mx.controls.Alert;
+	import mx.core.FlexGlobals;

 	public class ConditionalSyllogism extends ParentArg
 	{
@@ -35,6 +38,19 @@
 		}

 		override public function formText(argumentTypeModel:ArgumentTypeModel):void{
+			var output:String = "";
+			var reasonText:String = "";
+			var reasonModels:Vector.<StatementModel> = argumentTypeModel.reasonModels;
+			var claimModel:StatementModel = argumentTypeModel.claimModel;
+			var inferenceModel:StatementModel = argumentTypeModel.inferenceModel;
+
+			switch(argumentTypeModel.language){
+				case langTypes[0]:
+					inferenceModel.statement.text = "If " + inferenceModel.statements[0].text + ", then " + inferenceModel.statements[1].text;
+					break;
+				case langTypes[1]:
+					inferenceModel.statement.text = inferenceModel.statements[0].text + " implies " + inferenceModel.statements[1].text;
+			}

 		}

@@ -55,8 +71,7 @@
 			for(i=0; i<reasonModels.length - 1; i++){
 				removeDependence(reasonModels[i].statements[1], reasonModels[i+1].statements[0]);
 			}
-
-
+
 			//reason to inference
 			removeDependence(reasonModels[reasonModels.length - 1].statements[1], inferenceModel.statements[0]);

@@ -82,16 +97,25 @@
 			var reasonModels:Vector.<StatementModel> = argumentTypeModel.reasonModels;
 			var claimModel:StatementModel = argumentTypeModel.claimModel;
 			var inferenceModel:StatementModel = argumentTypeModel.inferenceModel;
+			var hashMap:Dictionary = FlexGlobals.topLevelApplication.map.agoraMap.panelsHash;
 			var i:int;
-
+			var argumentPanel:ArgumentPanel;
 			inferenceModel.connectingString = StatementModel.IMPLICATION;

 			if(claimModel.firstClaim && claimModel.statements.length < 2){
 				claimModel.addTemporaryStatement();
+				if(hashMap.hasOwnProperty(claimModel.ID)){
+					argumentPanel = hashMap[claimModel.ID];
+					argumentPanel.statementsAddedDF = true;
+				}
 			}

 			if(reasonModels[0].statements.length < 2){
 				reasonModels[0].addTemporaryStatement();
+				if(hashMap.hasOwnProperty(reasonModels[0].ID)){
+					argumentPanel = hashMap[reasonModels[0].ID];
+					argumentPanel.statementsAddedDF = true;
+				}
 			}
 			//connect the conclusion of the claim
 			//to the conclusion of the inference


- bugfix: Added guard against another null condition in BitmapElement

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

--- src/reprise/controls/BitmapElement.as
+++ src/reprise/controls/BitmapElement.as
@@ -81,7 +81,7 @@

 		override protected function applyInFlowChildPositions() : void
 		{
-			if (!m_image)
+			if (!(m_image && m_image.bitmapData))
 			{
 				return;
 			}


fix potential video issues with streams with last video PES packet overflowing between different segments

--- src/org/mangui/HLS/muxing/TS.as
+++ src/org/mangui/HLS/muxing/TS.as
@@ -155,6 +155,8 @@
                     // complete PES, parse and push into the queue
                     _parseAVCPES(pes);
                     _curVideoData = null;
+                }  else {
+                    _curVideoData.position = _curVideoData.length;
                 }
             }
             Log.debug("TS: successfully parsed");


Transferred from the Adobe Open Source Subversion Repository

Revision: 19253
Author:   jasonsj@adobe.com
Date:     2010-12-10T00:48:41.286807Z

Log Message:
-----------
Explicitly set default stage.quality to HIGH. Fixes rendering issues in mobiletheme skins.

Moved textShadowColor and textShadowAlpha from BasicInheritingTextStyles to only ActionBar and Button

Added mobile DefaultButtonSkin for Button.emphasized, accentColor styling.

Remove text shadow from CheckBox and RadioButton

QE notes: Changing mobile stage quality from MEDIUM to HIGH results in anti aliasing changes in rounded graphics and FTE fonts.
Doc notes:
Bugs:
SDK-28224 [AIR] Android stage quality capped at MEDIUM
SDK-28665 textShadowAlpha and textShadowColor are code hinted in Builder for mobile text controls.
SDK-28522 accentColor not working
SDK-28583 	textShadowAlpha should have a common global value, should only apply to ActionBar and Button
Reviewer: gruehle, jszeto
Tests run: checkintests, cyclone
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/styles/metadata/BasicInheritingTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as
@@ -11,571 +11,534 @@

 package spark.skins.mobile.supportClasses
 {
-
-    import flash.display.DisplayObject;
-    import flash.display.GradientType;
-    import flash.display.Graphics;
-    import flash.events.Event;
-    import flash.events.EventDispatcher;
-    import flash.geom.Matrix;
-    import flash.geom.Point;
-    import flash.text.TextField;
-    import flash.text.TextFormat;
-    import flash.text.TextFormatAlign;
-    import flash.text.TextLineMetrics;
-
-    import mx.core.IFlexDisplayObject;
-    import mx.core.ILayoutElement;
-    import mx.core.IUITextField;
-    import mx.core.UITextField;
-    import mx.core.mx_internal;
-    import mx.events.FlexEvent;
-    import mx.managers.LayoutManager;
-    import mx.states.SetProperty;
-    import mx.states.State;
-    import mx.utils.ColorUtil;
-
-    import spark.components.Group;
-    import spark.components.IconPlacement;
-    import spark.components.supportClasses.ButtonBase;
-    import spark.components.supportClasses.StyleableTextField;
-    import spark.primitives.BitmapImage;
-    import spark.skins.mobile.supportClasses.MobileSkin;
-
-    use namespace mx_internal;
-
-    /*
-    ISSUES:
-    - should we support textAlign (if not, remove extra code)
-    */
-    /**
-     *  Actionscript based skin for mobile applications. The skin supports
-     *  icon and iconPlacement. It uses a couple of FXG classes to
-     *  implement the vector drawing.
+
+import flash.display.DisplayObject;
+import flash.display.GradientType;
+import flash.display.Graphics;
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.geom.Matrix;
+import flash.geom.Point;
+import flash.text.TextField;
+import flash.text.TextFormat;
+import flash.text.TextFormatAlign;
+import flash.text.TextLineMetrics;
+
+import mx.core.IFlexDisplayObject;
+import mx.core.ILayoutElement;
+import mx.core.IUITextField;
+import mx.core.UITextField;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+import mx.managers.LayoutManager;
+import mx.states.SetProperty;
+import mx.states.State;
+import mx.utils.ColorUtil;
+
+import spark.components.Group;
+import spark.components.IconPlacement;
+import spark.components.supportClasses.ButtonBase;
+import spark.components.supportClasses.StyleableTextField;
+import spark.primitives.BitmapImage;
+import spark.skins.mobile.supportClasses.MobileSkin;
+
+use namespace mx_internal;
+
+/*
+ISSUES:
+- should we support textAlign (if not, remove extra code)
+*/
+/**
+ *  Actionscript based skin for mobile applications. The skin supports
+ *  icon and iconPlacement. It uses a couple of FXG classes to
+ *  implement the vector drawing.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public class ButtonSkinBase extends MobileSkin
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    public function ButtonSkinBase()
+    {
+        super();
+
+        setStyle("textAlign", "center");
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  iconDisplay skin part.
+     */
+    private var iconChanged:Boolean = false;
+    private var iconInstance:Object;    // Can be either DisplayObject or BitmapImage
+    private var iconHolder:Group;       // Needed when iconInstance is a BitmapImage
+    private var _icon:Object;           // The currently set icon, can be Class, DisplayObject, URL
+
+    /**
+     *  labelDisplay skin part.
+     */
+    public var labelDisplay:StyleableTextField;
+
+    /**
+     *  If true, then create the iconDisplay using the icon style
      *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
+     *  @default true
+     */
+    protected var useIconStyle:Boolean = true;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Layout variables
+    //
+    //--------------------------------------------------------------------------
+
+    protected var layoutBorderSize:uint;
+
+    protected var layoutGap:int;
+
+    protected var layoutPaddingLeft:int;
+
+    protected var layoutPaddingRight:int;
+
+    protected var layoutPaddingTop:int;
+
+    protected var layoutPaddingBottom:int;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @copy spark.skins.spark.ApplicationSkin#hostComponent
      */
-    public class ButtonSkinBase extends MobileSkin
-    {
-        //--------------------------------------------------------------------------
-        //
-        //  Constructor
-        //
-        //--------------------------------------------------------------------------
-
-        public function ButtonSkinBase()
-        {
-            super();
-
-            setStyle("textAlign", "center");
-        }
-
-        //--------------------------------------------------------------------------
-        //
-        //  Variables
-        //
-        //--------------------------------------------------------------------------
-
-        /**
-         *  iconDisplay skin part.
-         */
-        private var iconChanged:Boolean = false;
-        private var iconInstance:Object;    // Can be either DisplayObject or BitmapImage
-        private var iconHolder:Group;       // Needed when iconInstance is a BitmapImage
-        private var _icon:Object;           // The currently set icon, can be Class, DisplayObject, URL
-
-        /**
-         *  labelDisplay skin part.
-         */
-        public var labelDisplay:StyleableTextField;
-
-        public var labelDisplayShadow:StyleableTextField;
-
-        /**
-         *  If true, then create the iconDisplay using the icon style
-         *
-         *  @default true
-         */
-        protected var useIconStyle:Boolean = true;
-
-        //--------------------------------------------------------------------------
-        //
-        //  Layout variables
-        //
-        //--------------------------------------------------------------------------
-
-        protected var layoutBorderSize:uint;
-
-        protected var layoutGap:int;
-
-        protected var layoutPaddingLeft:int;
-
-        protected var layoutPaddingRight:int;
-
-        protected var layoutPaddingTop:int;
-
-        protected var layoutPaddingBottom:int;
-
-        //--------------------------------------------------------------------------
-        //
-        //  Overridden properties
-        //
-        //--------------------------------------------------------------------------
-
-        /**
-         * @copy spark.skins.spark.ApplicationSkin#hostComponent
-         */
-        public var hostComponent:ButtonBase; // SkinnableComponent will popuplate
-
-        //--------------------------------------------------------------------------
-        //
-        //  Overridden methods
-        //
-        //--------------------------------------------------------------------------
-
-        /**
-         *  @private
-         */
-        override protected function commitCurrentState():void
-        {
-            super.commitCurrentState();
-
-            commitDisabled(currentState.indexOf("disabled") >= 0);
-        }
-
-        protected function commitDisabled(isDisabled:Boolean):void
-        {
-            alpha = isDisabled ? 0.5 : 1;
-        }
-
-        /**
-         *  @private
-         */
-        override protected function createChildren():void
-        {
-            labelDisplay = StyleableTextField(createInFontContext(StyleableTextField));
-            labelDisplay.styleName = this;
-            labelDisplay.addEventListener(FlexEvent.VALUE_COMMIT, labelDisplay_valueCommitHandler);
-
-            labelDisplayShadow = StyleableTextField(createInFontContext(StyleableTextField));
-            labelDisplayShadow.styleName = this;
-            labelDisplayShadow.colorName = "textShadowColor";
-
-            addChild(labelDisplayShadow);
-            addChild(labelDisplay);
-        }
-
-        /**
-         *  @private
-         */
-        override public function styleChanged(styleProp:String):void
-        {
-            var allStyles:Boolean = !styleProp || styleProp == "styleName";
-
-            if (allStyles || styleProp == "iconPlacement")
-            {
-                invalidateSize();
-                invalidateDisplayList();
-            }
-
-            if (useIconStyle && (allStyles || styleProp == "icon"))
-            {
-                iconChanged = true;
-                invalidateProperties();
-            }
-
-            if (styleProp == "textShadowAlpha")
-            {
-                invalidateDisplayList();
-            }
-
-            super.styleChanged(styleProp);
-        }
-
-        /**
-         *  @private
-         */
-        override protected function commitProperties():void
-        {
-            super.commitProperties();
-
-            if (iconChanged)
-            {
-                iconChanged = false;
-                if (useIconStyle)
-                    setIcon(getStyle("icon"));
-            }
-        }
-
-        /**
-         *  @private
-         */
-        override protected function measure():void
-        {
-            super.measure();
-
-            var iconPlacement:String = getStyle("iconPlacement");
-
-            var textWidth:Number = 0;
-            var textHeight:Number = 0;
-
-            // reset text if it was truncated before.
-            if (hostComponent && labelDisplay.isTruncated)
-                labelDisplay.text = hostComponent.label;
-            labelDisplay.commitStyles();
-
-            if (hostComponent && hostComponent.label != "")
-            {
-                // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
-                //                  +1 originates from MX Button without explaination
-                var textSize:Point = labelDisplay.measuredTextSize;
-                textWidth = textSize.x + 1;
-                textHeight = textSize.y;
-            }
-            else
-            {
-                textHeight = measureText("Wj").height + UITextField.TEXT_HEIGHT_PADDING;
-            }
-
-            var iconDisplay:DisplayObject = getIconDisplay();
-            var iconWidth:Number = iconDisplay ? iconDisplay.width : 0;
-            var iconHeight:Number = iconDisplay ? iconDisplay.height : 0;
-            var w:Number = 0;
-            var h:Number = 0;
-
-            if (iconDisplay is ILayoutElement)
-            {
-                iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth(false);
-                iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight(false);
-            }
-
-            if (iconPlacement == IconPlacement.LEFT ||
-                iconPlacement == IconPlacement.RIGHT)
-            {
-                w = textWidth + iconWidth;
-                if (textWidth && iconWidth)
-                    w += layoutGap;
-                h = Math.max(textHeight, iconHeight);
-            }
-            else
-            {
-                w = Math.max(textWidth, iconWidth);
-                h = textHeight + iconHeight;
-                if (textHeight && iconHeight)
-                    h += layoutGap;
-            }
-
-            w += layoutPaddingLeft + layoutPaddingRight;
-            h += layoutPaddingTop + layoutPaddingBottom;
-
-            measuredWidth = Math.max(w, layoutMeasuredWidth);
-            measuredMinHeight = measuredHeight = Math.max(h, layoutMeasuredHeight);
-            measuredMinWidth = iconWidth + layoutPaddingLeft + layoutPaddingRight;
-        }
-
-        /**
-         *  @private
-         */
-        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):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 = 0;
-            var verticalGap:Number = 0;
-
-            var iconPlacement:String = getStyle("iconPlacement");
-
-            var textWidth:Number = 0;
-            var textHeight:Number = 0;
-            var textDescent:Number = 0;
-
-            // reset text if it was truncated before.
-            if (hostComponent && labelDisplay.isTruncated)
-                labelDisplay.text = hostComponent.label;
-            labelDisplay.commitStyles();
-
-            if (hostComponent && hostComponent.label != "")
-            {
-                // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
-                //                  +1 originates from MX Button without explaination
-                var textSize:Point = labelDisplay.measuredTextSize;
-                textWidth = textSize.x + 1;
-                textHeight = textSize.y;
-                textDescent = labelDisplay.getLineMetrics(0).descent;
-            }
-            else
-            {
-                var metrics:TextLineMetrics = measureText("Wj");
-                textHeight = metrics.height + UITextField.TEXT_HEIGHT_PADDING;
-                textDescent = metrics.descent;
-            }
-
-            var textAlign:String = "center"; // 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 viewWidth:Number = unscaledWidth;
-            var viewHeight:Number = unscaledHeight;
-
-            var iconDisplay:DisplayObject = getIconDisplay();
-            if (iconDisplay)
-            {
-                if (iconDisplay is ILayoutElement)
-                {
-                    iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth();
-                    iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight();
-                }
-                else
-                {
-                    iconWidth = iconDisplay.width;
-                    iconHeight = iconDisplay.height;
-                }
-            }
-
-            if (iconPlacement == IconPlacement.LEFT ||
-                iconPlacement == IconPlacement.RIGHT)
-            {
-                horizontalGap = layoutGap;
-
-                if (iconWidth == 0 || textWidth == 0)
-                    horizontalGap = 0;
-
-                if (textWidth > 0)
-                {
-                    labelWidth =
-                        Math.max(Math.min(viewWidth - iconWidth - horizontalGap -
-                            layoutPaddingLeft - layoutPaddingRight, textWidth), 0);
-                }
-                else
-                {
-                    labelWidth = 0;
-                }
-                labelHeight = Math.min(viewHeight, textHeight);
-
-                if (textAlign == "left")
-                {
-                    labelX += layoutPaddingLeft;
-                }
-                else if (textAlign == "right")
-                {
-                    labelX += (viewWidth - labelWidth - iconWidth -
-                        horizontalGap - layoutPaddingRight);
-                }
-                else // "center" -- default value
-                {
-                    labelX += ((viewWidth - labelWidth - iconWidth -
-                        horizontalGap - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
-                }
-
-                if (iconPlacement == IconPlacement.LEFT)
-                {
-                    labelX += iconWidth + horizontalGap;
-                    iconX = labelX - (iconWidth + horizontalGap);
-                }
-                else
-                {
-                    iconX  = labelX + labelWidth + horizontalGap;
-                }
-
-                // FIXME (jasonsj): enforcement of layoutPaddingTop && layoutPaddingBottom for text
-                iconY  = ((viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom) / 2) + layoutPaddingTop;
-                labelY = ((viewHeight - labelHeight + textDescent - StyleableTextField.TEXT_HEIGHT_PADDING) / 2);
-            }
-            else
-            {
-                verticalGap = layoutGap;
-
-                if (iconHeight == 0 || !hostComponent || hostComponent.label == "")
-                    verticalGap = 0;
-
-                if (textWidth > 0)
-                {
-                    labelWidth = Math.max(viewWidth - layoutPaddingLeft - layoutPaddingRight, 0);
-                    labelHeight =
-                        Math.min(viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom - verticalGap, textHeight);
-                }
-                else
-                {
-                    labelWidth = 0;
-                    labelHeight = 0;
-                }
-
-                labelX = layoutPaddingLeft;
-
-                if (textAlign == "left")
-                {
-                    iconX += layoutPaddingLeft;
-                }
-                else if (textAlign == "right")
-                {
-                    iconX += Math.max(viewWidth - iconWidth - layoutPaddingRight, layoutPaddingLeft);
-                }
-                else
-                {
-                    iconX += ((viewWidth - iconWidth - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
-                }
-
-                if (iconPlacement == IconPlacement.BOTTOM)
-                {
-                    labelY += ((viewHeight - labelHeight - iconHeight -
-                        layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
-                    iconY += labelY + labelHeight + verticalGap;
-                }
-                else
-                {
-                    iconY += ((viewHeight - labelHeight - iconHeight -
-                        layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
-                    labelY += iconY + iconHeight + verticalGap;
-                }
-            }
-
-            labelX = Math.max(0, Math.round(labelX));
-            labelY = Math.max(0, Math.round(labelY));
-
-            labelDisplay.commitStyles();
-            setElementSize(labelDisplay, labelWidth, labelHeight);
-            setElementPosition(labelDisplay, labelX, labelY);
-
-            if (textWidth > labelWidth)
-            {
-                labelDisplay.truncateToFit();
-            }
-
-            labelDisplayShadow.alpha = getStyle("textShadowAlpha");
-            labelDisplayShadow.commitStyles();
-
-            // FIXME (jasonsj): this resize causes scaling issues at 1.5x and 2x
-            // artifacts show below ActionBar buttons
-            setElementSize(labelDisplayShadow, labelWidth, labelHeight);
-            setElementPosition(labelDisplayShadow, labelX, labelY + 1);
-
-            // if labelDisplay is truncated, then push it down here as well.
-            // otherwise, it would have gotten pushed in the labelDisplay_valueCommitHandler()
-            if (labelDisplay.isTruncated)
-                labelDisplayShadow.text = labelDisplay.text;
-
-            if (iconDisplay)
-            {
-                setElementSize(iconDisplay, iconWidth, iconHeight);
-                setElementPosition(iconDisplay, Math.max(0, Math.round(iconX)), Math.max(0, Math.round(iconY)));
-            }
-
-            // draw chromeColor after parts have been positioned
-            super.updateDisplayList(unscaledWidth, unscaledHeight);
-        }
-
-        //--------------------------------------------------------------------------
-        //
-        //  Class methods
-        //
-        //--------------------------------------------------------------------------
-
-        /**
-         *  The current skin part that displays the icon.
-         *  If the icon is a Class, then the iconDisplay is an instance of that class.
-         *  If the icon is a DisplayObject instance, then the iconDisplay is that instance.
-         *  If the icon is URL, then iconDisplay is the Group that holds the BitmapImage with that URL.
-         *
-         *  @see #setIcon
-         *  @see #useIconStyle
-         */
-        protected function getIconDisplay():DisplayObject
-        {
-            return iconHolder ? iconHolder : iconInstance as DisplayObject;
-        }
-
-        /**
-         *  Sets the current icon for the iconDisplay skin part.
-         *  The iconDisplay skin part is created/set-up on demand.
-         *
-         *  @see #getIconDisplay
-         *  @see #useIconStyle
-         */
-        protected function setIcon(icon:Object):void
-        {
-            if (_icon == icon)
-                return;
-            _icon = icon;
-
-            // Clean-up the iconInstance
-            if (iconInstance)
-            {
-                if (iconHolder)
-                    iconHolder.removeAllElements();
-                else
-                    this.removeChild(iconInstance as DisplayObject);
-            }
-            iconInstance = null;
-
-            // Set-up the iconHolder
-            var needsHolder:Boolean = icon && !(icon is Class) && !(icon is DisplayObject);
-            if (needsHolder && !iconHolder)
-            {
-                iconHolder = new Group();
-                this.addChildAt(iconHolder, 0);
-            }
-            else if (!needsHolder && iconHolder)
-            {
-                this.removeChild(iconHolder);
-                iconHolder = null;
-            }
-
-            // Set-up the icon
-            if (icon)
-            {
-                if (needsHolder)
-                {
-                    iconInstance = new BitmapImage();
-                    iconInstance.source = icon;
-                    iconHolder.addElementAt(iconInstance as BitmapImage, 0);
-                }
-                else
-                {
-                    if (icon is Class)
-                        iconInstance = new (Class(icon))();
-                    else
-                        iconInstance = icon;
-
-                    addChildAt(iconInstance as DisplayObject, 0);
-                }
-            }
-
-            // explicitly invalidate, since addChild/removeChild don't invalidate for us
+    public var hostComponent:ButtonBase; // SkinnableComponent will popuplate
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function commitCurrentState():void
+    {
+        super.commitCurrentState();
+
+        commitDisabled(currentState.indexOf("disabled") >= 0);
+    }
+
+    protected function commitDisabled(isDisabled:Boolean):void
+    {
+        alpha = isDisabled ? 0.5 : 1;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        labelDisplay = StyleableTextField(createInFontContext(StyleableTextField));
+        labelDisplay.styleName = this;
+
+        addChild(labelDisplay);
+    }
+
+    /**
+     *  @private
+     */
+    override public function styleChanged(styleProp:String):void
+    {
+        var allStyles:Boolean = !styleProp || styleProp == "styleName";
+
+        if (allStyles || styleProp == "iconPlacement")
+        {
             invalidateSize();
             invalidateDisplayList();
         }

-        //--------------------------------------------------------------------------
-        //
-        //  Event Handlers
-        //
-        //--------------------------------------------------------------------------
-
-        /**
-         *  @private
-         */
-        private function labelDisplay_valueCommitHandler(event:FlexEvent):void
-        {
-            labelDisplayShadow.text = labelDisplay.text;
-            invalidateSize();
+        if (useIconStyle && (allStyles || styleProp == "icon"))
+        {
+            iconChanged = true;
+            invalidateProperties();
+        }
+
+        if (styleProp == "textShadowAlpha")
+        {
             invalidateDisplayList();
         }
-    }
+
+        super.styleChanged(styleProp);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        if (iconChanged)
+        {
+            iconChanged = false;
+            if (useIconStyle)
+                setIcon(getStyle("icon"));
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        var iconPlacement:String = getStyle("iconPlacement");
+
+        var textWidth:Number = 0;
+        var textHeight:Number = 0;
+
+        // reset text if it was truncated before.
+        if (hostComponent && labelDisplay.isTruncated)
+            labelDisplay.text = hostComponent.label;
+        labelDisplay.commitStyles();
+
+        if (hostComponent && hostComponent.label != "")
+        {
+            // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
+            //                  +1 originates from MX Button without explaination
+            var textSize:Point = labelDisplay.measuredTextSize;
+            textWidth = textSize.x + 1;
+            textHeight = textSize.y;
+        }
+        else
+        {
+            textHeight = measureText("Wj").height + UITextField.TEXT_HEIGHT_PADDING;
+        }
+
+        var iconDisplay:DisplayObject = getIconDisplay();
+        var iconWidth:Number = iconDisplay ? iconDisplay.width : 0;
+        var iconHeight:Number = iconDisplay ? iconDisplay.height : 0;
+        var w:Number = 0;
+        var h:Number = 0;
+
+        if (iconDisplay is ILayoutElement)
+        {
+            iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth(false);
+            iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight(false);
+        }
+
+        if (iconPlacement == IconPlacement.LEFT ||
+            iconPlacement == IconPlacement.RIGHT)
+        {
+            w = textWidth + iconWidth;
+            if (textWidth && iconWidth)
+                w += layoutGap;
+            h = Math.max(textHeight, iconHeight);
+        }
+        else
+        {
+            w = Math.max(textWidth, iconWidth);
+            h = textHeight + iconHeight;
+            if (textHeight && iconHeight)
+                h += layoutGap;
+        }
+
+        w += layoutPaddingLeft + layoutPaddingRight;
+        h += layoutPaddingTop + layoutPaddingBottom;
+
+        measuredWidth = Math.max(w, layoutMeasuredWidth);
+        measuredMinHeight = measuredHeight = Math.max(h, layoutMeasuredHeight);
+        measuredMinWidth = iconWidth + layoutPaddingLeft + layoutPaddingRight;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):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 = 0;
+        var verticalGap:Number = 0;
+
+        var iconPlacement:String = getStyle("iconPlacement");
+
+        var textWidth:Number = 0;
+        var textHeight:Number = 0;
+        var textDescent:Number = 0;
+
+        // reset text if it was truncated before.
+        if (hostComponent && labelDisplay.isTruncated)
+            labelDisplay.text = hostComponent.label;
+        labelDisplay.commitStyles();
+
+        if (hostComponent && hostComponent.label != "")
+        {
+            // FIXME (jasonsj): was previously textWidth + UITextField.TEXT_WIDTH_PADDING + 1;
+            //                  +1 originates from MX Button without explaination
+            var textSize:Point = labelDisplay.measuredTextSize;
+            textWidth = textSize.x + 1;
+            textHeight = textSize.y;
+            textDescent = labelDisplay.getLineMetrics(0).descent;
+        }
+        else
+        {
+            var metrics:TextLineMetrics = measureText("Wj");
+            textHeight = metrics.height + UITextField.TEXT_HEIGHT_PADDING;
+            textDescent = metrics.descent;
+        }
+
+        var textAlign:String = "center"; // 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 viewWidth:Number = unscaledWidth;
+        var viewHeight:Number = unscaledHeight;
+
+        var iconDisplay:DisplayObject = getIconDisplay();
+        if (iconDisplay)
+        {
+            if (iconDisplay is ILayoutElement)
+            {
+                iconWidth = ILayoutElement(iconDisplay).getPreferredBoundsWidth();
+                iconHeight = ILayoutElement(iconDisplay).getPreferredBoundsHeight();
+            }
+            else
+            {
+                iconWidth = iconDisplay.width;
+                iconHeight = iconDisplay.height;
+            }
+        }
+
+        if (iconPlacement == IconPlacement.LEFT ||
+            iconPlacement == IconPlacement.RIGHT)
+        {
+            horizontalGap = layoutGap;
+
+            if (iconWidth == 0 || textWidth == 0)
+                horizontalGap = 0;
+
+            if (textWidth > 0)
+            {
+                labelWidth =
+                    Math.max(Math.min(viewWidth - iconWidth - horizontalGap -
+                        layoutPaddingLeft - layoutPaddingRight, textWidth), 0);
+            }
+            else
+            {
+                labelWidth = 0;
+            }
+            labelHeight = Math.min(viewHeight, textHeight);
+
+            if (textAlign == "left")
+            {
+                labelX += layoutPaddingLeft;
+            }
+            else if (textAlign == "right")
+            {
+                labelX += (viewWidth - labelWidth - iconWidth -
+                    horizontalGap - layoutPaddingRight);
+            }
+            else // "center" -- default value
+            {
+                labelX += ((viewWidth - labelWidth - iconWidth -
+                    horizontalGap - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
+            }
+
+            if (iconPlacement == IconPlacement.LEFT)
+            {
+                labelX += iconWidth + horizontalGap;
+                iconX = labelX - (iconWidth + horizontalGap);
+            }
+            else
+            {
+                iconX  = labelX + labelWidth + horizontalGap;
+            }
+
+            // FIXME (jasonsj): enforcement of layoutPaddingTop && layoutPaddingBottom for text
+            iconY  = ((viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom) / 2) + layoutPaddingTop;
+            labelY = ((viewHeight - labelHeight + textDescent - StyleableTextField.TEXT_HEIGHT_PADDING) / 2);
+        }
+        else
+        {
+            verticalGap = layoutGap;
+
+            if (iconHeight == 0 || !hostComponent || hostComponent.label == "")
+                verticalGap = 0;
+
+            if (textWidth > 0)
+            {
+                labelWidth = Math.max(viewWidth - layoutPaddingLeft - layoutPaddingRight, 0);
+                labelHeight =
+                    Math.min(viewHeight - iconHeight - layoutPaddingTop - layoutPaddingBottom - verticalGap, textHeight);
+            }
+            else
+            {
+                labelWidth = 0;
+                labelHeight = 0;
+            }
+
+            labelX = layoutPaddingLeft;
+
+            if (textAlign == "left")
+            {
+                iconX += layoutPaddingLeft;
+            }
+            else if (textAlign == "right")
+            {
+                iconX += Math.max(viewWidth - iconWidth - layoutPaddingRight, layoutPaddingLeft);
+            }
+            else
+            {
+                iconX += ((viewWidth - iconWidth - layoutPaddingLeft - layoutPaddingRight) / 2) + layoutPaddingLeft;
+            }
+
+            if (iconPlacement == IconPlacement.BOTTOM)
+            {
+                labelY += ((viewHeight - labelHeight - iconHeight -
+                    layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
+                iconY += labelY + labelHeight + verticalGap;
+            }
+            else
+            {
+                iconY += ((viewHeight - labelHeight - iconHeight -
+                    layoutPaddingTop - layoutPaddingBottom - verticalGap) / 2) + layoutPaddingTop;
+                labelY += iconY + iconHeight + verticalGap;
+            }
+        }
+
+        labelX = Math.max(0, Math.round(labelX));
+        labelY = Math.max(0, Math.round(labelY));
+
+        labelDisplay.commitStyles();
+        setElementSize(labelDisplay, labelWidth, labelHeight);
+        setElementPosition(labelDisplay, labelX, labelY);
+
+        if (textWidth > labelWidth)
+        {
+            labelDisplay.truncateToFit();
+        }
+
+        if (iconDisplay)
+        {
+            setElementSize(iconDisplay, iconWidth, iconHeight);
+            setElementPosition(iconDisplay, Math.max(0, Math.round(iconX)), Math.max(0, Math.round(iconY)));
+        }
+
+        // draw chromeColor after parts have been positioned
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  The current skin part that displays the icon.
+     *  If the icon is a Class, then the iconDisplay is an instance of that class.
+     *  If the icon is a DisplayObject instance, then the iconDisplay is that instance.
+     *  If the icon is URL, then iconDisplay is the Group that holds the BitmapImage with that URL.
+     *
+     *  @see #setIcon
+     *  @see #useIconStyle
+     */
+    protected function getIconDisplay():DisplayObject
+    {
+        return iconHolder ? iconHolder : iconInstance as DisplayObject;
+    }
+
+    /**
+     *  Sets the current icon for the iconDisplay skin part.
+     *  The iconDisplay skin part is created/set-up on demand.
+     *
+     *  @see #getIconDisplay
+     *  @see #useIconStyle
+     */
+    protected function setIcon(icon:Object):void
+    {
+        if (_icon == icon)
+            return;
+        _icon = icon;
+
+        // Clean-up the iconInstance
+        if (iconInstance)
+        {
+            if (iconHolder)
+                iconHolder.removeAllElements();
+            else
+                this.removeChild(iconInstance as DisplayObject);
+        }
+        iconInstance = null;
+
+        // Set-up the iconHolder
+        var needsHolder:Boolean = icon && !(icon is Class) && !(icon is DisplayObject);
+        if (needsHolder && !iconHolder)
+        {
+            iconHolder = new Group();
+            this.addChildAt(iconHolder, 0);
+        }
+        else if (!needsHolder && iconHolder)
+        {
+            this.removeChild(iconHolder);
+            iconHolder = null;
+        }
+
+        // Set-up the icon
+        if (icon)
+        {
+            if (needsHolder)
+            {
+                iconInstance = new BitmapImage();
+                iconInstance.source = icon;
+                iconHolder.addElementAt(iconInstance as BitmapImage, 0);
+            }
+            else
+            {
+                if (icon is Class)
+                    iconInstance = new (Class(icon))();
+                else
+                    iconInstance = icon;
+
+                addChildAt(iconInstance as DisplayObject, 0);
+            }
+        }
+
+        // explicitly invalidate, since addChild/removeChild don't invalidate for us
+        invalidateSize();
+        invalidateDisplayList();
+    }
+}
 }


rename Blending.NORMAL to Blending.OPAQUE

--- src/aerys/minko/type/enum/Blending.as
+++ src/aerys/minko/type/enum/Blending.as
@@ -18,14 +18,17 @@
 	 */
 	public final class Blending
 	{
-		public static const NORMAL		: uint		= BlendingSource.ONE
+		public static const OPAQUE		: uint		= BlendingSource.ONE
 													  | BlendingDestination.ZERO;

 		public static const ALPHA		: uint		= BlendingSource.SOURCE_ALPHA
 													  | BlendingDestination.ONE_MINUS_SOURCE_ALPHA;

-		public static const ADDITIVE	: uint		= BlendingSource.SOURCE_ALPHA
-													  | BlendingDestination.ONE;
+//		public static const ADDITIVE	: uint		= BlendingSource.SOURCE_ALPHA
+//													  | BlendingDestination.ONE;
+
+        public static const ADDITIVE	: uint		= BlendingSource.DESTINATION_ALPHA
+            | BlendingDestination.ONE;

 		public static const LIGHT		: uint		= BlendingSource.ZERO
 													  | BlendingDestination.SOURCE_COLOR;


Bug 538107: update testcase to match expected RTE with malformed URI passed to decodeURI* (r=brbaker)

--- test/acceptance/regress/bug_538107.as
+++ test/acceptance/regress/bug_538107.as
@@ -47,18 +47,29 @@
 // ED A0 80 = UTF-8 for 0xD800
 // 0xDC00 0xD800 is an invalid UTF-16 sequence
 var s = "%ED%B0%80%ED%A0%80";
-decodeURIComponent(s);
-// test here is actually to make sure that this will run, previously
-// the shell would have already thrown a runtime error:
-//  URIError: Error #1052: Invalid URI passed to decodeURIComponent function.
-AddTestCase("decodeURIComponent", 2, decodeURIComponent(s).length);

-decodeURI(s);
-// test here is actually to make sure that this will run, previously
-// the shell would have already thrown a runtime error:
-//  URIError: Error #1052: Invalid URI passed to decodeURI function.
-AddTestCase("decodeURI", 2, decodeURI(s).length);
+err = "no error";
+// looking for URIError: Error #1052: Invalid URI passed to decodeURIComponent function.
+try {
+    decodeURIComponent(s);
+} catch (e) {
+    err = grabError(e, e.toString());
+} finally {
+    AddTestCase("decodeURIComponent", "Error #1052", err );
+}
+
+
+err = "no error";
+// looking for URIError: Error #1052: Invalid URI passed to decodeURI function.
+try {
+    decodeURI(s);
+} catch (e) {
+    err = grabError(e, e.toString());
+} finally {
+    AddTestCase("decodeURI", "Error #1052", err );
+}
+

 test();


- change: ImageResource now actually cancels the loading process if it's told to do so

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

--- src/reprise/external/ImageResource.as
+++ src/reprise/external/ImageResource.as
@@ -136,6 +136,17 @@
 		{
 			if (m_loader)
 			{
+				if (!m_didFinishLoading)
+				{
+					try
+					{
+						m_loader.close();
+					}
+					catch (error : Error)
+					{
+						//no need to handle this error, just throw it away
+					}
+				}
 				m_loader.unload();
 			}
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 18478
Author:   klin@adobe.com
Date:     2010-11-05T21:01:35.464312Z

Log Message:
-----------
Added columns IList collection change handling in GridColumnHeaderGroupLayout. GCHGL now preserve the visible sort indicators when columns are added, removed, or moved. Also, fixed a related bug in GridDimensions where handling the move event for columns was causing an RTE.

QE notes: No
Doc notes: No
Bugs: SDK-28375
Reviewer: Hans
Tests run: cyclone server, checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/GridColumnHeaderGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
@@ -18,6 +18,8 @@
 import mx.core.IFactory;
 import mx.core.IVisualElement;
 import mx.core.mx_internal;
+import mx.events.CollectionEvent;
+import mx.events.CollectionEventKind;

 import spark.components.Grid;
 import spark.components.GridColumnHeaderGroup;
@@ -147,7 +149,7 @@
             rendererHeights[renderer.column.columnIndex] = renderer.getPreferredBoundsHeight();
         }

-        const columns:IList = grid.columns;
+        const columns:IList = columns;
         rendererHeights.length = (columns) ? columns.length : 0;

         var maxRendererHeight:Number = 0;
@@ -220,7 +222,7 @@
         const paddingTop:Number = columnHeaderGroup.getStyle("paddingTop");
         const paddingBottom:Number = columnHeaderGroup.getStyle("paddingBottom");

-        const columns:IList = grid.columns;
+        const columns:IList = columns;
         const columnsLength:int = (columns) ? columns.length : 0;
         const lastVisibleColumnIndex:int = grid.getPreviousVisibleColumnIndex(columnsLength);
         const rendererY:Number = paddingTop;
@@ -388,8 +390,9 @@
     {
         const columnHeaderGroup:GridColumnHeaderGroup = columnHeaderGroup;
         const grid:Grid = grid;
-
-        if (!columnHeaderGroup || !grid || !grid.columns)
+        const columns:IList = columns;
+
+        if (!columnHeaderGroup || !grid || !columns)
             return -1;

         const paddingLeft:Number = columnHeaderGroup.getStyle("paddingLeft");
@@ -399,7 +402,7 @@
             return -1;

         const isFirstColumn:Boolean = columnIndex == grid.getNextVisibleColumnIndex(-1);
-        const isLastColumn:Boolean = columnIndex == grid.getPreviousVisibleColumnIndex(grid.columns.length);
+        const isLastColumn:Boolean = columnIndex == grid.getPreviousVisibleColumnIndex(columns.length);

         const columnLeft:Number = grid.getCellX(0, columnIndex);
         const columnRight:Number = columnLeft + grid.getColumnWidth(columnIndex);
@@ -438,7 +441,7 @@
         if (!columnHeaderGroup || !grid)
             return null;

-        const columns:IList = grid.columns;
+        const columns:IList = columns;
         const columnsLength:int = (columns) ? columns.length : 0;

         if (columnIndex >= columnsLength)
@@ -512,10 +515,10 @@

         // create a new renderer

-        const columns:IList = grid.columns;
+        const columns:IList = columns;
         if (!columns || (columns.length <= columnIndex))
             return null;
-        const column:GridColumn = grid.columns.getItemAt(columnIndex) as GridColumn;
+        const column:GridColumn = columns.getItemAt(columnIndex) as GridColumn;
         if (!column.visible)
             return null;

@@ -622,19 +625,191 @@
         element.visible = false;
     }

-
     private function get columnHeaderGroup():GridColumnHeaderGroup
     {
         return target as GridColumnHeaderGroup;
-    }
+    }

     private function get grid():Grid
     {
-        const chb:GridColumnHeaderGroup = columnHeaderGroup;
-        if (chb.dataGrid)
-            return chb.dataGrid.grid;
+        const chg:GridColumnHeaderGroup = columnHeaderGroup;
+        if (chg.dataGrid)
+            return chg.dataGrid.grid;

         return null;
+    }
+
+    private var _columns:IList;
+
+    /**
+     *  @private
+     *  The columns IList on the current Grid. A local reference is kept so
+     *  that we can remove the colllection change handler if the columns
+     *  list changes.
+     */
+    private function get columns():IList
+    {
+        const grid:Grid = grid;
+        const newColumns:IList = (grid) ? grid.columns : null;
+
+        if (newColumns != _columns)
+        {
+            if (_columns)
+                _columns.removeEventListener(CollectionEvent.COLLECTION_CHANGE, columns_collectionChangeHandler);
+
+            _columns = newColumns;
+
+            if (_columns)
+                _columns.addEventListener(CollectionEvent.COLLECTION_CHANGE, columns_collectionChangeHandler);
+        }
+
+        return _columns;
+    }
+
+    /**
+     *  @private
+     *  Handles changes to the columns IList that might affect the visible sort
+     *  indicators.
+     */
+    private function columns_collectionChangeHandler(event:CollectionEvent):void
+    {
+        switch (event.kind)
+        {
+            case CollectionEventKind.ADD:
+            {
+                columns_collectionChangeAdd(event);
+                break;
+            }
+
+            case CollectionEventKind.REMOVE:
+            {
+                columns_collectionChangeRemove(event);
+                break;
+            }
+
+            case CollectionEventKind.MOVE:
+            {
+                columns_collectionChangeMove(event);
+                break;
+            }
+
+            case CollectionEventKind.REPLACE:
+            case CollectionEventKind.UPDATE:
+            {
+                // Do nothing.
+                break;
+            }
+
+            case CollectionEventKind.REFRESH:
+            case CollectionEventKind.RESET:
+            {
+                columnHeaderGroup.visibleSortIndicatorIndices = null;
+                break;
+            }
+        }
+    }
+
+    /**
+     *  @private
+     *  Adjusts the visibleSortIndicatorIndices to the correct columns
+     *  after columns are added.
+     */
+    private function columns_collectionChangeAdd(event:CollectionEvent):void
+    {
+        const itemsLength:int = event.items.length;
+        if (itemsLength <= 0)
+            return;
+
+        const chg:GridColumnHeaderGroup = columnHeaderGroup;
+        const indices:Vector.<int> = chg.visibleSortIndicatorIndices;
+        const indicesLength:int = indices.length;
+        const startIndex:int = event.location;
+
+        for (var i:int = 0; i < indicesLength; i++)
+        {
+            if (indices[i] >= startIndex)
+                indices[i] += itemsLength;
+        }
+        chg.visibleSortIndicatorIndices = indices;
+    }
+
+    /**
+     *  @private
+     *  Adjusts the visibleSortIndicatorIndices to the correct columns
+     *  after columns are removed.
+     */
+    private function columns_collectionChangeRemove(event:CollectionEvent):void
+    {
+        const itemsLength:int = event.items.length;
+        if (itemsLength <= 0)
+            return;
+
+        const chg:GridColumnHeaderGroup = columnHeaderGroup;
+        const indices:Vector.<int> = chg.visibleSortIndicatorIndices;
+        const indicesLength:int = indices.length;
+        const startIndex:int = event.location;
+        const lastIndex:int = startIndex + itemsLength;
+        const newIndices:Vector.<int> = new Vector.<int>();
+        var index:int;
+
+        for each (index in indices)
+        {
+            if (index < startIndex)
+                newIndices.push(index);
+            else if (index >= lastIndex)
+                newIndices.push(index - lastIndex);
+        }
+        chg.visibleSortIndicatorIndices = newIndices;
+    }
+
+    /**
+     *  @private
+     *  Adjusts the visibleSortIndicatorIndices to the correct columns
+     *  after columns are moved.
+     */
+    private function columns_collectionChangeMove(event:CollectionEvent):void
+    {
+        const itemsLength:int = event.items.length;
+        if (itemsLength <= 0)
+            return;
+
+        const chg:GridColumnHeaderGroup = columnHeaderGroup;
+        const indices:Vector.<int> = chg.visibleSortIndicatorIndices;
+        const indicesLength:int = indices.length;
+        const oldStart:int = event.oldLocation;
+        const oldEnd:int = event.oldLocation + itemsLength;
+        const newStart:int = event.location;
+        const newEnd:int = event.location + itemsLength;
+        var index:int;
+
+        for (var i:int = 0; i < indicesLength; i++)
+        {
+            index = indices[i];
+
+            if (index >= oldStart && index < oldEnd)
+            {
+                // Moved items move up to new position
+                indices[i] = newStart + (index - oldStart);
+                continue;
+            }
+
+            // Two cases:
+            //      1) New position is greater than old position, so we
+            //         decrement their position by the number of moved items.
+            //      2) New position is less than old position, so we
+            //         increment their position by the number of moved items.
+            if (newStart > oldStart)
+            {
+                if (index >= oldEnd && index < newEnd)
+                    indices[i] -= itemsLength;
+            }
+            else if (newStart < oldStart)
+            {
+                if (index >= newStart && index < oldStart)
+                    indices[i] += itemsLength;
+            }
+        }
+        chg.visibleSortIndicatorIndices = indices;
     }

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 spark.components.gridClasses
 {


Moved source/dest link swapping so that loading links works properly

--- src/Components/Link.as
+++ src/Components/Link.as
@@ -71,19 +71,19 @@
 				link.destination = link.findDestinationPort(link.destination.Loc);
 				if (link.destination) {
 					link.hovering = false;
-
-					if (!link.source.isSource()) {
-						var t:Port = link.source;
-						link.source = link.destination;
-						link.destination = t;
-
-						if (!link.source.isSource())
-							throw new Error("Link connected with no source!");
-					}
 				} else {
 					link.deleted = true;
 					return false; //won't enter onto the action stack
 				}
+			}
+
+			if (!link.source.isSource()) {
+				var t:Port = link.source;
+				link.source = link.destination;
+				link.destination = t;
+
+				if (!link.source.isSource())
+					throw new Error("Link connected with no source!");
 			}

 			link.connect();


Removed enclosing testsuites tag in junit xml output

--- src/as3spec/Printer.as
+++ src/as3spec/Printer.as
@@ -20,7 +20,7 @@

 		  trace("<XMLResultPrinter>");
       trace("<?xml version='1.0' encoding='UTF-8'?>");
-      trace("<testsuites>");
+      //trace("<testsuites>");
       trace("<testsuite name='AllSpecs' errors='" + counter.errors + "' failures='" + counter.failures + "' tests='" + counter.specifications + "' time='" + (counter.time/1000) + "'>");
       for(var countName:String in counter.contexts) {
         for each(var specification:Specification in counter.contexts[countName]) {
@@ -28,7 +28,7 @@
         }
       }
       trace("</testsuite>");
-      trace("</testsuites>");
+      //trace("</testsuites>");
       trace("</XMLResultPrinter>");

 		}


Fixed bounding box merging problem for node and component

--- bin/Data/Scripts/Editor/EditorView.as
+++ bin/Data/Scripts/Editor/EditorView.as
@@ -2518,6 +2518,12 @@
     if (node is null || node is editorScene)
         return;

+    // if node has no component, merge its world position
+    if (node.numComponents == 0)
+    {
+        box.Merge(node.worldPosition);
+    }
+
     // Merge components bounding box of this node
     for (uint i = 0; i < node.numComponents; ++i)
     {
@@ -2538,14 +2544,18 @@
         return;

     Drawable@ drawable = cast<Drawable>(component);
-    if (drawable is null)
-        return;

     // Merge drawable component's bounding box. Skip skybox, as its box is very large, as well as lights
     if (drawable !is null && cast<Skybox>(drawable) is null && cast<Light>(drawable) is null)
+    {
         box.Merge(drawable.worldBoundingBox);
-    else if (drawable.node !is editorScene)
-        box.Merge(drawable.node.worldPosition);
+        visitedComponents.Push(component);
+        return;
+    }
+
+    // If the component is not a drawable, merge the world position of its node
+    if (component.node !is editorScene)
+        box.Merge(component.node.worldPosition);

     visitedComponents.Push(component);
 }


FIXED FLEX-33899 DataGrid goes blank when removing last item from dataProvider when requestedRowCount is set FIXED mispelled variable that caused getter to be used instead.

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -853,7 +853,7 @@
             const gridMaxVSP:Number = contentHeight - height;
             const centerContentHeight:Number = Math.ceil(gridViewLayout.gridDimensionsView.getContentHeight());
             const centerMaxVSP:Number = centerContentHeight - centerGridView.height;
-            const vsp:Number = (centerMaxVSP / gridMaxVSP) * value;
+            const vsp:Number = gridMaxVSP == 0 ? 0 :  (centerMaxVSP / gridMaxVSP) * value;

             centerGridView.verticalScrollPosition = vsp;

@@ -4609,7 +4609,6 @@

 		if (!variableRowHeight)
 			setFixedRowHeight(gridDimensions.getRowHeight(0));
-
 	}

     //--------------------------------------------------------------------------
@@ -5606,7 +5605,7 @@
             gridDimensions.columnCount = generatedColumns ? columns.length : 0;
         }

-        const gridDimenions:GridDimensions = this.gridDimensions;
+        const gridDimensions:GridDimensions = this.gridDimensions;
         if (gridDimensions)
         {
             gridDimensions.dataProviderCollectionChanged(event);


Transferred from the Adobe Open Source Subversion Repository

Revision: 10244
Author:   dsubrama@adobe.com
Date:     2009-09-14T21:21:01.470697Z

Log Message:
-----------
Now Spark multiple selection properties match the ordering of Halo multiple selection properties. The first item in the multiple selection vectors is always the last item the user selected.

QE notes: None
Doc notes: None
Bugs: SDK-21642
Reviewer: Hans
Tests run: List, ButtonBar, DDL
Is noteworthy for integration: Yes

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

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -350,7 +350,7 @@
                 var index:int = dataProvider.getItemIndex(value[i]);
                 if (index != -1)
                 {
-                    indices[i] = index;
+                    indices.splice(0, 0, index);
                 }
                 if (index == -1)
                 {
@@ -445,7 +445,7 @@
         }
         // Keep _proposedSelectedIndex in-sync with multiple selection properties.
         if (!isEmpty(_proposedSelectedIndices))
-           _proposedSelectedIndex = getLastItemValue(_proposedSelectedIndices);
+           _proposedSelectedIndex = getFirstItemValue(_proposedSelectedIndices);

         // Let ListBase handle the validating and commiting of the single-selection
         // properties.
@@ -656,27 +656,27 @@

     /**
      *  @private
-     *  Returns the index of the first selected item. In single
+     *  Returns the index of the last selected item. In single
      *  selection, this is just selectedIndex. In multiple
      *  selection, this is the index of the first selected item.
      */
-    private function getFirstSelectedIndex():int
+    private function getLastSelectedIndex():int
     {
         if (selectedIndices && selectedIndices.length > 0)
-            return selectedIndices[0];
+            return selectedIndices[selectedIndices.length - 1];
         else
             return 0;
     }

     /**
      *  @private
-     *  Given a Vector, returns the value of the last item,
+     *  Given a Vector, returns the value of the first item,
      *  or -1 if there are no items in the Vector;
      */
-    private function getLastItemValue(v:Vector.<int>):int
+    private function getFirstItemValue(v:Vector.<int>):int
     {
         if (v && v.length > 0)
-            return v[v.length - 1];
+            return v[0];
         else
             return -1;
     }
@@ -716,7 +716,7 @@
                             return interval;
                         else
                         {
-                            interval.push(selectedIndices[0]);
+                            interval.splice(0, 0, selectedIndices[0]);
                             return interval;
                     }
                     }
@@ -731,14 +731,14 @@
                             if (_selectedIndices[i] == index)
                                 found = true;
                             else if (_selectedIndices[i] != index)
-                                interval.push(_selectedIndices[i]);
+                                interval.splice(0, 0, _selectedIndices[i]);
                         }
                         if (!found)
                         {
                             // Nothing from the selection model was de-selected.
                             // Instead, the Ctrl key was held down and we're doing a
                             // new add.
-                            interval.push(index);
+                            interval.splice(0, 0, index);
                         }
                         return interval;
                     }
@@ -746,14 +746,14 @@
                 // Ctrl+click with no previously selected items
                 else
                 {
-                    interval.push(index);
+                    interval.splice(0, 0, index);
                     return interval;
             }
             }
             // A single item was newly selected, add that to the selection interval.
             else
             {
-                interval.push(index);
+                interval.splice(0, 0, index);
                 return interval;
         }
         }
@@ -767,14 +767,14 @@
             {
                 for (i = start; i <= end; i++)
                 {
-                    interval.push(i);
+                    interval.splice(0, 0, i);
                 }
             }
             else
             {
                 for (i = start; i >= end; i--)
                 {
-                    interval.push(i);
+                    interval.splice(0, 0, i);
                 }
             }
             return interval;
@@ -999,7 +999,7 @@
             // an "caretChange" event to update any bindings and update the
             // caretIndex backing variable.
             var oldIndex:Number = caretIndex;
-            _caretIndex = getLastItemValue(newInterval);
+            _caretIndex = getFirstItemValue(newInterval);
             e = new IndexChangeEvent(IndexChangeEvent.CARET_CHANGE);
             e.oldIndex = oldIndex;
             e.newIndex = caretIndex;
@@ -1021,7 +1021,7 @@

         var oldIndices:Vector.<int> = selectedIndices;
         _selectedIndices = newInterval;
-        _selectedIndex = getLastItemValue(newInterval);
+        _selectedIndex = getFirstItemValue(newInterval);
         // If the selection has actually changed, trigger a pass to
         // commitProperties where a change event will be
         // fired to update any bindings to selection properties.
@@ -1214,21 +1214,21 @@
         // interval.
         if (allowMultipleSelection && event.shiftKey && selectedIndices)
         {
-            var startIndex:Number = getFirstSelectedIndex();
+            var startIndex:Number = getLastSelectedIndex();
             var newInterval:Vector.<int> = new Vector.<int>();
             var i:int;
             if (startIndex <= proposedNewIndex)
             {
                 for (i = startIndex; i <= proposedNewIndex; i++)
                 {
-                    newInterval.push(i);
+                    newInterval.splice(0, 0, i);
                 }
             }
             else
             {
                 for (i = startIndex; i >= proposedNewIndex; i--)
                 {
-                    newInterval.push(i);
+                    newInterval.splice(0, 0, i);
                 }
             }
             selectedIndices = newInterval;