Revert "Falcon caught a duplicate variable"

This reverts commit 3c40976eb0b3a73d2bb7180cc22400917f719fc4.

--- frameworks/projects/apache/src/org/apache/flex/collections/ArrayList.as
+++ frameworks/projects/apache/src/org/apache/flex/collections/ArrayList.as
@@ -1,839 +1,839 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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
-//
-//      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.
-//
-////////////////////////////////////////////////////////////////////////////////
-
-package org.apache.flex.collections
-{
-
-import flash.events.EventDispatcher;
-import flash.events.IEventDispatcher;
-import flash.utils.IDataInput;
-import flash.utils.IDataOutput;
-import flash.utils.IExternalizable;
-import flash.utils.getQualifiedClassName;
-
-import mx.collections.ICollectionView;
-import mx.collections.IList;
-import mx.core.IPropertyChangeNotifier;
-import mx.events.CollectionEvent;
-import mx.events.CollectionEventKind;
-import mx.events.PropertyChangeEvent;
-import mx.events.PropertyChangeEventKind;
-import mx.resources.IResourceManager;
-import mx.resources.ResourceManager;
-import mx.utils.ArrayUtil;
-import mx.utils.UIDUtil;
-
-//--------------------------------------
-//  Events
-//--------------------------------------
-
-/**
- *  Dispatched when the IList has been updated in some way.
- *
- *  @eventType mx.events.CollectionEvent.COLLECTION_CHANGE
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-[Event(name="collectionChange", type="mx.events.CollectionEvent")]
-
-//--------------------------------------
-//  Other metadata
-//--------------------------------------
-
-[RemoteClass(alias="flex.messaging.io.ArrayList")]
-
-[ResourceBundle("collections")]
-
-[DefaultProperty("source")]
-
-/**
- *  The ArrayList class is a simple implementation of IList
- *  that uses a backing Array as the source of the data.
- *
- *  Items in the backing Array can be accessed and manipulated
- *  using the methods and properties of the IList
- *  interface. Operations on an ArrayList instance modify the
- *  data source; for example, if you use the removeItemAt()
- *  method on an ArrayList, you remove the item from the underlying
- *  Array.
- *
- *  This base class will not throw ItemPendingErrors but it
- *  is possible that a subclass might.
- *
- *

- *  <mx:ArrayList
- *  Properties
- *  source="null"
- *  />
- *

- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-public class ArrayList extends EventDispatcher
-       implements IList, IExternalizable, IPropertyChangeNotifier
-{
-    //include "../core/Version.as";
-
-    //--------------------------------------------------------------------------
-    //
-    // Constructor
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  Construct a new ArrayList using the specified array as its source.
-     *  If no source is specified an empty array will be used.
-     *
-     *  @param source The Array to use as a source for the ArrayList.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function ArrayList(source:Array = null)
-    {
-        super();
-
-        disableEvents();
-        this.source = source;
-        enableEvents();
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    // Variables
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Used for accessing localized Error messages.
-     */
-    private var resourceManager:IResourceManager =
-        ResourceManager.getInstance();
-
-    /**
-     *  @private
-     *  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;
-
-    //--------------------------------------------------------------------------
-    //
-    // Properties
-    //
-    //--------------------------------------------------------------------------
-
-    //----------------------------------
-    // length
-    //----------------------------------
-
-    [Bindable("collectionChange")]
-
-    /**
-     *  Get the number of items in the list.  An ArrayList should always
-     *  know its length so it shouldn't return -1, though a subclass may
-     *  override that behavior.
-     *
-     *  @return int representing the length of the source.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get length():int
-    {
-        if (source)
-            return source.length;
-        else
-            return 0;
-    }
-
-    //----------------------------------
-    // source
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the source Array.
-     */
-    private var _source:Array;
-
-    /**
-     *  The source array for this ArrayList.
-     *  Any changes done through the IList interface will be reflected in the
-     *  source array.
-     *  If no source array was supplied the ArrayList will create one internally.
-     *  Changes made directly to the underlying Array (e.g., calling
-     *  theList.source.pop() will not cause CollectionEvents
-     *  to be dispatched.
-     *
-     *  @return An Array that represents the underlying source.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get source():Array
-    {
-        return _source;
-    }
-
-    public function set source(s:Array):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 : [];
-        len = _source.length;
-        for (i = 0; i < len; i++)
-        {
-            startTrackUpdates(_source[i]);
-        }
-
-        if (_dispatchEvents == 0)
-        {
-           var event:CollectionEvent =
-            new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
-           event.kind = CollectionEventKind.RESET;
-           dispatchEvent(event);
-        }
-    }
-
-    //----------------------------------
-    // uid -- mx.core.IPropertyChangeNotifier
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the UID String.
-     */
-    private var _uid:String;
-
-    /**
-     *  Provides access to the unique id for this list.
-     *
-     *  @return String representing the internal uid.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get uid():String
-    {
-		if (!_uid) {
-			_uid = UIDUtil.createUID();
-		}
-        return _uid;
-    }
-
-    public function set uid(value:String):void
-    {
-        _uid = value;
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    // Methods
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  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
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    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];
-    }
-
-    /**
-     *  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.
-     *
-     *  @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 or greater than or equal to length
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    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);
-
-        //dispatch the appropriate events
-        if (_dispatchEvents == 0)
-        {
-            var hasCollectionListener:Boolean =
-                hasEventListener(CollectionEvent.COLLECTION_CHANGE);
-            var hasPropertyListener:Boolean =
-                hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE);
-            var updateInfo:PropertyChangeEvent;
-
-            if (hasCollectionListener || hasPropertyListener)
-            {
-                updateInfo = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
-                updateInfo.kind = PropertyChangeEventKind.UPDATE;
-                updateInfo.oldValue = oldItem;
-                updateInfo.newValue = item;
-                updateInfo.property = index;
-            }
-
-            if (hasCollectionListener)
-            {
-                var event:CollectionEvent =
-                    new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
-                event.kind = CollectionEventKind.REPLACE;
-                event.location = index;
-                event.items.push(updateInfo);
-                dispatchEvent(event);
-            }
-
-            if (hasPropertyListener)
-            {
-                dispatchEvent(updateInfo);
-            }
-        }
-        return oldItem;
-    }
-
-    /**
-     *  Add the specified item to the end of the list.
-     *  Equivalent to addItemAt(item, length);
-     *
-     *  @param item the item to add
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    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.
-     *
-     *  @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 or greater than the length
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function addItemAt(item:Object, index:int):void
-    {
-        const spliceUpperBound:int = length;
-
-        if (index < spliceUpperBound && index > 0)
-        {
-            source.splice(index, 0, item);
-        }
-        else if (index == spliceUpperBound)
-        {
-            source.push(item);
-        }
-        else if (index == 0)
-        {
-            source.unshift(item);
-        }
-        else
-        {
-            var message:String = resourceManager.getString(
-                "collections", "outOfBounds", [ index ]);
-            throw new RangeError(message);
-        }
-
-        startTrackUpdates(item);
-        internalDispatchEvent(CollectionEventKind.ADD, item, index);
-    }
-
-    /**
-     *  @copy mx.collections.ListCollectionView#addAll()
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function addAll(addList:IList):void
-    {
-        addAllAt(addList, length);
-    }
-
-    /**
-     *  @copy mx.collections.ListCollectionView#addAllAt()
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function addAllAt(addList:IList, index:int):void
-    {
-        var length:int = addList.length;
-        for (var i:int = 0; i < length; i++)
-        {
-            this.addItemAt(addList.getItemAt(i), i+index);
-        }
-    }
-
-    /**
-     *  Return the index of the item if it is in the list such that
-     *  getItemAt(index) == item.
-     *  Note that in this implementation the search is linear and is therefore
-     *  O(n).
-     *
-     *  @param item the item to find
-     *  @return the index of the item, -1 if the item is not in the list.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function getItemIndex(item:Object):int
-    {
-        return ArrayUtil.getItemIndex(item, source);
-    }
-
-    /**
-     *  Removes the specified item from this list, should it exist.
-     *
-     *  @param  item Object reference to the item that should be removed.
-     *  @return Boolean indicating if the item was removed.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function removeItem(item:Object):Boolean
-    {
-        var index:int = getItemIndex(item);
-        var result:Boolean = index >= 0;
-        if (result)
-            removeItemAt(index);
-
-        return result;
-    }
-
-    /**
-     *  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 if index < 0 or index >= length.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function removeItemAt(index:int):Object
-    {
-        const spliceUpperBound:int = length - 1;
-        var removed:Object;
-
-        if (index > 0 && index < spliceUpperBound)
-        {
-            removed = source.splice(index, 1)[0];
-        }
-        else if (index == spliceUpperBound)
-        {
-            removed = source.pop();
-        }
-        else if (index == 0)
-        {
-            removed = source.shift();
-        }
-        else
-        {
-            var message:String = resourceManager.getString(
-                "collections", "outOfBounds", [ index ]);
-            throw new RangeError(message);
-        }
-
-        removed = source.splice(index, 1)[0];
-        stopTrackUpdates(removed);
-        internalDispatchEvent(CollectionEventKind.REMOVE, removed, index);
-        return removed;
-    }
-
-    /**
-     *  Remove all items from the list.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function removeAll():void
-    {
-        if (length > 0)
-        {
-            var len:int = length;
-            for (var i:int = 0; i < len; i++)
-            {
-                stopTrackUpdates(source[i]);
-            }
-
-            source.splice(0, length);
-            internalDispatchEvent(CollectionEventKind.RESET);
-        }
-    }
-
-    /**
-     *  Notify the view that an item has been updated.
-     *  This is useful if the contents of the view do not implement
-     *  IEventDispatcher.
-     *  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
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-     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;
-
-		//This handler was intended to handle events from child objects, not to be called directly
-		//itemUpdateHandler(event);
-
-		internalDispatchEvent(CollectionEventKind.UPDATE, event);
-
-		// need to dispatch object event now
-		if (_dispatchEvents == 0 && hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
-		{
-			dispatchPropertyChangeEventClone( event, item );
-		}
-    }
-
-    /**
-     *  Return an Array that is populated in the same order as the IList
-     *  implementation.
-     *
-     *  @return An Array populated in the same order as the IList
-     *  implementation.
-     *
-     *  @throws ItemPendingError if the data is not yet completely loaded
-     *  from a remote location
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function toArray():Array
-    {
-        return source.concat();
-    }
-
-    /**
-     *  Ensures that only the source property is seralized.
-     *  @private
-     */
-    public function readExternal(input:IDataInput):void
-    {
-        source = input.readObject();
-    }
-
-    /**
-     *  Ensures that only the source property is serialized.
-     *  @private
-     */
-    public function writeExternal(output:IDataOutput):void
-    {
-        output.writeObject(_source);
-    }
-
-    /**
-     *  Pretty prints the contents of this ArrayList to a string and returns it.
-     *
-     *  @return A String containing the contents of the ArrayList.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    override public function toString():String
-    {
-        if (source)
-            return source.toString();
-        else
-            return getQualifiedClassName(this);
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    // Internal Methods
-    //
-    //--------------------------------------------------------------------------
-
-	/**
-	 *  Dispatches a PropertyChangeEvent clone either from a child object whose event needs to be redispatched
-	 *  or when a PropertyChangeEvent is faked inside of this class for the purposes of informing the view
-	 *  of an update to underlying data.
-	 *
-	 *  @param event The PropertyChangeEvent to be cloned and dispatched
-	 *  @param item The item within the view that was updated.
-	 *
-	 *  @see mx.core.IPropertyChangeNotifier
-	 *  @see mx.events.PropertyChangeEvent
-	 */
-
-	private function dispatchPropertyChangeEventClone( event:PropertyChangeEvent, item:Object ):void {
-		var objEvent:PropertyChangeEvent = PropertyChangeEvent(event.clone());
-
-		var index:int = getItemIndex( item );
-		objEvent.property = index.toString() + "." + event.property;
-		dispatchEvent(objEvent);
-	}
-
-    /**
-     *  Enables event dispatch for this list.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    private 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().
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    private function disableEvents():void
-    {
-        _dispatchEvents--;
-    }
-
-    /**
-     *  Dispatches a collection event with the specified information.
-     *
-     *  @param kind String indicates what the kind property of the event should be
-     *  @param item Object reference to the item that was added or removed
-     *  @param location int indicating where in the source the item was added.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    private function internalDispatchEvent(kind:String, item:Object = null, location:int = -1):void
-    {
-        if (_dispatchEvents == 0)
-        {
-            if (hasEventListener(CollectionEvent.COLLECTION_CHANGE))
-            {
-                var event:CollectionEvent =
-                    new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
-                event.kind = kind;
-                event.items.push(item);
-                event.location = location;
-                dispatchEvent(event);
-            }
-
-            // now dispatch a complementary PropertyChangeEvent
-            if (hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE) &&
-               (kind == CollectionEventKind.ADD || kind == CollectionEventKind.REMOVE))
-            {
-                var objEvent:PropertyChangeEvent =
-                    new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
-                objEvent.property = location;
-                if (kind == CollectionEventKind.ADD)
-                    objEvent.newValue = item;
-                else
-                    objEvent.oldValue = item;
-                dispatchEvent(objEvent);
-            }
-        }
-    }
-
-    /**
-     *  Called when any of the contained items in the list dispatch an
-     *  ObjectChange event.
-     *  Wraps it in a CollectionEventKind.UPDATE object.
-     *
-     *  @param event The event object for the ObjectChange event.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    protected function itemUpdateHandler(event:PropertyChangeEvent):void
-    {
-        internalDispatchEvent(CollectionEventKind.UPDATE, event);
-
-		// need to dispatch object event now
-		if (_dispatchEvents == 0 && hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
-		{
-			dispatchPropertyChangeEventClone( event, event.target );
-		}
-    }
-
-    /**
-     *  If the item is an IEventDispatcher, watch it for updates.
-     *  This method is called by the addItemAt() method,
-     *  and when the source is initially assigned.
-     *
-     *  @param item The item passed to the addItemAt() method.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    protected function startTrackUpdates(item:Object):void
-    {
-        if (item && (item is IEventDispatcher))
-        {
-            IEventDispatcher(item).addEventListener(
-                                        PropertyChangeEvent.PROPERTY_CHANGE,
-                                        itemUpdateHandler, false, 0, true);
-        }
-    }
-
-    /**
-     *  If the item is an IEventDispatcher, stop watching it for updates.
-     *  This method is called by the removeItemAt() and
-     *  removeAll() methods, and before a new
-     *  source is assigned.
-     *
-     *  @param item The item passed to the removeItemAt() method.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    protected function stopTrackUpdates(item:Object):void
-    {
-        if (item && item is IEventDispatcher)
-        {
-            IEventDispatcher(item).removeEventListener(
-                                        PropertyChangeEvent.PROPERTY_CHANGE,
-                                        itemUpdateHandler);
-        }
-    }
-
-}
-
-}
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+//
+//      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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package org.apache.flex.collections
+{
+
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import flash.utils.IDataInput;
+import flash.utils.IDataOutput;
+import flash.utils.IExternalizable;
+import flash.utils.getQualifiedClassName;
+
+import mx.collections.ICollectionView;
+import mx.collections.IList;
+import mx.core.IPropertyChangeNotifier;
+import mx.events.CollectionEvent;
+import mx.events.CollectionEventKind;
+import mx.events.PropertyChangeEvent;
+import mx.events.PropertyChangeEventKind;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.utils.ArrayUtil;
+import mx.utils.UIDUtil;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the IList has been updated in some way.
+ *
+ *  @eventType mx.events.CollectionEvent.COLLECTION_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="collectionChange", type="mx.events.CollectionEvent")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[RemoteClass(alias="flex.messaging.io.ArrayList")]
+
+[ResourceBundle("collections")]
+
+[DefaultProperty("source")]
+
+/**
+ *  The ArrayList class is a simple implementation of IList
+ *  that uses a backing Array as the source of the data.
+ *
+ *  Items in the backing Array can be accessed and manipulated
+ *  using the methods and properties of the IList
+ *  interface. Operations on an ArrayList instance modify the
+ *  data source; for example, if you use the removeItemAt()
+ *  method on an ArrayList, you remove the item from the underlying
+ *  Array.
+ *
+ *  This base class will not throw ItemPendingErrors but it
+ *  is possible that a subclass might.
+ *
+ *

+ *  <mx:ArrayList
+ *  Properties
+ *  source="null"
+ *  />
+ *

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+public class ArrayList extends EventDispatcher
+       implements IList, IExternalizable, IPropertyChangeNotifier
+{
+    //include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Construct a new ArrayList using the specified array as its source.
+     *  If no source is specified an empty array will be used.
+     *
+     *  @param source The Array to use as a source for the ArrayList.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function ArrayList(source:Array = null)
+    {
+        super();
+
+        disableEvents();
+        this.source = source;
+        enableEvents();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Used for accessing localized Error messages.
+     */
+    private var resourceManager:IResourceManager =
+        ResourceManager.getInstance();
+
+    /**
+     *  @private
+     *  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;
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // length
+    //----------------------------------
+
+    [Bindable("collectionChange")]
+
+    /**
+     *  Get the number of items in the list.  An ArrayList should always
+     *  know its length so it shouldn't return -1, though a subclass may
+     *  override that behavior.
+     *
+     *  @return int representing the length of the source.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get length():int
+    {
+        if (source)
+            return source.length;
+        else
+            return 0;
+    }
+
+    //----------------------------------
+    // source
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the source Array.
+     */
+    private var _source:Array;
+
+    /**
+     *  The source array for this ArrayList.
+     *  Any changes done through the IList interface will be reflected in the
+     *  source array.
+     *  If no source array was supplied the ArrayList will create one internally.
+     *  Changes made directly to the underlying Array (e.g., calling
+     *  theList.source.pop() will not cause CollectionEvents
+     *  to be dispatched.
+     *
+     *  @return An Array that represents the underlying source.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get source():Array
+    {
+        return _source;
+    }
+
+    public function set source(s:Array):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 : [];
+        len = _source.length;
+        for (i = 0; i < len; i++)
+        {
+            startTrackUpdates(_source[i]);
+        }
+
+        if (_dispatchEvents == 0)
+        {
+           var event:CollectionEvent =
+            new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+           event.kind = CollectionEventKind.RESET;
+           dispatchEvent(event);
+        }
+    }
+
+    //----------------------------------
+    // uid -- mx.core.IPropertyChangeNotifier
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the UID String.
+     */
+    private var _uid:String;
+
+    /**
+     *  Provides access to the unique id for this list.
+     *
+     *  @return String representing the internal uid.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get uid():String
+    {
+		if (!_uid) {
+			_uid = UIDUtil.createUID();
+		}
+        return _uid;
+    }
+
+    public function set uid(value:String):void
+    {
+        _uid = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  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
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    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];
+    }
+
+    /**
+     *  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.
+     *
+     *  @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 or greater than or equal to length
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    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);
+
+        //dispatch the appropriate events
+        if (_dispatchEvents == 0)
+        {
+            var hasCollectionListener:Boolean =
+                hasEventListener(CollectionEvent.COLLECTION_CHANGE);
+            var hasPropertyListener:Boolean =
+                hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE);
+            var updateInfo:PropertyChangeEvent;
+
+            if (hasCollectionListener || hasPropertyListener)
+            {
+                updateInfo = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
+                updateInfo.kind = PropertyChangeEventKind.UPDATE;
+                updateInfo.oldValue = oldItem;
+                updateInfo.newValue = item;
+                updateInfo.property = index;
+            }
+
+            if (hasCollectionListener)
+            {
+                var event:CollectionEvent =
+                    new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+                event.kind = CollectionEventKind.REPLACE;
+                event.location = index;
+                event.items.push(updateInfo);
+                dispatchEvent(event);
+            }
+
+            if (hasPropertyListener)
+            {
+                dispatchEvent(updateInfo);
+            }
+        }
+        return oldItem;
+    }
+
+    /**
+     *  Add the specified item to the end of the list.
+     *  Equivalent to addItemAt(item, length);
+     *
+     *  @param item the item to add
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    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.
+     *
+     *  @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 or greater than the length
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addItemAt(item:Object, index:int):void
+    {
+        const spliceUpperBound:int = length;
+
+        if (index < spliceUpperBound && index > 0)
+        {
+            source.splice(index, 0, item);
+        }
+        else if (index == spliceUpperBound)
+        {
+            source.push(item);
+        }
+        else if (index == 0)
+        {
+            source.unshift(item);
+        }
+        else
+        {
+            var message:String = resourceManager.getString(
+                "collections", "outOfBounds", [ index ]);
+            throw new RangeError(message);
+        }
+
+        startTrackUpdates(item);
+        internalDispatchEvent(CollectionEventKind.ADD, item, index);
+    }
+
+    /**
+     *  @copy mx.collections.ListCollectionView#addAll()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addAll(addList:IList):void
+    {
+        addAllAt(addList, length);
+    }
+
+    /**
+     *  @copy mx.collections.ListCollectionView#addAllAt()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addAllAt(addList:IList, index:int):void
+    {
+        var length:int = addList.length;
+        for (var i:int = 0; i < length; i++)
+        {
+            this.addItemAt(addList.getItemAt(i), i+index);
+        }
+    }
+
+    /**
+     *  Return the index of the item if it is in the list such that
+     *  getItemAt(index) == item.
+     *  Note that in this implementation the search is linear and is therefore
+     *  O(n).
+     *
+     *  @param item the item to find
+     *  @return the index of the item, -1 if the item is not in the list.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getItemIndex(item:Object):int
+    {
+        return ArrayUtil.getItemIndex(item, source);
+    }
+
+    /**
+     *  Removes the specified item from this list, should it exist.
+     *
+     *  @param  item Object reference to the item that should be removed.
+     *  @return Boolean indicating if the item was removed.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function removeItem(item:Object):Boolean
+    {
+        var index:int = getItemIndex(item);
+        var result:Boolean = index >= 0;
+        if (result)
+            removeItemAt(index);
+
+        return result;
+    }
+
+    /**
+     *  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 if index < 0 or index >= length.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function removeItemAt(index:int):Object
+    {
+        const spliceUpperBound:int = length - 1;
+        var removed:Object;
+
+        if (index > 0 && index < spliceUpperBound)
+        {
+            removed = source.splice(index, 1)[0];
+        }
+        else if (index == spliceUpperBound)
+        {
+            removed = source.pop();
+        }
+        else if (index == 0)
+        {
+            removed = source.shift();
+        }
+        else
+        {
+            var message:String = resourceManager.getString(
+                "collections", "outOfBounds", [ index ]);
+            throw new RangeError(message);
+        }
+
+        var removed:Object = source.splice(index, 1)[0];
+        stopTrackUpdates(removed);
+        internalDispatchEvent(CollectionEventKind.REMOVE, removed, index);
+        return removed;
+    }
+
+    /**
+     *  Remove all items from the list.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function removeAll():void
+    {
+        if (length > 0)
+        {
+            var len:int = length;
+            for (var i:int = 0; i < len; i++)
+            {
+                stopTrackUpdates(source[i]);
+            }
+
+            source.splice(0, length);
+            internalDispatchEvent(CollectionEventKind.RESET);
+        }
+    }
+
+    /**
+     *  Notify the view that an item has been updated.
+     *  This is useful if the contents of the view do not implement
+     *  IEventDispatcher.
+     *  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
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+     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;
+
+		//This handler was intended to handle events from child objects, not to be called directly
+		//itemUpdateHandler(event);
+
+		internalDispatchEvent(CollectionEventKind.UPDATE, event);
+
+		// need to dispatch object event now
+		if (_dispatchEvents == 0 && hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+		{
+			dispatchPropertyChangeEventClone( event, item );
+		}
+    }
+
+    /**
+     *  Return an Array that is populated in the same order as the IList
+     *  implementation.
+     *
+     *  @return An Array populated in the same order as the IList
+     *  implementation.
+     *
+     *  @throws ItemPendingError if the data is not yet completely loaded
+     *  from a remote location
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function toArray():Array
+    {
+        return source.concat();
+    }
+
+    /**
+     *  Ensures that only the source property is seralized.
+     *  @private
+     */
+    public function readExternal(input:IDataInput):void
+    {
+        source = input.readObject();
+    }
+
+    /**
+     *  Ensures that only the source property is serialized.
+     *  @private
+     */
+    public function writeExternal(output:IDataOutput):void
+    {
+        output.writeObject(_source);
+    }
+
+    /**
+     *  Pretty prints the contents of this ArrayList to a string and returns it.
+     *
+     *  @return A String containing the contents of the ArrayList.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function toString():String
+    {
+        if (source)
+            return source.toString();
+        else
+            return getQualifiedClassName(this);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Internal Methods
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Dispatches a PropertyChangeEvent clone either from a child object whose event needs to be redispatched
+	 *  or when a PropertyChangeEvent is faked inside of this class for the purposes of informing the view
+	 *  of an update to underlying data.
+	 *
+	 *  @param event The PropertyChangeEvent to be cloned and dispatched
+	 *  @param item The item within the view that was updated.
+	 *
+	 *  @see mx.core.IPropertyChangeNotifier
+	 *  @see mx.events.PropertyChangeEvent
+	 */
+
+	private function dispatchPropertyChangeEventClone( event:PropertyChangeEvent, item:Object ):void {
+		var objEvent:PropertyChangeEvent = PropertyChangeEvent(event.clone());
+
+		var index:int = getItemIndex( item );
+		objEvent.property = index.toString() + "." + event.property;
+		dispatchEvent(objEvent);
+	}
+
+    /**
+     *  Enables event dispatch for this list.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    private 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().
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    private function disableEvents():void
+    {
+        _dispatchEvents--;
+    }
+
+    /**
+     *  Dispatches a collection event with the specified information.
+     *
+     *  @param kind String indicates what the kind property of the event should be
+     *  @param item Object reference to the item that was added or removed
+     *  @param location int indicating where in the source the item was added.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    private function internalDispatchEvent(kind:String, item:Object = null, location:int = -1):void
+    {
+        if (_dispatchEvents == 0)
+        {
+            if (hasEventListener(CollectionEvent.COLLECTION_CHANGE))
+            {
+                var event:CollectionEvent =
+                    new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+                event.kind = kind;
+                event.items.push(item);
+                event.location = location;
+                dispatchEvent(event);
+            }
+
+            // now dispatch a complementary PropertyChangeEvent
+            if (hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE) &&
+               (kind == CollectionEventKind.ADD || kind == CollectionEventKind.REMOVE))
+            {
+                var objEvent:PropertyChangeEvent =
+                    new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
+                objEvent.property = location;
+                if (kind == CollectionEventKind.ADD)
+                    objEvent.newValue = item;
+                else
+                    objEvent.oldValue = item;
+                dispatchEvent(objEvent);
+            }
+        }
+    }
+
+    /**
+     *  Called when any of the contained items in the list dispatch an
+     *  ObjectChange event.
+     *  Wraps it in a CollectionEventKind.UPDATE object.
+     *
+     *  @param event The event object for the ObjectChange event.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function itemUpdateHandler(event:PropertyChangeEvent):void
+    {
+        internalDispatchEvent(CollectionEventKind.UPDATE, event);
+
+		// need to dispatch object event now
+		if (_dispatchEvents == 0 && hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+		{
+			dispatchPropertyChangeEventClone( event, event.target );
+		}
+    }
+
+    /**
+     *  If the item is an IEventDispatcher, watch it for updates.
+     *  This method is called by the addItemAt() method,
+     *  and when the source is initially assigned.
+     *
+     *  @param item The item passed to the addItemAt() method.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function startTrackUpdates(item:Object):void
+    {
+        if (item && (item is IEventDispatcher))
+        {
+            IEventDispatcher(item).addEventListener(
+                                        PropertyChangeEvent.PROPERTY_CHANGE,
+                                        itemUpdateHandler, false, 0, true);
+        }
+    }
+
+    /**
+     *  If the item is an IEventDispatcher, stop watching it for updates.
+     *  This method is called by the removeItemAt() and
+     *  removeAll() methods, and before a new
+     *  source is assigned.
+     *
+     *  @param item The item passed to the removeItemAt() method.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected function stopTrackUpdates(item:Object):void
+    {
+        if (item && item is IEventDispatcher)
+        {
+            IEventDispatcher(item).removeEventListener(
+                                        PropertyChangeEvent.PROPERTY_CHANGE,
+                                        itemUpdateHandler);
+        }
+    }
+
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 16822
Author:   deeptika@adobe.com
Date:     2010-07-07T06:16:32.586582Z

Log Message:
-----------
Removing deprecated API and their usage.

QE notes:
Doc notes:
Bugs: FLEXDMV-2463 (LineaSeries legendData marker are not working if the series has lineStroke to a SolidColorStroke)
FLEXDMV-2470 (Remove deprecation or Remove deprecated properties in charting)
Reviewer:
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/BarChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation_dmv/src/mx/automation/delegates/charts/CartesianChartAutomationImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/renderers/AreaRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/AreaChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/series/HLOCSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/series/LineSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/PlotChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/series/BubbleSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/series/ColumnSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/automation/src/mx/automation/tabularData/CartesianChartTabularData.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/CandlestickChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/HLOCChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/chartClasses/StackedSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/series/BarSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/LineChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/chartClasses/HLOCSeriesBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/chartClasses/CartesianChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/chartClasses/ChartBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/BubbleChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/series/AreaSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/chartClasses/PolarChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/ColumnChart.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/series/PlotSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/datavisualization/src/mx/charts/renderers/HLOCItemRenderer.as</path>

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

--- frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as
@@ -112,50 +112,6 @@
  *  @productversion Flex 3
  */
 [Style(name="gutterTop", type="Number", format="Length", inherit="no")]
-
-/**
- *  The class selector that defines the style properties
- *  for the horizontal axis.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-[Style(name="horizontalAxisStyleName", type="String", inherit="no", deprecatedReplacement="horizontalAxisStyleNames")]
-
-/**
- *  The class selector that defines the style properties
- *  for the second horizontal axis.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-[Style(name="secondHorizontalAxisStyleName", type="String", inherit="no", deprecatedReplacement="horizontalAxisStyleNames")]
-
-/**
- *  The class selector that defines the style properties
- *  for the second vertical axis.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-[Style(name="secondVerticalAxisStyleName", type="String", inherit="no", deprecatedReplacement="verticalAxisStyleNames")]
-
-/**
- *  The class selector that defines the style properties
- *  for the vertical axis.
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-[Style(name="verticalAxisStyleName", type="String", inherit="no", deprecatedReplacement="verticalAxisStyleNames")]

 /**
  *  An array of class selectors that define the style properties
@@ -255,8 +211,7 @@
         horizontalAxis = new LinearAxis();
         verticalAxis = new LinearAxis();

-        _series2 = _userSeries2 = [];
-        transforms = [new CartesianTransform()];
+        _transforms = [new CartesianTransform()];

         var gridLines:GridLines = new GridLines();
         backgroundElements = [ gridLines ];
@@ -387,11 +342,6 @@
         if (_verticalAxisRenderer)
             _verticalAxisRenderer.chartStateChanged(oldState, value);

-        if (_secondHorizontalAxisRenderer)
-            _secondHorizontalAxisRenderer.chartStateChanged(oldState, value);
-        if (_secondVerticalAxisRenderer)
-            _secondVerticalAxisRenderer.chartStateChanged(oldState, value);
-
         var n:uint = _horizontalAxisRenderers.length;

@@ -555,8 +505,8 @@
     private var _horizontalAxisRenderer:IAxisRenderer;

     [Inspectable(category="Data")]
-    [Deprecated(replacement="CartesianChart.horizontalAxisRenderers")]
-    /**
+    /**
+	 *  @private
      *  Specifies how data appears along the x-axis of a chart.
      *  Use the AxisRenderer class to define the properties
      *  for horizontalAxisRenderer as a child tag in MXML
@@ -567,7 +517,7 @@
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public function get horizontalAxisRenderer():IAxisRenderer
+    mx_internal function get horizontalAxisRenderer():IAxisRenderer
     {
         return _horizontalAxisRenderer;
     }
@@ -575,7 +525,7 @@
     /**
      *  @private
      */
-    public function set horizontalAxisRenderer(value:IAxisRenderer):void
+    mx_internal function set horizontalAxisRenderer(value:IAxisRenderer):void
     {
         if (_horizontalAxisRenderer)
         {
@@ -657,82 +607,19 @@
         invalidateChildOrder();
         invalidateProperties();
     }
-
-    //----------------------------------
-    //  secondDataProvider
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the secondDataProvider property.
-     */
-    private var _secondDataProvider:ICollectionView;
+
+    //----------------------------------
+    //  verticalAxis
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the verticalAxis property.
+     */
+    private var _verticalAxis:IAxis;

     [Inspectable(category="Data")]
-    [Deprecated(replacement="CartesianChart.dataProvider")]
-    /**
-     *  The second data provider for this chart.
-     *  The second data provider is typically rendered by a second series.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get secondDataProvider():Object
-    {
-        return _secondDataProvider;
-    }
-
-    /**
-     *  @private
-     */
-    public function set secondDataProvider(value:Object):void
-    {
-        if (value is Array)
-        {
-            value = new ArrayCollection(value as Array);
-        }
-        else if (value is ICollectionView)
-        {
-        }
-        else if (value is IList)
-        {
-            value = new ListCollectionView(value as IList);
-        }
-        else if (value is XMLList)
-        {
-            value = new XMLListCollection(XMLList(value));
-        }
-        else if (value != null)
-        {
-            value = new ArrayCollection([ value ]);
-        }
-        else
-        {
-            value = new ArrayCollection();
-        }
-
-        _secondDataProvider = ICollectionView(value);
-
-        if (!_bDualMode)
-            initSecondaryMode();
-
-        invalidateData();
-    }
-
-    //----------------------------------
-    //  secondHorizontalAxis
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the secondHorizontalAxis property.
-     */
-    private var _secondHorizontalAxis:IAxis;
-
-    [Inspectable(category="Data")]
-    [Deprecated(replacement="horizontalAxis in individual series")]
+
     /**
      *  Defines the labels, tick marks, and data position
      *  for items on the y-axis.
@@ -745,259 +632,6 @@
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public function get secondHorizontalAxis():IAxis
-    {
-        return _secondHorizontalAxis;
-    }
-
-    /**
-     *  @private
-     */
-    public function set secondHorizontalAxis(value:IAxis):void
-    {
-        _secondHorizontalAxis = value;
-
-        if (!_bDualMode)
-            initSecondaryMode();
-
-        _bAxesRenderersDirty = true;
-        invalidateData();
-        invalidateProperties();
-    }
-
-    //----------------------------------
-    //  secondHorizontalAxisRenderer
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the secondHorizontalAxisRenderer property.
-     */
-    private var _secondHorizontalAxisRenderer:IAxisRenderer;
-
-    [Inspectable(category="Data")]
-    [Deprecated(replacement="CartesianChart.horizontalAxisRenderers")]
-    /**
-     *  Specifies how data appears along the y-axis of a chart.
-     *  Use the AxisRenderer class to set the properties
-     *  for verticalAxisRenderer as a child tag in MXML
-     *  or create an AxisRenderer object in ActionScript.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get secondHorizontalAxisRenderer():IAxisRenderer
-    {
-        return _secondHorizontalAxisRenderer;
-    }
-
-    /**
-     *  @private
-     */
-    public function set secondHorizontalAxisRenderer(value:IAxisRenderer):void
-    {
-        if (_secondHorizontalAxisRenderer)
-        {
-            if (DisplayObject(_secondHorizontalAxisRenderer).parent == this)
-                removeChild(DisplayObject(_secondHorizontalAxisRenderer));
-            _secondHorizontalAxisRenderer.otherAxes = null;
-        }
-        _secondHorizontalAxisRenderer = value;
-
-        if (!_bDualMode)
-            initSecondaryMode();
-
-        _secondHorizontalAxisRenderer.horizontal = true;
-
-        if (_secondHorizontalAxisRenderer.axis)
-            secondHorizontalAxis = _secondHorizontalAxisRenderer.axis;
-
-        _bAxesRenderersDirty = true;
-        _bAxisStylesDirty=true;
-
-        invalidateChildOrder();
-        invalidateProperties();
-    }
-
-    //----------------------------------
-    //  secondSeries
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the secondSeries property.
-     */
-    private var _series2:Array /* of Series */;
-
-    /**
-     *  @private
-     */
-    private var _userSeries2:Array /* of Series */;
-
-    [Deprecated(replacement="ChartBase.series")]
-    [Inspectable(category="Data", arrayType="mx.charts.chartClasses.Series")]
-    /**
-     *  An array of Series objects that define the secondary chart data.
-     *  Secondary Series are displayed in the same data area as the primary
-     *  chart series, but are typically rendered with different scales and axes.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get secondSeries():Array /* of Series */
-    {
-        return _series2;
-    }
-
-    /**
-     *  @private
-     */
-    public function set secondSeries(value:Array /* of Series */):void
-    {
-
-        value = value == null ? [] : value;
-        _userSeries2 = value;
-
-        var n:int = value.length;
-        for (var i:int = 0; i < n; ++i)
-        {
-            if (value[i] is Series)
-            {
-                (value[i] as Series).owner = this;
-            }
-        }
-
-        if (!_bDualMode)
-            initSecondaryMode();
-
-        invalidateSeries();
-        invalidateData();
-
-        legendDataChanged();
-    }
-
-    //----------------------------------
-    //  secondVerticalAxis
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the secondVerticalAxis property.
-     */
-    private var _secondVerticalAxis:IAxis;
-
-    [Inspectable(category="Data")]
-    [Deprecated(replacement="verticalAxis in individual series")]
-    /**
-     *  The second vertical axis definition for this chart.
-     *  This class is typically used to render the axis for a secondSeries.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get secondVerticalAxis():IAxis
-    {
-        return _secondVerticalAxis;
-    }
-
-    /**
-     *  @private
-     */
-    public function set secondVerticalAxis(value:IAxis):void
-    {
-        _secondVerticalAxis = value;
-
-        if (!_bDualMode)
-            initSecondaryMode();
-
-        _bAxesRenderersDirty = true;
-        invalidateData();
-        invalidateProperties();
-    }
-
-    //----------------------------------
-    //  secondVerticalAxisRenderer
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the secondVerticalAxisRenderer property.
-     */
-    private var _secondVerticalAxisRenderer:IAxisRenderer;
-
-    [Inspectable(category="Data")]
-    [Deprecated(replacement="CartesianChart.verticalAxisRenderers")]
-
-    /**
-     *  Defines the labels, tick marks, and data position
-     *  for items on the x-axis.
-     *  Use either the LinearAxis class or the CategoryAxis class
-     *  to set the properties of the horizontal axis as a child tag in MXML
-     *  or create a LinearAxis or CategoryAxis object in ActionScript.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function get secondVerticalAxisRenderer():IAxisRenderer
-    {
-        return _secondVerticalAxisRenderer;
-    }
-
-    /**
-     *  @private
-     */
-    public function set secondVerticalAxisRenderer(value:IAxisRenderer):void
-    {
-
-        if (_secondVerticalAxisRenderer)
-            if (DisplayObject(_secondVerticalAxisRenderer).parent == this)
-                removeChild(DisplayObject(_secondVerticalAxisRenderer));
-
-        _secondVerticalAxisRenderer = value;
-
-        if (_secondVerticalAxisRenderer.axis)
-            secondVerticalAxis = _secondVerticalAxisRenderer.axis;
-
-        _secondVerticalAxisRenderer.horizontal = false;
-        _bAxisStylesDirty=true;
-        _bAxesRenderersDirty = true;
-
-        invalidateChildOrder();
-        invalidateProperties();
-    }
-
-    //----------------------------------
-    //  verticalAxis
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the verticalAxis property.
-     */
-    private var _verticalAxis:IAxis;
-
-    [Inspectable(category="Data")]
-
-    /**
-     *  Defines the labels, tick marks, and data position
-     *  for items on the y-axis.
-     *  Use either the LinearAxis class or the CategoryAxis class
-     *  to set the properties of the horizontal axis as a child tag in MXML
-     *  or create a LinearAxis or CategoryAxis object in ActionScript.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
     public function get verticalAxis():IAxis
     {
         return _verticalAxis;
@@ -1046,9 +680,8 @@
     private var _verticalAxisRenderer:IAxisRenderer;

     [Inspectable(category="Data")]
-    [Deprecated(replacement="CartesianChart.verticalAxisRenderers")]
-
-    /**
+
+	/**
      *  Specifies how data appears along the y-axis of a chart.
      *  Use the AxisRenderer class to set the properties
      *  for verticalAxisRenderer as a child tag in MXM
@@ -1059,7 +692,7 @@
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public function get verticalAxisRenderer():IAxisRenderer
+    mx_internal function get verticalAxisRenderer():IAxisRenderer
     {
         return _verticalAxisRenderer;
     }
@@ -1067,7 +700,7 @@
     /**
      *  @private
      */
-    public function set verticalAxisRenderer(value:IAxisRenderer):void
+    mx_internal function set verticalAxisRenderer(value:IAxisRenderer):void
     {
         if (_verticalAxisRenderer)
             if (DisplayObject(_verticalAxisRenderer).parent == this)
@@ -1163,10 +796,6 @@
 			this.fill = new SolidColor(0xFFFFFF, 0);
 			this.calloutStroke = new Stroke(0x888888,2);
 			this.fontSize = 10;
-			this.horizontalAxisStyleName = "blockCategoryAxis";
-			this.secondHorizontalAxisStyleName = "blockCategoryAxis";
-			this.secondVerticalAxisStyleName = "blockNumericAxis";
-			this.verticalAxisStyleName = "blockNumericAxis";
 			this.horizontalAxisStyleNames = ["blockCategoryAxis"];
 			this.verticalAxisStyleNames = ["blockNumericAxis"];
 		}
@@ -1230,12 +859,6 @@

             if (_verticalAxisRenderer)
                 addChild(DisplayObject(_verticalAxisRenderer));
-
-            if (_secondHorizontalAxisRenderer)
-                addChild(DisplayObject(_secondHorizontalAxisRenderer));
-
-            if (_secondVerticalAxisRenderer)
-                addChild(DisplayObject(_secondVerticalAxisRenderer));

             invalidateDisplayList();

@@ -1246,21 +869,6 @@

                 CartesianTransform(_transforms[0]).setAxis(
                     CartesianTransform.VERTICAL_AXIS, _verticalAxis);
-
-                if (_transforms.length > 1)
-                {
-                    CartesianTransform(_transforms[1]).setAxis(
-                        CartesianTransform.HORIZONTAL_AXIS,
-                        _secondHorizontalAxis == null ?
-                        _horizontalAxis :
-                        _secondHorizontalAxis);
-
-                    CartesianTransform(_transforms[1]).setAxis(
-                        CartesianTransform.VERTICAL_AXIS,
-                        _secondVerticalAxis == null ?
-                        _verticalAxis :
-                        _secondVerticalAxis);
-                }
             }

             if (_horizontalAxisRenderer)
@@ -1268,21 +876,6 @@
             if (_verticalAxisRenderer)
                 _verticalAxisRenderer.axis = _verticalAxis;

-            if (_secondHorizontalAxisRenderer)
-            {
-                _secondHorizontalAxisRenderer.axis = _secondHorizontalAxis == null ?
-                                                _horizontalAxis :
-                                                _secondHorizontalAxis;
-            }
-
-            if (_secondVerticalAxisRenderer)
-            {
-                if (!_secondVerticalAxis)
-                    _secondVerticalAxisRenderer.axis = _verticalAxis;
-                else
-                    _secondVerticalAxisRenderer.axis = _secondVerticalAxis;
-            }
-
             updateMultipleAxesRenderers();

             // now if the series is using the same axis as charts, its datatransform needs to have
@@ -1299,16 +892,6 @@
                 g.invalidateProperties();
             }

-            n = _series2.length;
-            for (i = 0; i < n; i++)
-            {
-                g = _series2[i];
-                if (!g)
-                    continue;
-
-                g.invalidateProperties();
-            }
-
             n = annotationElements.length;
             for (i = 0; i < n; i++)
             {
@@ -1337,24 +920,13 @@
             if (_horizontalAxisRenderer && _horizontalAxisRenderer is DualStyleObject)
             {
                 DualStyleObject(_horizontalAxisRenderer).internalStyleName =
-                    getStyle("horizontalAxisStyleName");
+                    getStyle("horizontalAxisStyleNames")[0];
             }

             if (_verticalAxisRenderer && _verticalAxisRenderer is DualStyleObject)
             {
                 DualStyleObject(_verticalAxisRenderer).internalStyleName =
-                    getStyle("verticalAxisStyleName");
-            }
-
-            if (_secondHorizontalAxisRenderer && _secondHorizontalAxisRenderer is DualStyleObject)
-            {
-                DualStyleObject(_secondHorizontalAxisRenderer).internalStyleName =
-                    getStyle("secondHorizontalAxisStyleName");
-            }
-            if (_secondVerticalAxisRenderer && _secondVerticalAxisRenderer is DualStyleObject)
-            {
-                DualStyleObject(_secondVerticalAxisRenderer).internalStyleName =
-                    getStyle("secondVerticalAxisStyleName");
+                    getStyle("verticalAxisStyleNames")[0];
             }

             updateMultipleAxesStyles();
@@ -1403,38 +975,6 @@
      */
     override public function styleChanged(styleProp:String):void
     {
-        if (styleProp == null ||
-            _horizontalAxisRenderer &&
-            styleProp == "horizontalAxisStyleName")
-        {
-            _bAxisStylesDirty = true;
-            invalidateDisplayList();
-        }
-
-        if (styleProp == null ||
-            _verticalAxisRenderer &&
-            styleProp == "verticalAxisStyleName")
-        {
-            _bAxisStylesDirty = true;
-            invalidateDisplayList();
-        }
-
-        if (styleProp == null ||
-            _secondHorizontalAxisRenderer &&
-            styleProp == "secondHorizontalAxisStyleName")
-        {
-            _bAxisStylesDirty = true;
-            invalidateDisplayList();
-        }
-
-        if (styleProp == null ||
-            _secondVerticalAxisRenderer &&
-            styleProp == "secondVerticalAxisStyleName")
-        {
-            _bAxisStylesDirty = true;
-            invalidateDisplayList();
-        }
-
         if (_defaultGridLines && styleProp == "gridLinesStyleName")
         {
             _bgridLinesStyleNameDirty = true;
@@ -1486,9 +1026,6 @@
     {
         if (dataProvider != null)
             applyDataProvider(ICollectionView(dataProvider),_transforms[0]);
-
-        if (_secondDataProvider != null && _transforms.length >= 2)
-            applyDataProvider(_secondDataProvider,_transforms[1]);

     }

@@ -1503,9 +1040,6 @@
     override mx_internal function updateSeries():void
     {
         var displayedSeries:Array /* of Series */ = applySeriesSet(series,_transforms[0]);
-
-        if (_userSeries2 != null && _transforms.length >= 2)
-            _series2 = applySeriesSet(_userSeries2,_transforms[1]);

         var i:int;
         var len:int = displayedSeries ? displayedSeries.length : 0;
@@ -1523,9 +1057,6 @@
         addElements(displayedSeries,_transforms[0], _seriesFilterer);
         allElements = allElements.concat(displayedSeries);

-        addElements(_series2,_transforms[1], _seriesFilterer);
-        allElements = allElements.concat(_series2);
-
         labelElements = [];

         var n:int = displayedSeries.length;
@@ -1542,20 +1073,6 @@
                 labelElements.push(labelLayer);
         }

-        n = _series2.length;
-        for (i = 0; i < n; i++)
-        {
-            g = _series2[i] as IChartElement;
-            if (!g)
-                continue;
-
-            Series(g).invalidateProperties();
-
-            labelLayer = UIComponent(g.labelContainer);
-            if (labelLayer)
-                labelElements.push(labelLayer);
-        }
-
         addElements(labelElements,_transforms[0],_annotationElementHolder);
         allElements = allElements.concat(labelElements);

@@ -1565,13 +1082,7 @@
         _transforms[0].elements = annotationElements.concat(displayedSeries).
                                         concat(backgroundElements);

-        if (_transforms.length >= 2)
-            _transforms[1].elements = _series2;
-
         _allSeries = findSeriesObjects(series);
-        if (secondSeries)
-            _allSeries = _allSeries.concat(findSeriesObjects(secondSeries));
-
         invalidateData();
         invalidateSeriesStyles();
     }
@@ -1592,12 +1103,6 @@
         if (_verticalAxisRenderer)
             setChildIndex(DisplayObject(_verticalAxisRenderer), nextIndex++);

-        if (_secondHorizontalAxisRenderer)
-            setChildIndex(DisplayObject(_secondHorizontalAxisRenderer), nextIndex++);
-
-        if (_secondVerticalAxisRenderer)
-            setChildIndex(DisplayObject(_secondVerticalAxisRenderer), nextIndex++);
-
         var n: int = _horizontalAxisRenderers.length;
         for (var i:int = 0; i < n; i++)
         {
@@ -1612,58 +1117,7 @@
         return nextIndex;
     }

-    [Deprecated(replacement="IChartElement2.dataToLocal()")]
-    /**
-     *  @inheritDoc
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    override public function dataToLocal(... dataValues):Point
-    {
-        var data:Object = {};
-        var da:Array = [ data ];
-        var n:int = dataValues.length;
-
-        if (n > 0)
-        {
-            data["d0"] = dataValues[0];
-            _transforms[0].getAxis(CartesianTransform.HORIZONTAL_AXIS).
-                mapCache(da, "d0", "v0");
-        }
-
-        if (n > 1)
-        {
-            data["d1"] = dataValues[1];
-            _transforms[0].getAxis(CartesianTransform.VERTICAL_AXIS).
-                mapCache(da, "d1", "v1");
-        }
-
-        _transforms[0].transformCache(da,"v0","s0","v1","s1");
-
-        return new Point(data.s0 + _transformBounds.left,
-                         data.s1 + _transformBounds.top);
-    }
-
-    [Deprecated(replacement="IChartElement2.localToData()")]
-    /**
-     *  @inheritDoc
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    override public function localToData(v:Point):Array /* of Object */
-    {
-        var values:Array /* of Object */ = _transforms[0].invertTransform(
-                                            v.x - _transformBounds.left,
-                                            v.y - _transformBounds.top);
-        return values;
-    }
-
+
     /**
      *  @inheritDoc
      *
@@ -1901,12 +1355,6 @@
         if (_verticalAxisRenderer)
             measuredMinWidth = _verticalAxisRenderer.minWidth + 40;

-        if (_secondHorizontalAxisRenderer)
-            measuredMinHeight += _secondHorizontalAxisRenderer.minHeight;
-
-        if (_secondVerticalAxisRenderer)
-            measuredMinWidth += _secondVerticalAxisRenderer.minWidth;
-
         var n:int = _horizontalAxisRenderers.length;
         for (var i:int = 0; i < n; i++)
         {
@@ -2014,24 +1462,6 @@
             _verticalAxisRenderers[i].move(paddingLeft, paddingTop);
         }

-        if (_secondHorizontalAxisRenderer)
-        {
-            _secondHorizontalAxisRenderer.setActualSize(
-                unscaledWidth - paddingLeft - paddingRight,
-                unscaledHeight - paddingTop - paddingBottom);
-
-            _secondHorizontalAxisRenderer.move(paddingLeft, paddingTop);
-        }
-
-        if (_secondVerticalAxisRenderer)
-        {
-            _secondVerticalAxisRenderer.setActualSize(
-                unscaledWidth - paddingLeft - paddingRight,
-                unscaledHeight - paddingTop - paddingBottom);
-
-            _secondVerticalAxisRenderer.move(paddingLeft, paddingTop);
-        }
-
         // Fallback to the previous algorithm
         if (vLen == 0 && hLen == 0)
         {
@@ -2040,48 +1470,6 @@

             if (_verticalAxisRenderer.placement == "")
                 _verticalAxisRenderer.placement = "left";
-
-            if (_secondHorizontalAxisRenderer)
-            {
-                // Make sure their placement aligns.
-                var harPlacement:String = _horizontalAxisRenderer.placement;
-                switch (harPlacement)
-                {
-                    case "left":
-                    case "bottom":
-                    {
-                        _secondHorizontalAxisRenderer.placement = "right";
-                        break;
-                    }
-                    case "top":
-                    case "right":
-                    {
-                        _secondHorizontalAxisRenderer.placement = "left";
-                        break;
-                    }
-                }
-            }
-
-            if (_secondVerticalAxisRenderer)
-            {
-                // Make sure their placement aligns.
-                var varPlacement:String = _verticalAxisRenderer.placement;
-                switch (varPlacement)
-                {
-                    case "left":
-                    case "bottom":
-                    {
-                        _secondVerticalAxisRenderer.placement = "top";
-                        break;
-                    }
-                    case "top":
-                    case "right":
-                    {
-                        _secondVerticalAxisRenderer.placement = "bottom";
-                        break;
-                    }
-                }
-            }

             _computedGutters = new Rectangle();
             if (gutterLeft != null)
@@ -2107,38 +1495,17 @@

             var otherAxes:Array /* of AxisRenderer */ = [];
             otherAxes.push(_verticalAxisRenderer);
-            if (_secondVerticalAxisRenderer)
-                otherAxes.push(_secondVerticalAxisRenderer);
-
+
             _horizontalAxisRenderer.otherAxes = otherAxes;
-            if (_secondHorizontalAxisRenderer)
-                _secondHorizontalAxisRenderer.otherAxes = otherAxes;

             _computedGutters = _verticalAxisRenderer.adjustGutters(
                                     _computedGutters, adjustable);
-
-            if (_secondVerticalAxisRenderer)
-            {
-                _computedGutters= _secondVerticalAxisRenderer.adjustGutters(
-                                        _computedGutters, adjustable);
-            }
-
-            if (_secondHorizontalAxisRenderer)
-            {
-                _computedGutters= _secondHorizontalAxisRenderer.adjustGutters(
-                                        _computedGutters, adjustable);
-            }

             _computedGutters = _horizontalAxisRenderer.adjustGutters(
                                         _computedGutters, adjustable);

             _verticalAxisRenderer.gutters = _computedGutters;

-            if (_secondVerticalAxisRenderer)
-                _secondVerticalAxisRenderer.gutters = _computedGutters;
-
-            if (_secondHorizontalAxisRenderer)
-                _secondHorizontalAxisRenderer.gutters = _computedGutters;
         }
         else // the new algo for calculating the gutters
         {
@@ -2499,26 +1866,6 @@
                     emptyverticalRenderers.push(_verticalAxisRenderer);
         }

-        if (_secondHorizontalAxisRenderer)
-        {
-            if (_secondHorizontalAxisRenderer.placement == "bottom")
-                _bottomRenderers.push(_secondHorizontalAxisRenderer);
-            else if (_secondHorizontalAxisRenderer.placement == "top")
-                    _topRenderers.push(_secondHorizontalAxisRenderer);
-                 else
-                    emptyhorizontalRenderers.push(_secondHorizontalAxisRenderer);
-        }
-
-        if (_secondVerticalAxisRenderer)
-        {
-            if (_secondVerticalAxisRenderer.placement == "left")
-                _leftRenderers.push(_secondVerticalAxisRenderer);
-            else if (_secondVerticalAxisRenderer.placement == "right")
-                    _rightRenderers.push(_secondVerticalAxisRenderer);
-                 else
-                    emptyverticalRenderers.push(_secondVerticalAxisRenderer);
-        }
-
         // Adjust the placements

         leftLen = _leftRenderers.length;
@@ -2644,76 +1991,6 @@
         adjustAxesPlacements();
         invalidateDisplayList();
     }
-
-    /**
-     *  Initializes the chart for displaying a second series.
-     *  This function is called automatically whenever any of the secondary
-     *  properties, such as <code>secondSeries</code> or
-     *  <code>secondHorizontalAxis</code>, are set.
-     *  Specific chart subtypes override this method
-     *  to initialize default secondary values.
-     *  Column charts, for example, initialize a separate secondary vertical
-     *  axis, but leave the primary and secondary horizontal axes linked.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    protected function initSecondaryMode():void
-    {
-        _bDualMode = true;
-
-        transforms = [ _transforms[0], new CartesianTransform() ];
-    }
-
-    [Deprecated(replacement="Series.getAxis()")]
-    /**
-     *  Retrieves the axis instance for a particular secondary dimension
-     *  of the chart.
-     *  This is a low level accessor.
-     *  You typically retrieve the axis directly through a named property
-     *  (such as the <code>secondHorizontalAxis</code> or
-     *  <code>secondVerticalAxis</code> property).
-     *
-     *  @param dimension The dimension whose axis is responsible
-     *  for transforming the data.
-     *
-     *  @return The instance of the specified axis.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function getSecondAxis(dimension:String):IAxis
-    {
-        return transforms[0].getAxis(dimension);
-    }
-
-    [Deprecated(replacement="Series.getAxis()")]
-    /**
-     *  Assigns an axis instance to a particular secondary dimension
-     *  of the chart.
-     *  This is a low level accessor.
-     *  You typically set the axis directly through a named property
-     *  (such as the <code>secondHorizontalAxis</code> or
-     *  <code>secondVerticalAxis</code> property).
-     *
-     *  @param dimension The dimension whose axis is responsible
-     *  for transforming the data.
-     *
-     *  @param value The axis instance to assign.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function setSecondAxis(dimension:String, value:IAxis):void
-    {
-        transforms[0].setAxis(dimension, value);
-    }

     mx_internal function measureLabels():Object
     {


now using URLUtil

now using URLUtil

--- WeaveData/src/weave/services/URLRequestUtils.as
+++ WeaveData/src/weave/services/URLRequestUtils.as
@@ -32,6 +32,7 @@
 	import mx.rpc.Fault;
 	import mx.rpc.events.FaultEvent;
 	import mx.rpc.events.ResultEvent;
+	import mx.utils.URLUtil;

 	import weave.api.WeaveAPI;
 	import weave.api.services.IURLRequestToken;
@@ -56,15 +57,11 @@
 		 */
 		public function setBaseURL(baseURL:String):void
 		{
-			// get everything before first '/'
-			var beforeSlash:String = baseURL.split('/')[0];
-			// only set baseURL if there is a ':'
-			if (beforeSlash.indexOf(':') >= 0)
+			// only set baseURL if there is a ':' before first '/'
+			if (baseURL.split('/')[0].indexOf(':') >= 0)
 			{
 				// remove '?' and everything after
-				baseURL = baseURL.split('?')[0];
-				// remove last '/' and everything after
-				_baseURL = baseURL.substr(0, baseURL.lastIndexOf('/'));
+				_baseURL = baseURL.split('?')[0];
 			}
 		}

@@ -75,24 +72,8 @@
 		 */
 		private function addBaseURL(request:URLRequest):void
 		{
-			if (!_baseURL)
-				return;
-
-			if (request.url.substr(0, 1) == '/')
-			{
-				// url begins with '/'
-				request.url = _baseURL + request.url;
-			}
-			else
-			{
-				// get everything before first '/'
-				var beforeSlash:String = request.url.split('/')[0];
-				if (beforeSlash.indexOf(':') < 0)
-				{
-					// relative url, so prepend base url
-					request.url = _baseURL + '/' + request.url;
-				}
-			}
+			if (_baseURL)
+				request.url = URLUtil.getFullURL(_baseURL, request.url);
 		}

 		/**


Now using fixErrorMessage() on uncaught errors.
Now ignoring uncaught error #2063 (IME error).

Change-Id: I14033d2d98599258a088a693aa6dfc19d1f9906c

--- WeaveUI/src/weave/application/VisApplication.as
+++ WeaveUI/src/weave/application/VisApplication.as
@@ -118,6 +118,7 @@
 	import weave.utils.DebugTimer;
 	import weave.utils.EditorManager;
 	import weave.utils.VectorUtils;
+	import weave.utils.fixErrorMessage;
 	import weave.visualization.tools.WeaveAnalyst;

 	internal class VisApplication extends VBox implements ILinkableObject
@@ -179,7 +180,13 @@
 					'uncaughtError',
 					function(event:Object):void
 					{
-						reportError(event.error);
+						var error:Error = event.error;
+						// ignore IME error
+						if (error.errorID == 2063)
+							return;
+
+						fixErrorMessage(error)
+						reportError(error);
 					}
 				);
 			} catch (e:Error) { }


Updated Query update to avoid premature value overwriting

git-svn-id: 6aa7ccb0a2048310a30f08a72aaff4ca39d980ed@203 91848ab2-c4ae-4e4f-8e6a-6a52ea0dccc3

--- flare.tests/src/flare/tests/ExpressionTests.as
+++ flare.tests/src/flare/tests/ExpressionTests.as
@@ -373,22 +373,33 @@
 				sums[o.cat] += o.val;
 			}

+			// normalize across all items
 			var q:Query = update({norm:div("val",sum("val"))});
 			q.eval(data);
 			for (var i:uint=0; i<data.length; ++i) {
 				assertEquals(data[i].val/sums.all, data[i].norm);
 			}

+			// normalize within category
 			q.groupby("cat");
 			q.eval(data);
 			for (i=0; i<data.length; ++i) {
 				assertEquals(data[i].val/sums[data[i].cat], data[i].norm);
 			}

+			// check update without aggregates
 			update({val:add(1,"val")}).eval(data);
 			for (i=0; i<data.length; ++i) {
 				assertEquals(i+2, data[i].val);
 			}
+
+			// ensure that value overwriting is not occurring
+			update({copy1:"val"},{val:add(1,"val")},{copy2:"val"}).eval(data);
+			for (i=0; i<data.length; ++i) {
+				assertEquals(i+2, data[i].copy1);
+				assertEquals(i+2, data[i].copy2);
+				assertEquals(i+3, data[i].val);
+			}
 		}
 	}
 }


Simplified. Turns out the x/y coords of the states are honored,
so I don't need to wrap the downState in a Sprite.

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

--- src/as/com/threerings/flash/SimpleIconButton.as
+++ src/as/com/threerings/flash/SimpleIconButton.as
@@ -6,7 +6,6 @@
 import flash.display.Bitmap;
 import flash.display.BitmapData;
 import flash.display.SimpleButton;
-import flash.display.Sprite;

 import flash.geom.ColorTransform;

@@ -36,19 +35,14 @@
                 "that becomes one.");
         }

+        const bright :ColorTransform = new ColorTransform(1.25, 1.25, 1.25);
         upState = new Bitmap(bmp);
+        overState = new Bitmap(bmp);
+        overState.transform.colorTransform = bright;
+        downState = new Bitmap(bmp);
+        downState.y = 1;
+        downState.transform.colorTransform = bright;
         hitTestState = upState;
-        overState = new Bitmap(bmp);
-
-        var down :Sprite = new Sprite();
-        var downBmp :Bitmap = new Bitmap(bmp);
-        downBmp.y = 1;
-        down.addChild(downBmp);
-        downState = down;
-
-        const bright :ColorTransform = new ColorTransform(1.25, 1.25, 1.25);
-        overState.transform.colorTransform = bright;
-        downState.transform.colorTransform = bright;
     }
 }
 }


LinkableSynchronizer now behaves properly when loading a session state

--- WeaveCore/src/weave/core/LinkableSynchronizer.as
+++ WeaveCore/src/weave/core/LinkableSynchronizer.as
@@ -15,6 +15,7 @@

 package weave.core
 {
+	import weave.api.core.ICallbackCollection;
 	import weave.api.core.ILinkableObject;
 	import weave.api.registerDisposableChild;
 	import weave.api.registerLinkableChild;
@@ -24,6 +25,12 @@
 		public static const VAR_STATE:String = 'state';
 		public static const VAR_PRIMARY:String = 'primary';
 		public static const VAR_SECONDARY:String = 'secondary';
+
+		public function LinkableSynchronizer()
+		{
+			_callbacks = WeaveAPI.SessionManager.getCallbackCollection(this);
+			_callbacks.addImmediateCallback(null, selfCallback);
+		}

 		public const primaryPath:LinkableVariable = registerLinkableChild(this, new LinkableVariable(Array), setPrimaryPath);
 		public const secondaryPath:LinkableVariable = registerLinkableChild(this, new LinkableVariable(Array), setSecondaryPath);
@@ -43,11 +50,26 @@
 			secondaryWatcher.targetPath = secondaryPath.getSessionState() as Array;
 		}

+		private var _callbacks:ICallbackCollection;
+		private var _delayedSynchronize:Boolean = false;
 		private var _primary:ILinkableObject;
 		private var _secondary:ILinkableObject;

+		private function selfCallback():void
+		{
+			if (_delayedSynchronize)
+				synchronize();
+		}
+
 		private function synchronize():void
 		{
+			if (_callbacks.callbacksAreDelayed)
+			{
+				_delayedSynchronize = true;
+				return;
+			}
+			_delayedSynchronize = false;
+
 			var primary:ILinkableObject = primaryWatcher.target;
 			var secondary:ILinkableObject = secondaryWatcher.target;
 			if (_primary != primary || _secondary != secondary)
@@ -66,8 +88,8 @@
 					WeaveAPI.SessionManager.getCallbackCollection(_secondary).addImmediateCallback(this, secondaryCallback);
 					WeaveAPI.SessionManager.getCallbackCollection(_primary).addImmediateCallback(this, primaryCallback);

-					// if primaryTransform is not given but secondaryTransform is, call secondaryCallback
-					// otherwise, call primary callback.
+					// if primaryTransform is not given but secondaryTransform is, call secondaryCallback.
+					// otherwise, call primaryCallback.
 					if (!primaryTransform.value && secondaryTransform.value)
 						secondaryCallback();
 					else
@@ -78,13 +100,15 @@

 		private function handlePrimaryTransform():void
 		{
-			if (_primary && _secondary)
+			// if callbacks are delayed, it means we're loading a session state, so we don't want to apply the transform.
+			if (!_callbacks.callbacksAreDelayed && _primary && _secondary)
 				primaryCallback();
 		}

 		private function handleSecondaryTransform():void
 		{
-			if (_primary && _secondary)
+			// if callbacks are delayed, it means we're loading a session state, so we don't want to apply the transform.
+			if (!_callbacks.callbacksAreDelayed && _primary && _secondary)
 				secondaryCallback();
 		}

@@ -100,7 +124,7 @@
 				}
 				catch (e:Error)
 				{
-					WeaveAPI.ErrorManager.reportError(e, "Error in primaryTransform: " + e.message);
+					WeaveAPI.ErrorManager.reportError(e, "primaryTransform: " + e.message);
 				}
 			}
 			else if (!secondaryTransform.value)
@@ -120,7 +144,7 @@
 				}
 				catch (e:Error)
 				{
-					WeaveAPI.ErrorManager.reportError(e, "Error in secondaryTransform: " + e.message);
+					WeaveAPI.ErrorManager.reportError(e, "secondaryTransform: " + e.message);
 				}
 			}
 			else if (!primaryTransform.value)


fixed bug handling trailing separator items

--- WeaveUISpark/src/weave/menus/WeaveContextMenu.as
+++ WeaveUISpark/src/weave/menus/WeaveContextMenu.as
@@ -74,33 +74,32 @@
 		private function handleMenuSelect(e:*):void
 		{
 			var cmi_index:int = -1;
-			var cmi:ContextMenuItem;
+			var separatorBefore:Boolean = false;
 			for each (var wmi:WeaveMenuItem in root.children)
 			{
-				if (!cmi)
-					cmi = getCustomItem(++cmi_index);
-
 				if (wmi.type == WeaveMenuItem.TYPE_SEPARATOR)
 				{
-					cmi.separatorBefore = true;
+					separatorBefore = true;
 					continue;
 				}

+				var cmi:ContextMenuItem = getCustomItem(++cmi_index);
 				cmi_to_wmi[cmi] = wmi;
 				cmi.caption = wmi.label;
 				cmi.visible = wmi.shown;
 				cmi.enabled = wmi.enabled;
-				cmi = null;
+				cmi.separatorBefore = separatorBefore;
+				separatorBefore = false;
 			}

 			// hide remaining items
 			while (++cmi_index < _contextMenu.customItems.length)
-				(_contextMenu.customItems[cmi_index] as ContextMenuItem).visible = false;
+				getCustomItem(cmi_index).visible = false;
 		}

-		private function getCustomItem(i:int):ContextMenuItem
+		private function getCustomItem(index:int):ContextMenuItem
 		{
-			while (_contextMenu.customItems.length <= i)
+			while (_contextMenu.customItems.length <= index)
 			{
 				var items:Array = _contextMenu.customItems;
 				var cmi:ContextMenuItem = new ContextMenuItem('');
@@ -108,7 +107,7 @@
 				items.push(cmi);
 				_contextMenu.customItems = items;
 			}
-			return _contextMenu.customItems[i];
+			return _contextMenu.customItems[index] as ContextMenuItem;
 		}

 		private function handleMenuItemSelect(event:ContextMenuEvent):void


Remove old code

Remove old code

--- src/com/merlinds/miracle_tool/services/FileSystemService.as
+++ src/com/merlinds/miracle_tool/services/FileSystemService.as
@@ -99,21 +99,8 @@
 		public function writeTexture(name:String, png:ByteArray, mesh:ByteArray):void{
 			log(this, "writeTexture", name);
 			_queue.push(new SaveHelper(png, PNG_EXTENSION));
-			name = name + ATF_EXTENSION;
-			/*//create file
-			var output:ByteArray = new ByteArray();
-			//add signature
-			output.position = 0;
-			output.writeUTFBytes(TEXTURE_EXTENSION.substr(1).toUpperCase());
-			output.position = 4;
-			var meshHeaderBlocks:int = Math.ceil( mesh.length / 512 );
-			output.writeUnsignedInt( meshHeaderBlocks );
-			output.position = 8;
-			output.writeBytes(mesh);
-			output.position = 8 + meshHeaderBlocks * 512;*/
-
 			_queue.push(new SaveHelper(mesh, TEXTURE_EXTENSION));
-			_target = this.appModel.lastFileDirection.resolvePath(name);
+			_target = this.appModel.lastFileDirection.resolvePath(name + ATF_EXTENSION);
 			_publishBuilder.createATFFile(png, 0, this.publishBuilderATFHandler);
 		}