Transferred from the Adobe Open Source Subversion Repository

Revision: 2644
Author:   egeorgie@adobe.com
Date:     2008-07-28T23:58:09.872940Z

Log Message:
-----------
First pass at unifying layout APIs between UIComponent and GraphicElement, more to come with additional check-ins.

reviewed by Ryan, Glenn, Gordon, Chet

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

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -28,6 +28,7 @@
 import mx.events.CollectionEvent;
 import mx.events.PropertyChangeEvent;
 import mx.events.PropertyChangeEventKind;
+import flex.graphics.graphicsClasses.GraphicElement;
 import flex.graphics.IAssignableDisplayObjectElement;
 import flex.graphics.IDisplayObjectElement;
 import flex.graphics.IGraphicElement;
@@ -328,10 +329,38 @@
                 }
             }
         }
+
+        // Check whether we manage the elements, or are they managed by an ItemRenderer
+        if (!alwaysUseItemRenderer)
+        {
+            // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
+            // Validate element properties
+            var length:int = numItems;
+            for (var i:int = 0; i < length; i++)
+            {
+                var element:GraphicElement = getItemAt(i) as GraphicElement;
+                if (element)
+                    element.validateProperties();
+            }
+        }
     }

     override protected function measure():void
     {
+        // Check whether we manage the elements, or are they managed by an ItemRenderer
+        if (!alwaysUseItemRenderer)
+        {
+            // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
+            // Validate element size
+            var length:int = numItems;
+            for (var i:int = 0; i < length; i++)
+            {
+                var element:GraphicElement = getItemAt(i) as GraphicElement;
+                if (element)
+                    element.validateSize();
+            }
+        }
+
         super.measure();

         if (_layout)
@@ -342,40 +371,25 @@
     {
         super.updateDisplayList(unscaledWidth, unscaledHeight);

-        // TODO!!! Move this above the GraphicElement drawing once layout objects
-        // understand how to layout GraphicElements.
         if (_layout)
             _layout.updateDisplayList(unscaledWidth, unscaledHeight);

-        // Iterate through the graphic elements, clear their graphics and draw them
-        var length:int = numItems;
-        for (var i:int = 0; i < length; i++)
-        {
-            var element:IGraphicElement = getItemAt(i) as IGraphicElement;
-
-            if (element && !alwaysUseItemRenderer)
-            {
-                var g:Graphics;
-                var elementShape:Shape = elementToDisplayObjectMap[element] as Shape;
-                if (elementShape)
-                {
-                    g = elementShape.graphics;
-                }
-                else
-                {
-                    var elementSprite:Sprite = elementToDisplayObjectMap[element] as Sprite;
-                    if (elementSprite)
-                        g = elementSprite.graphics;
-                }
-
-                if (g)
-                {
-                    g.clear();
-                    element.draw(g);
-                }
-            }
-        }
-
+        // Check whether we manage the elements, or are they managed by an ItemRenderer
+        if (!alwaysUseItemRenderer)
+        {
+            // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
+            // Iterate through the graphic elements, clear their graphics and draw them
+            var length:int = numItems;
+            for (var i:int = 0; i < length; i++)
+            {
+                var element:GraphicElement = getItemAt(i) as GraphicElement;
+                if (element)
+                    element.validateDisplayList();
+            }
+        }
+
+        // TODO EGeorgie: maybe move this to commitProperties, or at least before
+        // children validateDisplayList()
         if (transformChanged)
         {
             transformChanged = false;


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

--- frameworks/projects/spark/src/spark/components/Image.as
+++ frameworks/projects/spark/src/spark/components/Image.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
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5124
Author:   cframpto@adobe.com
Date:     2009-03-02T13:20:23.924509Z

Log Message:
-----------
Optimize the number of times text has to be composed.  It's preferred to clip already composed text, rather than recomposing the text.

All 480 mustella GraphicTags tests still pass.

QE Notes: yes, this will need extensive testing, and I can give you test cases, but we should do it at the same time we test the new clipping code
Doc Notes:
Bugs: SDK-18746
Reviewers: Gordon

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/baseClasses/TextGraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/Label.as
+++ frameworks/projects/spark/src/spark/components/Label.as
@@ -152,31 +152,6 @@

     //--------------------------------------------------------------------------
     //
-    //  Overridden methods: GraphicElement
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    override protected function updateDisplayList(unscaledWidth:Number,
-                                                  unscaledHeight:Number):void
-    {
-        super.updateDisplayList(unscaledWidth, unscaledHeight);
-
-        // The updateDisplayList() method of a GraphicElement can get called
-        // when its style chain hasn't been initialized.
-        // In that case, composeTextLines() must not be called.
-        if (!mx_internal::styleChainInitialized)
-            return;
-
-        composeTextLines(unscaledWidth, unscaledHeight);
-
-        mx_internal::clip(unscaledWidth, unscaledHeight);
-	}
-
-    //--------------------------------------------------------------------------
-    //
     //  Methods
     //
     //--------------------------------------------------------------------------
@@ -204,6 +179,9 @@
         mx_internal::removeTextLines();
 		createTextLines(elementFormat);
         mx_internal::addTextLines(DisplayObjectContainer(displayObject));
+
+        // Just recomposed so reset.
+        mx_internal::stylesChanged = false;
     }

 	/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 13168
Author:   gosmith@adobe.com
Date:     2009-12-22T22:31:13.970084Z

Log Message:
-----------
Changed how accessibility works in the Spark Panel and TitleWindow.

Previously, we were attaching the PanelAccImpl or TitleWindowAccImpl to the titleDisplay, which complicated things. The first complication was that the titleDisplay is a skin part that might not be there when initializeAccessibility() is called. The second complication was in trying to get the MSAA Location to be the size of the Panel or TitleWindow, not the size of the titleDisplay; this wasn't working properly due to timing issues, since the titleDisplay redraws after the Panel/TitleWindow.

Now, we attach the acc impl to a special first child Sprite which stays behind all the content. The accessibility code in Panel and TitleWindow goes back to being completely standard; the creation and drawing of this Sprite (to get the MSAA Location correct) is handled in PanelAccImpl and inherited by TitleWindowAccImpl.

To prevent the title from being spoken twice, I null out the titleDisplay's own accessibilityImplementation at initialization or when the titelDisplay is added as a skin part. But I keep a reference to it in the component's acc impl so that I can restore it when the titleDisplay is removed as a skin part. For some reason, simply setting accessibilityEnabled to false didn't seem to work.

I also changed the logic in TitleWindowAccImpl for dispatching the MSAA events EVENT_OBJECT_LOCATIONCHANGE and EVENT_OBJECT_DESTROY. Previously, EVENT_OBJECT_LOCATIONCHANGE was being sent in response to a MOUSE_UP from the titleDisplay (after a drag); now it is sent in response to a WINDOW_MOVE_END from the TitleWindow (after a drag). And, previously, EVENT_OBJECT_DESTROY was sent in response to a MOUSE_UP from the closeButton (after a click); now it is sent in response to a CLOSE from the TitleWindow.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TitleWindow.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/PanelAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/TitleWindowAccImpl.as</path>

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

--- frameworks/projects/spark/src/spark/components/Panel.as
+++ frameworks/projects/spark/src/spark/components/Panel.as
@@ -11,9 +11,6 @@

 package spark.components
 {
-
-import flash.display.Graphics;
-import flash.utils.getQualifiedClassName;

 import mx.core.mx_internal;
 import mx.utils.BitFlagUtil;
@@ -200,7 +197,7 @@

         // default skin uses graphical dropshadow which
         // we don't want to be hittable
-        mouseEnabled=false;
+        mouseEnabled = false;
     }

     //--------------------------------------------------------------------------
@@ -227,7 +224,7 @@
      *  have been explicitely set or not.
      */
     mx_internal var controlBarGroupProperties:Object = { visible: true };
-
+
     //--------------------------------------------------------------------------
     //
     //  Skin parts
@@ -477,53 +474,16 @@
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
-
+
     /**
      *  @private
      */
     override protected function initializeAccessibility():void
     {
-        // Do nothing... don't even call super.
-        // The PanelAccImpl needs to be attached not to the Panel
-        // but to the Panel's titleDisplay, which is a skin part
-        // which may not exist initially and which may come and go.
-        // So we have to create and attach the PanelAccImpl
-        // in partAdded() instead.
-    }
-
-    /**
-     *  @private
-     */
-    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        // TODO (gosmith): this is not working
-        // to extend the height of the the titleDisplay
-        super.updateDisplayList(unscaledWidth, unscaledHeight);
-        if (titleDisplay)
-        {
-            var g:Graphics = titleDisplay.graphics;
-            g.clear();
-            // Also draw an invisible unfilled rect whose height
-            // is the height of the entire Panel, not just the headerHeight.
-            // This is for accessibility; the titleDisplay of the Panel
-            // has an AccessibilityImplementation (see PanelAccImpl)
-            // which makes it act like a grouping (ROLE_SYSTEM_GROUPING)
-            // for the controls inside the panel.
-            // Drawing this rect makes the accLocation rect of the grouping
-            // enclose the controls inside the grouping,
-            // even though it is a sibling of them, not their parent.
-            // (This is because the Player doesn't support Sprites
-            // with AccessibilityImplementations inside other Sprites
-            // with AccessibilityImplementations; the accessible objects
-            // in a Flash SWF are a flat list, not a hierarchy.)
-            // This rectangle must be unfilled because the titleBar is
-            // actually on top of the content area and would otherwise
-            // block mouse events to the controls in the Panel.
-            g.lineStyle(0, 0x000000, 0);
-            g.drawRect(0, 0, unscaledWidth, unscaledHeight);
-        }
-    }
-
+		if (Panel.createAccessibilityImplementation != null)
+			Panel.createAccessibilityImplementation(this);
+    }
+
     /**
      *  @private
      */
@@ -534,19 +494,6 @@
         if (instance == titleDisplay)
         {
             titleDisplay.text = title;
-
-            // Since the PanelAccImpl must be attached to the Panel's titleDisplay
-            // instead of to the Panel itself, we delay doing this until we are
-            // sure there is a titleDisplay, and we do it again if it gets
-            // re-added.
-            // But if the TitleWindow subclass has already attached its acc impl,
-            // leave that one.
-            if (getQualifiedClassName(titleDisplay.accessibilityImplementation) !=
-                "spark.accessibility::TitleWindowAccImpl")
-            {
-                if (Panel.createAccessibilityImplementation != null)
-                    Panel.createAccessibilityImplementation(this);
-            }
         }
         else if (instance == controlBarGroup)
         {
@@ -590,14 +537,7 @@
     {
         super.partRemoved(partName, instance);

-        if (instance == titleDisplay)
-        {
-            // Since the PanelAccImpl must be attached to the Panel's titleDisplay
-            // instead of to the Panel itself, we remove it from the titleDisplay
-            // when the titleDisplay is removed from the Panel.
-            titleDisplay.accessibilityImplementation = null;
-        }
-        else if (instance == controlBarGroup)
+		if (instance == controlBarGroup)
         {
             // copy proxied values from contentGroup (if explicitely set) to contentGroupProperties


minor refactor of TransformController.transformChangedHandler()

--- src/aerys/minko/scene/controller/TransformController.as
+++ src/aerys/minko/scene/controller/TransformController.as
@@ -74,16 +74,11 @@
             _node.worldToLocal.lock();
             _node.localToWorld.lock();

+			_node.localToWorld.copyFrom(_node.transform);
 			if (_node.parent)
-			{
-				_node.localToWorld.lock()
-					.copyFrom(_node.transform)
-					.append(parent.localToWorld)
-			}
-			else
-				_node.localToWorld.copyFrom(_node.transform);
+				_node.localToWorld.append(parent.localToWorld);

-			_node.worldToLocal.lock()
+			_node.worldToLocal
 				.copyFrom(_node.localToWorld)
 				.invert();


No need for the Dictionary, Object is simpler and enough for the case.

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

--- src/org/igniterealtime/xiff/im/Roster.as
+++ src/org/igniterealtime/xiff/im/Roster.as
@@ -23,16 +23,15 @@
  */
 package org.igniterealtime.xiff.im
 {
+	import flash.events.EventDispatcher;
+
 	import mx.collections.ArrayCollection;
-
-	import flash.events.EventDispatcher;
-	import flash.utils.Dictionary;
-
+
 	import org.igniterealtime.xiff.core.*;
 	import org.igniterealtime.xiff.data.*;
 	import org.igniterealtime.xiff.data.im.*;
 	import org.igniterealtime.xiff.events.*;
-
+
 	/**
 	 * Broadcast whenever someone revokes your presence subscription. This is not
 	 * an event that is fired when you revoke a subscription, but rather when one of your
@@ -107,43 +106,39 @@
 	 */
 	public class Roster extends ArrayCollection
 	{
+
+		private static var rosterStaticConstructed:Boolean = RosterStaticConstructor();
+
+		private static const staticConstructorDependencies:Array = [ ExtensionClassRegistry,
+																	 RosterExtension ]
+
 		private var _connection:XMPPConnection;
-
+
+		/**
+		 * Store groups as RosterGroup.
+		 */
+		private var _groups:Object = {};
+
+		/**
+		 * Store presences of the people in users roster.
+		 */
+		private var _presenceMap:Object = {};
+
 		//FIXME: does not support multiple pending requests
 		private var pendingSubscriptionRequestJID:UnescapedJID;
-
-		/**
-		 * Store presences of the people in users roster.
-		 */
-		private var _presenceMap:Dictionary;
-
-		/**
-		 * Store groups as RosterGroup.
-		 */
-		private var _groups:Dictionary;
-
-		private static const staticConstructorDependencies:Array = [
-			ExtensionClassRegistry,
-			RosterExtension
-		]
-
-		private static var rosterStaticConstructed:Boolean = RosterStaticConstructor();
-
+
 		/**
 		 *
 		 * @param	aConnection A reference to an XMPPConnection class instance
 		 */
 		public function Roster( aConnection:XMPPConnection = null )
 		{
-			_presenceMap = new Dictionary();
-			_groups = new Dictionary();
-
-			if (aConnection != null)
+			if ( aConnection != null )
 			{
 				connection = aConnection;
 			}
 		}
-
+
 		/**
 		 *
 		 * @return
@@ -153,7 +148,7 @@
 			ExtensionClassRegistry.register( RosterExtension );
 			return true;
 		}
-
+
 		/**
 		 * Adds a contact to the roster. Remember: All roster data is managed on the server-side,
 		 * so this contact is added to the server-side roster first, and upon successful addition,
@@ -176,12 +171,12 @@
 			{
 				displayName = id.toString();
 			}
-
+
 			var callbackObj:Roster = null;
 			var callbackMethod:String = null;
 			var subscription:String = RosterExtension.SUBSCRIBE_TYPE_NONE;
 			var askType:String = RosterExtension.ASK_TYPE_NONE;
-
+
 			if ( requestSubscription == true )
 			{
 				callbackObj = this;
@@ -190,67 +185,45 @@
 				subscription = RosterExtension.SUBSCRIBE_TYPE_TO;
 				askType = RosterExtension.ASK_TYPE_SUBSCRIBE
 			}
-
-			var tempIQ:IQ = new IQ (null, IQ.SET_TYPE, XMPPStanza.generateID("add_user_"), callbackMethod, callbackObj );
+
+			var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID( "add_user_" ),
+									callbackMethod, callbackObj );
 			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
-			ext.addItem( id.escaped, null, displayName, groupName ? [groupName] : null );
+			ext.addItem( id.escaped, null, displayName, groupName ? [ groupName ] :
+						 null );
 			tempIQ.addExtension( ext );
 			_connection.send( tempIQ );
-
-
+
+
 			addRosterItem( id, displayName, RosterExtension.SHOW_PENDING, RosterExtension.SHOW_PENDING,
-				[groupName], subscription, askType );
-		}
-
-		/**
-		 * Requests subscription authorization with a user or service. In the XMPP-world, you cannot receive
-		 * notifications on changes to a contact's presence until that contact has authorized you to subscribe
-		 * to his/her/its presence.
-		 *
-		 * @param	id The JID of the user or service that you wish to subscribe to
-		 * @param	isResponse
-		 * @see	#subscriptionDenial
-		 */
-		public function requestSubscription( id:UnescapedJID, isResponse:Boolean = false):void
-		{
-			// Roster length is 0 if it a response to a user request. we must handle this event.
-			var tempPresence:Presence;
-			if (isResponse)
-			{
-				tempPresence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
-				_connection.send( tempPresence );
-				return;
-			}
-			// Only request for items in the roster
-			if (contains(RosterItemVO.get(id, false)))
-			{
-				tempPresence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
-				_connection.send( tempPresence );
-			}
-		}
-
-		/**
-		 * Removes a contact from the roster and revokes all presence subscriptions for that contact.
-		 * This method will only attempt action if the contact you are trying to remove is currently on the
-		 * roster in the first place.
-		 *
-		 * @param	rosterItem The value object which is to be removed
-		 */
-		public function removeContact( rosterItem:RosterItemVO ):void
-		{
-			if (contains(rosterItem))
-			{
-				var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID("remove_user_"), "unsubscribe_result", this );
-				var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
-				ext.addItem( new EscapedJID(rosterItem.jid.bareJID), RosterExtension.SUBSCRIBE_TYPE_REMOVE );
-				tempIQ.addExtension( ext );
-				_connection.send( tempIQ );
-
-				//the roster item is not actually removed from the roster
-				//until confirmation comes back from the XMPP server
-			}
-		}
-
+						   [ groupName ], subscription, askType );
+		}
+
+		/**
+		 *
+		 * @param	resultIQ
+		 */
+		public function addContact_result( resultIQ:IQ ):void
+		{
+			// Contact was added, request subscription
+			requestSubscription( pendingSubscriptionRequestJID );
+			pendingSubscriptionRequestJID = null;
+		}
+
+		/**
+		 * Revokes an existing presence subscription or denies a subscription request. If a user
+		 * has sent you a subscription request you can use this method to deny that request. Otherwise,
+		 * if a user already has a granted presence subscription, you can use this method to revoke that
+		 * subscription.
+		 *
+		 * @param	tojid The JID of the user or service that you are denying subscription
+		 */
+		public function denySubscription( tojid:UnescapedJID ):void
+		{
+			var tempPresence:Presence = new Presence( tojid.escaped, null, Presence.UNSUBSCRIBED_TYPE );
+			_connection.send( tempPresence );
+		}
+
 		/**
 		 * Fetches the roster data from the server. Once the data has been fetched, the Roster's data
 		 * provider is populated appropriately. If the Roster-XMPPConnection class dependency has been
@@ -259,11 +232,92 @@
 		 */
 		public function fetchRoster():void
 		{
-			var tempIQ:IQ = new IQ( null, IQ.GET_TYPE, XMPPStanza.generateID("roster_"), "fetchRoster_result", this );
+			var tempIQ:IQ = new IQ( null, IQ.GET_TYPE, XMPPStanza.generateID( "roster_" ),
+									"fetchRoster_result", this );
 			tempIQ.addExtension( new RosterExtension( tempIQ.getNode() ) );
 			_connection.send( tempIQ );
 		}
-
+
+		/**
+		 *
+		 * @param	resultIQ
+		 */
+		public function fetchRoster_result( resultIQ:IQ ):void
+		{
+			// Clear out the old roster
+			removeAll();
+			try
+			{
+				disableAutoUpdate();
+				for each ( var ext:RosterExtension in resultIQ.getAllExtensionsByNS( RosterExtension.NS ) )
+				{
+					for each ( var item:*in ext.getAllItems() )
+					{
+						//var classInfo:XML = flash.utils.describeType(item);
+						if ( !item is XMLStanza )
+						{
+							continue;
+						}
+
+						var askType:String = item.askType != null ? item.askType.toLowerCase() :
+							RosterExtension.ASK_TYPE_NONE;
+						addRosterItem( new UnescapedJID( item.jid ), item.name, RosterExtension.SHOW_UNAVAILABLE,
+									   "Offline", item.groupNames, item.subscription.toLowerCase(),
+									   askType );
+					}
+				}
+				enableAutoUpdate();
+
+				// Fire Roster Loaded Event
+				var rosterEvent:RosterEvent = new RosterEvent( RosterEvent.ROSTER_LOADED,
+															   false, false );
+				dispatchEvent( rosterEvent );
+			}
+			catch ( e:Error )
+			{
+				trace( e.getStackTrace() );
+			}
+		}
+
+		/**
+		 *
+		 * @param	item
+		 * @return
+		 */
+		public function getContainingGroups( item:RosterItemVO ):Array
+		{
+			var result:Array = [];
+			for ( var key:String in _groups )
+			{
+				var group:RosterGroup = _groups[ key ] as RosterGroup;
+				if ( group.contains( item ) )
+				{
+					result.push( group );
+				}
+			}
+			return result;
+		}
+
+		/**
+		 * Get a group by given name
+		 * @param	name
+		 * @return
+		 */
+		public function getGroup( name:String ):RosterGroup
+		{
+			return _groups[ name ] as RosterGroup;
+		}
+
+		/**
+		 * Get the Presence of the given user if any.
+		 * @param	jid
+		 * @return
+		 */
+		public function getPresence( jid:UnescapedJID ):Presence
+		{
+			return _presenceMap[ jid.toString() ] as Presence;
+		}
+
 		/**
 		 * Grants a user or service authorization for subscribing to your presence. Once authorization
 		 * is granted, the user can see whether you are offline, online, away, etc. Subscriptions can
@@ -277,91 +331,64 @@
 		{
 			var tempPresence:Presence = new Presence( tojid.escaped, null, Presence.SUBSCRIBED_TYPE );
 			_connection.send( tempPresence );
-
+
 			// Request a return subscription
 			if ( requestAfterGrant )
 			{
 				requestSubscription( tojid, true );
 			}
 		}
-
-		/**
-		 * Revokes an existing presence subscription or denies a subscription request. If a user
-		 * has sent you a subscription request you can use this method to deny that request. Otherwise,
-		 * if a user already has a granted presence subscription, you can use this method to revoke that
-		 * subscription.
-		 *
-		 * @param	tojid The JID of the user or service that you are denying subscription
-		 */
-		public function denySubscription( tojid:UnescapedJID ):void
-		{
-			var tempPresence:Presence = new Presence( tojid.escaped, null, Presence.UNSUBSCRIBED_TYPE );
-			_connection.send( tempPresence );
-		}
-
-		/**
-		 * Updates the information for an existing contact. You can use this method to change the
-		 * display name or associated group for a contact in your roster.
-		 *
-		 * @param	rosterItem The value object of the contact to update
-		 * @param	newName The new display name for this contact
-		 * @param	newGroups The new groups to associate the contact with
-		 */
-		private function updateContact( rosterItem:RosterItemVO, newName:String, groupNames:Array ):void
-		{
-			var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID("update_contact_") );
-			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
-
-			ext.addItem( rosterItem.jid.escaped, rosterItem.subscribeType, newName, groupNames );
-			tempIQ.addExtension( ext );
-			_connection.send( tempIQ );
-		}
-
-		/**
-		 * Updates the display name for an existing contact.
-		 *
-		 * @param	rosterItem The value object of the contact to update
-		 * @param	newName The new display name for this contact
-		 */
-		public function updateContactName( rosterItem:RosterItemVO, newName:String ):void
-		{
-			var groupNames:Array = [];
-			for each(var group:RosterGroup in getContainingGroups(rosterItem))
-			{
-				groupNames.push(group.label);
-			}
-			updateContact( rosterItem, newName, groupNames);
-		}
-
-		/**
-		 *
-		 * @param	item
-		 * @return
-		 */
-		public function getContainingGroups(item:RosterItemVO):Array
-		{
-			var result:Array = [];
-			for each(var group:RosterGroup in _groups)
-			{
-				if (group.contains(item))
-				{
-					result.push(group);
-				}
-			}
-			return result;
-		}
-
-		/**
-		 * Updates the groups associated with an existing contact.
-		 *
-		 * @param	rosterItem The value object of the contact to update
-		 * @param	newGroups The new groups to associate the contact with
-		 */
-		public function updateContactGroups( rosterItem:RosterItemVO, newGroupNames:Array ):void
-		{
-			updateContact( rosterItem, rosterItem.displayName, newGroupNames );
-		}
-
+
+		/**
+		 * Removes a contact from the roster and revokes all presence subscriptions for that contact.
+		 * This method will only attempt action if the contact you are trying to remove is currently on the
+		 * roster in the first place.
+		 *
+		 * @param	rosterItem The value object which is to be removed
+		 */
+		public function removeContact( rosterItem:RosterItemVO ):void
+		{
+			if ( contains( rosterItem ) )
+			{
+				var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID( "remove_user_" ),
+										"unsubscribe_result", this );
+				var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
+				ext.addItem( new EscapedJID( rosterItem.jid.bareJID ), RosterExtension.SUBSCRIBE_TYPE_REMOVE );
+				tempIQ.addExtension( ext );
+				_connection.send( tempIQ );
+
+				//the roster item is not actually removed from the roster
+				//until confirmation comes back from the XMPP server
+			}
+		}
+
+		/**
+		 * Requests subscription authorization with a user or service. In the XMPP-world, you cannot receive
+		 * notifications on changes to a contact's presence until that contact has authorized you to subscribe
+		 * to his/her/its presence.
+		 *
+		 * @param	id The JID of the user or service that you wish to subscribe to
+		 * @param	isResponse
+		 * @see	#subscriptionDenial
+		 */
+		public function requestSubscription( id:UnescapedJID, isResponse:Boolean = false ):void
+		{
+			// Roster length is 0 if it a response to a user request. we must handle this event.
+			var presence:Presence;
+			if ( isResponse )
+			{
+				presence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
+				_connection.send( presence );
+				return;
+			}
+			// Only request for items in the roster
+			if ( contains( RosterItemVO.get( id, false ) ) )
+			{
+				presence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
+				_connection.send( presence );
+			}
+		}
+
 		/**
 		 * Sets your current presence status. Calling this method notifies others who
 		 * are subscribed to your presence of a presence change. You should use this to
@@ -383,69 +410,77 @@
 		 */
 		public function setPresence( show:String, status:String, priority:Number ):void
 		{
-			//var tempPresence:Presence = new Presence( null, null, Presence.AVAILABLE_TYPE, show, status, priority );
-			var tempPresence:Presence = new Presence( null, null, null, show, status, priority );
-			_connection.send( tempPresence );
-		}
-
+			var presence:Presence = new Presence( null, null, null, show, status,
+													  priority );
+			_connection.send( presence );
+		}
+
 		/**
 		 *
 		 * @param	resultIQ
 		 */
-		public function fetchRoster_result( resultIQ:IQ ):void
-		{
-			// Clear out the old roster
-			removeAll();
-			try
-			{
-				disableAutoUpdate();
-				for each(var ext:RosterExtension in resultIQ.getAllExtensionsByNS( RosterExtension.NS ))
-				{
-					for each(var item:* in ext.getAllItems())
-					{
-						//var classInfo:XML = flash.utils.describeType(item);
-						if (!item is XMLStanza)
-						{
-							continue;
-						}
-
-						var askType:String = item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE;
-						addRosterItem( new UnescapedJID(item.jid), item.name, RosterExtension.SHOW_UNAVAILABLE,
-							"Offline", item.groupNames, item.subscription.toLowerCase(), askType);
-					}
-				}
-				enableAutoUpdate();
-
-				// Fire Roster Loaded Event
-				var rosterEvent:RosterEvent = new RosterEvent(RosterEvent.ROSTER_LOADED, false, false);
-				dispatchEvent(rosterEvent);
-			}
-			catch (e:Error)
-			{
-				trace(e.getStackTrace());
-			}
-		}
-
-		/**
-		 *
-		 * @param	resultIQ
-		 */
-		public function addContact_result( resultIQ:IQ ):void
-		{
-			// Contact was added, request subscription
-			requestSubscription( pendingSubscriptionRequestJID );
-			pendingSubscriptionRequestJID = null;
-		}
-
-		/**
-		 *
-		 * @param	resultIQ
-		 */
 		public function unsubscribe_result( resultIQ:IQ ):void
 		{
 			// Does nothing for now
 		}
-
+
+		/**
+		 * Updates the groups associated with an existing contact.
+		 *
+		 * @param	rosterItem The value object of the contact to update
+		 * @param	newGroups The new groups to associate the contact with
+		 */
+		public function updateContactGroups( rosterItem:RosterItemVO, newGroupNames:Array ):void
+		{
+			updateContact( rosterItem, rosterItem.displayName, newGroupNames );
+		}
+
+		/**
+		 * Updates the display name for an existing contact.
+		 *
+		 * @param	rosterItem The value object of the contact to update
+		 * @param	newName The new display name for this contact
+		 */
+		public function updateContactName( rosterItem:RosterItemVO, newName:String ):void
+		{
+			var groupNames:Array = [];
+			for each ( var group:RosterGroup in getContainingGroups( rosterItem ) )
+			{
+				groupNames.push( group.label );
+			}
+			updateContact( rosterItem, newName, groupNames );
+		}
+
+		private function addRosterItem( jid:UnescapedJID, displayName:String, show:String, status:String, groupNames:Array, type:String, askType:String = "none" ):Boolean
+		{
+			if ( !jid )
+			{
+				return false;
+			}
+
+			var rosterItem:RosterItemVO = RosterItemVO.get( jid, true );
+			if ( !contains( rosterItem ) )
+			{
+				addItem( rosterItem );
+			}
+			if ( displayName )
+			{
+				rosterItem.displayName = displayName;
+			}
+			rosterItem.subscribeType = type;
+			rosterItem.askType = askType;
+			rosterItem.status = status;
+			rosterItem.show = show;
+			setContactGroups( rosterItem, groupNames );
+
+			var event:RosterEvent = new RosterEvent( RosterEvent.USER_ADDED );
+			event.jid = jid;
+			event.data = rosterItem;
+			dispatchEvent( event );
+
+			return true;
+		}
+
 		/**
 		 *
 		 * @param	eventObj PresenceEvent, LoginEvent or RosterExtension
@@ -453,13 +488,13 @@
 		private function handleEvent( eventObj:* ):void
 		{

-			switch( eventObj.type )
+			switch ( eventObj.type )
 			{
 				// Handle any incoming presence items
 				case PresenceEvent.PRESENCE:
 					handlePresences( eventObj.data );
 					break;
-
+
 				// Fetch the roster immediately after login
 				case LoginEvent.LOGIN:
 					fetchRoster();
@@ -467,207 +502,191 @@
 					//setPresence( Presence.SHOW_NORMAL, "Online", 5 );
 					setPresence( null, "Online", 5 );
 					break;
-
+
 				case RosterExtension.NS:
 					try
 					{
-						var ext:RosterExtension = (eventObj.iq as IQ).getAllExtensionsByNS( RosterExtension.NS )[0] as RosterExtension;
+						var ext:RosterExtension = ( eventObj.iq as IQ ).getAllExtensionsByNS( RosterExtension.NS )[ 0 ] as
+							RosterExtension;
 						var items:Array = ext.getAllItems();
-						for each(var item:* in items)
+						for each ( var item:*in items )
 						{
-							var jid:UnescapedJID = new UnescapedJID(item.jid);
-							var rosterItemVO:RosterItemVO = RosterItemVO.get(jid, true);
+							var jid:UnescapedJID = new UnescapedJID( item.jid );
+							var rosterItemVO:RosterItemVO = RosterItemVO.get( jid,
+																			  true );
 							var rosterEvent:RosterEvent;
-
-							if (contains(rosterItemVO))
+
+							if ( contains( rosterItemVO ) )
 							{
-								switch (item.subscription.toLowerCase())
+								switch ( item.subscription.toLowerCase() )
 								{
 									case RosterExtension.SUBSCRIBE_TYPE_NONE:
-										rosterEvent = new RosterEvent(RosterEvent.SUBSCRIPTION_REVOCATION);
+										rosterEvent = new RosterEvent( RosterEvent.SUBSCRIPTION_REVOCATION );
 										rosterEvent.jid = jid;
 										dispatchEvent( rosterEvent );
 										break;
-
+
 									case RosterExtension.SUBSCRIBE_TYPE_REMOVE:
-										rosterEvent = new RosterEvent(RosterEvent.USER_REMOVED);
-										for each(var group:RosterGroup in getContainingGroups(rosterItemVO))
+										rosterEvent = new RosterEvent( RosterEvent.USER_REMOVED );
+										for each ( var group:RosterGroup in getContainingGroups( rosterItemVO ) )
 										{
-											group.removeItem(rosterItemVO);
+											group.removeItem( rosterItemVO );
 										}
 										//should be impossible for getItemIndex to return -1, since we just looked it up
-										rosterEvent.data = removeItemAt(getItemIndex(rosterItemVO));;
+										rosterEvent.data = removeItemAt( getItemIndex( rosterItemVO ) );;
 										rosterEvent.jid = jid;
 										dispatchEvent( rosterEvent );
 										break;
-
+
 									default:
-										updateRosterItemSubscription(rosterItemVO, item.subscription.toLowerCase(), item.name, item.groupNames);
+										updateRosterItemSubscription( rosterItemVO,
+																	  item.subscription.toLowerCase(),
+																	  item.name,
+																	  item.groupNames );
 										break;
 								}
 							}
 							else
 							{
 								var groupNames:Array = item.groupNames;
-								var askType:String = item.askType != null ?
-									item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE;
+								var askType:String = item.askType != null ? item.askType.toLowerCase() :
+									RosterExtension.ASK_TYPE_NONE;

 								if ( item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_REMOVE &&
-									item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_NONE)
+									item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_NONE )
 								{
 									// Add this item to the roster if it's not there and if the subscription type is not equal to 'remove' or 'none'
-									addRosterItem( jid, item.name, RosterExtension.SHOW_UNAVAILABLE, "Offline",
-										groupNames, item.subscription.toLowerCase(), askType );
+									addRosterItem( jid, item.name, RosterExtension.SHOW_UNAVAILABLE,
+												   "Offline", groupNames, item.subscription.toLowerCase(),
+												   askType );
 								}
-								else if ( (item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_NONE ||
-									item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_FROM) &&
-										item.askType == RosterExtension.ASK_TYPE_SUBSCRIBE )
+								else if ( ( item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_NONE ||
+									item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_FROM ) &&
+									item.askType == RosterExtension.ASK_TYPE_SUBSCRIBE )
 								{
 									// A contact was added to the roster, and its authorization is still pending.
-									addRosterItem( jid, item.name, RosterExtension.SHOW_PENDING, "Pending", groupNames,
-										item.subscription.toLowerCase(), askType );
+									addRosterItem( jid, item.name, RosterExtension.SHOW_PENDING,
+												   "Pending", groupNames, item.subscription.toLowerCase(),
+												   askType );
 								}
 							}
 						}
 					}
-					catch (e:Error)
+					catch ( e:Error )
 					{
-						trace(e.getStackTrace());
+						trace( e.getStackTrace() );
 					}
 					break;
 			}
 		}
-
+
 		/**
 		 * Dispathing <code>RosterEvent</code> based on the types of the <code>Presence</code>.
 		 * @param	presenceArray	A pile of presences received at one time
 		 */
-		private function handlePresences( presenceArray:Array):void
-		{
-			for each(var aPresence:Presence in presenceArray)
-			{
-				var type:String = aPresence.type ? aPresence.type.toLowerCase() : null;
+		private function handlePresences( presenceArray:Array ):void
+		{
+			for each ( var aPresence:Presence in presenceArray )
+			{
+				var type:String = aPresence.type ? aPresence.type.toLowerCase() :
+					null;
 				var rosterEvent:RosterEvent = null;
-
-				switch( type )
+
+				switch ( type )
 				{
 					case Presence.SUBSCRIBE_TYPE:
-						rosterEvent = new RosterEvent(RosterEvent.SUBSCRIPTION_REQUEST);
+						rosterEvent = new RosterEvent( RosterEvent.SUBSCRIPTION_REQUEST );
 						break;
-
+
 					case Presence.UNSUBSCRIBED_TYPE:
-						rosterEvent = new RosterEvent(RosterEvent.SUBSCRIPTION_DENIAL);
+						rosterEvent = new RosterEvent( RosterEvent.SUBSCRIPTION_DENIAL );
 						break;
-
+
 					case Presence.UNAVAILABLE_TYPE:
-						rosterEvent = new RosterEvent(RosterEvent.USER_UNAVAILABLE);
-
-						var unavailableItem:RosterItemVO = RosterItemVO.get(aPresence.from.unescaped, false);
-						if(!unavailableItem) return;
+						rosterEvent = new RosterEvent( RosterEvent.USER_UNAVAILABLE );
+
+						var unavailableItem:RosterItemVO = RosterItemVO.get( aPresence.from.unescaped,
+																			 false );
+						if ( !unavailableItem )
+							return;
 						updateRosterItemPresence( unavailableItem, aPresence );
-
+
 						break;
-
+
 					// null means available
 					default:
-						rosterEvent = new RosterEvent(RosterEvent.USER_AVAILABLE);
+						rosterEvent = new RosterEvent( RosterEvent.USER_AVAILABLE );
 						rosterEvent.data = aPresence;
-
+
 						// Change the item on the roster
 						var availableItem:RosterItemVO;
-						if(aPresence.from)
-							availableItem = RosterItemVO.get(aPresence.from.unescaped, false);
-
-						if(!availableItem) return;
+						if ( aPresence.from )
+							availableItem = RosterItemVO.get( aPresence.from.unescaped,
+															  false );
+
+						if ( !availableItem )
+							return;
 						updateRosterItemPresence( availableItem, aPresence );
-
+
 						break;
 				}
-
-				if (rosterEvent != null)
+
+				if ( rosterEvent != null )
 				{
 					// from can sometimes not be set
-					if (aPresence.from)
+					if ( aPresence.from )
 					{
 						rosterEvent.jid = aPresence.from.unescaped;
 					}
-					dispatchEvent(rosterEvent);
+					dispatchEvent( rosterEvent );
 				}
 			}
 		}
-
-		private function addRosterItem( jid:UnescapedJID, displayName:String, show:String, status:String, groupNames:Array, type:String, askType:String = "none" ):Boolean
-		{
-			if (!jid)
-			{
-				return false;
-			}
-
-			var rosterItem:RosterItemVO = RosterItemVO.get(jid, true);
-			if (!contains( rosterItem ))
-			{
-				addItem( rosterItem );
-			}
-			if (displayName)
-			{
-				rosterItem.displayName = displayName;
-			}
-			rosterItem.subscribeType = type;
-			rosterItem.askType = askType;
-			rosterItem.status = status;
-			rosterItem.show = show;
-			setContactGroups(rosterItem, groupNames);
-
-			var event:RosterEvent = new RosterEvent(RosterEvent.USER_ADDED);
-			event.jid = jid;
-			event.data = rosterItem;
-			dispatchEvent(event);
-
-			return true;
-		}
-
+
 		private function setContactGroups( contact:RosterItemVO, groupNames:Array ):void
 		{
-			if (!groupNames || groupNames.length == 0)
-			{
-				groupNames = ["General"];
-			}
-			for each(var name:String in groupNames)
+			if ( !groupNames || groupNames.length == 0 )
+			{
+				groupNames = [ "General" ];
+			}
+			for each ( var name:String in groupNames )
 			{
 				//if there's no group by this name already, we need to make one
-				if(!getGroup(name))
-					_groups[name] = new RosterGroup(name);
-			}
-			for each(var group:RosterGroup in _groups)
-			{
-				if (groupNames.indexOf(group.label) >= 0)
+				if ( !getGroup( name ) )
+					_groups[ name ] = new RosterGroup( name );
+			}
+			for each ( var group:RosterGroup in _groups )
+			{
+				if ( groupNames.indexOf( group.label ) >= 0 )
 				{
-					group.addItem(contact);
+					group.addItem( contact );
 				}
 				else
 				{
-					group.removeItem(contact);
+					group.removeItem( contact );
 				}
 			}
 		}
-
-		private function updateRosterItemSubscription( item:RosterItemVO, type:String, name:String, newGroupNames:Array ):void
-		{
-			item.subscribeType = type;
-
-			setContactGroups(item, newGroupNames);
-
-			if (name)
-			{
-				item.displayName = name;
-			}
-
-			var event:RosterEvent = new RosterEvent(RosterEvent.USER_SUBSCRIPTION_UPDATED);
-			event.jid = item.jid;
-			event.data = item;
-			dispatchEvent(event);
-		}
-
+
+		/**
+		 * Updates the information for an existing contact. You can use this method to change the
+		 * display name or associated group for a contact in your roster.
+		 *
+		 * @param	rosterItem The value object of the contact to update
+		 * @param	newName The new display name for this contact
+		 * @param	newGroups The new groups to associate the contact with
+		 */
+		private function updateContact( rosterItem:RosterItemVO, newName:String, groupNames:Array ):void
+		{
+			var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID( "update_contact_" ) );
+			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
+
+			ext.addItem( rosterItem.jid.escaped, rosterItem.subscribeType, newName,
+						 groupNames );
+			tempIQ.addExtension( ext );
+			_connection.send( tempIQ );
+		}
+
 		private function updateRosterItemPresence( item:RosterItemVO, presence:Presence ):void
 		{
 			try
@@ -675,48 +694,45 @@
 				item.status = presence.status;
 				item.show = presence.show;
 				item.priority = presence.priority;
-				if (!presence.type)
+				if ( !presence.type )
 				{
 					item.online = true;
 				}
-				else if (presence.type == Presence.UNAVAILABLE_TYPE)
+				else if ( presence.type == Presence.UNAVAILABLE_TYPE )
 				{
 					item.online = false;
 				}
-
-				var event:RosterEvent = new RosterEvent(RosterEvent.USER_PRESENCE_UPDATED);
+
+				var event:RosterEvent = new RosterEvent( RosterEvent.USER_PRESENCE_UPDATED );
 				event.jid = item.jid;
 				event.data = item;
-				dispatchEvent(event);
-
-				_presenceMap[item.jid.toString()] = presence;
-			}
-			catch (e:Error)
-			{
-				trace(e.getStackTrace());
-			}
-		}
-
-		/**
-		 * Get the Presence of the given user if any.
-		 * @param	jid
-		 * @return
-		 */
-		public function getPresence(jid:UnescapedJID):Presence
-		{
-			return _presenceMap[jid.toString()] as Presence;
-		}
-
-		/**
-		 * Get a group by given name
-		 * @param	name
-		 * @return
-		 */
-		public function getGroup(name:String):RosterGroup
-		{
-			return _groups[name] as RosterGroup;
-		}
-
+				dispatchEvent( event );
+
+				_presenceMap[ item.jid.toString() ] = presence;
+			}
+			catch ( e:Error )
+			{
+				trace( e.getStackTrace() );
+			}
+		}
+
+		private function updateRosterItemSubscription( item:RosterItemVO, type:String, name:String, newGroupNames:Array ):void
+		{
+			item.subscribeType = type;
+
+			setContactGroups( item, newGroupNames );
+
+			if ( name )
+			{
+				item.displayName = name;
+			}
+
+			var event:RosterEvent = new RosterEvent( RosterEvent.USER_SUBSCRIPTION_UPDATED );
+			event.jid = item.jid;
+			event.data = item;
+			dispatchEvent( event );
+		}
+
 		/**
 		 * The instance of the XMPPConnection class to use for the roster to use for
 		 * sending and receiving data.
@@ -725,17 +741,18 @@
 		{
 			return _connection;
 		}
+
 		public function set connection( value:XMPPConnection ):void
 		{
 			_connection = value;
-			_connection.addEventListener(PresenceEvent.PRESENCE, handleEvent);
-			_connection.addEventListener(LoginEvent.LOGIN, handleEvent);
+			_connection.addEventListener( PresenceEvent.PRESENCE, handleEvent );
+			_connection.addEventListener( LoginEvent.LOGIN, handleEvent );
 			_connection.addEventListener( RosterExtension.NS, handleEvent );
 		}
-
+
 		public override function set filterFunction(f:Function):void
 		{
-			throw new Error("Setting the filterFunction on Roster is not allowed; Wrap it in a ListCollectionView and filter that.");
+			throw new Error( "Setting the filterFunction on Roster is not allowed; Wrap it in a ListCollectionView and filter that." );
 		}
 	}
 }


fixed the hit normal computation on Geometry.cast()

--- src/aerys/minko/render/geometry/Geometry.as
+++ src/aerys/minko/render/geometry/Geometry.as
@@ -1166,6 +1166,31 @@

 				if (hitNormal)
 				{
+					indicesData.position = triangleIndice * 2;
+
+					xyzData.position = indicesData.readUnsignedShort() * xyzVertexSize + offset
+					v0X = xyzData.readFloat();
+					v0Y = xyzData.readFloat();
+					v0Z = xyzData.readFloat();
+
+					xyzData.position = indicesData.readUnsignedShort() * xyzVertexSize + offset;
+					v1X = xyzData.readFloat();
+					v1Y = xyzData.readFloat();
+					v1Z = xyzData.readFloat();
+
+					xyzData.position = indicesData.readUnsignedShort() * xyzVertexSize + offset;
+					v2X = xyzData.readFloat();
+					v2Y = xyzData.readFloat();
+					v2Z = xyzData.readFloat();
+
+					edge1X = v1X - v0X;
+					edge1Y = v1Y - v0Y;
+					edge1Z = v1Z - v0Z;
+
+					edge2X = v2X - v0X;
+					edge2Y = v2Y - v0Y;
+					edge2Z = v2Z - v0Z;
+
 					// length
 					var edge1Length		: Number	= Math.sqrt(edge1X * edge1X + edge1Y * edge1Y + edge1Z * edge1Z);
 					var edge2Length		: Number	= Math.sqrt(edge2X * edge2X + edge2Y * edge2Y + edge2Z * edge2Z);
@@ -1179,9 +1204,9 @@
 					edge2Z /= edge2Length;

 					// cross product
-					hitNormal.x = edge1Y * edge2Z - edge1Z * edge2Y;
-					hitNormal.y = edge1Z * edge2X - edge1X * edge2Z;
-					hitNormal.z = edge1X * edge2Y - edge1Y * edge2X;
+					hitNormal.x = edge2Y * edge1Z - edge2Z * edge1Y;
+					hitNormal.y = edge2Z * edge1X - edge2X * edge1Z;
+					hitNormal.z = edge2X * edge1Y - edge2Y * edge1X;
 				}
 			}


When we start and end a transaction in EZGame do so on the InvocationDirector
as that's where all of our messages are generated.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@454 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/ezgame/client/GameControlBackend.as
+++ src/as/com/threerings/ezgame/client/GameControlBackend.as
@@ -889,20 +889,20 @@
     }

     /**
-     * Start a dobj transaction on the game object.
+     * Starts a transaction that will group all game state changes into a single message.
      */
     protected function startTransaction_v1 () :void
     {
         validateConnected();
-        _ezObj.startTransaction();
-    }
-
-    /**
-     * Commit a dobj transaction on the game object.
+        _ctx.getClient().getInvocationDirector().startTransaction();
+    }
+
+    /**
+     * Commits a transaction started with {@link #startTransaction_v1}.
      */
     protected function commitTransaction_v1 () :void
     {
-        _ezObj.commitTransaction();
+        _ctx.getClient().getInvocationDirector().commitTransaction();
     }

     /**
@@ -919,8 +919,7 @@

     protected var _ctx :CrowdContext;

-    protected var _userListener :MessageAdapter =
-        new MessageAdapter(messageReceivedOnUserObject);
+    protected var _userListener :MessageAdapter = new MessageAdapter(messageReceivedOnUserObject);

     protected var _container :GameContainer;

@@ -931,8 +930,8 @@

     protected var _userFuncs :Object;

-    /** The function on the EZGameControl which we can use to directly
-     * dispatch events to the user's game. */
+    /** The function on the EZGameControl which we can use to directly dispatch events to the
+     * user's game. */
     protected var _ezDispatcher :Function;

     protected var _gameData :Object;


Let's continue to decode the value for each requesting function
(just to be safe), but let's document why we're doing that as well
as do it outside the try/catch, in case there's an error in our code.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@518 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/ezgame/client/GameControlBackend.as
+++ src/as/com/threerings/ezgame/client/GameControlBackend.as
@@ -417,8 +417,10 @@
             if (arr != null) {
                 delete _cookieCallbacks[cookie.playerId];
                 for each (var fn :Function in arr) {
+                    // we want to decode every time, in case usercode mangles the value
+                    var decodedValue :Object = ObjectMarshaller.decode(cookie.cookie);
                     try {
-                        fn(ObjectMarshaller.decode(cookie.cookie));
+                        fn(decodedValue);
                     } catch (err :Error) {
                         log.warning("Error in user-code: " + err);
                         log.logStackTrace(err);


AS3 tests weren't being reported on Jenkins because the task is killing itself before the test report could finish posting to Cloud Script.

Summary:
AS3 tests weren't being reported on Jenkins because the task is killing itself before the test report could finish posting to Cloud Script.
So, the AS3 test project no longer shuts itself down, and instead, the Jenkernaught will kill it once it's received the test results.

Test Plan: Jenkernaught

Reviewers: #devtools_in-progress, zac-playfab

Reviewed By: #devtools_in-progress, zac-playfab

Subscribers: zac-playfab

Maniphest Tasks: T1573

Differential Revision: https://phab.playfabdev.com/D1520

--- targets/actionscript/source/PfApiTest.as
+++ targets/actionscript/source/PfApiTest.as
@@ -55,19 +55,7 @@
             textField.text = "Tests finished";
             testSuite.removeEventListener(ASyncUnitTestEvent.SUITE_TEARDOWN_COMPLETE, OnTestsComplete);

-            exitCode = 0;
-            if (event.testsErrored > 0 || event.testsSkipped > 0 || event.testsFailed > 0 || event.testsTimedOut > 0)
-                exitCode = 1000 + event.testsErrored + event.testsSkipped + event.testsFailed + event.testsTimedOut;
-
-            // Jenkernaught hack: Don't shut down until the results are submitted to CloudScript - TODO: Track the actual completion rather than a hard coded timer
-            var timer:Timer = new Timer(15, 15);
-            timer.addEventListener(TimerEvent.TIMER, ExitProgram);
-            timer.start();
-        }
-
-        private function ExitProgram(e:TimerEvent) : void
-        {
-            NativeApplication.nativeApplication.exit(exitCode);
+            // Jenkernaught shuts down ActionScriptSdk example project now, so just leave it running
         }
     }
 }


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

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

 package mx.utils
 {


Updated ASDocs

Updated ASDocs

--- src/org/mangui/hls/controller/SubtitlesTrackController.as
+++ src/org/mangui/hls/controller/SubtitlesTrackController.as
@@ -154,7 +154,7 @@
 			_subtitlesTracks = _subtitlesTracksFromManifest.slice();
 		}

-        /** triggered by demux, it should return the subtitles track to be parsed */
+        /** Normally triggered by user selection, it should return the subtitles track to be parsed */
         public function subtitlesTrackSelectionHandler(subtitlesTrackList : Vector.<SubtitlesTrack>) : SubtitlesTrack {
             var subtitlesTrackChanged : Boolean = false;
             subtitlesTrackList = subtitlesTrackList.sort(function(a : SubtitlesTrack, b : SubtitlesTrack) : int {


Apply formatting.

Apply formatting.

--- src/com/esri/builder/controllers/ApplicationCompleteController.as
+++ src/com/esri/builder/controllers/ApplicationCompleteController.as
@@ -20,11 +20,11 @@
 import com.esri.builder.components.LogFileTarget;
 import com.esri.builder.components.SignInWindow;
 import com.esri.builder.components.ToolTip;
+import com.esri.builder.controllers.supportClasses.MachineDisplayName;
 import com.esri.builder.controllers.supportClasses.Settings;
+import com.esri.builder.controllers.supportClasses.StartupWidgetTypeLoader;
 import com.esri.builder.controllers.supportClasses.WellKnownDirectories;
-import com.esri.builder.controllers.supportClasses.StartupWidgetTypeLoader;
 import com.esri.builder.eventbus.AppEvent;
-import com.esri.builder.controllers.supportClasses.MachineDisplayName;
 import com.esri.builder.model.Model;
 import com.esri.builder.model.PortalModel;
 import com.esri.builder.supportClasses.LogUtil;


Added support for hash map index values in request/remove JS API functions.

--- WeaveCore/src/weave/core/ExternalSessionStateInterface.as
+++ WeaveCore/src/weave/core/ExternalSessionStateInterface.as
@@ -186,15 +186,19 @@
 				return false;

 			var parentPath:Array = objectPath.concat();
-			var childName:String = parentPath.pop();
+			var childName:Object = parentPath.pop();
 			var parent:ILinkableObject = getObject(parentPath);
 			var hashMap:ILinkableHashMap = parent as ILinkableHashMap;
 			var dynamicObject:ILinkableDynamicObject = parent as ILinkableDynamicObject;
 			var child:Object = null;
-			if (hashMap)
-				child = hashMap.requestObject(childName, classDef, false);
+			if (hashMap)
+			{
+				if (childName is Number)
+					childName = hashMap.getNames()[childName];
+				child = hashMap.requestObject(childName as String, classDef, false);
+			}
 			else if (dynamicObject)
-				child = dynamicObject.requestGlobalObject(childName, classDef, false);
+				child = dynamicObject.requestGlobalObject(childName as String, classDef, false);
 			else
 				child = getObject(objectPath);
 			return child is classDef;
@@ -208,12 +212,16 @@
 			if (!objectPath || !objectPath.length)
 				return false;
 			objectPath = objectPath.concat();
-			var childName:String = objectPath.pop();
+			var childName:Object = objectPath.pop();
 			var object:ILinkableObject = getObject(objectPath);
 			var hashMap:ILinkableHashMap = object as ILinkableHashMap;
 			var dynamicObject:ILinkableDynamicObject = object as ILinkableDynamicObject;
-			if (hashMap)
-				hashMap.removeObject(childName);
+			if (hashMap)
+			{
+				if (childName is Number)
+					childName = hashMap.getNames()[childName];
+				hashMap.removeObject(childName as String);
+			}
 			else if (dynamicObject)
 				dynamicObject.removeObject();
 			else


cleaner energon / action bar outlines

cleaner energon / action bar outlines

--- src/battlecode/client/viewer/render/DrawRobot.as
+++ src/battlecode/client/viewer/render/DrawRobot.as
@@ -318,13 +318,16 @@
             }

             var size:Number = getImageSize(true) * .9;
-            this.graphics.lineStyle(.5, 0xFFFFFF);
+            this.graphics.lineStyle();
             this.graphics.beginFill(color, 0.8);
             this.graphics.drawRect(-size / 2, size / 2, ratio * size, 5 * getImageScale());
             this.graphics.endFill();
             this.graphics.beginFill(0x000000, 0.8);
             this.graphics.drawRect(-size / 2 + ratio * size, size / 2, (1 - ratio) * size, 5 * getImageScale());
             this.graphics.endFill();
+            this.graphics.lineStyle(.5, 0xFFFFFF);
+            this.graphics.drawRect(-size / 2, size / 2, size, 5 * getImageScale());
+
         }

         private function drawActionBar(action:DrawAction):void {
@@ -341,13 +344,15 @@

             var ratio:Number = (action.getMaxRounds() - action.getRounds()) / action.getMaxRounds();
             var size:Number = getImageSize(true) * .9;
-            this.graphics.lineStyle(.5, 0xFFFFFF);
+            this.graphics.lineStyle();
             this.graphics.beginFill(color, 0.8);
             this.graphics.drawRect(-size / 2, size / 2 + yOffset, ratio * size, 5 * getImageScale());
             this.graphics.endFill();
             this.graphics.beginFill(0x000000, 0.8);
             this.graphics.drawRect(-size / 2 + ratio * size, size / 2  + yOffset, (1 - ratio) * size, 5 * getImageScale());
             this.graphics.endFill();
+            this.graphics.lineStyle(.5, 0xFFFFFF);
+            this.graphics.drawRect(-size / 2, size / 2, size, 5 * getImageScale());
         }

         private function drawAttack():void {


correctly handle empty <body/> tags for inbound messages - GTalk sends these as part of a chatstate message

--- src/org/igniterealtime/xiff/data/Message.as
+++ src/org/igniterealtime/xiff/data/Message.as
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2009 Igniterealtime Community Contributors
+ * Copyright (C) 2003-2010 Igniterealtime Community Contributors
  *
  *     Daniel Henninger
  *     Derrick Grigg <dgrigg@rogers.com>
@@ -7,6 +7,7 @@
  *     Nick Velloff <nick.velloff@gmail.com>
  *     Sean Treadway <seant@oncotype.dk>
  *     Sean Voisen <sean@voisen.org>
+ *     Matt Towers (Typidee Inc) <matt@typidee.com>
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -253,7 +254,7 @@
 						case Message.STATE_INACTIVE :
 						case Message.STATE_PAUSED :
 							myStateNode = children[i];
-							break;
+							continue;
 					}
 				}
 			}
@@ -266,7 +267,7 @@
 		 */
 		public function get body():String
 		{
-			if (!exists(myBodyNode))
+			if (!exists(myBodyNode) || !exists(myBodyNode.firstChild))
 			{
 				return null;
 			}


little fixes

little fixes

--- src/com/merlinds/miracle_tool/viewer/ViewerView.as
+++ src/com/merlinds/miracle_tool/viewer/ViewerView.as
@@ -138,6 +138,7 @@
 			}else{
 				_current.mesh = mesh;
 				_current.animation = animation;
+				_current.play();
 			}
 		}


add hola_setBandwidth api

add hola_setBandwidth api

--- src/org/mangui/hls/loader/FragmentLoader.as
+++ src/org/mangui/hls/loader/FragmentLoader.as
@@ -112,9 +112,13 @@
         {
             setTimeout(timerHandler, ms);
         }
+        private static function hola_setBandwidth(bandwidth:Number) : void
+        {
+            g_bandwidth = bandwidth;
+        }
         private static function hola_hls_set_bandwidth(bandwidth:Number) : void
         {
-            g_bandwidth = bandwidth;
+            hola_setBandwidth(bandwidth);
         }
         /** Create the loader. **/
         public function FragmentLoader(hls : HLS, audioTrackController : AudioTrackController) : void {
@@ -123,6 +127,7 @@
                 ExternalInterface.call('console.log', 'FragmentLoader hola_api_inited');
                 hola_api_inited = true;
                 ExternalInterface.addCallback("hola_set_timeout", FragmentLoader.hola_set_timeout);
+                ExternalInterface.addCallback("hola_setBandwidth", FragmentLoader.hola_setBandwidth);
                 ExternalInterface.addCallback("hola_hls_set_bandwidth", FragmentLoader.hola_hls_set_bandwidth);
              }
             _hls = hls;


fixed slightly odd formatting

fixed slightly odd formatting

--- frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
+++ frameworks/projects/advancedgrids/src/mx/controls/AdvancedDataGrid.as
@@ -8152,26 +8152,27 @@
     {
         if (event is CollectionEvent)
         {
-            var ceEvent:CollectionEvent = CollectionEvent(event)
-                if (ceEvent.kind == CollectionEventKind.RESET)
-                {
-                    // if the data is grouped, update the groupLabelField.
-                    if (_rootModel is IGroupingCollection && IGroupingCollection(_rootModel).grouping)
-                        groupLabelField = IGroupingCollection(_rootModel).grouping.label;
-
-					if (_rootModel is IGroupingCollection2 && IGroupingCollection2(_rootModel).grouping)
-						groupLabelField = IGroupingCollection2(_rootModel).grouping.label;
-
-                    // if collection is reset, then expand the items if displayItemsExpanded is true
-                    if (displayItemsExpanded)
-                        expandAll();
-                }
-                if (ceEvent.kind == CollectionEventKind.REFRESH)
-                {
-                    // if collection is reset, then expand the items if displayItemsExpanded is true
-                    if (displayItemsExpanded)
-                        expandAll();
-                }
+            var ceEvent:CollectionEvent = CollectionEvent(event);
+
+            if (ceEvent.kind == CollectionEventKind.RESET)
+            {
+                // if the data is grouped, update the groupLabelField.
+                if (_rootModel is IGroupingCollection && IGroupingCollection(_rootModel).grouping)
+                    groupLabelField = IGroupingCollection(_rootModel).grouping.label;
+
+				if (_rootModel is IGroupingCollection2 && IGroupingCollection2(_rootModel).grouping)
+					groupLabelField = IGroupingCollection2(_rootModel).grouping.label;
+
+                // if collection is reset, then expand the items if displayItemsExpanded is true
+                if (displayItemsExpanded)
+                    expandAll();
+            }
+            if (ceEvent.kind == CollectionEventKind.REFRESH)
+            {
+                // if collection is reset, then expand the items if displayItemsExpanded is true
+                if (displayItemsExpanded)
+                    expandAll();
+            }
         }

         super.collectionChangeHandler(event);


Transferred from the Adobe Open Source Subversion Repository

Revision: 8963
Author:   jszeto@adobe.com
Date:     2009-07-31T18:24:40.340878Z

Log Message:
-----------
http://bugs.adobe.com/jira/browse/SDK-22307 - spreadMethod=”pad” does not work correctly for LinearGradient on MXML Graphics

The actual problem is that LinearGradientStroke is not properly positioning the gradient if no x value is specified. The old behavior always put the gradient at the left edge of the bounds. The proper behavior puts the gradient in the center of the bounds. This matches the behavior of LinearGradient as defined in the FXG spec. There is no need to “center” the y position because it is not possible to adjust the height of a linear gradient.

QE notes: Add tests for this use case
Doc notes: None
Bugs: SDK-22307
Reviewer: Chet
Tests run: Spark Primitives
Is noteworthy for integration: No

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as

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

--- frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as
+++ frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as
@@ -239,8 +239,9 @@
         if (!compoundTransform)
         {
             var w:Number = !isNaN(scaleX) ? scaleX : rect.width;
-            var bX:Number = !isNaN(x) ? x + rect.left : rect.left;
+            var bX:Number = !isNaN(x) ? x + rect.left : rect.left + (rect.width - w) / 2;
             var bY:Number = !isNaN(y) ? y + rect.top : rect.top;
+

             matrix.createGradientBox(w, rect.height,
                                     !isNaN(_angle) ?


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

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

 package mx.effects.effectClasses
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 19412
Author:   jasonsj@adobe.com
Date:     2010-12-15T23:54:30.560146Z

Log Message:
-----------
New TabbedViewNavigatorButtonBarSkin.
Fixed label alignment issues when using IconPlacement.BOTTOM.
Fixed disabled state (alpha) handling of Buttons.
Added DPI-specific styles to defaults.css using new CSS media query support.

QE notes: TabbedViewNavigatorButtonBarSkin is complete. Need to add tests for changing Button enabled state before/after icon changes.
Doc notes:
Bugs:
SDK-28715 Cannot size and position button correctly in i4 build.
Reviewer: jszeto
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<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/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarFirstButton_down.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarLastButton_down.fxg</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/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarFirstButton_up.fxg</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/SkinnableContainerSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorButtonBarFirstButtonSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarLastButton_down.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarFirstButton_up.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarLastButton_up.fxg</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/.settings</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorButtonBarSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TabbedViewNavigatorButtonBarHorizontalLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarFirstButton_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorSkin.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults320.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorButtonBarLastButtonSkin.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults160.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TabbedViewNavigatorButtonBarButtonSkinBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/TabbedViewNavigatorButtonBarLastButton_up.fxg</path>

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

--- frameworks/projects/mobiletheme/src/MobileThemeClasses.as
+++ frameworks/projects/mobiletheme/src/MobileThemeClasses.as
@@ -33,6 +33,7 @@
 import spark.skins.mobile.HSliderSkin; spark.skins.mobile.HSliderSkin;
 import spark.skins.mobile.ListSkin; spark.skins.mobile.ListSkin;
 import spark.skins.mobile.TabbedViewNavigatorApplicationSkin; TabbedViewNavigatorApplicationSkin;
+import spark.skins.mobile.TabbedViewNavigatorButtonBarSkin; TabbedViewNavigatorButtonBarSkin;
 import spark.skins.mobile.TextAreaSkin; TextAreaSkin;
 import spark.skins.mobile.TextInputSkin; TextInputSkin;
 import spark.skins.mobile.SkinnableContainerSkin; SkinnableContainerSkin;


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

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

 package mx.containers
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 4721
Author:   egeorgie@adobe.com
Date:     2009-01-28T23:23:58.809377Z

Log Message:
-----------
Fix bug http://bugs.adobe.com/jira/browse/SDK-18857 Changing rowCount does not cause items to lay out again when setting it to a value which it was previously automatically set to

Fix: Setting explicit row/column count must invalidate the layout.

QE Notes: None
Doc Notes: None
Bugs: SDK-18857
Reviewer: Ryan
tests: mustella gumbo/layout/TileLayout

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

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

--- frameworks/projects/spark/src/spark/layouts/TileLayout.as
+++ frameworks/projects/spark/src/spark/layouts/TileLayout.as
@@ -185,9 +185,11 @@
      */
     public function set columnCount(value:int):void
     {
+        // Changing rowCount/columnCount explicit values may affect layout
+        // even if the current actual values are the same
+        if (value == explicitColumnCount)
+            return;
         explicitColumnCount = value;
-        if (value == _columnCount)
-            return;

         _columnCount = value;
         invalidateTargetSizeAndDisplayList();
@@ -232,9 +234,11 @@
      */
     public function set rowCount(value:int):void
     {
+        // Changing rowCount/columnCount explicit values may affect layout
+        // even if the current actual values are the same
+        if (value == explicitRowCount)
+            return;
         explicitRowCount = value;
-        if (value == _rowCount)
-            return;

         _rowCount = value;
         invalidateTargetSizeAndDisplayList();
@@ -581,18 +585,21 @@
      */
     protected function dispatchEventsForActualValueChanges():void
     {
-        if (oldColumnWidth != _columnWidth)
-            dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "columnWidth", oldColumnWidth, _columnWidth));
-        if (oldRowHeight != _rowHeight)
-            dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "rowHeight", oldRowHeight, _rowHeight));
-        if (oldColumnCount != _columnCount)
-            dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "columnCount", oldColumnCount, _columnCount));
-        if (oldRowCount != _rowCount)
-            dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "rowCount", oldRowCount, _rowCount));
-        if (oldHorizontalGap != _horizontalGap)
-            dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "horizontalGap", oldHorizontalGap, _horizontalGap));
-        if (oldVerticalGap != _verticalGap)
-            dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "verticalGap", oldVerticalGap, _verticalGap));
+        if (hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+        {
+            if (oldColumnWidth != _columnWidth)
+                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "columnWidth", oldColumnWidth, _columnWidth));
+            if (oldRowHeight != _rowHeight)
+                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "rowHeight", oldRowHeight, _rowHeight));
+            if (oldColumnCount != _columnCount)
+                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "columnCount", oldColumnCount, _columnCount));
+            if (oldRowCount != _rowCount)
+                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "rowCount", oldRowCount, _rowCount));
+            if (oldHorizontalGap != _horizontalGap)
+                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "horizontalGap", oldHorizontalGap, _horizontalGap));
+            if (oldVerticalGap != _verticalGap)
+                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "verticalGap", oldVerticalGap, _verticalGap));
+        }

         oldColumnWidth   = _columnWidth;
         oldRowHeight     = _rowHeight;


Fix a crasher Gato found

Fix a crasher Gato found

--- src/org/jivesoftware/xiff/core/XMPPConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPConnection.as
@@ -501,6 +501,12 @@
 				}
 			}

+			if(ev.data == "</flash:stream>")
+			{
+				socketClosed(null);
+				return;
+			}
+
 			var xmlData:XMLDocument = new XMLDocument();
 			xmlData.ignoreWhite = this.ignoreWhite;
 			xmlData.parseXML( ev.data );


Transferred from the Adobe Open Source Subversion Repository

Revision: 19847
Author:   tkraikit@adobe.com
Date:     2011-01-20T22:34:22.112386Z

Log Message:
-----------
bug29179: svn 19813 uncovered UIComponent.styleChanged() overrides which failed to call super.styleChanged(), resulting in a layout error in ColorPicker. Fix applied there and in two other locations lacking the call.

QE notes: none
Doc notes: none
Bugs: 29179
Reviewer: rfrishbe
Tests run: checkintests, mustella
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/skins/halo/ToolTipBorder.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/skins/halo/HaloBorder.as</path>

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

--- frameworks/projects/framework/src/mx/skins/halo/ToolTipBorder.as
+++ frameworks/projects/framework/src/mx/skins/halo/ToolTipBorder.as
@@ -127,14 +127,14 @@
 	 */
 	override public function styleChanged(styleProp:String):void
 	{
+        super.styleChanged(styleProp);
+
 		if (styleProp == "borderStyle" ||
 			styleProp == "styleName" ||
 			styleProp == null)
 		{
 			_borderMetrics = null;
 		}
-
-		invalidateDisplayList();
 	}

 	/**