Multiple fields adding, URL getter/setter

--- src/com/jonas/net/Multipart.as
+++ src/com/jonas/net/Multipart.as
@@ -5,45 +5,51 @@
 	import flash.utils.ByteArray;

 	/**
-	 *
+	 *
 	 * Based on RFC 1867 + real case observation
-	 *
+	 *
 	 * RFC 1867
 	 * https://tools.ietf.org/html/rfc1867
-	 *
+	 *
 	 */
-	public class Multipart
+	public class Multipart
 	{
 		private var _url:String;
 		private var _fields:Array = [];
 		private var _files:Array = [];
 		private var _data:ByteArray = new ByteArray();
-
-		public function  Multipart(url:String = null) {
+
+		public function Multipart(url:String = null) {
 			_url = url;
 		}

+		public function addFields(fields:Object):void {
+			for (var s:String in fields) {
+				addField(s, fields[s]);
+			}
+		}
+
 		public function addField(name:String, value:String):void {
 			_fields.push({name:name, value:value});
 		}
-
+
 		public function addFile(name:String, byteArray:ByteArray, mimeType:String, fileName:String):void {
 			_files.push({name:name, byteArray:byteArray, mimeType:mimeType, fileName:fileName});
 		}
-
+
 		public function clear():void {
 			_data = new ByteArray();
 			_fields = [];
 			_files = [];
 		}
-
-		public function get request():URLRequest
+
+		public function get request():URLRequest
 		{
 			var boundary: String = (Math.round(Math.random()*100000000)).toString();
-
+
 			var n:uint;
 			var i:uint;
-
+
 			// Add fields
 			n = _fields.length;
 			for(i=0; i<n; i++){
@@ -51,40 +57,48 @@
 					+'Content-Disposition: form-data; name="'+_fields[i].name+'"\r\n\r\n'
 					+_fields[i].value+'\r\n');
 			}
-
+
 			// Add files
 			n = _files.length;
 			for(i=0; i<n; i++){
 				_writeString('--'+boundary + '\r\n'
 					+'Content-Disposition: form-data; name="'+_files[i].name+'"; filename="'+_files[i].fileName+'"\r\n'
 					+'Content-Type: '+_files[i].mimeType+'\r\n\r\n');
-
+
 				_writeBytes(_files[i].byteArray);
 				_writeString('\r\n');
 			}
-
+
 			// Close
 			_writeString('--' + boundary + '--\r\n');
-
+
 			var r: URLRequest = new URLRequest(_url);
 			r.data = _data;
 			r.method = URLRequestMethod.POST;
 			r.contentType = "multipart/form-data; boundary=" + boundary;
-
+
 			// Tiago Ribeiro's suggestion
 			// Not necessary until proven otherwise
-			//r.requestHeaders.push(new URLRequestHeader("Content-type", "multipart/form-data; boundary=" + boundary));
-
+			//r.requestHeaders.push(new URLRequestHeader("Content-type", "multipart/form-data; boundary=" + boundary));
+
 			return r;
-
+
 		}
-
+		public function get url():String
+		{
+			return _url;
+		}
+		public function set url(value:String):void
+		{
+			_url = value;
+		}
+
 		private function _writeString(value:String):void {
 			var b:ByteArray = new ByteArray();
 			b.writeMultiByte(value, "ascii");
 			_data.writeBytes(b, 0, b.length);
 		}
-
+
 		private function _writeBytes(value:ByteArray):void {
 			//_writeString("....FILE....");
 			value.position = 0;


requirements default to a qty of 1 when not N/A

--- flexEditor/src/org/arisgames/editor/view/RequirementsEditorView.as
+++ flexEditor/src/org/arisgames/editor/view/RequirementsEditorView.as
@@ -193,6 +193,7 @@
 				r.requirement == AppConstants.REQUIREMENT_PLAYER_HAS_ITEM_DATABASE)
 			{
 				trace("RequirementEditorView: This requirement uses QTY");
+				r.requirementDetail2 = "1";
 			}
 			else
 			{


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.controls
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/collections/XMLListAdapter.as
+++ frameworks/projects/framework/src/mx/collections/XMLListAdapter.as
@@ -0,0 +1,665 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.collections
+{
+
+import flash.events.EventDispatcher;
+import flash.utils.getQualifiedClassName;
+import mx.events.CollectionEvent;
+import mx.events.CollectionEventKind;
+import mx.events.PropertyChangeEvent;
+import mx.events.PropertyChangeEventKind;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.utils.IXMLNotifiable;
+import mx.utils.XMLNotifier;
+import mx.utils.UIDUtil;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the IList has been updated in some way.
+ *
+ *  @eventType mx.events.CollectionEvent.COLLECTION_CHANGE
+ */
+[Event(name="collectionChange", type="mx.events.CollectionEvent")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[ExcludeClass]
+
+[ResourceBundle("collections")]
+
+/**
+ *  @private
+ *  A simple implementation of IList that uses a backing XMLList.
+ *  No ItemPendingErrors since the data is always local.
+ */
+public class XMLListAdapter extends EventDispatcher implements IList, IXMLNotifiable
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Construct a new XMLListAdapter using the specified XMLList as its source.
+     *  If no source is specified an empty XMLList will be used.
+     */
+    public function XMLListAdapter(source:XMLList = null)
+    {
+		super();
+
+        disableEvents();
+        this.source = source;
+        enableEvents();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Used for accessing localized Error messages.
+	 */
+	private var resourceManager:IResourceManager =
+									ResourceManager.getInstance();
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // length
+    //----------------------------------
+
+    /**
+     *  The number of items in this list.
+     *
+     *  @return -1 if the length is unknown while 0 means no items
+     */
+    public function get length():int
+    {
+        return source.length();
+    }
+
+    //----------------------------------
+    // source
+    //----------------------------------
+
+    private var _source:XMLList;
+
+    /**
+     *  The source XMLList for this XMLListAdapter.
+     *  Any changes done through the IList interface will be reflected in the
+     *  source XMLList.
+     *  If no source XMLList was supplied the XMLListAdapter will create one
+     *  internally.
+     *  Changes made directly to the underlying XMLList (e.g., calling
+     *  delete theList[someIndex] will not cause CollectionEvents
+     *  to be dispatched.
+     */
+    public function get source():XMLList
+    {
+        return _source;
+    }
+
+    public function set source(s:XMLList):void
+    {
+        var i:int;
+        var len:int;
+        if (_source && _source.length())
+        {
+            len = _source.length();
+            for (i = 0; i < len; i++)
+            {
+                stopTrackUpdates(_source[i]);
+            }
+        }
+        _source  = s ? s : XMLList(<></>);
+
+		// get a seed UID.  XML seems to have problems cleaning up
+		// UIDs, so this makes UIDs more similar and uses less
+		// memory
+		seedUID = UIDUtil.createUID();
+		uidCounter = 0;
+
+        len = _source.length();
+        for (i = 0; i < len; i++)
+        {
+            startTrackUpdates(_source[i], seedUID + uidCounter.toString());
+			uidCounter++;
+        }
+
+        if (_dispatchEvents == 0)
+        {
+			var event:CollectionEvent =
+				new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+			event.kind = CollectionEventKind.RESET;
+			dispatchEvent(event);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Add the specified item to the end of the list.
+     *  Equivalent to addItemAt(item, length);
+     *  @param item the item to add
+     */
+    public function addItem(item:Object):void
+    {
+        addItemAt(item, length);
+    }
+
+    /**
+     *  Add the item at the specified index.  Any item that was after
+     *  this index is moved out by one.  If the list is shorter than
+     *  the specified index it will grow to accomodate the new item.
+     *
+     *  @param item the item to place at the index
+     *  @param index the index at which to place the item
+     *  @throws RangeError if index is less than 0
+     */
+    public function addItemAt(item:Object, index:int):void
+    {
+        var message:String;
+
+        if (index < 0 || index > length)
+        {
+        	message = resourceManager.getString(
+        		"collections", "outOfBounds", [ index ]);
+        	throw new RangeError(message);
+        }
+
+		if (!(item is XML) && !(item is XMLList && item.length() == 1))
+		{
+			message = resourceManager.getString(
+				"collections", "invalidType");
+			throw new Error(message);
+		}
+
+		setBusy();
+
+    	//e4x doesn't provide an insertion operator so you tend to do
+    	//addition.  if we're inserting at the first item we you add
+    	//the old 1st to the new one.  if inserting in the middle or end
+    	//you just add to the one before
+        if (index == 0)
+            source[0] = length > 0 ? item + source[0] : item;
+        else
+            source[index - 1] += item;
+
+        startTrackUpdates(item, seedUID + uidCounter.toString());
+		uidCounter++;
+
+        if (_dispatchEvents == 0)
+        {
+            var event:CollectionEvent =
+				new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+            event.kind = CollectionEventKind.ADD;
+            event.items.push(item);
+            event.location = index;
+            dispatchEvent(event);
+        }
+
+		clearBusy();
+    }
+
+    /**
+     *  Get the item at the specified index.
+     *
+     *  @param index the index in the list from which to retrieve the item
+     *  @param	prefetch int indicating both the direction and amount of items
+     *			to fetch during the request should the item not be local.
+     *  @return the item at that index, null if there is none
+     *  @throws ItemPendingError if the data for that index needs to be
+     *                          loaded from a remote location
+     *  @throws RangeError if the index < 0 or index >= length
+     */
+    public function getItemAt(index:int, prefetch:int = 0):Object
+    {
+        if (index < 0 || index >= length)
+        {
+        	var message:String = resourceManager.getString(
+        		"collections", "outOfBounds", [ index ]);
+        	throw new RangeError(message);
+        }
+
+        return source[index];
+    }
+
+    /**
+     *  Return the index of the item if it is in the list such that
+     *  getItemAt(index) == item.  Note: unlike IViewCursor.findXXX
+     *  getItemIndex cannot take a representative object, it is
+     *  searching for an exact match.
+     *
+     *  @param item the item to find
+     *  @return the index of the item, -1 if the item is not in the list.
+     */
+    public function getItemIndex(item:Object):int
+    {
+        if (item is XML && source.contains(XML(item)))
+        {
+	        var len:int = length;
+	        for (var i:int = 0; i < len; i++)
+	        {
+	            var search:Object = source[i];
+	            if (search === item)
+	            {
+	                return i;
+	            }
+	        }
+        }
+        return -1;
+    }
+
+    /**
+     *  Notify the view that an item has been updated.  This is useful if the
+     *  contents of the view do not implement IEventDispatcher
+     *  and dispatches a PropertyChangeEvent.  If a property
+     *  is specified the view may be able to optimize its notification mechanism.
+     *  Otherwise it may choose to simply refresh the whole view.
+     *
+     *  @param item The item within the view that was updated.
+	 *
+     *  @param property A String, QName, or int
+	 *  specifying the property that was updated.
+	 *
+     *  @param oldValue The old value of that property.
+	 *  (If property was null, this can be the old value of the item.)
+	 *
+     *  @param newValue The new value of that property.
+	 *  (If property was null, there's no need to specify this
+	 *  as the item is assumed to be the new value.)
+     *
+     *  @see mx.events.CollectionEvent
+     *  @see mx.core.IPropertyChangeNotifier
+     *  @see mx.events.PropertyChangeEvent
+     */
+    public function itemUpdated(item:Object, property:Object = null,
+                                oldValue:Object = null,
+                                newValue:Object = null):void
+    {
+        var event:PropertyChangeEvent =
+			new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
+
+		event.kind = PropertyChangeEventKind.UPDATE;
+        event.source = item;
+        event.property = property;
+        event.oldValue = oldValue;
+        event.newValue = newValue;
+
+		itemUpdateHandler(event);
+    }
+
+    /**
+     * Remove all items from the list.
+     */
+    public function removeAll():void
+    {
+        if (length > 0)
+        {
+            for (var i:int=length - 1; i >= 0; i--)
+            {
+                stopTrackUpdates(source[i]);
+                delete source[i];
+            }
+
+            if (_dispatchEvents == 0)
+            {
+               var event:CollectionEvent =
+				new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+               event.kind = CollectionEventKind.RESET;
+               dispatchEvent(event);
+            }
+        }
+    }
+
+    /**
+     *  Remove the item at the specified index and return it.  Any items
+     *  that were after this index are now one index earlier.
+     *
+     *  @param index the index from which to remove the item
+     *  @return the item that was removed
+     *  @throws RangeError is index is less than 0 or greater than length
+     */
+    public function removeItemAt(index:int):Object
+    {
+        if (index < 0 || index >= length)
+        {
+        	var message:String = resourceManager.getString(
+        		"collections", "outOfBounds", [ index ]);
+        	throw new RangeError(message);
+        }
+
+		setBusy();
+
+        var removed:Object = source[index];
+        delete source[index];
+        stopTrackUpdates(removed);
+        if (_dispatchEvents == 0)
+        {
+            var event:CollectionEvent =
+				new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+            event.kind = CollectionEventKind.REMOVE;
+            event.location = index;
+            event.items.push(removed);
+            dispatchEvent(event);
+        }
+
+		clearBusy();
+
+        return removed;
+    }
+
+    /**
+     *  Place the item at the specified index.  If an item was already
+     *  at that index the new item will replace it and it will be returned.
+     *  If the list is shorter than the specified index it will grow to
+     *  to accomodate the new item.
+     *
+     *  @param item the new value for the index
+     *  @param index the index at which to place the item
+     *  @return the item that was replaced, null if none
+     *  @throws RangeError if index is less than 0
+     */
+    public function setItemAt(item:Object, index:int):Object
+    {
+        if (index < 0 || index >= length)
+        {
+        	var message:String = resourceManager.getString(
+        		"collections", "outOfBounds", [ index ]);
+        	throw new RangeError(message);
+        }
+
+        var oldItem:Object = source[index];
+        source[index] = item;
+        stopTrackUpdates(oldItem);
+        startTrackUpdates(item, seedUID + uidCounter.toString());
+		uidCounter++;
+
+        if (_dispatchEvents == 0)
+        {
+            var event:CollectionEvent =
+				new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+            event.kind = CollectionEventKind.REPLACE;
+            var updateInfo:PropertyChangeEvent =
+				new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
+            updateInfo.kind = PropertyChangeEventKind.UPDATE;
+            updateInfo.oldValue = oldItem;
+            updateInfo.newValue = item;
+            event.location = index;
+            event.items.push(updateInfo);
+            dispatchEvent(event);
+        }
+        return oldItem;
+    }
+
+    /**
+     *  Return an Array that is populated in the same order as the IList
+     *  implementation.
+     *
+     *  @throws ItemPendingError if the data is not yet completely loaded
+     *  from a remote location
+     */
+    public function toArray():Array
+    {
+        var s:XMLList = source;
+        var len:int = s.length();
+        var ret:Array = [];
+        for (var i:int = 0; i < len; i++)
+        {
+            ret[i] = s[i];
+        }
+        return ret;
+    }
+
+	/**
+     *  Pretty prints the contents of this XMLListAdapter to a string and returns it.
+     */
+	override public function toString():String
+	{
+		if (source)
+			return source.toString();
+		else
+			return getQualifiedClassName(this);
+	}
+
+	/**
+     *  True if we're processing a addItem or removeItem call
+     */
+	public function busy():Boolean
+	{
+		return (_busy != 0)
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    // Internal Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Enables event dispatch for this list.
+	 */
+	protected function enableEvents():void
+	{
+		_dispatchEvents++;
+		if (_dispatchEvents > 0)
+			_dispatchEvents = 0;
+	}
+
+	/**
+	 *  Disables event dispatch for this list.
+	 *  To re-enable events call enableEvents(), enableEvents() must be called
+	 *  a matching number of times as disableEvents().
+	 */
+	protected function disableEvents():void
+	{
+		_dispatchEvents--;
+	}
+
+	/**
+	 *  clears busy flag
+	 */
+	private function clearBusy():void
+	{
+		_busy++;
+		if (_busy > 0)
+			_busy = 0;
+	}
+
+	/**
+	 *  Sets busy flag.  Tree DP's check it so they
+	 *  know whether to fake events for it or not.
+	 */
+	private function setBusy():void
+	{
+		_busy--;
+	}
+
+    /**
+     *  Called whenever any of the contained items in the list fire an
+     *  ObjectChange event.
+     *  Wraps it in a CollectionEventKind.UPDATE.
+     */
+    protected function itemUpdateHandler(event:PropertyChangeEvent):void
+    {
+    	if (_dispatchEvents == 0)
+    	{
+	        var updateEvent:CollectionEvent =
+				new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+	        updateEvent.kind = CollectionEventKind.UPDATE;
+	        updateEvent.items.push(event);
+	        dispatchEvent(updateEvent);
+	    }
+    }
+
+    /**
+     * Called whenever an XML object contained in our list is updated
+     * in some way.  The initial implementation stab is very lenient,
+     * any changeType will cause an update no matter how much further down
+     * in a hierarchy.
+     */
+    public function xmlNotification(currentTarget:Object,
+                                        type:String,
+                                        target:Object,
+                                        value:Object,
+                                        detail:Object):void
+    {
+        var prop:String;
+        var oldValue:Object;
+        var newValue:Object;
+
+        if (currentTarget === target)
+        {
+	        switch(type)
+	        {
+	            case "attributeAdded":
+	            {
+	                prop = "@" + String(value);
+	                newValue = detail;
+	                break;
+	            }
+
+	            case "attributeChanged":
+	            {
+	                prop = "@" + String(value);
+	                oldValue = detail;
+	                newValue = target[prop];
+	                break;
+	            }
+
+	            case "attributeRemoved":
+	            {
+	                prop = "@" + String(value);
+	                oldValue = detail;
+	                break;
+	            }
+
+	            case "nodeAdded":
+	            {
+	                prop = value.localName();
+	                newValue = value;
+	                break;
+	            }
+
+	            case "nodeChanged":
+	            {
+	                prop = value.localName();
+	                oldValue = detail;
+	                newValue = value;
+	                break;
+	            }
+
+	            case "nodeRemoved":
+	            {
+	                prop = value.localName();
+	                oldValue = value;
+	                break;
+	            }
+
+	            case "textSet":
+	            {
+	                prop = String(value);
+	                newValue = String(target[prop]);
+	                oldValue = detail;
+	                break;
+	            }
+
+	            default:
+				{
+	                break;
+				}
+	        }
+        }
+		else if (type == "textSet")
+		{
+			var par:* = target.parent();
+			if (par != undefined)
+			{
+				var gpar:* = par.parent();
+				if (gpar === currentTarget)
+				{
+					prop = par.name().toString();
+					newValue = value;
+					oldValue = detail;
+				}
+			}
+		}
+
+        itemUpdated(currentTarget, prop, oldValue, newValue);
+    }
+
+    /**
+     *  This is called by addItemAt and when the source is initially
+     *  assigned.
+     */
+    protected function startTrackUpdates(item:Object, uid:String):void
+    {
+        XMLNotifier.getInstance().watchXML(item, this, uid);
+    }
+
+    /**
+     *  This is called by removeItemAt, removeAll, and before a new
+     *  source is assigned.
+     */
+    protected function stopTrackUpdates(item:Object):void
+    {
+        XMLNotifier.getInstance().unwatchXML(item, this);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  indicates if events should be dispatched.
+	 *  calls to enableEvents() and disableEvents() effect the value when == 0
+	 *  events should be dispatched.
+	 */
+	private var _dispatchEvents:int = 0;
+
+	/**
+	 *  non-zero if we're processing an addItem or removeItem
+	 */
+	private var _busy:int = 0;
+
+	private var seedUID:String;
+
+	private var uidCounter:int = 0;
+
+}
+
+}


fix frameworkSWC() test in SDKSWCTests

fix frameworkSWC() test in SDKSWCTests

--- frameworks/projects/framework/src/mx/collections/XMLListAdapter.as
+++ frameworks/projects/framework/src/mx/collections/XMLListAdapter.as
@@ -416,8 +416,8 @@
 	 */
 	public function removeItem( item:Object ):Boolean
 	{
-		var item:Object = removeItemAt[getItemIndex(item)];
-		return item != null;
+		var _item:Object = removeItemAt[getItemIndex(item)];
+		return _item != null;
 	}

     /**


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 3725
Author:   gosmith@adobe.com
Date:     2008-10-17T21:50:05.154403Z

Log Message:
-----------
If both 'text' and 'content' are set on TextGraphic, TextView, or FxTextArea during the same invalidation cycle, the last one set now wins. This is similar to how 'text' and 'htmlText' work in Halo components. Previously 'content' won over 'text', but this caused problems such as SDK-17023.

You should not set both 'text' and 'content' on an MXML tag. It makes no sense to do so, and the result is unpredictable because the compiler doesn't guarantee the order in which MXML attributes get applied to a component.

Reviewer: Ryan
Bugs: SDK-17023
QA: No
Doc: No

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

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -558,11 +558,6 @@
      */
     public function set text(value:String):void
     {
-        // If 'text' is being set after 'content', ignore it
-        // because 'content' has precedence.
-        if (contentChanged)
-            return;
-
         // Setting 'text' temporarily causes 'content' to become null.
         // Later, after the 'text' has been committed into the TextFlow,
         // getting 'content' will return the TextFlow.


Transferred from the Adobe Open Source Subversion Repository

Revision: 8452
Author:   cframpto@adobe.com
Date:     2009-07-08T15:38:32.261224Z

Log Message:
-----------
- Fix flicker problem with constraint bound text that is being autoSized.  If the remeasure is done in a 2nd pass you will see a flicker as all the objects are moved to accommodate the reflowed text.
- Fix data binding issue with text setter.
- Rework measure() to accommodate implicit autoSize.

If explicitWidth or widthInChars specified and explicitHeight or heightInLines specified, or for now, blockProgression != "tb", the text has fixed dimensions and is not auto-sized.

If no text and width specified, but no height, start at specified width and one line high and grow taller.
If no text and height specified, start at 1 char wide with the specified height and grow wider.
If neither width nor height specified, and toFit lineBreaks, start at explicitMaxWidth, or default maxWidth of 160, and grow taller.
If neither width nor height specified, and explicit lineBreaks width is unlimited and can grow taller.

These are further constrained by min/max Width and Height except in the case that explicitWidth or explicitHeight are specified.

- Change default maxWidth for RichText and SimpleText to 160 to match RET.  Previously it was 10000.  This is used for
text with toFit lineBreaks if a width isn't specified.

QA Notes: 12 or so TextGraphic tests fail because of the new default maxWidth.
Doc Notes:SDK-22014, SDK-21837
Reviewers: Gordon

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

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -49,6 +49,7 @@
 import flashx.textLayout.events.FlowOperationEvent;
 import flashx.textLayout.events.SelectionEvent;
 import flashx.textLayout.events.StatusChangeEvent;
+import flashx.textLayout.formats.BlockProgression;
 import flashx.textLayout.formats.Category;
 import flashx.textLayout.formats.FormatValue;
 import flashx.textLayout.formats.ITextLayoutFormat;
@@ -81,10 +82,11 @@
 import spark.core.NavigationUnit;
 import spark.events.TextOperationEvent;
 import spark.primitives.supportClasses.RichEditableTextContainerManager;
+import spark.primitives.supportClasses.RichEditableTextEditManager;
 import spark.utils.TextUtil;

 use namespace mx_internal;
-//use namespace tlf_internal;
+use namespace tlf_internal;

 //--------------------------------------
 //  Events
@@ -477,6 +479,12 @@

     /**
      *  @private
+     *  Source of text: one of "text", "textFlow" or "content".
+     */
+    private var source:String = "";
+
+    /**
+     *  @private
      *  True if TextOperationEvent.CHANGING should be dispatched at
      *  operationEnd.
      */
@@ -540,6 +548,13 @@
      */
     private var widthConstraint:Number = NaN;

+    /**
+     *  @private
+     *  Cache the height constraint as set by the layout in setLayoutBoundsSize()
+     *  so that text reflow can be calculated during a subsequent measure pass.
+     */
+    private var heightConstraint:Number = NaN;
+
     /**
      *  @private
      *  True if this component sizes itself based on its actual
@@ -587,6 +602,22 @@

         invalidateProperties();
         invalidateDisplayList();
+    }
+
+    //----------------------------------
+    //  maxWidth
+    //----------------------------------
+
+    override public function get maxWidth():Number
+    {
+        if (autoSize)
+        {
+            return !isNaN(explicitMaxWidth) ?
+                   explicitMaxWidth :
+                   UIComponent.DEFAULT_MEASURED_WIDTH;      // 160 not 10000
+        }
+
+        return super.maxWidth;
     }

     //--------------------------------------------------------------------------
@@ -842,6 +873,7 @@

         _content = value;
         contentChanged = true;
+        source = "content";

         // Of 'text', 'textFlow', and 'content', the last one set wins.
         textChanged = false;
@@ -1399,18 +1431,21 @@
         // (which is the default state).
         if (value == null)
             value = "";
-
-        // Don't return early if value is the same as _text,
-        // because _text might have been produced from setting
-        // 'textFlow' or 'content'.
-        // For example, if you set a TextFlow corresponding to
-        // "Hello World"
+
+        // If value is the same as _text, make sure if was not produced from
+        // setting 'textFlow' or 'content'.  For example, if you set a TextFlow
+        // corresponding to "Hello World"
         // and then get the 'text', it will be the String "Hello World"
         // But if you then set the 'text' to "Hello World"
         // this represents a change: the "World" should no longer be red.
-
+        //
+        // Note: this is needed to stop two-binding from recursing.
+        if (source == "text" && text == value)
+            return;
+
         _text = value;
         textChanged = true;
+        source = "text";

         // Of 'text', 'textFlow', and 'content', the last one set wins.
         textFlowChanged = false;
@@ -1482,6 +1517,7 @@

         _textFlow = value;
         textFlowChanged = true;
+        source = "textFlow";

         // Of 'text', 'textFlow', and 'content', the last one set wins.
         textChanged = false;
@@ -1681,10 +1717,7 @@
                 // change the displayed text.
                 _text = text;

-                // FIXME (cframpto): if content, should the paragraph terminators
-                // be left in the string so the displayAsPassword string has the
-                // same form as the original string?  This is only an issue
-                // for TextArea.
+                // Paragraph terminators are lost during this substitution.
                 var textToDisplay:String = StringUtil.repeat(
                     passwordChar, _text.length);

@@ -1740,7 +1773,7 @@

             _textContainerManager.verticalScrollPosition =
                 _verticalScrollPosition;
-
+
             dispatchPropertyChangeEvent("verticalScrollPosition",
                 oldVerticalScrollPosition, _verticalScrollPosition);

@@ -1758,101 +1791,169 @@
                                 width:Number, height:Number,
                                 postLayoutTransform:Boolean = true):void
     {
-        //trace("setLayoutBoundsSize", width, height);
+        //trace("setLayoutBoundsSize", width, height, "autoSize", autoSize);
+
+        // If both values are constrained don't need to remeasure.
+        if (!isNaN(width) && !isNaN(height))
+            autoSize = false;
+
+        if (autoSize)
+        {
+            // Only autoSize cares about the real measured width.  This may
+            // update measuredWidth and measuredHeight with new values which
+            // will be used by the layout manager when the object's actual
+            // size is set.
+            remeasureConstrainedText(width, height, postLayoutTransform);
+        }

         super.setLayoutBoundsSize(width, height, postLayoutTransform);
-
-        // Only autoSize cares about the real measured width.
-        if (!autoSize)
-            return;
-
-        // FIXME (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 (super.skipMeasure())
-            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 RichEditableText 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;
-
-        // We support reflow only when we don't have a transform.
-        // We could add support for scale, but not skew or rotation.
-        var matrix:Matrix = postLayoutTransform ? nonDeltaLayoutMatrix() : null;
-        if (matrix != null)
-            return;
-
-        widthConstraint = width;
-
-        invalidateSize();
-    }
-
+    }
+
     /**
      *  @private
      */
     override protected function skipMeasure():Boolean
     {
-        // If any of width, height, widthInChars or heightInLines is specified
-        // we're not autoSizing.
-        autoSize = isNaN(explicitWidth) && isNaN(explicitHeight) &&
-                   isNaN(heightInLines) && isNaN(widthInChars);
+        autoSize = false;
+        return super.skipMeasure();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();

-        // If we're autoSizing, make sure we aren't scrolled from
-        // previously not being autoSized.
-        if (autoSize)
-        {
-            _textContainerManager.horizontalScrollPosition = 0;
-            _textContainerManager.verticalScrollPosition = 0;
-        }
-
-        return super.skipMeasure();
-    }
-
-    /**
-     *  @private
-     */
-    override protected function measure():void
-    {
-        super.measure();
-
-        if (autoSize)
-        {
-            measureForAutoSize();
-        }
-        else
-        {
+        // percentWidth and/or percentHeight will come back in as constraints
+        // on the remeasure if we're autoSizing.
+
+        // TODO:(cframpto) implement blockProgression rl for autoSize
+
+        if (isMeasureFixed())
+        {
+            autoSize = false;
+
             // Go large.  For performance reasons, want to avoid a scrollRect
             // whenever possible in drawBackgroundAndSetScrollRect().  This is
             // particularly true for 1 line TextInput components.
-            measuredWidth = Math.ceil(calculateWidthInChars());
-            measuredHeight = Math.ceil(calculateHeightInLines());
-        }
-
-        //trace("measure", measuredWidth, measuredHeight);
+            measuredWidth = !isNaN(explicitWidth) ? explicitWidth :
+                            Math.ceil(calculateWidthInChars());
+            measuredHeight = !isNaN(explicitHeight) ? explicitHeight :
+                             Math.ceil(calculateHeightInLines());
+        }
+        else
+        {
+            var composeWidth:Number;
+            var composeHeight:Number;
+
+            var bounds:Rectangle;
+
+            // If we're here, then at one or both of the width and height can
+            // grow to fit the text.  It is important to figure out whether
+            // or not autoSize should be allowed to continue.  If in
+            // updateDisplayList(), autoSize is true, then the
+            // compositionHeight is NaN to allow the text to grow.
+            autoSize = true;
+
+            if (!isNaN(widthConstraint) || !isNaN(explicitWidth) ||
+                !isNaN(widthInChars))
+            {
+                // width specified but no height
+                // if no text, start at one line high and grow
+
+                if (!isNaN(widthConstraint))
+                    composeWidth = widthConstraint;
+                else if (!isNaN(explicitWidth))
+                    composeWidth = explicitWidth;
+                else
+                    composeWidth = Math.ceil(calculateWidthInChars());
+
+                // The composeWidth may be adjusted for minWidth/maxWidth
+                // except if we're using the explicitWidth.
+                bounds = measureTextSize(composeWidth);
+
+                measuredWidth = _textContainerManager.compositionWidth;
+                measuredHeight = Math.ceil(bounds.height);
+            }
+            else if (!isNaN(heightConstraint) || !isNaN(explicitHeight) ||
+                     !isNaN(_heightInLines))
+            {
+                // if no text, 1 char wide with specified height and grow
+
+                composeWidth =
+                    hostFormat.lineBreak == "toFit" ? maxWidth : NaN;
+
+                if (!isNaN(heightConstraint))
+                    composeHeight = heightConstraint;
+                else if (!isNaN(explicitHeight))
+                    composeHeight = explicitHeight;
+                else
+                    composeHeight = calculateHeightInLines();
+
+                // The composeWidth may be adjusted for minWidth/maxWidth.
+                bounds = measureTextSize(composeWidth);
+
+                // Have we already hit the limit with the existing text?  If we
+                // are beyond the composeHeight we can assume we've maxed out on
+                // the compose width as well.
+                if (bounds.height > composeHeight)
+                {
+                    measuredWidth = _textContainerManager.compositionWidth;
+                    measuredHeight = composeHeight;
+                    autoSize = false;
+                }
+                else
+                {
+                    measuredWidth = Math.ceil(bounds.width);
+                    measuredHeight = composeHeight;
+                }
+            }
+            else
+            {
+                // If toFit line breaks and no text, start at explicitMaxWidth
+                // or default to 160 and grow.
+                // If explicit line breaks and no text, width is NaN
+
+                composeWidth =
+                    hostFormat.lineBreak == "toFit" ? maxWidth : NaN;
+
+                // The composeWidth may be adjusted for minWidth/maxWidth.
+                bounds = measureTextSize(composeWidth);
+
+                measuredWidth = Math.ceil(bounds.width);
+                measuredHeight = Math.ceil(bounds.height);
+            }
+
+            // Clamp the height, except if we're using the explicitHeight.
+            if (isNaN(explicitHeight))
+            {
+                if (!isNaN(explicitMinHeight) && measuredHeight < explicitMinHeight)
+                    measuredHeight = explicitMinHeight;
+
+                // Reached max height so can't grow anymore.
+                if (!isNaN(explicitMaxHeight) && measuredHeight > explicitMaxHeight)
+                {
+                    measuredHeight = explicitMaxHeight;
+                    autoSize = false;
+                }
+            }
+
+            // Make sure we weren't previously scrolled.
+            if (autoSize)
+             {
+                ignoreDamageEvent = true;
+
+                _textContainerManager.horizontalScrollPosition = 0;
+                _textContainerManager.verticalScrollPosition = 0;
+
+                ignoreDamageEvent = false;
+             }
+
+             invalidateDisplayList();
+        }
+
+        //trace("measure", measuredWidth, measuredHeight, "autoSize", autoSize);
     }

     /**
@@ -1861,20 +1962,25 @@
     override protected function updateDisplayList(unscaledWidth:Number,
                                                   unscaledHeight:Number):void
     {
-        //trace("updateDisplayList", unscaledWidth, unscaledHeight);
+        // If we need to remeasure don't bother updating the display.
+        if (invalidateSizeFlag)
+            return;
+
+        //trace("updateDisplayList", unscaledWidth, unscaledHeight, "autoSize", autoSize);

         super.updateDisplayList(unscaledWidth, unscaledHeight);

         // If we're autoSizing we're telling the layout manager one set of
         // values and TLF another set of values so there is room for the text
-        // to grow.  The composition values for autoSize were set when the
-        // text was measured.
-        if (!autoSize)
-        {
-            _textContainerManager.compositionWidth = unscaledWidth;
-            _textContainerManager.compositionHeight = unscaledHeight;
-        }
-
+        // to grow.
+        ignoreDamageEvent = true;
+
+        _textContainerManager.compositionWidth = unscaledWidth;
+        _textContainerManager.compositionHeight = autoSize ? NaN :
+                                                  unscaledHeight;
+
+        ignoreDamageEvent = false;
+
 		if (debug)
 			trace("updateContainer()");

@@ -1944,6 +2050,58 @@
         invalidateProperties();
     }

+    //----------------------------------
+    // explicitHeight
+    //----------------------------------
+
+    override public function set explicitHeight(value:Number):void
+    {
+        super.explicitHeight = value;
+
+        // Because of autoSizing, the size and display might be impacted.
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    // explicitWidth
+    //----------------------------------
+
+    override public function set explicitWidth(value:Number):void
+    {
+        super.explicitWidth = value;
+
+        // Because of autoSizing, the size and display might be impacted.
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    // percentHeight
+    //----------------------------------
+
+    override public function set percentHeight(value:Number):void
+    {
+        super.percentHeight = value;
+
+        // If we were autoSizing and now we are not we need to remeasure.
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    // percentWidth
+    //----------------------------------
+
+    override public function set percentWidth(value:Number):void
+    {
+        super.percentWidth = value;
+
+        // If we were autoSizing and now we are not we need to remeasure.
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Methods: IViewport
@@ -1976,7 +2134,6 @@
         // Scroll by a "character" which is 1 em (matches widthInChars()).
         var em:Number = getStyle("fontSize");

-        // FIXME (cframpto): what if blockDirection!=TB and direction!=LTR?
         switch (navigationUnit)
         {
             case NavigationUnit.LEFT:
@@ -2025,7 +2182,6 @@
         var maxDelta:Number = contentHeight - scrollR.bottom;
         var minDelta:Number = -scrollR.top;

-        // FIXME (cframpto): what if blockDirection!=TB and direction!=LTR?
         switch (navigationUnit)
         {
             case NavigationUnit.UP:
@@ -2211,77 +2367,151 @@
         releaseSelectionManager();

     }
-
-    /**
-     *  @private
-     *  If the explicit widths and heights are not set to NaN, the
-     *  measuredWidth and measuredHeight are clamped down to these values
-     *  when measure() returns to UIComponent.measureSizes().
-     */
-    private function measureForAutoSize():void
-    {
-        var composeWidth:Number;
-
-        // Need to set a width to cause a wrap.  Use constrainedWidth,
-        // explicit maxWidth or default for maxWidth, in that order.
-        // Never compose over max width because the width will always be
-        // adjusted down to this and it's easy to get into an infinite
-        // measure/update display loop.
-        if (hostFormat.lineBreak == "toFit")
-        {
-            // Constrain the width if it's less than maxWidth.
-            if (!isNaN(widthConstraint) && widthConstraint <= maxWidth)
-            {
-                composeWidth = widthConstraint
-            }
-            else
-            {
-                // The default maxWidth is 10000 which isn't a
-                // reasonable default for the autoSize width so use the default
-                // measured width which is 160 instead.
-                composeWidth = !isNaN(explicitMaxWidth) ?
-                               explicitMaxWidth :
-                               UIComponent.DEFAULT_MEASURED_WIDTH;
-            }
-            explicitMinWidth = NaN;
-        }
-        else
-        {
-            // Let the text determine the width.  Ignore explicit widths.
-            composeWidth = NaN;
-            explicitMinWidth = explicitMaxWidth = NaN;
-        }
-
-        // Ignore all explicit heights.
-        explicitMinHeight = explicitMaxHeight = NaN;
-
+
+    /**
+     *  @private
+     *  Return true if there is a width and height to use for the measure.
+     */
+    private function isMeasureFixed():Boolean
+    {
+        return ((!isNaN(explicitWidth) || !isNaN(_widthInChars)) &&
+                (!isNaN(explicitHeight) || !isNaN(_heightInLines)) ||
+                hostFormat.blockProgression != BlockProgression.TB);
+    }
+
+    /**
+     *  @private
+     *  Returns the bounds of the measured text.  The initial composeWidth may
+     *  be adjusted for minWidth or maxWidth.  The value used for the compose
+     *  is in _textContainerManager.compositionWidth.
+     */
+    private function measureTextSize(composeWidth:Number):Rectangle
+    {
+        var clampWidth:Boolean = isNaN(explicitWidth);
+
+        // Don't want to trigger a another remeasure when we compose the text.
+        ignoreDamageEvent = true;
+
+        // Up the composeWidth if it isn't at least minWidth so we get an
+        // accurate measurement.
+        if (clampWidth &&
+            !isNaN(explicitMinWidth) && composeWidth < explicitMinWidth)
+        {
+            composeWidth = explicitMinWidth;
+        }
+
         // The bottom border can grow to allow all the text to fit.
         // If dimension is NaN, composer will measure text in that
-        // direction.
+        // direction.  This can cause a damage event if changed.
         _textContainerManager.compositionWidth = composeWidth;
         _textContainerManager.compositionHeight = NaN;

-        // Compose only.  The display is not updated.
+        // Compose only.  The display should not be updated.
         _textContainerManager.compose();

-        var contentBounds:Rectangle = _textContainerManager.getContentBounds();
-
+        var bounds:Rectangle = _textContainerManager.getContentBounds();
+
+        // Remeasure if the composed width was restricted by max width.
+        // Typical this is done in validateSize() after returing from measure()
+        // but it impacts our calculations so we need to do it now.
+        if (clampWidth &&
+            !isNaN(explicitMaxWidth) && bounds.width > explicitMaxWidth)
+        {
+            _textContainerManager.compositionWidth = composeWidth;
+            _textContainerManager.compose();
+            bounds = _textContainerManager.getContentBounds();
+        }
+
         // If it's an empty text flow, there is one line with one
-        // character so the height is good for the line.
-        measuredHeight = Math.ceil(contentBounds.height);
-
-        if (_textContainerManager.getText().length > 0)
-        {
-            // Text flow with a terminator (which has width).
-            measuredWidth = Math.ceil(contentBounds.width);
-        }
-        else
+        // character so the height is good for the line but we
+        // need to give it some width.
+
+         if (_textContainerManager.getText().length == 0)
         {
             // Empty text flow.  One Em wide so there
             // is a place to put the insertion cursor.
-            measuredWidth = Math.ceil(contentBounds.width +
-                                       getStyle("fontSize"));
+            bounds.width = bounds.width + getStyle("fontSize");
        }
+
+       ignoreDamageEvent = false;
+
+       //trace("measureTextSize", composeWidth, "->", bounds.width, bounds.height);
+
+       return bounds;
+    }
+
+
+    /**
+     *  @private
+     *
+     *  This assumes one of width or height is constrained, but not both.
+     *  If both are constrained there is no need to remeasure the text.
+     */
+    private function remeasureConstrainedText(
+                                width:Number, height:Number,
+                                postLayoutTransform:Boolean = true):void
+    {
+        // If we have a transform we don't support reflow.
+        // We could add support for scale, but not skew or rotation.
+        if (postLayoutTransform && nonDeltaLayoutMatrix() != null)
+        {
+            autoSize = false;
+            return;
+        }
+
+        if (!isNaN(width))
+        {
+            // Did we already constrain the width?
+            if (widthConstraint == width)
+                return;
+
+            // Note that we compare with measuredWidth,
+            // as for example the RichEditableText 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.
+            if (width == measuredWidth || width == 0)
+                return;
+
+            // No reflow for explicit lineBreak
+            if (hostFormat.lineBreak == "explicit")
+                return;
+
+            // Do we have a constrained width and an explicit height?
+            // If so, the sizes are set so no need to remeasure now.
+            if (!isNaN(explicitHeight) || !isNaN(_heightInLines))
+            {
+                autoSize = false;
+                return;
+            }
+
+            widthConstraint = width;
+        }
+        else
+        {
+            // Did we already constrain the height?
+            if (height == heightConstraint)
+                return;
+
+            if (height == measuredHeight || height == 0)
+                return;
+
+            // Do we have a constrained height and an explicit width?
+            // If so, the sizes are set so no need to remeasure now.
+            if (!isNaN(explicitWidth) || !isNaN(_widthInChars))
+            {
+                autoSize = false;
+                return;
+            }
+
+            heightConstraint = height;
+        }
+
+        // Force the remeasure now.  We don't want to do it in two passes
+        // because there is flicker as the display objects are updated with the
+        // sizes and positions from layout pass1 and then from layout pass 2.
+        invalidateSize();
+        validateSize();
     }

     /**
@@ -2365,7 +2595,7 @@
         // If both height and width are NaN use 15 chars.  Otherwise if only
         // width is NaN, use 1.
     	if (isNaN(_widthInChars))
-    	   effectiveWidthInChars = isNaN(_heightInLines) ? 15 : 1;
+    	   effectiveWidthInChars = isNaN(_heightInLines) ? 10 : 1;
     	else
     	   effectiveWidthInChars = _widthInChars;

@@ -2548,26 +2778,8 @@
      *  @productversion Flex 4
      */
     public function insertText(text:String):void
-    {
-        // Make sure all properties are committed before doing the insert.
-        validateNow();
-
-        // Always use the EditManager regardless of the values of
-        // selectable, editable and enabled.
-        var editManager:IEditManager = getEditManager();
-
-        // If no selection, then it's an append.
-         if (!editManager.hasSelection())
-            editManager.selectRange(int.MAX_VALUE, int.MAX_VALUE);
-
-        // Force the insertion to happen right away rather than on the next
-        // frame.  We need the selection to change and our damage handler to
-        // be invoked to invalidate the text and update the display list.
-        editManager.insertText(text);
-        editManager.flushPendingOperations();
-
-        // All done with edit manager.
-        releaseEditManager();
+    {
+        handleInsertText(text);
     }

     /**
@@ -2584,24 +2796,7 @@
      */
     public function appendText(text:String):void
     {
-        // Make sure all properties are committed before doing the append.
-        validateNow();
-
-        // Always use the EditManager regardless of the values of
-        // selectable, editable and enabled.
-        var editManager:IEditManager = getEditManager();
-
-        // An append is an insert with the selection set to the end.
-        editManager.selectRange(int.MAX_VALUE, int.MAX_VALUE);
-
-        // Force the insertion to happen right away rather than on the next
-        // frame.  We need the selection to change and our damage handler to
-        // be invoked to invalidate the text and update the display list.
-        editManager.insertText(text);
-        editManager.flushPendingOperations();
-
-        // All done with edit manager.
-        releaseEditManager();
+        handleInsertText(text, true);
     }

     /**
@@ -2638,7 +2833,7 @@
         // to Property instances.
         // Each Property instance has a category property which tells
         // whether it is container-, paragraph-, or character-level.
-        var description:Object = TextLayoutFormat.tlf_internal::description;
+        var description:Object = TextLayoutFormat.description;

         var p:String;
         var category:String;
@@ -2771,7 +2966,7 @@
         // to Property instances.
         // Each Property instance has a category property which tells
         // whether it is container-, paragraph-, or character-level.
-        var description:Object = TextLayoutFormat.tlf_internal::description;
+        var description:Object = TextLayoutFormat.description;

         for (var p:String in description)
         {
@@ -2815,6 +3010,39 @@
         releaseEditManager();
     }

+    /**
+     *  @private
+     *
+     *  This is used when text is either inserted or appended via the API.
+     */
+    private function handleInsertText(text:String, isAppend:Boolean=false):void
+    {
+        // Make sure all properties are committed before doing the append.
+        validateProperties();
+
+        // Always use the EditManager regardless of the values of
+        // selectable, editable and enabled.
+        var editManager:IEditManager = getEditManager();
+
+        // An append is an insert with the selection set to the end.
+        // If no selection, then it's an append.
+         if (isAppend || !editManager.hasSelection())
+            editManager.selectRange(int.MAX_VALUE, int.MAX_VALUE);
+
+        // Insert the text.  It will be composed but the display will not be
+        // updated because of our override of
+        // EditManager.updateAllControllers().
+        editManager.insertText(text);
+
+        // All done with edit manager.
+        releaseEditManager();
+
+        // The insertion will generate a damage event which will invalidate
+        // the size and the display list.
+        validateSize();
+        validateDisplayList();
+    }
+
 	/**
 	 *  @private
 	 */
@@ -2828,7 +3056,7 @@
         // If copied/cut from displayAsPassword field the pastedText
         // is '*' characters but this is correct.
         var pastedText:String = TextUtil.extractText(
-            textScrap.tlf_internal::textFlow);
+            textScrap.textFlow);

         // We know it's an EditManager or we wouldn't have gotten here.
         var editManager:IEditManager = getEditManager();
@@ -2978,6 +3206,7 @@
         // Make sure that if we did a double pass, next time around we'll
         // measure normally
         widthConstraint = NaN;
+        heightConstraint = NaN;
     }

     /**
@@ -3002,13 +3231,13 @@
             dispatchChangeEvent = false;
         }

-        var dimensionChanged:Boolean = false;
         var oldContentWidth:Number = _contentWidth;

         var newContentBounds:Rectangle =
             _textContainerManager.getContentBounds();
         var newContentWidth:Number = newContentBounds.width;

+        // TODO:(cframpto) Figure out if we still need these checks.
         // Error correction for rounding errors.  It shouldn't be so but
         // the contentWidth can be slightly larger than the requested
         // compositionWidth.
@@ -3027,8 +3256,6 @@

             dispatchPropertyChangeEvent(
                 "contentWidth", oldContentWidth, newContentWidth);
-
-            dimensionChanged = true;
         }

         var oldContentHeight:Number = _contentHeight;
@@ -3052,16 +3279,7 @@

             dispatchPropertyChangeEvent(
                 "contentHeight", oldContentHeight, newContentHeight);
-
-            dimensionChanged = true;
         }
-
-        // If autoSize and text size changed, need to remeasure.
-        if (dimensionChanged && autoSize)
-        {
-            invalidateSize();
-            invalidateDisplayList();
-        }
     }

     /**
@@ -3071,13 +3289,13 @@
      */
     private function textContainerManager_damageHandler(event:DamageEvent):void
     {
-        //trace("damageHandler", id, event.damageAbsoluteStart, event.damageLength);
-
         // setText triggers a damage event which we want to ignore.  We
         // override TCM.setText() in RETCM and set this flag before calling the
         // superclass.
         if (ignoreDamageEvent || event.damageLength == 0)
             return;
+
+        //trace("damageHandler", id, event.damageAbsoluteStart, event.damageLength);

         // If there are pending changes, don't wipe them out.  We have
         // not gotten to commitProperties() yet.
@@ -3099,7 +3317,12 @@
         // because the hostFormat and the _textFlow are still valid.

         invalidateSize();
-        invalidateDisplayList();
+        invalidateDisplayList();
+
+        // This is necessary to get any constraints there are reapplied by
+        // the layout manager.  This matters if we are auto-sizing text.
+        if (!isMeasureFixed())
+            invalidateParentSizeAndDisplayList();
     }

     /**


Modified ESC key handling to give priority to dismiss file selector when it is displayed.

--- Bin/Data/Scripts/Editor/EditorUI.as
+++ Bin/Data/Scripts/Editor/EditorUI.as
@@ -703,12 +703,12 @@
     if (key == KEY_ESC)
     {
         UIElement@ front = ui.frontElement;
-        if (uiHidden)
+        if (uiFileSelector !is null && front is uiFileSelector.window)
+            CloseFileSelector();
+        else if (uiHidden)
             UnhideUI();
         else if (console.visible)
             console.visible = false;
-        else if (uiFileSelector !is null && front is uiFileSelector.window)
-            CloseFileSelector();
         else if (front is settingsDialog || front is preferencesDialog)
         {
             ui.focusElement = null;
@@ -801,8 +801,8 @@
     Array<UIElement@> children = ui.root.GetChildren();
     for (uint i = 0; i < children.length; ++i)
     {
-        // Cursor, FileSelector, and editorUIElement are excluded
-        if (children[i].type != CURSOR_TYPE && children[i] !is editorUIElement && (uiFileSelector is null || children[i] !is uiFileSelector.window))
+        // Cursor and editorUIElement are excluded
+        if (children[i].type != CURSOR_TYPE && children[i] !is editorUIElement)
         {
             if (visible)
             {


whitespace

whitespace

--- WeaveAPI/src/weave/api/ui/ILinkableObjectEditor.as
+++ WeaveAPI/src/weave/api/ui/ILinkableObjectEditor.as
@@ -18,7 +18,7 @@
 	import mx.core.IUIComponent;

 	import weave.api.core.ILinkableObject;
-
+
 	/**
 	 * This is an interface to an editor for an ILinkableObject.
 	 */
@@ -27,13 +27,13 @@
 		/**
 		 * Sets the target object to be edited.
 		 * @param object The target object.
-		 */
+		 */
 		function setTarget(object:ILinkableObject):void;

 		/**
 		 * Checks if the user has made any unsaved changes.
 		 * @return true if there are unsaved changes.
-		 */
+		 */
 		function hasPendingChanges():Boolean;

 		/**
@@ -41,4 +41,4 @@
 		 */
 		function applyChanges():void;
 	}
-}+}


format code Cookie.as

format code Cookie.as


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3139
Author:   jimurphy@adobe.com
Date:     2008-09-08T15:42:37.788151Z

Log Message:
-----------
Merged 3.0.x revisions [3074,3079-3080,3086,3094,3096,3098,3101-3102,3104,3108,3114,3123,3125-3126] -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FocusRequestDirection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/NetConnectionChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/EventListenerRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/config/ServerConfig.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/SecurityUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxMouseEvent.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterDragManagerEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/SWFBridgeGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SWFBridgeEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextFormat.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InvalidateRequestData.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISWFBridgeProvider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterManagerRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SWFBridgeRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISWFBridgeGroup.as</path>

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

--- frameworks/projects/framework/src/mx/core/ISWFBridgeProvider.as
+++ frameworks/projects/framework/src/mx/core/ISWFBridgeProvider.as
@@ -16,11 +16,11 @@

 /**
  *  An implementor of ISWFProvider provides a bridge
- *  to an application in a different sandbox
+ *  to an application in a different security sandbox
  *  or to an application that was compiled with a different version
- *  of Flex and is running in a separate ApplicationDomain.
- *  This interface allows a caller to get a bridge to that application.
- *  Once the caller has the bridge it can then dispatch events
+ *  of the Flex compiler and is running in a separate ApplicationDomain.
+ *  This interface lets a caller get a bridge to that application.
+ *  Once the caller has the bridge, it can then dispatch events
  *  to the application.
  */
 public interface ISWFBridgeProvider
@@ -36,25 +36,25 @@
     //----------------------------------

     /**
-     *  A bridge to the application associated with the implementor of this
+     *  A bridge to the application that is associated with the implementor of this
      *  interface. The IEventDispatcher that can be used to send events to an
      *  application in a different ApplicationDomain or a different sandbox.
      */
     function get swfBridge():IEventDispatcher;

     /**
-     *  Test if the child allows its parent to access its display objects or listen
+     *  Tests if the child allows its parent to access its display objects or listen
      *  to messages that originate in the child.
      *
-     *  true if access if allowed, false otherwise.
+     *  true if access if allowed; otherwise false.
      */
     function get childAllowsParent():Boolean;

     /**
-     *  Test if the parent allows its child to access its display objects or listen
+     *  Tests if the parent allows its child to access its display objects or listen
      *  to messages that originate in the parent.
      *
-     *  true if access if allowed, false otherwise.
+     *  true if access if allowed; otherwise false.
      */
     function get parentAllowsChild():Boolean;
 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/framework/src/mx/effects/CompositeEffect.as
+++ frameworks/projects/framework/src/mx/effects/CompositeEffect.as
@@ -490,8 +490,12 @@
                 m = childTargets.length;
                 for (j = 0; j < m; j++)
                 {
-                    if (childTargets[j] != null) // Don't include null targets
+                    // Don't include null or duplicate targets
+                    if (child.targets[j] != null &&
+                        resultsArray.indexOf(child.targets[j]) < 0)
+                    {
                         resultsArray.push(childTargets[j]);
+                    }
                 }
             }
             else if (child.targets != null)
@@ -499,8 +503,12 @@
                 m = child.targets.length;
                 for (j = 0; j < m; j++)
                 {
-                    if (child.targets[j] != null) // Don't include null targets
+                    // Don't include null or duplicate targets
+                    if (child.targets[j] != null &&
+                        resultsArray.indexOf(child.targets[j]) < 0)
+                    {
                         resultsArray.push(child.targets[j]);
+                    }
                 }
             }
         }
@@ -509,8 +517,12 @@
         n = targets.length;
         for (i = 0; i < n; i++)
         {
-            if (targets[i] != null) // Don't include null targets
+            // Don't include null or duplicate targets
+            if (targets[i] != null &&
+                resultsArray.indexOf(targets[i]) < 0)
+            {
                 resultsArray.push(targets[i]);
+            }
         }

         return resultsArray;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8483
Author:   smgilson@adobe.com
Date:     2009-07-09T17:52:48.367800Z

Log Message:
-----------
Second checkin to update the namespace in ASDoc MXML syntax descriptions for Spark components

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/EaseInOutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ColorMatrixFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BlurFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DisplacementMapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ShaderFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DropShadowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/CallAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientBevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ConvolutionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Keyframe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientGlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/SetAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientFilter.as</path>

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

--- frameworks/projects/spark/src/spark/effects/AnimateTransform.as
+++ frameworks/projects/spark/src/spark/effects/AnimateTransform.as
@@ -89,7 +89,7 @@
  *  and adds the following tag attributes:

  *
  *

- *  <mx:AnimateTransform
+ *  <s:AnimateTransform
  *    Properties
  *    id="ID"
  *    applyChangesPostLayout="false"
@@ -518,20 +518,20 @@
                 // we still need to capture default start values, so let's initialize the offsets
                 // to a default set anyway.
             if(postLayoutTransformPropertiesSet && target.postLayoutTransformOffsets == null)
-            	target.postLayoutTransformOffsets = new TransformOffsets();
+                target.postLayoutTransformOffsets = new TransformOffsets();

                 // if the target doesn't have any offsets, there's no need to capture
                 // offset values.
             if(target.postLayoutTransformOffsets != null)
                 {
-            	var postLayoutTransformOffsets:TransformOffsets = target.postLayoutTransformOffsets;
-            	valueMap.postLayoutRotationX = postLayoutTransformOffsets.rotationX;
-            	valueMap.postLayoutRotationY = postLayoutTransformOffsets.rotationY;
-            	valueMap.postLayoutRotationZ = postLayoutTransformOffsets.rotationZ;
-
-            	valueMap.postLayoutScaleX = postLayoutTransformOffsets.scaleX;
-            	valueMap.postLayoutScaleY = postLayoutTransformOffsets.scaleY;
-            	valueMap.postLayoutScaleZ = postLayoutTransformOffsets.scaleZ;
+                var postLayoutTransformOffsets:TransformOffsets = target.postLayoutTransformOffsets;
+                valueMap.postLayoutRotationX = postLayoutTransformOffsets.rotationX;
+                valueMap.postLayoutRotationY = postLayoutTransformOffsets.rotationY;
+                valueMap.postLayoutRotationZ = postLayoutTransformOffsets.rotationZ;
+
+                valueMap.postLayoutScaleX = postLayoutTransformOffsets.scaleX;
+                valueMap.postLayoutScaleY = postLayoutTransformOffsets.scaleY;
+                valueMap.postLayoutScaleZ = postLayoutTransformOffsets.scaleZ;

                     if (valueMap.postLayoutTranslationX === undefined ||
                         valueMap.postLayoutTranslationY === undefined ||
@@ -709,19 +709,19 @@
                         position.z = xformPosition.z;
                 }

-				if(target.postLayoutTransformOffsets != null)
+                if(target.postLayoutTransformOffsets != null)
                 {
-					var postLayoutTransformOffsets:TransformOffsets = target.postLayoutTransformOffsets;
+                    var postLayoutTransformOffsets:TransformOffsets = target.postLayoutTransformOffsets;
                     if (!isNaN(transitionValues.postLayoutRotationX) ||
                         !isNaN(transitionValues.postLayoutRotationY) ||
                         !isNaN(transitionValues.postLayoutRotationZ))
                     {
                         offsetRotation.x = !isNaN(transitionValues.postLayoutRotationX) ?
-			                transitionValues.postLayoutRotationX : postLayoutTransformOffsets.rotationX;
+                            transitionValues.postLayoutRotationX : postLayoutTransformOffsets.rotationX;
                         offsetRotation.y = !isNaN(transitionValues.postLayoutRotationY) ?
-			                transitionValues.postLayoutRotationY : postLayoutTransformOffsets.rotationY;
+                            transitionValues.postLayoutRotationY : postLayoutTransformOffsets.rotationY;
                         offsetRotation.z = !isNaN(transitionValues.postLayoutRotationZ) ?
-			                transitionValues.postLayoutRotationZ : postLayoutTransformOffsets.rotationZ;
+                            transitionValues.postLayoutRotationZ : postLayoutTransformOffsets.rotationZ;
                         tmpOffsetRotation = offsetRotation;
                     }

@@ -730,11 +730,11 @@
                         !isNaN(transitionValues.postLayoutScaleZ))
                     {
                         offsetScale.x = !isNaN(transitionValues.postLayoutScaleX) ?
-			                transitionValues.postLayoutScaleX : postLayoutTransformOffsets.scaleX;
+                            transitionValues.postLayoutScaleX : postLayoutTransformOffsets.scaleX;
                         offsetScale.y = !isNaN(transitionValues.postLayoutScaleY) ?
-			                transitionValues.postLayoutScaleY : postLayoutTransformOffsets.scaleY;
+                            transitionValues.postLayoutScaleY : postLayoutTransformOffsets.scaleY;
                         offsetScale.z = !isNaN(transitionValues.postLayoutScaleZ) ?
-			                transitionValues.postLayoutScaleZ : postLayoutTransformOffsets.scaleZ;
+                            transitionValues.postLayoutScaleZ : postLayoutTransformOffsets.scaleZ;
                         tmpOffsetScale = offsetScale;
                     }

@@ -1024,8 +1024,8 @@
             // flag.  In that case, we can assume that they need an offsets object if one doesn't already exist.
             // Second, if we captured post-layout changes from a state change. In that case, we can assume that since values were captured,
             // offsets must already exist.
-	        if(target.postLayoutTransformOffsets == null)
-	            target.postLayoutTransformOffsets = new TransformOffsets();
+            if(target.postLayoutTransformOffsets == null)
+                target.postLayoutTransformOffsets = new TransformOffsets();
         }
         // Feed startDelay directly into keyframe times
         if (motionPaths)


Fix for when importDir is an absolute path.

We still need to handle absolute paths, since on Windows you can't have a
relative path between different drive letters. Plus, absolute paths may be
useful in some cases anyways.

--- exporter/src/main/as/flump/export/Exporter.as
+++ exporter/src/main/as/flump/export/Exporter.as
@@ -136,7 +136,7 @@
             try {
                 _conf = FlumpConf.fromJSON(JSONFormat.readJSON(_confFile));
                 _win.title = _confFile.name;
-                var dir :String = _confFile.parent.nativePath + File.separator + _conf.importDir;
+                var dir :String = _confFile.parent.resolvePath(_conf.importDir).nativePath;
                 setImport(new File(dir));
             } catch (e :Error) {
                 log.warning("Unable to parse conf", e);


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.core
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11498
Author:   jon.avila@ssbbartgroup.com
Date:     2009-11-06T14:57:49.466484Z

Log Message:
-----------
Adds in the mixins (metadata and methods) for hooking accessibility into RichEditableText.
QE notes: none
Doc notes: none
Bugs: n/a
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -202,6 +202,7 @@
 //  Other metadata
 //--------------------------------------

+[AccessibilityClass(implementation="spark.accessibility.RichEditableTextAccImpl")]
 [DefaultProperty("content")]
 [IconFile("RichEditableText.png")]
 [DefaultTriggerEvent("change")]
@@ -387,7 +388,19 @@
     implements IFocusManagerComponent, IIMESupport, ITextSupport, IViewport
 {
     include "../core/Version.as";
-
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class mixins
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Placeholder for mixin by RichEditableTextAccImpl.
+     */
+    mx_internal static var createAccessibilityImplementation:Function;
+
     //--------------------------------------------------------------------------
     //
     //  Class initialization
@@ -2171,6 +2184,15 @@
     //  Overridden Methods: UIComponent
     //
     //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function initializeAccessibility():void
+    {
+        if (RichEditableText.createAccessibilityImplementation != null)
+            RichEditableText.createAccessibilityImplementation(this);
+    }

     /**
      *  @private


Transferred from the Adobe Open Source Subversion Repository

Revision: 4284
Author:   gosmith@adobe.com
Date:     2008-12-10T22:45:46.490650Z

Log Message:
-----------
From now on we'll use the TLF team's release SWCs rather than their debug ones.

I've updated to today's Build 323.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_core.swc</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/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_conversion.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_edit.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -185,12 +185,6 @@
     private static var staticConfiguration:Configuration =
         new Configuration();

-    /**
-     *  @private
-     *  Used for determining whitespace processing during import.
-     */
-    private static var staticImportExportConfiguration:ImportExportConfiguration;
-
     //--------------------------------------------------------------------------
     //
     //  Constructor
@@ -202,17 +196,6 @@
      */
     public function TextView()
     {
-        // Initialize staticImportExportConfiguration at instance-creation
-        // time rather than at static initialization time, to avoid
-        // any class-initialization-order problems.
-        if (!staticImportExportConfiguration)
-        {
-            staticImportExportConfiguration =
-                ImportExportConfiguration.defaultConfiguration;
-
-            ImportExportConfiguration.restoreDefaults();
-        }
-
         super();

         _content = textFlow = createEmptyTextFlow();
@@ -1344,8 +1327,6 @@
             getStyle("whiteSpaceCollapse");
         staticConfiguration.textFlowInitialCharacterFormat =
             staticCharacterFormat;
-        staticImportExportConfiguration.textFlowConfiguration =
-            staticConfiguration;

         if (markup is String)
         {
@@ -1383,7 +1364,7 @@
         }

         return TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT,
-                                       staticImportExportConfiguration);
+                                       staticConfiguration);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 2912
Author:   gcomnino@adobe.com
Date:     2008-08-20T01:54:31.237620Z

Log Message:
-----------
Added custom icon file for flash templates. Checkin tests pass. Reviewed by: TBD Jono. QA: No. Docs: No. Bugs: SDK-16449

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/utilities/src/FlashComponentPlaceholder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/utilities/src/FlashContainerPlaceholder.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/utilities/src/flash_component_icon_small.png</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/utilities/src/flash_container_icon_small.png</path>

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

--- frameworks/projects/authoringsupport/src/FlashComponentPlaceholder.as
+++ frameworks/projects/authoringsupport/src/FlashComponentPlaceholder.as
@@ -13,6 +13,7 @@
 {
 	import mx.controls.Image;

+	[IconFile("flash_component_icon_small.png")]
 	public class FlashComponentPlaceholder extends FlashContainerPlaceholder
 	{
 		public function FlashComponentPlaceholder()