ADDED APIs to send, retrieve and delete tags

--- actionscript/src/com/marpies/ane/onesignal/OneSignal.as
+++ actionscript/src/com/marpies/ane/onesignal/OneSignal.as
@@ -19,6 +19,7 @@
     import flash.events.StatusEvent;
     import flash.external.ExtensionContext;
     import flash.system.Capabilities;
+    import flash.utils.Dictionary;

     public class OneSignal {

@@ -30,10 +31,13 @@
         /* Event codes */
         private static const TOKEN_RECEIVED:String = "tokenReceived";
         private static const NOTIFICATION_RECEIVED:String = "notificationReceived";
+        private static const TAGS_RECEIVED:String = "tagsReceived";

         /* Callbacks */
         private static var mTokenCallbacks:Vector.<Function> = new <Function>[];
         private static var mNotificationCallbacks:Vector.<Function> = new <Function>[];
+        private static var mCallbackMap:Dictionary;
+        private static var mCallbackIdCounter:int;

         /* Misc */
         private static var mInitialized:Boolean;
@@ -75,6 +79,7 @@
             if( !isSupported ) return false;
             if( mInitialized ) return true;

+            if( iOS && oneSignalAppID === null ) throw new ArgumentError( "Parameter oneSignalAppID cannot be null when targeting iOS." );
             mLogEnabled = showLogs;

             /* Initialize context */
@@ -83,6 +88,7 @@
                 return false;
             }

+            mCallbackMap = new Dictionary();
             /* Listen for native library events */
             mContext.addEventListener( StatusEvent.STATUS, onStatus );

@@ -117,6 +123,136 @@
             validateExtensionContext();

             mContext.call( "setSubscription", value );
+        }
+
+        /**
+         * Tag a user based on an app event of your choosing so later you can create
+         * segments in the OneSignal dashboard to target these users.
+         *
+         *
Consider using OneSignal.sendTags() to send more than one tag at a time.

+         *
+         *
Extension must be initialized using OneSignal.init() before calling this method.

+         *
+         * @param key Key of your choosing to create or update.
+         * @param value Value to set on the key. Empty String removes the key.
+         *
+         * @see #sendTags()
+         * @see #getTags()
+         * @see #deleteTag()
+         * @see #deleteTags()
+         */
+        public static function sendTag( key:String, value:String ):void {
+            if( !isSupported ) return;
+            validateExtensionContext();
+
+            if( key === null ) throw new ArgumentError( "Parameter key cannot be null." );
+            if( value === null ) throw new ArgumentError( "Parameter value cannot be null." );
+
+            var tag:Object = {};
+            tag[key] = value;
+            sendTags( tag );
+        }
+
+        /**
+         * Tag a user based on an app event of your choosing so later you can create
+         * segments in the OneSignal dashboard to target these users.
+         *
+         *
This method allows sending multiple tags at once. Consider using OneSignal.sendTag()
+         * to send a single tag.

+         *
+         *
Extension must be initialized using OneSignal.init() before calling this method.

+         *
+         * @param tags Key-value pairs of your choosing to create or update, for example:
+         * <listing version="3.0">
+         * OneSignal.sendTags( {
+         *    profession: "warrior",
+         *    area: "desert"
+         * } );
+         * </listing>
+         *
+         * @see #sendTag()
+         * @see #getTags()
+         * @see #deleteTag()
+         * @see #deleteTags()
+         */
+        public static function sendTags( tags:Object ):void {
+            if( !isSupported ) return;
+            validateExtensionContext();
+
+            if( tags === null ) throw new ArgumentError( "Parameter tags cannot be null." );
+
+            mContext.call( "sendTags", getVectorFromObject( tags ) );
+        }
+
+        /**
+         * Retrieves a list of tags that have been set on the user.
+         *
+         *
Extension must be initialized using OneSignal.init() before calling this method.

+         *
+         * @param callback Function with the following signature:
+         * <listing version="3.0">
+         * function callback( tags:Object ):void {
+         *    // tags may be null if there's a connection error or user has not been tagged
+         * };
+         * </listing>
+         *
+         * @see #sendTag()
+         * @see #sendTags()
+         * @see #deleteTag()
+         * @see #deleteTags()
+         */
+        public static function getTags( callback:Function ):void {
+            if( !isSupported ) return;
+            if( callback === null ) return;
+
+            validateExtensionContext();
+
+            mContext.call( "getTags", registerCallback( callback ) );
+        }
+
+        /**
+         * Deletes a tag that was previously set on a user using OneSignal.sendTag() or
+         * OneSignal.sendTags(). Consider using OneSignal.deleteTags() if you need
+         * to delete more than one tag at a time.
+         *
+         *
Extension must be initialized using OneSignal.init() before calling this method.

+         *
+         * @param key Key to delete.
+         *
+         * @see #sendTag()
+         * @see #sendTags()
+         * @see #getTags()
+         * @see #deleteTags()
+         */
+        public static function deleteTag( key:String ):void {
+            if( !isSupported ) return;
+            validateExtensionContext();
+
+            if( key === null ) throw new ArgumentError( "Parameter key cannot be null." );
+            deleteTags( new <String>[key] );
+        }
+
+        /**
+         * Deletes tags that were previously set on a user using OneSignal.sendTag() or
+         * OneSignal.sendTags(). Consider using OneSignal.deleteTag() to delete
+         * a single tag.
+         *
+         *
Extension must be initialized using OneSignal.init() before calling this method.

+         *
+         * @param keys List of keys to delete.
+         *
+         * @see #sendTag()
+         * @see #sendTags()
+         * @see #getTags()
+         * @see #deleteTag()
+         */
+        public static function deleteTags( keys:Vector.<String> ):void {
+            if( !isSupported ) return;
+            validateExtensionContext();
+
+            if( keys === null ) throw new ArgumentError( "Parameter keys cannot be null." );
+
+            mContext.call( "deleteTags", keys );
         }

         /**
@@ -294,7 +430,69 @@
                         mNotificationCallbacks[i]( OneSignalNotification.fromJSON( responseJSON ) );
                     }
                     return;
-            }
+                case TAGS_RECEIVED:
+                    responseJSON = JSON.parse( event.level );
+                    var callbackID:int = ("callbackID" in responseJSON) ? responseJSON.callbackID : -1;
+                    var callback:Function = getCallback( callbackID );
+                    if( callback !== null ) {
+                        var tags:Object = responseJSON.tags;
+                        if( tags is String ) {
+                            tags = JSON.parse( tags as String );
+                        }
+                        callback( tags );
+                    }
+                    return;
+            }
+        }
+
+        /**
+         * Registers given callback and generates ID which is used to look the callback up when it is time to call it.
+         * @param callback Function to register.
+         * @return ID of the callback.
+         */
+        private static function registerCallback( callback:Function ):int {
+            if( callback == null ) return -1;
+
+            mCallbackMap[mCallbackIdCounter] = callback;
+            return mCallbackIdCounter++;
+        }
+
+        /**
+         * Gets registered callback with given ID.
+         * @param callbackID ID of the callback to retrieve.
+         * @return Callback registered with given ID, or null if no such callback exists.
+         */
+        private static function getCallback( callbackID:int ):Function {
+            if( callbackID == -1 || !(callbackID in mCallbackMap) ) return null;
+            return mCallbackMap[callbackID];
+        }
+
+        /**
+         * Unregisters callback with given ID.
+         * @param callbackID ID of the callback to unregister.
+         */
+        private static function unregisterCallback( callbackID:int ):void {
+            if( callbackID in mCallbackMap ) {
+                delete mCallbackMap[callbackID];
+            }
+        }
+
+        /**
+         * Returns list of key-values from key-value object, e.g. { "key": "val" } -> [ "key", "val" ].
+         * @param object Key-value object to transform into list.
+         * @return List of key-values from object, or null if object is null.
+         */
+        private static function getVectorFromObject( object:Object ):Vector.<String> {
+            var properties:Vector.<String> = null;
+            if( object ) {
+                properties = new <String>[];
+                /* Create a list of object properties, that is key followed by its value */
+                for( var key:String in object ) {
+                    properties[properties.length] = key;
+                    properties[properties.length] = object[key];
+                }
+            }
+            return properties;
         }

         private static function log( message:String ):void {


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

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

 package mx.olap
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as
+++ frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as
@@ -24,7 +24,7 @@
 import mx.utils.NameUtil;

 /**
- *  The AdvancedStyleClient is a base class that can be used
+ *  A base class that can be used
  *  when implementing an object that uses the
  *  IAdvancedStyleClient interface.  The base class supplies
  *  implementations of the methods and properties required for an object
@@ -40,7 +40,7 @@
  *  that contains the MXML declaration. For more details, see the description
  *  of the initilized method.

  *
- *  @see mx.core.styles.IAdvancedStyleClient
+ *  @see mx.styles.IAdvancedStyleClient
  *  @see #initialized
  *
  *  @langversion 3.0
@@ -180,6 +180,13 @@
     //----------------------------------

     /**
+     *  @private
+     */
+    private var _styleDeclarationVar:CSSStyleDeclaration;
+
+    [Inspectable(environment="none")]
+
+    /**
      *  The style declaration that holds the inline styles declared by this
      *  object.
      *
@@ -190,10 +197,6 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    private var _styleDeclarationVar:CSSStyleDeclaration;
-
-    [Inspectable(environment="none")]
-
     public function get styleDeclaration():CSSStyleDeclaration
     {
         return _styleDeclarationVar;


Transferred from the Adobe Open Source Subversion Repository

Revision: 9716
Author:   aharui@adobe.com
Date:     2009-08-27T21:21:41.305389Z

Log Message:
-----------
PARB changes for ViewStack.  No more anticpated changes to these APIs.

QE Notes: APIs are hopefully final
Doc Notes: APIs are hopefully final
Bugs: None
Reviewer: Ryan
API Change: Yes
Is noteworthy for integration: No
tests: checkintests mustella/containers/ViewStack

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/INavigatable.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/INavigatable.as" copyfrom-rev="9577" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISelectableList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NavigatorChild.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/halo/views/AccordionTests.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/halo/views/TabNavigatorTests.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NavigatorChild.as" copyfrom-rev="9577" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NavigatorContent.as</path>

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

--- frameworks/projects/spark/src/spark/components/NavigatorContent.as
+++ frameworks/projects/spark/src/spark/components/NavigatorContent.as
@@ -41,7 +41,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class NavigatorChild extends SkinnableContainer
+public class NavigatorContent extends SkinnableContainer
        implements INavigatorContent
 {
     include "../core/Version.as";
@@ -61,7 +61,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function NavigatorChild()
+    public function NavigatorContent()
     {
         super();
         creationPolicy = ContainerCreationPolicy.NONE;


Transferred from the Adobe Open Source Subversion Repository

Revision: 11518
Author:   cframpto@adobe.com
Date:     2009-11-06T19:38:42.339609Z

Log Message:
-----------
Add RET mx_internal flag batchTextInput which defaults to true.  The TLF edit manager will batch all inserted text until the next enter frame event.  This includes text inserted via the GUI as well as api calls to EditManager.insertText().  Set this to false if you want every keystroke to be inserted into the text immediately which will result in a TextOperationEvent.CHANGE event for each character.

QE notes:
Doc notes:
Bugs: editable combo box type-ahead feature won't work without this
Reviewer: Gordon
Tests run: checkintests, TextInput
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/RichEditableTextEditManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -688,6 +688,18 @@

     /**
      *  @private
+     *  The TLF edit manager will batch all inserted text until the next
+     *  enter frame event.  This includes text inserted via the GUI as well
+     *  as api calls to EditManager.insertText().  Set this to false if you
+     *  want every keystroke to be inserted into the text immediately which will
+     *  result in a TextOperationEvent.CHANGE event for each character.  One
+     *  place this is needed is for the type-ahead feature of the editable combo
+     *  box.
+     */
+    mx_internal var batchTextInput:Boolean = true;
+
+    /**
+     *  @private
      *  True if we've seen a MOUSE_DOWN event and haven't seen the
      *  corresponding MOUSE_UP event.
      */


Transferred from the Adobe Open Source Subversion Repository

Revision: 4211
Author:   jszeto@adobe.com
Date:     2008-12-02T00:51:56.799456Z

Log Message:
-----------
GraphicElement re-layering optimization and removal of change events

SDK-18055 Optimize invalidation of layering for GraphicElements

For the properties that affect whether GraphicElement needs a displayObject, in their setters we add checks to see if we need to recalculate layering.

SDK-18054  Remove non-critical change events from GraphicElement

Removed a bunch of change events from properties that only get set programmatically.

QE Notes: Most change events from GraphicElement and its subclasses have been removed
Doc Notes:
Bugs: SDK-18054, SDK-18055
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Line.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/FilledElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/BitmapGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Rect.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/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -290,9 +290,7 @@
     {
         if (value != mx_internal::_text)
         {
-            var oldValue:String = mx_internal::_text;
             mx_internal::_text = value;
-            dispatchPropertyChangeEvent("text", oldValue, value);

             invalidateTextLines("text");
             invalidateSize();


Transferred from the Adobe Open Source Subversion Repository

Revision: 6018
Author:   pfarland@adobe.com
Date:     2009-04-08T15:36:36.925077Z

Log Message:
-----------
API changes from PARB review of Advanced CSS additions.

Changes include:
- Fold IStyleManager3 back into IStyleManager2
- Remove CSSSelectorKind enum as it is not needed.
- Update CSSStyleDeclaration constructor to accept either a CSSSelector or legacy String selector.
- Update CSSConditionKind enum to use Strings
- Revert concept of StyleManager.addCSSStyleDeclaration() so that we continue to use the Flex 3 restriction of one CSSStyleDeclaration per unique selector String.
- Minor renames for lower level APIs such as IAdvancedStyleClient's isPseudoSelectorMatch() -> matchesCSSState(), and isTypeSelectorMatch)() -> matchesCSSType()
- Update ASDoc comment version info for APIs that were really added in Gumbo
- Add compiler warning for unqualified type selectors (e.g. when a type selector probably needs a namespace prefix).
- Add compiler warning for unresolved qualified type selector (e.g. when a type is probably missing from a manifest).

QE: I have an update for the mustella tests of programmatic creation of CSSStyleDeclaration
Doc: Yes, if we can do an ASDoc review of CSS classes in the framework it would be much appreciated.
Checkintests: Pass
mustella StyleManager/AdvancedCSS: Pass
Reviewer: Glenn

Modified Paths:
--------------
<path kind="dir" action="D">/flex/sdk/trunk/modules/fxgutils/src/java/flash</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleManager2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleManager3.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSSelector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flash/css/StyleSelector.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler_en.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSSelectorKind.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSCondition.as</path>
<path kind="file" action="A">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/UnqualifiedTypeSelector.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flash/css/StyleCondition.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/ClassDefLib.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="A">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/UnresolvedQualifiedTypeSelector.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSConditionKind.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/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -965,7 +965,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function isPseudoSelectorMatch(pseudoState:String):Boolean
+    public function matchesCSSState(cssState:String):Boolean
     {
         return false;
     }
@@ -979,23 +979,9 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function isTypeSelectorMatch(type:String):Boolean
-    {
-        return StyleProtoChain.isTypeSelectorMatch(this, type);
-    }
-
-    /**
-     *  This method is required by the IAdvancedStyleClient interface,
-     *  but doesn't do anything for TextGraphicElements as they do not have
-     *  state specific behavior.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function applyStateStyles(oldState:String, newState:String, recursive:Boolean):void
-    {
+    public function matchesCSSType(cssType:String):Boolean
+    {
+        return StyleProtoChain.matchesCSSType(this, cssType);
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 18635
Author:   aharui@adobe.com
Date:     2010-11-17T00:18:36.469040Z

Log Message:
-----------
Add estimatedSizes to the layout infrastructure to better deal with text reflow.
Add new events to layout infrastructure to deal with caching of size information

QE notes: New APIs and Interfaces
Doc notes: New APIs and interfaces
Bugs: SDK-27226, SDK-26155, SDK-25483, SDK-23621, SDK-27225, SDK-26993, SDK-25535, SDK-25521
Reviewer: Evtim
Tests run: checkintests mustella full run
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/core/Application.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/IContainerInvalidating.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/scripts/FormTestScript.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/ILayoutManagerContainerClient.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/IStyleManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/core/Container.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/LayoutManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Application.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -23,8 +23,10 @@

 import flashx.textLayout.compose.TextLineRecycler;

+import mx.core.FlexVersion;
 import mx.core.IFlexModuleFactory;
 import mx.core.UIComponent;
+import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
 import mx.resources.IResourceManager;
@@ -157,8 +159,9 @@
                 "core", "truncationIndicator");
         }

-        addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
-
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_5)
+            addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
+
         // Register as a weak listener for "change" events from ResourceManager.
         // If TextBases registered as a strong listener,
         // they wouldn't get garbage collected.
@@ -222,13 +225,6 @@
      *  The value of bounds.height, before the compose was done.
      */
     mx_internal var _composeHeight:Number;
-
-    /**
-     *  @private
-     *  Cache the width constraint as set by the layout in setLayoutBoundsSize()
-     *  so that text reflow can be calculated during a subsequent measure pass.
-     */
-    private var _widthConstraint:Number = NaN;

     /**
      *  @private
@@ -523,7 +519,7 @@
         // _widthConstraint trumps even explicitWidth as some layouts may choose
         // to specify width different from the explicit.
         var constrainedWidth:Number =
-            !isNaN(_widthConstraint) ? _widthConstraint : explicitWidth;
+            !isNaN(this.estimatedWidth) ? this.estimatedWidth : explicitWidth;

         // for measurement, try not to collapse so small we don't measure
         // anything
@@ -539,17 +535,20 @@
         // x and/or y may not be 0.
         var newMeasuredHeight:Number = Math.ceil(bounds.bottom);

-        // If the measured height is not affected, then constrained
-        // width measurement is not neccessary.
-        if (!isNaN(_widthConstraint) && measuredHeight == newMeasuredHeight)
+        // If the measured height is not affected, then set constrained
+        // width measurement and exit early
+        if (!isNaN(constrainedWidth) && measuredHeight == newMeasuredHeight)
+        {
+            measuredWidth = Math.ceil(bounds.width);
             return;
+        }

         // Call super.measure() here insted of in the beginning of the method,
         // as it zeroes the measuredWidth, measuredHeight and these values will
         // still be valid if we decided to do an early return above.
         super.measure();

-        measuredWidth = Math.ceil(bounds.right);
+        measuredWidth = Math.ceil(bounds.width);
         measuredHeight = newMeasuredHeight;

         // Remember the number of text lines during measure. We can use this to
@@ -561,6 +560,37 @@
     }

     /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+	override public function setEstimatedSize(estimatedWidth:Number = NaN,
+												estimatedHeight:Number = NaN,
+												invalidateSizeAllowed:Boolean = true):void
+    {
+        var oldcw:Number = this.estimatedWidth;
+        var oldch:Number = this.estimatedHeight;
+        super.setEstimatedSize(estimatedWidth, estimatedHeight, invalidateSizeAllowed);
+        if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_4_5)
+        {
+			var sameWidth:Boolean = isNaN(estimatedWidth) && isNaN(oldcw) || estimatedWidth == oldcw;
+			var sameHeight:Boolean = isNaN(estimatedHeight) && isNaN(oldch) || estimatedHeight == oldch;
+			if (!(sameHeight && sameWidth))
+            {
+                if (!isNaN(explicitWidth) &&
+                    !isNaN(explicitHeight))
+                    return;
+
+				if (invalidateSizeAllowed)
+                	invalidateSize();
+            }
+        }
+    }
+
+    /**
      *  @private
      *  We override the setLayoutBoundsSize to determine whether to perform
      *  text reflow. This is a convenient place, as the layout passes NaN
@@ -570,57 +600,93 @@
                                                  height:Number,
                                                  postLayoutTransform:Boolean = true):void
     {
+		if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_4_5)
+		{
+			var newEstimates:Boolean = false;
+			var cw:Number = estimatedWidth;
+			var ch:Number = estimatedHeight;
+			var oldcw:Number = cw;
+			var oldch:Number = ch;
+			// we got lied to, probably the constraints weren't accurate or
+			// couldn't be computed
+			if (!isNaN(width))
+			{
+				if (isNaN(estimatedWidth) || width != estimatedWidth)
+				{
+					cw = width;
+					newEstimates = true;
+				}
+			}
+			// we got lied to, probably the constraints weren't accurate or
+			// couldn't be computed
+			if (!isNaN(height))
+			{
+				if (isNaN(estimatedHeight) || height != estimatedHeight)
+				{
+					ch = height;
+					newEstimates = true;
+				}
+			}
+			if (newEstimates)
+			{
+				setEstimatedSize(cw, ch);
+				UIComponentGlobals.layoutManager.validateClient(this, true);
+				setEstimatedSize(oldcw, oldch, false);
+			}
+		}
         super.setLayoutBoundsSize(width, height, postLayoutTransform);
-
-        // TODO (egeorgie): possible optimization - if we reflow the text
-        // immediately, we'll be able to detect whether the constrained
-        // width causes the measured height to change.
-        // Also certain layouts like vertical/horizontal will
-        // be able to get the better performance as subsequent elements
-        // will not go through updateDisplayList twice. This also has the
-        // potential of avoiding text compositing during measure.
-
-        // Did we already constrain the width?
-        if (_widthConstraint == width)
-            return;
-
-        // No reflow for explicit lineBreak
-        if (getStyle("lineBreak") == "explicit")
-            return;
-
-        // If we don't measure
-        if (canSkipMeasurement())
-            return;
-
-        if (!isNaN(explicitHeight))
-            return;
-
-        // We support reflow only in the case of constrained width and
-        // unconstrained height. Note that we compare with measuredWidth,
-        // as for example the TextBase can be
-        // constrained by the layout with "left" and "right", but the
-        // container width itself may not be constrained and it would depend
-        // on the element's measuredWidth.
-        var constrainedWidth:Boolean = !isNaN(width) && (width != measuredWidth) && (width != 0);
-        if (!constrainedWidth)
-            return;
-
-        // Special case - if we have a single line, then having a constraint larger
-        // than the measuredWidth will not result in measuredHeight change, as we
-        // will still have only a single line
-        if (_measuredOneTextLine && width > measuredWidth)
-            return;
-
-        // We support reflow only when we don't have a transform.
-        // We could add support for scale, but not skew or rotation.
-        if (postLayoutTransform && hasComplexLayoutMatrix)
-			return;
-
-        _widthConstraint = width;
-        invalidateSize();
-
-    }
-
+
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_5)
+        {
+            // TODO (egeorgie): possible optimization - if we reflow the text
+            // immediately, we'll be able to detect whether the estimated
+            // width causes the measured height to change.
+            // Also certain layouts like vertical/horizontal will
+            // be able to get the better performance as subsequent elements
+            // will not go through updateDisplayList twice. This also has the
+            // potential of avoiding text compositing during measure.
+
+            // Did we already constrain the width?
+            if (estimatedWidth == width)
+                return;
+
+            // No reflow for explicit lineBreak
+            if (getStyle("lineBreak") == "explicit")
+                return;
+
+            // If we don't measure
+            if (canSkipMeasurement())
+                return;
+
+            if (!isNaN(explicitHeight))
+                return;
+
+            // We support reflow only in the case of constrained width and
+            // constrained height. Note that we compare with measuredWidth,
+            // as for example the TextBase can be
+            // constrained by the layout with "left" and "right", but the
+            // container width itself may not be constrained and it would depend
+            // on the element's measuredWidth.
+            var widthConstrained:Boolean = !isNaN(width) && (width != measuredWidth) && (width != 0);
+            if (!widthConstrained)
+                return;
+
+            // Special case - if we have a single line, then having a constraint larger
+            // than the measuredWidth will not result in measuredHeight change, as we
+            // will still have only a single line
+            if (_measuredOneTextLine && width > measuredWidth)
+                return;
+
+            // We support reflow only when we don't have a transform.
+            // We could add support for scale, but not skew or rotation.
+            if (postLayoutTransform && hasComplexLayoutMatrix)
+                return;
+
+            setEstimatedSize(width, estimatedHeight);
+            invalidateSize();
+        }
+    }
+
     /**
      *  @private
      */
@@ -711,6 +777,7 @@
         g.beginFill(uint(backgroundColor), backgroundAlpha);
         g.drawRect(0, 0, unscaledWidth, unscaledHeight);
         g.endFill();
+
     }

     //--------------------------------------------------------------------------
@@ -1076,8 +1143,9 @@
     {
         // Make sure that if we did a double pass, next time around we'll
         // measure normally
-        _widthConstraint = NaN;
-    }
+        setEstimatedSize(NaN, estimatedHeight);
+    }
+
 }

 }


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

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

 package spark.effects.animation
 {


HLSNetStream : when pausing the stream in low buffer condition, also switch to PLAYING_BUFFERING state

This avoids live being paused and never resumed when stuck on last fragment

--- src/org/mangui/hls/stream/HLSNetStream.as
+++ src/org/mangui/hls/stream/HLSNetStream.as
@@ -186,6 +186,8 @@
                     } else if (buffer <= 0.1) {
                         // playing and buffer <= 0.1 and not EOS, pause playback
                         super.pause();
+                        // low buffer condition and play state. switch to play buffering state
+                        _setPlaybackState(HLSPlayStates.PLAYING_BUFFERING);
                     }
                     _lastNetStreamTime = super.time;
                 }


MF-23 Add to shader color fix types

MF-23 Add to shader color fix types

--- src/com/merlinds/miracle_tool/controllers/converters/XMLColorConverter.as
+++ src/com/merlinds/miracle_tool/controllers/converters/XMLColorConverter.as
@@ -6,6 +6,9 @@
 package com.merlinds.miracle_tool.controllers.converters {
 	import com.merlinds.miracle.meshes.Color;
 	import com.merlinds.unitls.ColorUtils;
+
+	import flash.debugger.enterDebugger;
+
 	/**
 	 * The XMLColorConverter class present color transformations from the XML to Miracle format.
 	 * In miracle engine this object will be downloaded as Color object and gives to shader color transformations data.
@@ -14,7 +17,7 @@
 	 **/
 	public class XMLColorConverter extends Color{
 		//constants Color node attributes that need convert to Color parameters
-		private static const BRIGHTNESS:String = "brightness";
+		private static const BRIGHTNESS_TAG:String = "brightness";
 		private static const TINT_MULTIPLIER:String = "tintMultiplier";
 		private static const TINT_COLOR:String = "tintColor";
 		//auxiliary constants
@@ -79,7 +82,7 @@
 					}else if(name == TINT_MULTIPLIER){
 						//tint multiplier spreads for all channels except alpha chanel
 						this.redMultiplier = this.greenMultiplier = this.blueMultiplier = attribute;
-					}else if(name == BRIGHTNESS){
+					}else if(name == BRIGHTNESS_TAG){
 						//brightness multiplier spreads for all channels except alpha chanel
 						this.redMultiplier = this.greenMultiplier = this.blueMultiplier = attribute;
 						//all channels offset equals 255 channels except alpha chanel
@@ -89,11 +92,18 @@
 			}
 			//define color transformation type
 			this.type = TINT;//by default set TINT as type.
-			if(this.redMultiplier == 0 && this.greenMultiplier == 0 && this.blueMultiplier == 0){
-				if(this.alphaMultiplier != 0 || this.alphaOffset != 0){
+			if(this.alphaMultiplier + this.alphaOffset == 0){
+				if(this.redMultiplier + this.greenMultiplier + this.blueMultiplier == this.redMultiplier * 3 &&
+						this.redOffset + this.greenOffset + this.blueOffset == this.redOffset * 3){
+					this.type = BRIGHTNESS;
+				}
+			}else{
+				if(this.redMultiplier + this.greenMultiplier + this.blueMultiplier +
+					this.redOffset + this.greenOffset + this.blueOffset == 0){
 					this.type = ALPHA;
 				}
 			}
+			//in other case Color type is tint
 		}

 		private function covertTintColor(hex:String):void{


Add an accessor for our chatInput field.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@446 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flex/ChatControl.as
+++ src/as/com/threerings/flex/ChatControl.as
@@ -70,6 +70,14 @@

         addEventListener(Event.ADDED_TO_STAGE, handleAddRemove);
         addEventListener(Event.REMOVED_FROM_STAGE, handleAddRemove);
+    }
+
+    /**
+     * Provides access to the text field we use to accept chat.
+     */
+    public function get chatInput () :ChatInput
+    {
+        return _txt;
     }

     /**


fixed bug in default script

fixed bug in default script

Change-Id: Id4183c2d33d00c5713578e016f798ebc15a5169d

--- WeaveUISpark/src/weave/visualization/plotters/CustomGlyphPlotter.as
+++ WeaveUISpark/src/weave/visualization/plotters/CustomGlyphPlotter.as
@@ -88,9 +88,11 @@

 					var x = tempPoint.x, y = tempPoint.y;
 					var size = 20 * sizeStats.getNorm(key);
+					var color = colorColumn.getValueFromKey(key, Number);

 					// draw graphics
-					buffer.beginFill(color, 1.0); // color, alpha
+					if (isFinite(color))
+						buffer.beginFill(color, 1.0); // color, alpha
 					if (isNaN(size))
 					{
 						size = 10;


Transferred from the Adobe Open Source Subversion Repository

Revision: 13363
Author:   gosmith@adobe.com
Date:     2010-01-08T01:35:33.958261Z

Log Message:
-----------
Improved ASDoc for UIFTETextField and FTETextField.

QE notes: None
Doc notes: None
Bugs: SDK-24904
Reviewer: None
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as</path>

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

--- frameworks/projects/spark/src/mx/core/UIFTETextField.as
+++ frameworks/projects/spark/src/mx/core/UIFTETextField.as
@@ -49,19 +49,30 @@
 [ResourceBundle("core")]

 /**
- *  The UITextField class defines the component used by many Flex
- *  components to display text.
- *  For example, the mx.controls.Button control uses a
- *  UITextField component to define the label area of the Button control.
- *
- *
The UITextField class extends the flash.text.TextField class to
- *  support additional functionality required by Flex, such as CSS styles,
- *  invalidation/measurement/layout, enabling/disabling, tooltips, and IME
- *  (Input Method Editor) support for entering Chinese, Japanese, and
- *  Korean text.

+ *  The UIFTETextField class is an alternative to the UITextField class
+ *  for displaying text in MX components.
  *
- *  @see flash.text.TextField
- *  @see mx.core.UITextFormat
+ *
UIFTETextField extends FTETextField in the same way
+ *  that UITextField extends TextField.
+ *  By extending FTETextField, it makes it possible
+ *  for MX components to use the Flash Text Engine.
+ *  Benefits of using FTE over TextField include
+ *  higher-quality typography, bidirectional text, and rotatable text.

+ *
+ *
When MX components use FTE, they can use the same
+ *  embedded fonts as Spark components, which always use FTE.
+ *  Otherwise, a font must be embedded with embedAsCFF="false"
+ *  for use by TextField-based components, and with
+ *  embedAsCFF="true" for use by FTE-based components.

+ *
+ *
MX components that display text use the textFieldClass
+ *  style to determine whether to create instances
+ *  of UITextField or UIFTETextField.
+ *  They are able to use either class because both classes implement
+ *  the IUITextField interface.

+ *
+ *  @see mx.core.UITextField
+ *  @see mx.core.FTETextField
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


HLSNetStream.as : append tags synchronously to simplify the logic

--- src/org/mangui/hls/stream/HLSNetStream.as
+++ src/org/mangui/hls/stream/HLSNetStream.as
@@ -38,10 +38,6 @@
         private var _hls : HLS;
         /** reference to buffer threshold controller */
         private var _bufferThresholdController : BufferThresholdController;
-        /** FLV tags buffer vector **/
-        private var _flvTagBuffer : Vector.<FLVTag>;
-        /** FLV tags buffer duration **/
-        private var _flvTagBufferDuration : Number;
         /** The fragment loader. **/
         private var _fragmentLoader : FragmentLoader;
         /** FLV Tag Buffer . **/
@@ -63,7 +59,6 @@
         public function HLSNetStream(connection : NetConnection, hls : HLS, fragmentLoader : FragmentLoader, streamBuffer : StreamBuffer) : void {
             super(connection);
             super.bufferTime = 0.1;
-            _flvTagBufferDuration = 0;
             _hls = hls;
             _bufferThresholdController = new BufferThresholdController(hls);
             _fragmentLoader = fragmentLoader;
@@ -112,12 +107,15 @@
         /** timer function, check/update NetStream state, and append tags if needed **/
         private function _checkBuffer(e : Event) : void {
             var buffer : Number = this.bufferLength;
-            //Log.info("netstream/total:" + super.bufferLength + "/" + this.bufferLength);
+            // Log.info("netstream/total:" + super.bufferLength + "/" + this.bufferLength);
             // Set playback state. no need to check buffer status if seeking
             if (_seekState != HLSSeekStates.SEEKING) {
                 // check low buffer condition
                 if (buffer <= 0.1) {
                     if (_reached_vod_end) {
+                        // Last tag done? Then append sequence end.
+                        super.appendBytesAction(NetStreamAppendBytesAction.END_SEQUENCE);
+                        super.appendBytes(new ByteArray());
                         // reach end of playlist + playback complete (as buffer is empty).
                         // stop timer, report event and switch to IDLE mode.
                         _timer.stop();
@@ -157,52 +155,6 @@
                     }
                 }
             }
-            // in case any data available in our FLV buffer, append into NetStream
-            if (_flvTagBuffer.length) {
-                if (_seekState == HLSSeekStates.SEEKING) {
-                    /* this is our first injection after seek(),
-                    let's flush netstream now
-                    this is to avoid black screen during seek command */
-                    super.close();
-                    CONFIG::FLASH_11_1 {
-                        try {
-                            super.useHardwareDecoder = HLSSettings.useHardwareVideoDecoder;
-                        } catch(e : Error) {
-                        }
-                    }
-                    super.play(null);
-                    super.appendBytesAction(NetStreamAppendBytesAction.RESET_SEEK);
-                    // immediatly pause NetStream, it will be resumed when enough data will be buffered in the NetStream
-                    super.pause();
-                    // dispatch event to mimic NetStream behaviour
-                    dispatchEvent(new NetStatusEvent(NetStatusEvent.NET_STATUS, false, false, {code:"NetStream.Seek.Notify", level:"status"}));
-                    _setSeekState(HLSSeekStates.SEEKED);
-                }
-                // CONFIG::LOGGING {
-                // Log.debug("appending data into NetStream");
-                // }
-                while (0 < _flvTagBuffer.length) {
-                    var tagBuffer : FLVTag = _flvTagBuffer.shift();
-                    // append data until we drain our _buffer
-                    try {
-                        if (tagBuffer.type == FLVTag.DISCONTINUITY) {
-                            super.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
-                            super.appendBytes(FLVTag.getHeader());
-                        }
-                        super.appendBytes(tagBuffer.data);
-                    } catch (error : Error) {
-                        var hlsError : HLSError = new HLSError(HLSError.TAG_APPENDING_ERROR, null, tagBuffer.type + ": " + error.message);
-                        _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR, hlsError));
-                    }
-                    // Last tag done? Then append sequence end.
-                    if (_reached_vod_end && _flvTagBuffer.length == 0) {
-                        super.appendBytesAction(NetStreamAppendBytesAction.END_SEQUENCE);
-                        super.appendBytes(new ByteArray());
-                    }
-                }
-                // FLV tag buffer drained, reset its duration
-                _flvTagBufferDuration = 0;
-            }
         };

         /** Return the current playback state. **/
@@ -222,9 +174,39 @@

         /** append tags to NetStream **/
         public function appendTags(tags : Vector.<FLVTag>) : void {
-            _flvTagBufferDuration += (tags[tags.length - 1].pts - tags[0].pts) / 1000;
-            for each (var tag : FLVTag in tags) {
-                _flvTagBuffer.push(tag);
+            if (_seekState == HLSSeekStates.SEEKING) {
+                /* this is our first injection after seek(),
+                let's flush netstream now
+                this is to avoid black screen during seek command */
+                super.close();
+                CONFIG::FLASH_11_1 {
+                    try {
+                        super.useHardwareDecoder = HLSSettings.useHardwareVideoDecoder;
+                    } catch(e : Error) {
+                    }
+                }
+                super.play(null);
+                super.appendBytesAction(NetStreamAppendBytesAction.RESET_SEEK);
+                // immediatly pause NetStream, it will be resumed when enough data will be buffered in the NetStream
+                super.pause();
+            }
+            // append all tags
+            for each (var tagBuffer : FLVTag in tags) {
+                try {
+                    if (tagBuffer.type == FLVTag.DISCONTINUITY) {
+                        super.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
+                        super.appendBytes(FLVTag.getHeader());
+                    }
+                    super.appendBytes(tagBuffer.data);
+                } catch (error : Error) {
+                    var hlsError : HLSError = new HLSError(HLSError.TAG_APPENDING_ERROR, null, tagBuffer.type + ": " + error.message);
+                    _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR, hlsError));
+                }
+            }
+            if (_seekState == HLSSeekStates.SEEKING) {
+                // dispatch event to mimic NetStream behaviour
+                dispatchEvent(new NetStatusEvent(NetStatusEvent.NET_STATUS, false, false, {code:"NetStream.Seek.Notify", level:"status"}));
+                _setSeekState(HLSSeekStates.SEEKED);
             }
         };

@@ -314,9 +296,9 @@

         public function get netStreamBufferLength() : Number {
             if (_seekState == HLSSeekStates.SEEKING) {
-                return _flvTagBufferDuration;
+                return 0;
             } else {
-                return super.bufferLength + _flvTagBufferDuration;
+                return super.bufferLength;
             }
         };

@@ -327,8 +309,6 @@
             }
             _fragmentLoader.stop();
             _fragmentLoader.seek(position);
-            _flvTagBuffer = new Vector.<FLVTag>();
-            _flvTagBufferDuration = 0;
             _reached_vod_end = false;

             _setSeekState(HLSSeekStates.SEEKING);


Disable the export combined button if there are errors.

--- exporter/src/main/as/flump/export/ProjectController.as
+++ exporter/src/main/as/flump/export/ProjectController.as
@@ -172,7 +172,11 @@

     protected function exportAll (modifiedOnly :Boolean) :void {
         // if we have one or more combined export format, publish them
-        if (hasCombinedExportConfig()) exportCombined();
+        if (hasCombinedExportConfig()) {
+            var valid :Boolean = _flashDocsGrid.dataProvider.toArray()
+                .every(function (status :DocStatus,..._) :Boolean { return status.isValid; });
+            if (valid) exportCombined();
+        }
         // now publish any appropriate single formats
         if (hasSingleExportConfig()) {
             for each (var status :DocStatus in _flashDocsGrid.dataProvider.toArray()) {
@@ -301,6 +305,7 @@
         }
         _win.formatOverview.text = formatNames.join(", ");
         _win.exportAll.label = hasCombined ? "Export Combined" : "Export All";
+        checkValid();
         _win.exportModified.enabled = !hasCombined;
         _win.export.enabled = !hasCombined;

@@ -455,9 +460,10 @@

         load.succeeded.connect(function (lib :XflLibrary) :void {
             status.lib = lib;
-            checkModified();
             for each (var err :ParseError in lib.getErrors()) _errorsGrid.dataProvider.addItem(err);
             status.updateValid(Ternary.of(lib.valid));
+            checkModified();
+            checkValid();
         });
         load.failed.connect(function (error :Error) :void {
             trace("Failed to load " + file.nativePath + ": " + error);
@@ -486,6 +492,18 @@
             var status :DocStatus = _flashDocsGrid.dataProvider[ii];
             status.updateModified(Ternary.of(pub == null || pub.modified(libs, ii)))
         }
+    }
+
+    protected function checkValid () :void {
+        if (getLibs() == null) {
+            _win.exportAll.enabled = false;
+            return;
+        }
+
+        _win.exportAll.enabled = !hasCombinedExportConfig() || _flashDocsGrid.dataProvider.toArray()
+            .every(function (status :DocStatus, ..._) :Boolean {
+                return status.isValid;
+            });
     }

     protected function setProjectDirty (val :Boolean) :void {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/charts/src/mx/charts/LegendItem.as
+++ frameworks/projects/charts/src/mx/charts/LegendItem.as
@@ -0,0 +1,694 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.charts
+{
+
+import flash.display.DisplayObject;
+import flash.events.MouseEvent;
+import flash.geom.Rectangle;
+import mx.charts.chartClasses.IChartElement;
+import mx.charts.renderers.BoxItemRenderer;
+import mx.charts.styles.HaloDefaults;
+import mx.core.IDataRenderer;
+import mx.core.IFactory;
+import mx.core.IFlexDisplayObject;
+import mx.core.IUITextField;
+import mx.core.UIComponent;
+import mx.core.UITextField;
+import mx.core.mx_internal;
+import mx.graphics.SolidColor;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.ISimpleStyleClient;
+import mx.core.IFlexModuleFactory;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../styles/metadata/GapStyles.as"
+include "../styles/metadata/PaddingStyles.as"
+include "styles/metadata/TextStyles.as"
+
+/**
+ *  Specifies an IFill object that defines the fill for the legend element.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="fill", type="Object", inherit="no")]
+
+/**
+ *  Specifies the label placement of the legend element. Recognized values are
+ *  "top", "bottom", "left", and "right".
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="labelPlacement", type="String", enumeration="top,bottom,right,left", inherit="yes")]
+
+/**
+ *  Specifies the class that renders the marker portion of the legend item.
+ *  Typically the marker is provided by the chart element that
+ *  generates the legend item.
+ *  When you create a legend manually, however, this style specifies
+ *  what class is used to render the marker.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="legendMarkerRenderer", type="mx.core.IFactory", inherit="no")]
+
+/**
+ *  Specifies the height of the legend element.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="markerHeight", type="Number", format="Length", inherit="yes")]
+
+/**
+ *  Specifies the width of the legend element.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="markerWidth", type="Number", format="Length", inherit="yes")]
+
+/**
+ *  Specifies the line stroke for the legend element.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="stroke", type="Object", inherit="no")]
+
+/**
+ *  Controls the individual legend elements in a chart legend.
+ *
+ *  @mxml
+ *
+ *
The <mx:LegendItem> tag inherits all the properties
+ *  of its parent classes and adds the following properties:

+ *
+ *

+ *  <mx:LegendItem
+ *    Properties
+ *    element="No default"
+ *    label="No default"
+ *    source="No default"
+ *    legendData="No default"
+ *    marker="No default"
+ *    markerAspectRatio="No default"
+ *
+ *    Styles
+ *    fill="IFill; no default."
+ *    fontWeight="normal|bold"
+ *    fontSize="10"
+ *    horizontalGap="8"
+ *    labelPlacement="right|left|top|bottom"
+ *    legendMarkerRenderer="Defaults to series's itemRenderer"
+ *    markerHeight="15"
+ *    markerWidth="10"
+ *    paddingLeft="0"
+ *    paddingRight="0"
+ *    stroke="IStroke; no default"
+ * 	  textDecoration="underline|none"
+ *    verticalGap="6"
+ *  />
+ *

+ *
+ *  @see mx.charts.Legend
+ *  @see mx.charts.chartClasses.LegendData
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class LegendItem extends UIComponent
+{
+    include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class initialization
+	//
+	//--------------------------------------------------------------------------
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function LegendItem()
+	{
+		super();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var _moduleFactoryInitialized:Boolean = false;
+
+	/**
+	 *  @private
+	 */
+	private var nameLabel:IUITextField;
+
+	/**
+	 *  @private
+	 */
+	private var labelChanged:Boolean = false;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  element
+	//----------------------------------
+
+	[Inspectable(environment="none")]
+
+	/**
+	 *  The chart element that is responsible for generating this legend item.
+	 *  When a Legend control's contents are automatically generated by a chart,
+	 *  this field refers to the element (usually a series)
+	 *  that this item represents.
+	 *  In some cases, multiple items refer to the same element.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public var element:IChartElement;
+
+	//----------------------------------
+	//  label
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the label property.
+	 */
+	private var _label:String = "";
+
+	[Inspectable(category="General")]
+
+	/**
+	 *  Specifies the text that Flex displays alongside the legend element.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function get label():String
+	{
+		return _label;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set label(value:String):void
+	{
+		_label = value;
+		labelChanged = true;
+
+		invalidateSize();
+		invalidateDisplayList();
+	}
+
+	//----------------------------------
+	//  legendData
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the legendData property.
+	 */
+	private var _legendData:Object;
+
+	[Inspectable(environment="none")]
+
+	/**
+	 *  The LegendData instance that this LegendItem object represents.
+	 *  When a chart generates the contents of a Legend control,
+	 *  the elements of the chart generate one or more
+	 *  LegendData structures for display in the Legend.
+	 *  Each LegendData structure generates one LegendItem object.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function set legendData(value:Object):void
+	{
+		_legendData = value;
+
+		if (_marker is IDataRenderer)
+			(_marker as IDataRenderer).data = _legendData;
+	}
+
+	//----------------------------------
+	//  marker
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the marker property.
+	 */
+	private var _marker:IFlexDisplayObject;
+
+	[Inspectable]
+
+	/**
+	 *  The marker displayed by this legend item.
+	 *  Markers are typically assigned by the chart element
+	 *  that generated the LegendData associated with this item.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function get marker():IFlexDisplayObject
+	{
+		return _marker;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set marker(value:IFlexDisplayObject):void
+	{
+		if (_marker)
+			removeChild(_marker as DisplayObject);
+
+		_marker = value;
+
+		if (_marker)
+			addChild(_marker as DisplayObject);
+
+		if (_marker is IDataRenderer)
+			(_marker as IDataRenderer).data = _legendData;
+
+		invalidateDisplayList();
+	}
+
+	//----------------------------------
+	//  markerAspectRatio
+	//----------------------------------
+
+	[Inspectable(category="General")]
+
+	/**
+	 *  The aspect ratio for the marker associated with this legend item.
+	 *  Some markers provided by chart series are intended for display
+	 *  at a particular aspect ratio.
+	 *  If this property is set, the legend item guarantees
+	 *  the aspect ratio of the marker during layout.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public var markerAspectRatio:Number;
+
+	//----------------------------------
+	//  source
+	//----------------------------------
+
+	[Inspectable(environment="none")]
+
+	/**
+	 *  Contains a reference
+	 *  to the data series that the LegendItem was generated from
+	 *  if you bind the dataProvider property
+	 *  of the parent Legend control to a chart control.
+	 *  Otherwise, this property contains a reference
+	 *  to the object associated with the LegendItem.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function get source():Object
+	{
+		return element;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods: UIComponent
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private function initStyles():Boolean
+	{
+		HaloDefaults.init(styleManager);
+
+		var o:CSSStyleDeclaration = HaloDefaults.createSelector("mx.charts.LegendItem", styleManager);
+
+		o.defaultFactory = function():void
+		{
+			this.fill = new SolidColor(0);
+			this.fontWeight = "bold";
+			this.fontSize = 10;
+		}
+
+		return true;
+	}
+
+
+	/**
+	 *  @inheritDoc
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	override public function set moduleFactory(factory:IFlexModuleFactory):void
+	{
+		super.moduleFactory = factory;
+
+		if (_moduleFactoryInitialized)
+			return;
+
+		_moduleFactoryInitialized = true;
+
+		// our style settings
+		initStyles();
+	}
+
+	/**
+	 *  @private
+	 */
+	override protected function createChildren():void
+    {
+        nameLabel = IUITextField(createInFontContext(UITextField));
+		nameLabel.selectable = false;
+		nameLabel.styleName = this;
+		addChild(DisplayObject(nameLabel));
+
+        super.createChildren();
+
+        if (!nameLabel)
+		{
+			nameLabel = IUITextField(createInFontContext(UITextField));
+			nameLabel.selectable = false;
+			nameLabel.styleName = this;
+			addChild(DisplayObject(nameLabel));
+		}
+    }
+
+	/**
+	 *  @private
+	 */
+	override protected function measure():void
+	{
+		super.measure();
+
+		var txt:String = _label;
+
+		var labelPlacement:String = getStyle("labelPlacement");
+		if (labelPlacement == "" && parent)
+			labelPlacement = UIComponent(parent).getStyle("labelPlacement");
+
+		var itemW:Number = 0;
+		var itemH:Number = 0;
+
+		// If the text is empty (or undefined), make the preferred
+		// size big enough to hold a capital and decending character
+		// using the current font.
+		if (txt == null || txt == "" || txt.length < 2)
+			txt = "Wj";
+
+		if (labelChanged)
+		{
+			labelChanged = false;
+			nameLabel.htmlText = _label;
+		}
+
+		var textW:Number = nameLabel.textWidth + UITextField.TEXT_WIDTH_PADDING;
+		var textH:Number = nameLabel.textHeight + UITextField.TEXT_HEIGHT_PADDING;
+
+		if (isNaN(textW))
+			textW = 0;
+		if (isNaN(textH))
+			textH = 0;
+
+		if (textW > 0 || calculateMarkerWidth() > 0)
+		{
+			itemW += getStyle("paddingLeft") + getStyle("paddingRight");
+			itemH += getStyle("paddingTop") + getStyle("paddingBottom");
+
+			if (labelPlacement == "top" || labelPlacement == "bottom")
+			{
+				itemW += Math.max(textW, calculateMarkerWidth());
+				itemH += getStyle("verticalGap") + calculateMarkerHeight() + textH;
+			}
+			else
+			{
+				itemW += getStyle("horizontalGap") + calculateMarkerWidth() + textW;
+				itemH += Math.max(textH, calculateMarkerHeight());
+			}
+		}
+
+		measuredWidth = itemW;
+		measuredHeight = itemH;
+
+		// Set the labelField size here.
+		// This way the width getter will return the proper value
+		// when the resize event is fired.
+		nameLabel.setActualSize(getExplicitOrMeasuredWidth(), measuredHeight);
+	}
+
+	/**
+	 *  @private
+	 */
+	override protected function updateDisplayList(unscaledWidth:Number,
+												  unscaledHeight:Number):void
+	{
+		super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+		var labelPlacement:String = getStyle("labelPlacement");
+
+		var labelX:Number = 0;
+		var labelY:Number = 0;
+
+		var markerX:Number = 0;
+		var markerY:Number = 0;
+
+		var paddingLeft:Number = getStyle("paddingLeft");
+		var paddingRight:Number = getStyle("paddingRight");
+		var paddingTop:Number = getStyle("paddingTop");
+
+		var mAvailableWidth:Number = calculateMarkerWidth();
+		var mAvailableHeight:Number = calculateMarkerHeight();
+
+		var markerH:Number = mAvailableHeight;
+		var markerW:Number = mAvailableWidth;
+
+		var txt:String = _label;
+
+		if (txt == null || txt.length < 2)
+			txt = "Wj";
+
+		if (labelChanged)
+		{
+			labelChanged = false;
+			nameLabel.text = _label;
+		}
+
+		var textW:Number = nameLabel.textWidth + UITextField.TEXT_WIDTH_PADDING;
+		var textH:Number = nameLabel.textHeight + UITextField.TEXT_HEIGHT_PADDING;
+
+		var cx:Number;
+
+		if (isNaN(textW))
+			textW = 0;
+		if (isNaN(textH))
+			textH = 0;
+
+		switch (labelPlacement)
+		{
+			case "top":
+			{
+				labelY = paddingTop;
+				markerY = labelY + getStyle("verticalGap") + textH;
+
+				cx = paddingLeft +
+					 (unscaledWidth - paddingLeft - paddingRight) / 2;
+				labelX = cx - textW / 2;
+				markerX = cx - markerW / 2;
+
+				break;
+			}
+
+			case "bottom":
+			{
+				markerY = paddingTop;
+				labelY = markerY + getStyle("verticalGap") + markerH;
+
+				cx = paddingLeft +
+					 (unscaledWidth - paddingLeft - paddingRight) / 2;
+				labelX = cx - textW / 2;
+				markerX = cx - markerW / 2;
+
+				break;
+			}
+
+			case "left":
+			{
+				markerX = unscaledWidth - markerW - paddingRight;
+				labelX = markerX - getStyle("horizontalGap") - textW;
+
+				labelY = markerY = paddingTop;
+				if (textH < markerH)
+					labelY += (markerH - textH) / 2;
+				else
+					markerY += (textH - markerH) / 2;
+
+				break;
+			}
+
+			default: // default is right
+			{
+				markerX = paddingLeft;
+				labelX = markerX + getStyle("horizontalGap") + markerW;
+
+				markerY = labelY = paddingTop;
+				if (markerH < textH)
+					markerY += (textH - markerH) / 2;
+				else
+					labelY += (markerH - textH) / 2;
+
+				break;
+			}
+		}
+
+		nameLabel.move(labelX, labelY);
+
+		if (!isNaN(markerAspectRatio))
+		{
+			var availableAR:Number = markerW / markerH;
+			if (availableAR > markerAspectRatio)
+				markerW = markerAspectRatio * markerH;
+			else
+				markerH = markerW / markerAspectRatio;
+		}
+
+		var rc:Rectangle = new Rectangle((mAvailableWidth - markerW) / 2,
+										 (mAvailableHeight - markerH) / 2,
+										 markerW, markerH);
+
+		if (!_marker)
+		{
+			var markerClass:IFactory = getStyle("legendMarkerRenderer");
+
+			if (markerClass)
+				marker = markerClass.newInstance();
+			else
+				marker = new BoxItemRenderer();
+
+			if (_marker is ISimpleStyleClient)
+			{
+				(_marker as ISimpleStyleClient).styleName =
+					(!element) ? this : element;
+			}
+		}
+
+		_marker.x = markerX + (mAvailableWidth - markerW) / 2;
+		_marker.y = markerY + (mAvailableHeight - markerH) / 2;
+
+		_marker.setActualSize(markerW, markerH);
+	}
+
+	/**
+	 *  @private
+	 */
+	override public function styleChanged(styleProp:String):void
+	{
+		invalidateDisplayList();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private function calculateMarkerWidth():Number
+	{
+		var out:Number = getStyle("markerWidth");
+		if (isNaN(out))
+			out = 10;
+		return out;
+	}
+
+	/**
+	 *  @private
+	 */
+	private function calculateMarkerHeight():Number
+	{
+		var out:Number = getStyle("markerHeight");
+		if (isNaN(out))
+			out = 15;
+		return out;
+	}
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 6367
Author:   dsubrama@adobe.com
Date:     2009-04-29T02:10:06.370325Z

Log Message:
-----------
Turn "on" multiple selection support in List.

Most of the behavior is the same as in Halo except for the following caveats:

-When a multiple selection change occurs, only the selectionChanged event is dispatched with no index information, the multipleSelectionChange flag is true though.

-In Halo when selection was toggled from multiple to single, the view did not update. In Spark, I clear out selection but we can change that if its not desireable (perhaps we should keep the last selected item as the currently selected single item?)

-Binding works for all the selection related properties

-Works programmatically and with the mouse, keyboard hookup will come in a subsequent checkin.

QA: Yes!
Reviewer: Ryan
Checkintests: PASS

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/IndexChangedEvent.as</path>

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -16,14 +16,11 @@
 import flash.geom.Point;
 import flash.ui.Keyboard;

-import mx.core.ClassFactory;
 import mx.core.IVisualElement;
-import mx.events.FlexEvent;
+import mx.events.IndexChangedEvent;
 import mx.managers.IFocusManagerComponent;

-import spark.components.IItemRenderer;
-import spark.components.supportClasses.ItemRenderer;
-import spark.components.supportClasses.ListBase;
+import spark.components.supportClasses.ListBase;
 import spark.events.RendererExistenceEvent;
 import spark.layouts.HorizontalLayout;
 import spark.layouts.VerticalLayout;
@@ -143,6 +140,7 @@
     //----------------------------------

     private var _allowMultipleSelection:Boolean = false;
+    private var allowMultipleSelectionChanged:Boolean = false;

     /**
      *  Boolean flag controlling whether multiple selection
@@ -167,8 +165,15 @@
     {
         if (value == _allowMultipleSelection)
             return
-
+
         _allowMultipleSelection = value;
+
+        //Going from multiple to single, clear out selection
+        if (!_allowMultipleSelection)
+        {
+            _proposedSelectedIndices = [NO_SELECTION];
+            commitMultipleSelection();
+        }
     }

     //----------------------------------
@@ -200,9 +205,45 @@
             super.selectedIndex = value;
             return;
         }
-
+        if (value == selectedIndex)
+            return;
+
         selectedIndices = [value];
-        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  selectedItem
+    //----------------------------------
+
+    [Bindable("selectionChanged")]
+    /**
+     *  @private
+     */
+    override public function get selectedItem():*
+    {
+        if (!allowMultipleSelection)
+            return super.selectedItem;
+
+        if (_selectedIndices && _selectedIndices.length > 0)
+            return dataProvider.getItemAt(_selectedIndices[0]);
+
+        return NO_SELECTION;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set selectedItem(value:*):void
+    {
+        if (!allowMultipleSelection)
+        {
+            super.selectedItem = value;
+            return;
+        }
+        if (value == selectedItem)
+            return;
+
+        selectedItems = [value];
     }

@@ -241,7 +282,8 @@
         if (!allowMultipleSelection)
             return;

-        // ?? should we check to see if the selection changed?
+        if (_proposedSelectedIndices == value)
+            return;

         multipleSelectionChanged = true;
         _proposedSelectedIndices = value;
@@ -390,6 +432,10 @@

     /**
      *  @private
+     *  Given a new selection interval, figure out which
+     *  items are newly added/removed from the selection interval and update
+     *  selection properties and view accordingly. Additionally, dispatch the
+     *  selectionChanged event.
      */
     private function commitMultipleSelection():void
     {
@@ -400,7 +446,8 @@

         if (!isEmpty(_selectedIndices) && !isEmpty(_proposedSelectedIndices))
         {
-            // Changing selection, determine which items were added
+            // Changing selection, determine which items were added to the
+            // selection interval
             count = _proposedSelectedIndices.length;
             for (i = 0; i < count; i++)
             {
@@ -408,7 +455,9 @@
                     addedItems.push(_proposedSelectedIndices[i]);
             }

-            // determine which items were removed
+            // Then determine which items were removed from the selection
+            // interval
+            count = _selectedIndices.length;
             for (i = 0; i < count; i++)
             {
                 if (_proposedSelectedIndices.indexOf(_selectedIndices[i]) < 0)
@@ -426,11 +475,11 @@
             addedItems = _proposedSelectedIndices;
         }

-        // Commit
+        // Commit the selected Indices
         _selectedIndices = _proposedSelectedIndices;
         _proposedSelectedIndices = null;

-        // un-select the old
+        // De-select the old items that were selected
         if (removedItems.length > 0)
         {
             count = removedItems.length;
@@ -440,7 +489,7 @@
             }
         }

-        // select the new
+        // Select the new items in the new selection interval
         if (addedItems.length > 0)
         {
             count = addedItems.length;
@@ -449,6 +498,92 @@
                 itemSelected(addedItems[i], true);
             }
         }
+
+        //Dispatch the selectionChanged event
+        var e:IndexChangedEvent = new IndexChangedEvent(IndexChangedEvent.SELECTION_CHANGED);
+        e.multipleSelectionChange = true;
+        dispatchEvent(e);
+    }
+
+    /**
+     *  @private
+     *  Taking into account which modifier keys were clicked, the new
+     *  selectedIndices interval is calculated.
+     */
+    private function calculateSelectedIndicesInterval(renderer:IVisualElement, shiftKey:Boolean, ctrlKey:Boolean):Array
+    {
+        var i:int;
+        var interval:Array = [];
+        var index:Number = dataGroup.getElementIndex(renderer);
+
+        if (!shiftKey)
+        {
+            if (ctrlKey)
+            {
+                if (!isEmpty(selectedIndices))
+                {
+                    //Quick check to see if selectedIndices had only one selected item
+                    //and that item was de-selected
+                    if (selectedIndices.length == 1 && (selectedIndices[0] == index))
+                    {
+                        //selectedIndex = NO_SELECTION;
+                        return [NO_SELECTION];
+                    }
+                    else
+                    {
+                        // Go through and see if the index passed in was in the
+                        // selection model. If so, leave it out when constructing
+                        // the new interval so it is de-selected.
+                        var found:Boolean = false;
+                        for (i = 0; i < _selectedIndices.length; i++)
+                        {
+                            if (_selectedIndices[i] == index)
+                                found = true;
+                            else if (_selectedIndices[i] != index)
+                                interval.push(_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);
+                        }
+                        for (var i:int = 0; i < interval.length; i++)
+                        {
+                            trace(interval[i]);
+                        }
+                        return interval;
+                    }
+                }
+            }
+            //A single item was newly selected, add that to the selection interval.
+            else
+                return [index];
+        }
+
+        else (shiftKey)
+        {
+            //A contiguous selection action has occurred. Figure out which new
+            //indices to add to the selection interval and return that.
+            var start:Number = (!isEmpty(selectedIndices)) ? selectedIndices[0] : -1;
+            var end:Number = index;
+            if (start < end)
+            {
+                for (i = start; i <= end; i++)
+                {
+                    interval.push(i);
+                }
+            }
+            else
+            {
+                for (i = start; i >= end; i--)
+                {
+                    interval.push(i);
+                }
+            }
+            return interval;
+        }
     }

     //--------------------------------------------------------------------------
@@ -497,9 +632,23 @@
      */
     protected function item_clickHandler(event:MouseEvent):void
     {
-        // Multiple selection needs to be added here....
-
-        selectedIndex = dataGroup.getElementIndex(event.currentTarget as IVisualElement);
+        if (!allowMultipleSelection)
+        {
+            //Single selection case
+            var newIndex:Number = dataGroup.getElementIndex(event.currentTarget as IVisualElement);
+
+            //Check to see if we're deselecting the currently selected item
+            if (event.ctrlKey && selectedIndex == newIndex)
+                selectedIndex = NO_SELECTION;
+            //Otherwise, select the new item
+            else
+                selectedIndex = newIndex;
+        }
+        else
+        {
+            //Multiple selection is handled by the helper method below
+            selectedIndices = calculateSelectedIndicesInterval(event.currentTarget as IVisualElement, event.shiftKey, event.ctrlKey);
+        }
     }

     /**
@@ -545,18 +694,21 @@
 	        var delta:int = 0;

 	        if (layout is VerticalLayout)
+	        {
 	            switch(event.keyCode)
 	            {
 	                case Keyboard.UP: delta = -1; break;
 	                case Keyboard.DOWN: delta = +1; break;
 	            }
+            }
 	        else if (layout is HorizontalLayout)
+	        {
 	            switch(event.keyCode)
 	            {
 	                case Keyboard.LEFT: delta = -1; break;
 	                case Keyboard.RIGHT: delta = +1; break;
 	            }
-
+	        }
 	        // Note that the KeyboardEvent is canceled even if the selectedIndex doesn't
 	        // change because we don't want another component to start handling these
 	        // events when the selectedIndex reaches a limit.


Transferred from the Adobe Open Source Subversion Repository

Revision: 6369
Author:   dsubrama@adobe.com
Date:     2009-04-29T04:03:43.452976Z

Log Message:
-----------
Left an unintentional trace in the selection handling method.

Checkintests: PASS

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

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -548,10 +548,6 @@
                             //Instead, the Ctrl key was held down and we're doing a
                             //new add.
                             interval.push(index);
-                        }
-                        for (var i:int = 0; i < interval.length; i++)
-                        {
-                            trace(interval[i]);
                         }
                         return interval;
                     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 22141
Author:   jasonsj@adobe.com
Date:     2011-08-22T22:59:31.642122Z

Log Message:
-----------
PARB approved change positionPopUp() to updatePopUpPosition(). Also changed from protected to public for SDK-31190.
Initial implementation of SoftKeyboardPopUpTransition for SkinnablePopUpContainer and Callout.

QE notes:
Doc notes:
Bugs:
SDK-31190 Callout does not reposition when the owner's bounds change
SDK-30880 Application is not resized when soft keyboard is activated in a pop up
Reviewer: tkraikit
Tests run: checkintests, mustella, mustella-mobile cyclones
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/transitions/SoftKeyboardPopUpTransition.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/transitions</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/SkinnablePopUpContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/Callout.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as
+++ frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as
@@ -406,6 +406,8 @@
      */
     private var _callout:Callout;

+    [Bindable("calloutChanged")]
+
     /**
      *  The Callout instance created after the DropDownEvent.OPEN
      *  is fired. The instance is created using the dropDown
@@ -431,6 +433,9 @@
             return;

         _callout = value;
+
+        if (hasEventListener("calloutChanged"))
+            dispatchEvent(new Event("calloutChanged"));
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 17366
Author:   rfrishbe@adobe.com
Date:     2010-08-18T20:55:44.548390Z

Log Message:
-----------
Adding touchDelay and minimumDownState styles to Button.

In addition, there are some other PARB changes (touchScroll is renamed to more generic gestureCapture).  This means TouchScrollEvent has been renamed to GestureCaptureEvent as well.

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

Modified Paths:
--------------
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchScrollEvent.as" copyfrom-rev="17335" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/GestureCaptureEvent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/MobileTextFieldTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.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/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/TouchScrollEvent.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
@@ -161,6 +161,26 @@
  *  @productversion Flex 4
  */
 [Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark")]
+
+/**
+ *  When in touch interaction mode, the number of milliseconds to wait before showing the
+ *  component in a visually down state.
+ *
+ *
The reason for this delay is because when a user initiates a scroll gesture, we don't want
+ *  components to flicker as they touch the screen.  By having a reasonable delay, we make
+ *  sure that the user still gets feedback when they press down on a component, but that the
+ *  feedback doesn't come too quickly that it gets displayed during a scroll gesture
+ *  operation.

+ *
+ *
If the mobile theme is applied, the default value for this style is 100 ms for
+ *  components inside of a Scroller and 0 ms for components outside of a Scroller.

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="touchDelay", type="Number", format="Time", inherit="yes", minValue="0.0")]

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