Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPHierarchy.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPHierarchy.as
@@ -0,0 +1,655 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.olap
+{
+
+import flash.utils.Dictionary;
+import flash.utils.getTimer;
+
+import mx.collections.ArrayCollection;
+import mx.collections.ICollectionView;
+import mx.collections.IList;
+import mx.collections.IViewCursor;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  metadata
+//--------------------------------------
+
+[DefaultProperty("elements")]
+
+/**
+ *  The OLAPHierarchy class represents a hierarchy of the schema of an OLAP cube.
+ *
+ *  @mxml
+ *

+ *  The <mx:OLAPHierarchy> tag inherits all of the tag attributes
+ *  of its superclass, and adds the following tag attributes:
+ *

+ *

+ *  <mx:OLAPHierarchy
+ *    Properties
+ *    allMemberName="(All)"
+ *    elements="An array of Levels of this hierarchy"
+ *    hasAll="true|false"
+ *    name="No default"
+ *  />
+ *
+ *  @see mx.olap.IOLAPHierarchy
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class OLAPHierarchy extends OLAPElement implements IOLAPHierarchy
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor
+     *
+     *  @param name The name of the OLAP level that includes the OLAP schema hierarchy of the element.
+     *
+     *  @param displayName The name of the OLAP level, as a String, which can be used for display.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function OLAPHierarchy(name:String=null, displayName:String=null)
+    {
+        OLAPTrace.traceMsg("Creating hierarchy: " + name, OLAPTrace.TRACE_LEVEL_3);
+        //if (!name)
+        //  name = "Hierarchy";
+        super(name, displayName);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The all member of this hierarchy.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    mx_internal var allMember:OLAPMember;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // hasAll
+    //----------------------------------
+
+    private var _hasAll:Boolean = true;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+     public function get hasAll():Boolean
+    {
+        return _hasAll;
+    }
+
+    /**
+     *  @private
+     */
+     public function set hasAll(value:Boolean):void
+    {
+        //we need to recreate this.
+        if (_hasAll != value)
+            _allLevels = null;
+        _hasAll = value;
+    }
+
+    //----------------------------------
+    // levels
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    protected var _levels:IList = new ArrayCollection();
+
+    /**
+     *  @private
+     */
+    protected var _levelMap:Dictionary = new Dictionary(true);
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get levels():IList
+    {
+        return _levels;
+    }
+
+    /**
+     *  @private
+     */
+    public function set levels(value:IList):void
+    {
+        var level:OLAPLevel;
+        _levels = value;
+        _levelMap = new Dictionary(true);
+
+        var n:int = levels.length;
+        for (var i:int = 0; i < n; ++i)
+        {
+            level = levels.getItemAt(i) as OLAPLevel;
+            level.hierarchy = this;
+            _levelMap[level.attributeName] = level;
+        }
+    }
+
+    //----------------------------------
+    // elements
+    //----------------------------------
+
+    /**
+    *  An Array of the  levels of the hierarchy, as OLAPLevel instances.
+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
+    */
+    public function set elements(value:Array):void
+    {
+        levels = new ArrayCollection(value);
+    }
+
+    //----------------------------------
+    // allLevels
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    protected var _allLevels:IList;
+
+    /**
+     *  @private
+     */
+    mx_internal function get allLevels():IList
+    {
+        if (!_allLevels)
+        {
+            _allLevels = new ArrayCollection(_levels.toArray());
+            _allLevels.addItemAt(allLevel, 0);
+        }
+
+        return _allLevels;
+    }
+
+    //----------------------------------
+    // dataProvider
+    //----------------------------------
+
+    private var _dataProvider:ICollectionView;
+
+    /**
+     *  @private
+     */
+    public function get dataProvider():ICollectionView
+    {
+        if (_dataProvider)
+            return _dataProvider;
+        return OLAPDimension(dimension).dataProvider;
+    }
+
+    /**
+     *  @private
+     */
+    public function set dataProvider(value:ICollectionView):void
+    {
+        _dataProvider = value;
+    }
+
+    //----------------------------------
+    // allLevelName
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    protected var _allLevelName:String = "(All)";
+
+    /**
+     *  The name of the all level for the hierarchy.
+     *
+     *  @default "(All)"
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    mx_internal function get allLevelName():String
+    {
+        return _allLevelName;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function set allLevelName(value:String):void
+    {
+        _allLevelName = value;
+    }
+
+    //----------------------------------
+    // allLevel
+    //----------------------------------
+
+    private var _allLevel:IOLAPLevel;
+
+    /**
+     *  The all level for the hierarchy.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    mx_internal function set allLevel(l:IOLAPLevel):void
+    {
+        _allLevel = l;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function get allLevel():IOLAPLevel
+    {
+        return _allLevel;
+    }
+
+    //----------------------------------
+    // allMemberName
+    //----------------------------------
+
+    private var _allMemberName:String = "(All)";
+
+    /**
+     *  @inheritDoc
+     *
+     *  @default "(All)"
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get allMemberName():String
+    {
+        return _allMemberName;
+    }
+
+    /**
+     *  @private
+     */
+    public function set allMemberName(value:String):void
+    {
+        if (value && _allMemberName != value)
+        {
+        	//if all level and all member are already present update them
+        	//this may be a rare case
+            var level:OLAPLevel = _levelMap[allLevelName];
+            if (level)
+            {
+                level.removeMemberByName(_allMemberName);
+                _allMemberName = value;
+                allMember = level.createMember(null, allMemberName) as OLAPMember;
+                allMember.setIsAll(true);
+            }
+            else
+                _allMemberName = value;
+        }
+
+    }
+
+    //----------------------------------
+    // members
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var allMembersCache:ArrayCollection;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get members():IList
+    {
+        var temp:Array = [];
+        if (hasAll)
+        {
+            if (!allMembersCache)
+            {
+                // add the all member then add children of each member up to the leaf level.
+                temp.push(allMember);
+                temp = temp.concat(getMembersRecursively(allMember));
+                allMembersCache = new ArrayCollection(temp);
+            }
+            return allMembersCache;
+        }
+        else
+        {
+            //TODO handle the case when all member is not present. Is this correct?
+            var n:int = levels.length;
+            for (var i:int = 0; i < n; ++i)
+            {
+                var level:OLAPLevel = levels.getItemAt(i) as OLAPLevel;
+                temp = temp.concat(level.getMembers(false).source);
+            }
+        }
+
+        return new ArrayCollection(temp);
+    }
+
+    //----------------------------------
+    // defaultMember
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+     public function get defaultMember():IOLAPMember
+    {
+        if (hasAll)
+            return allMember;
+
+        // return the first levels first member as default
+        return levels.length >= 1 ? levels[0].members[0] : null;
+    }
+
+    //----------------------------------
+    // name
+    //----------------------------------
+
+    /**
+     * User defined name of this hierarchy. If user has not set a explicit name
+     * then the dimension name is returned.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function get name():String
+    {
+        var n:String = super.name;
+        if (!n)
+            return dimension.name;
+        return n;
+    }
+
+    //----------------------------------
+    // children
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get children():IList
+    {
+        if (allLevel)
+        {
+            var temp:IOLAPMember = allLevel.members.getItemAt(0) as IOLAPMember;
+            var retValue:IList = temp.children;
+            return retValue;
+        }
+
+        //TODO pick first level's members as we don't have the all level?
+        return null;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function findLevel(name:String):IOLAPLevel
+    {
+        // allLevel is internal
+        if (name == allLevelName)
+            return null;
+        return _levelMap[name];
+    }
+
+    /**
+     *  @private
+     *  Creates a level of a hierarchy.
+     *
+     *  @param name The name of the level.
+     *
+     *  @return An OLAPLevel instance that represents the new level.
+     */
+    mx_internal function createLevel(name:String):OLAPLevel
+    {
+        var l:OLAPLevel = new OLAPLevel(name);
+        l.hierarchy = this;
+        l.dimension = dimension;
+        _levels.addItem(l);
+        _levelMap[name] = l;
+
+        return l;
+    }
+
+    /**
+     *  @private
+     */
+    protected function createAllLevelIfRequired():void
+    {
+        var level:OLAPLevel;
+        if (hasAll)
+        {
+            //check if we don't have all level and member
+            // if we don't have create them
+            level = _levelMap[allLevelName];
+            if (!level)
+            {
+                //we don't want all level to get included in levels array
+                //level = createLevel(allLevelName);
+                level = new OLAPLevel(name);
+                level.hierarchy = this;
+                level.dimension = dimension;
+                allLevel = level;
+                allMember = level.createMember(null, allMemberName) as OLAPMember;
+                allMember.setIsAll(true);
+            }
+        }
+        else
+        {
+            allLevel = null;
+            allMember = null;
+            level = _levelMap[allLevelName];
+            if (level)
+            {
+                var index:int = _levels.getItemIndex(level);
+                if (index > -1)
+                    _levels.removeItemAt(index);
+                delete _levelMap[allLevelName];
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function refresh():void
+    {
+        //clear the cached array
+        _allLevels = null;
+        allMembersCache = null;
+
+        createAllLevelIfRequired();
+
+        if (allLevel)
+            OLAPLevel(allLevel).refresh();
+
+        for each (var level:OLAPLevel in _levels)
+        {
+            level.dimension = dimension;
+            level.refresh();
+        }
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function processData(data:Object):void
+    {
+        var parent:IOLAPMember;
+        if (allLevel)
+            parent = allLevel.members.getItemAt(0) as IOLAPMember;
+
+        var n:int = levels.length;
+        for (var i:int = 0; i < n; ++i)
+        {
+            var level:OLAPLevel = levels.getItemAt(i) as OLAPLevel;
+            var value:String = level.dataFunction(data, level.dataField);
+
+            //the new member is parent to the next member
+            parent = level.createMember(parent, value);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function makeMembers():Boolean
+    {
+        var iterator:IViewCursor = dataProvider.createCursor();
+
+        var startTime:int = getTimer();
+
+        while (!iterator.afterLast)
+        {
+            var currentData:Object = iterator.current;
+            processData(currentData);
+            iterator.moveNext();
+        }
+
+        var endTime:int = getTimer();
+
+        return true;
+    }
+
+    /**
+     *  @private
+     */
+    private function getMembersRecursively(m:IOLAPMember):Array
+    {
+        var temp:Array = [];
+        var children:IList = m.children;
+        var n:int = children.length;
+        for (var i:int = 0; i < n; ++i)
+        {
+            var member:IOLAPMember = children.getItemAt(i) as IOLAPMember;
+            temp.push(member);
+            if (member.children.length > 0)
+            {
+                var members:Array = getMembersRecursively(member);
+                temp = temp.concat(members);
+            }
+        }
+        return temp;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function findMember(name:String):IOLAPMember
+    {
+        if (allLevel)
+        {
+            if (name == allMemberName)
+                return allMember;
+            return allMember.findChildMember(name);
+        }
+
+        if (levels.length)
+        {
+            var defLevel:IOLAPLevel = levels[0];
+            var list:IList = defLevel.findMember(name);
+            if (list && list.length == 1)
+                return list.getItemAt(0) as IOLAPMember;
+        }
+
+        return null;
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPQueryAxis.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPQueryAxis.as
@@ -0,0 +1,213 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.olap
+{
+
+import mx.resources.ResourceBundle;
+import mx.resources.ResourceManager;
+
+[ResourceBundle("olap")]
+
+/**
+ *  The OLAPQueryAxis interface represents an axis of an OLAP query.
+ *
+ *  @mxml
+ *

+ *  The <mx:OLAPQueryAxis> tag inherits all of the tag attributes
+ *  of its superclass, and adds the following tag attributes:
+ *

+ *

+ *  <mx:OLAPQueryAxis
+ *    Properties
+ *  />
+ *
+ *  @see mx.olap.OLAPQuery
+ *  @see mx.olap.IOLAPQueryAxis
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class OLAPQueryAxis implements IOLAPQueryAxis
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor
+     *
+     *  @param ordinal The type of axis.
+     *  Use OLAPQuery.COLUMN AXIS for a column axis,
+     *  OLAPQuery.ROW_AXIS for a row axis,
+     *  and OLAPQuery.SLICER_AXIS for a slicer axis.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function OLAPQueryAxis(ordinal:int)
+    {
+        axisOrdinal = ordinal;
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // axisOrdinal
+    //----------------------------------
+
+    /**
+     *  The type of axis, as
+     *  OLAPQuery.COLUMN AXIS for a column axis,
+     *  OLAPQuery.ROW_AXIS for a row axis,
+     *  and OLAPQuery.SLICER_AXIS for a slicer axis.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var axisOrdinal:int;
+
+    //----------------------------------
+    // sets
+    //----------------------------------
+
+    private var _sets:Array = [];
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get sets():Array
+    {
+        return _sets;
+    }
+
+    //----------------------------------
+    // tuples
+    //----------------------------------
+
+    private var _tuples:Array = [];
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get tuples():Array
+    {
+        return _tuples;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addMember(m:IOLAPMember):void
+    {
+        if (!m)
+        {
+            var message:String = ResourceManager.getInstance().getString(
+                    "olap", "nullMemberOnAxis", [axisOrdinal]);
+            throw new QueryError(message);
+        }
+
+        var t:OLAPTuple = new OLAPTuple;
+        _tuples.push(t);
+
+        //TODO should we keep creating new sets?
+        var s:OLAPSet = new OLAPSet;
+        s.addTuple(t)
+        _sets.push(s);
+
+        t.addMember(m);
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addSet(s:IOLAPSet):void
+    {
+        _sets.push(s);
+        for each (var t:OLAPTuple in OLAPSet(s).tuples)
+        {
+            _tuples.push(t);
+        }
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addTuple(t:IOLAPTuple):void
+    {
+        _tuples.push(t);
+        var s:OLAPSet = new OLAPSet;
+        s.addTuple(t)
+        _sets.push(s);
+    }
+
+    /**
+     * Clears all the sets, tuples and members from this axis.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function clear():void
+    {
+		_tuples.splice(0);
+		_sets.splice(0);
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/effects/SetStyleAction.as
+++ frameworks/projects/framework/src/mx/effects/SetStyleAction.as
@@ -46,6 +46,11 @@
  *  @see mx.states.SetStyle
  *
  *  @includeExample ../states/examples/TransitionExample.mxml
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
  public class SetStyleAction extends Effect
 {
@@ -61,6 +66,11 @@
 	 *  Constructor.
 	 *
 	 *  @param target The Object to animate with this effect.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function SetStyleAction(target:Object = null)
 	{
@@ -92,6 +102,11 @@
 	 *  style properties modified by this effect.
 	 *
 	 *  @see mx.effects.Effect#getAffectedProperties()
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	override public function get relevantStyles():Array /* of String */
 	{
@@ -114,6 +129,11 @@
 	 *  The name of the style property being changed.
 	 *  By default, Flex determines this value from the SetStyle
 	 *  property definition in the view state definition.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var name:String;

@@ -127,6 +147,11 @@
 	 *  The new value for the style property.
 	 *  By default, Flex determines this value from the SetStyle
 	 *  property definition in the view state definition.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var value:*;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.managers
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5417
Author:   mhorn@adobe.com
Date:     2009-03-19T17:51:41.646724Z

Log Message:
-----------
a couple of minor asdoc fixes

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

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

--- frameworks/projects/spark/src/spark/components/DropDownList.as
+++ frameworks/projects/spark/src/spark/components/DropDownList.as
@@ -91,7 +91,7 @@
 [DefaultProperty("dataProvider")]

 /**
- *  FxComboBox control contains a drop-down list
+ *  DropDownList control contains a drop-down list
  *  from which the user can select a single value.
  *  Its functionality is very similar to that of the
  *  SELECT form element in HTML.


Transferred from the Adobe Open Source Subversion Repository

Revision: 11650
Author:   dloverin@adobe.com
Date:     2009-11-11T14:00:10.715278Z

Log Message:
-----------
Fix global styles defined in a module and a module loading bug.

Fixes a case where a module locally modified the global style but it wasn’t taking effect. If a module has a global style defined in its style manager then add it to the inherit chain after its parent’s inherit chain.

QE notes: None.
Doc notes: None.
Bugs: SDK-24111, SDK-24095
Reviewer: Alex, Glenn
Tests run: checkintests, PerModuleStyles, Managers/StyleManager
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>

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

--- frameworks/projects/framework/src/mx/modules/ModuleManager.as
+++ frameworks/projects/framework/src/mx/modules/ModuleManager.as
@@ -512,6 +512,15 @@
      */
     public function resurrect():void
     {
+        // If the module is not ready then don't try to resurrect it.
+        // You can only resurrect a module that is in the ready state.
+        // We return here and do not destroy the current state because
+        // we may have started loading a module that is not yet ready.
+        if (!_ready)
+            return;
+
+        //trace("Module[", url, "] resurrect");
+
         if (!factoryInfo && limbo)
         {
             //trace("trying to resurrect ", _url, "...");
@@ -1075,13 +1084,7 @@
                          bytes:ByteArray = null,
                          moduleFactory:IFlexModuleFactory = null):void
     {
-        // If the module is not ready then don't try to resurrect it.
-        // You can only resurrect a module that is in the ready state.
-        // By not calling resurrect until we have a module loaded we
-        // can be called here multiple times for the same module and
-        // only load the module once.
-        if (info.ready)
-            info.resurrect();
+        info.resurrect();

         if (!referenced)
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 16262
Author:   dloverin@adobe.com
Date:     2010-05-20T18:44:39.210129Z

Log Message:
-----------
Move mx components out of framework.swc into mx.swc

The new mx.swc library lives in the libs/mx directory.

QE notes: Of the 5 failures I saw: 1 was intermittent and 4 are not a bug.
Managers/StyleManager/AdvancedCSS/descendantSelectors/AdvancedCSS_descendantSelectors_Style descendantSelector_combining_nested_style
    This failure was intermittent.

mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ApplicationControlBar_FromTo
mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ApplicationControlBar_By
mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ControlBar_FromTo
mx/effects/Resize/Containers/Resize_Containers Effects_Resize_Containers_ControlBar_By
    These failures are due to my code changes but I believe the old behavior was incorrect. When a control bar is the last child in a Panel it should appear at the bottom of the Panel. In the test case an ApplicationControlBar/ContorlBar is added to an empty Panel, making it the last child in the Panel. So it should appear at the bottom of the Panel instead of inside the Panel.

Doc notes: new library, mx.swc
Bugs:
Reviewer: Alex
Tests run:
Is noteworthy for integration: Yes

Modified Paths:
--------------
740 paths were modified

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

--- frameworks/projects/mx/src/mx/styles/metadata/LeadingStyle.as
+++ frameworks/projects/mx/src/mx/styles/metadata/LeadingStyle.as
@@ -0,0 +1,23 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  Additional vertical space between lines of text.
+ *
+ *
The default value is 2.

+ *
The default value for the ComboBox control is 0.

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="leading", type="Number", format="Length", inherit="yes")]


Transferred from the Adobe Open Source Subversion Repository

Revision: 4005
Author:   rfrishbe@adobe.com
Date:     2008-11-04T01:07:38.597640Z

Log Message:
-----------
Change in the way item renderers lay them selves out.  Before we were using 100% width and 100% height.  Now, we're using horizontalAlign and verticalAlign to accomplish this, which are properties added to VerticalLayout and HorizontalLayout, respectively.  horizontalAlign takes values "left", "center", "right", "justify", and "contentJustify".  "justify" sizes all elements to the width of the component.  "contentJustify" sizes all elements to the size of the largest child (with a minimum of the width of the parent component).  Similar, verticalAlign takes "top", "middle", "bottom", "justify", and "contentJustify".

The default List skin sets the VerticalLayout's horizontalAlign to "contentJustify."  Most lists should use "contentJustify" or "justify" if you don't want scrollbars.  If you want to change your list to a horizontal list, you change the layout to a horizontal layout.  However, you must set the verticalAlign property on the horizontal layout correctly--otherwise it'll default to "top" and probably won't do what you want.

Ran checkintests and the following mustella tests: layout, list, Group, DataGroup, FxDataContainer, and FxContainer.  Some DataGroup tests were failing but should be because of an unrelated, local change.  All other tests are passing.

QE Notes: Failing tests are excluded.  Please update them (I think all just need to add verticalAlign="contentJustify" in the horizontal layout case) and re-include them.  Also, please write tests for this new functionality.
Doc Notes: None
Bugs: SDK-17198
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxListSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDataContainerSkin.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalAlign.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalAlign.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -22,7 +22,6 @@

 import mx.containers.utilityClasses.Flex;
 import mx.events.PropertyChangeEvent;
-import mx.components.Group;

 /**
@@ -45,6 +44,33 @@
     	                                                       layoutItem.maxSize.x );
     	return percentWidth < width ? percentWidth : width;
     }
+
+    private static function sizeLayoutItem(layoutItem:ILayoutItem, width:Number,
+                                           horizontalAlign:String, restrictedWidth:Number,
+                                           height:Number, variableRowHeight:Boolean,
+                                           rowHeight:Number):void
+    {
+        var newWidth:Number = NaN;
+
+        // if horizontalAlign is "justify" or "contentJustify",
+        // restrict the width to restrictedWidth.  Otherwise,
+        // size it normally
+        if (horizontalAlign == HorizontalAlign.JUSTIFY ||
+            horizontalAlign == HorizontalAlign.CONTENT_JUSTIFY)
+        {
+            newWidth = restrictedWidth;
+        }
+        else
+        {
+            if (hasPercentWidth(layoutItem))
+               newWidth = calculatePercentWidth(layoutItem, width);
+        }
+
+        if (variableRowHeight)
+            layoutItem.setActualSize(newWidth, height);
+        else
+            layoutItem.setActualSize(newWidth, rowHeight);
+    }

     //--------------------------------------------------------------------------
     //
@@ -132,6 +158,42 @@
         var oldValue:int = _rowCount;
         _rowCount = value;
         dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "rowCount", oldValue, value));
+    }
+
+    //----------------------------------
+    //  horizontalAlign
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _horizontalAlign:String = HorizontalAlign.LEFT;
+
+    [Inspectable(category="General")]
+
+    /** Horizontal alignment of children in the container.
+     *  Possible values are "left", "center",
+     *  "right", "justify",
+     *  and "contentJustify".
+     *  The default value is "left", but some containers,
+     *  such as List, use a different default value.  There are constants
+     *  for these values in mx.layout.HorizontalAlign.
+     */
+    public function get horizontalAlign():String
+    {
+        return _horizontalAlign;
+    }
+
+    /**
+     *  @private
+     */
+    public function set horizontalAlign(value:String):void
+    {
+        if (value == _horizontalAlign)
+            return;
+
+        _horizontalAlign = value;
+        invalidateTargetDisplayList();
     }

     //----------------------------------
@@ -798,29 +860,42 @@
             return;

         // TODO EGeorgie: use vector
-        var layoutItemArray:Array = new Array();
         var layoutItem:ILayoutItem;
         var count:uint = layoutTarget.numLayoutItems;
-        var totalCount:uint = count; // How many items will be laid out
-        for (var i:int = 0; i < count; i++)
-        {
-            layoutItem = layoutTarget.getLayoutItemAt(i);
-            if (!layoutItem || !layoutItem.includeInLayout)
+
+        // if horizontalAlign is "contentJustify", we need to figure out restrictedWidth.
+        // contentWidth gets sent in to distributeHeight(), but is only used if
+        // horizontalAlign is "justify" (contentWidth is unscaledWidth) or
+        // horizontalAlign is "contentJustify" (contentWidth is the maximum width
+        // of all its children and a minimum of unscaledWidth)
+        var contentWidth:Number = unscaledWidth;
+
+        if (horizontalAlign != HorizontalAlign.LEFT)
+        {
+            for (var i:int = 0; i < count; i++)
             {
-            	totalCount--;
-                continue;
-            }
-            layoutItemArray.push(layoutItem);
-        }
-
-        var totalHeightToDistribute:Number = unscaledHeight;
-        if (totalCount > 1)
-            totalHeightToDistribute -= (totalCount - 1) * gap;
-
-        distributeHeight(layoutItemArray, unscaledWidth, totalHeightToDistribute);
-
-        // TODO EGeorgie: horizontalAlign
+                layoutItem = layoutTarget.getLayoutItemAt(i);
+                if (!layoutItem || !layoutItem.includeInLayout)
+                    continue;
+
+                var layoutItemWidth:Number;
+                if (hasPercentWidth(layoutItem))
+                    layoutItemWidth = calculatePercentWidth(layoutItem, unscaledWidth);
+                else
+                    layoutItemWidth = layoutItem.preferredSize.x;
+
+                contentWidth = Math.max(contentWidth, layoutItemWidth);
+            }
+        }
+
+        distributeHeight(unscaledWidth, unscaledHeight, contentWidth);
+
+        // default to left (0)
         var hAlign:Number = 0;
+        if (horizontalAlign == HorizontalAlign.CENTER)
+            hAlign = .5;
+        else if (horizontalAlign == HorizontalAlign.RIGHT)
+            hAlign = 1;

         // As the LayoutItems are positioned, we'll count how many rows
         // fall within the layoutTarget's scrollRect
@@ -836,24 +911,19 @@
         var maxY:Number = 0;
         var firstRowInView:int = -1;
         var lastRowInView:int = -1;
-
-        // rowHeight can be expensive to compute
-        var rh:Number = (variableRowHeight) ? 0 : rowHeight;

         for (var index:int = 0; index < count; index++)
         {
             layoutItem = layoutTarget.getLayoutItemAt(index);
             if (!layoutItem || !layoutItem.includeInLayout)
                 continue;
-
-        	// Set the layout item's acutual size and position
-            var x:Number = (unscaledWidth - layoutItem.actualSize.x) * hAlign;
+
+            // Set the layout item's position
+            var x:Number = (contentWidth - layoutItem.actualSize.x) * hAlign;
             layoutItem.setActualPosition(x, y);
-            var dx:Number = layoutItem.actualSize.x;
-            if (!variableRowHeight)
-                layoutItem.setActualSize(dx, rh);

             // Update maxX,Y, first,lastVisibleIndex, and y
+            var dx:Number = layoutItem.actualSize.x;
             var dy:Number = layoutItem.actualSize.y;
             maxX = Math.max(maxX, x + dx);
             maxY = Math.max(maxY, y + dy);
@@ -887,22 +957,35 @@
      *  The return value is any extra space that's left over
      *  after growing all children to their maxHeight.
      */
-    public function distributeHeight(layoutItemArray:Array,
-                                     width:Number,
-                                     height:Number):Number
+    public function distributeHeight(width:Number,
+                                     height:Number,
+                                     restrictedWidth:Number):Number
     {
         var spaceToDistribute:Number = height;
         var totalPercentHeight:Number = 0;
         var childInfoArray:Array = [];
         var childInfo:LayoutItemFlexChildInfo;
         var newWidth:Number;
+        var layoutItem:ILayoutItem;
+
+        // rowHeight can be expensive to compute
+        var rh:Number = (variableRowHeight) ? 0 : rowHeight;
+        var count:uint = target.numLayoutItems;
+        var totalCount:uint = count; // number of items to use in gap calculation

         // If the child is flexible, store information about it in the
         // childInfoArray. For non-flexible children, just set the child's
         // width and height immediately.
-        for each (var layoutItem:ILayoutItem in layoutItemArray)
-        {
-            if (hasPercentHeight(layoutItem))
+        for (var index:int = 0; index < count; index++)
+        {
+            layoutItem = target.getLayoutItemAt(index);
+            if (!layoutItem || !layoutItem.includeInLayout)
+            {
+                totalCount--;
+                continue;
+            }
+
+            if (hasPercentHeight(layoutItem) && variableRowHeight)
             {
                 totalPercentHeight += layoutItem.percentHeight;

@@ -916,14 +999,15 @@
             }
             else
             {
-                newWidth = NaN;
-                if (hasPercentWidth(layoutItem))
-                   newWidth = calculatePercentWidth(layoutItem, width);
+                sizeLayoutItem(layoutItem, width, horizontalAlign,
+                               restrictedWidth, NaN, variableRowHeight, rh);

-                layoutItem.setActualSize(newWidth, NaN);
                 spaceToDistribute -= layoutItem.actualSize.y;
             }
         }
+
+        if (totalCount > 1)
+            spaceToDistribute -= (totalCount-1) * gap;

         // Distribute the extra space among the flexible children
         if (totalPercentHeight)
@@ -932,13 +1016,12 @@
                                                                 spaceToDistribute,
                                                                 totalPercentHeight,
                                                                 childInfoArray);
+
             for each (childInfo in childInfoArray)
             {
-            	newWidth = NaN;
-            	if (hasPercentWidth(childInfo.layoutItem))
-            	   newWidth = calculatePercentWidth(childInfo.layoutItem, width);
-
-                childInfo.layoutItem.setActualSize(newWidth, childInfo.size);
+                sizeLayoutItem(childInfo.layoutItem, width, horizontalAlign,
+                               restrictedWidth, childInfo.size,
+                               variableRowHeight, rh);
             }
         }
         return spaceToDistribute;


added MISSING bracket.

added MISSING bracket.


Added StandardLib.formatDate().

Added StandardLib.formatDate().

Change-Id: I819ad9f1bc4a87773447aa53a2f67206e79b4cb0

--- WeaveCore/src/weave/compiler/StandardLib.as
+++ WeaveCore/src/weave/compiler/StandardLib.as
@@ -475,32 +475,74 @@
 		}

 		/**
-		 * This will parse a date string into a Date object or a Number.
+		 * This will parse a date string into a Date object.
 		 * @param dateString The date string to parse.
 		 * @param formatString The format of the date string.
-		 * @param returnDateObject If set to true, a Date object will be returned.  Otherwise, a Number will be returned.
-		 * @return The result of parsing the date string.
+		 * @param parseAsUniversalTime If set to true, the date string will be parsed as universal time.
+		 *        If set to false, the timezone of the user's computer will be used.
+		 * @return The resulting Date object.
 		 *
 		 * @see mx.formatters::DateFormatter#formatString
 		 * @see Date
 		 */
-		public static function parseDate(dateString:String, formatString:String = null, returnDateObject:Boolean = true):Object
+		public static function parseDate(dateString:String, formatString:String = null, parseAsUniversalTime:Boolean = true):Date
 		{
 			var formattedDateString:String = dateString;
 			if (formatString)
 			{
+				// work around bug in DateFormatter that requires Year, Month, and Day to be in the formatString
+				var separator:String = ' //';
+				for (var i:int = 0; i < 3; i++)
+				{
+					var char:String = "YMD".charAt(i);
+					if (formatString.indexOf(char) < 0)
+					{
+						formatString += separator + char;
+						dateString += separator + (char == 'Y' ? '1970' : '1');
+					}
+				}
+
 				_dateFormatter.formatString = formatString;
 				formattedDateString = _dateFormatter.format(dateString);
-			}
-			if (returnDateObject)
-				return DateFormatter.parseDateString(formattedDateString);
-			return Date.parse(formattedDateString);
-
-		}
-
-		/**
-		 * This is the DateFormatter used by parseDate().
+				if (_dateFormatter.error)
+					throw new Error(_dateFormatter.error);
+			}
+			var date:Date = DateFormatter.parseDateString(formattedDateString);
+			if (parseAsUniversalTime)
+				date.setTime( date.getTime() - date.getTimezoneOffset() * _timezoneMultiplier );
+			return date;
+		}
+
+		/**
+		 * This will generate a date string from a Number or a Date object using the specified date format.
+		 * @param value The Date object or date string to format.
+		 * @param formatString The format of the date string to be generated.
+		 * @param formatAsUniversalTime If set to true, the date string will be generated using universal time.
+		 *        If set to false, the timezone of the user's computer will be used.
+		 * @return The resulting formatted date string.
+		 *
+		 * @see mx.formatters::DateFormatter#formatString
+		 * @see Date
+		 */
+		public static function formatDate(value:Object, formatString:String = null, formatAsUniversalTime:Boolean = true):String
+		{
+			var date:Date = value as Date;
+			if (!date || formatAsUniversalTime)
+				date = new Date(value);
+			if (formatAsUniversalTime)
+				date.setTime( date.getTime() + date.getTimezoneOffset() * _timezoneMultiplier );
+
+			_dateFormatter.formatString = formatString;
+			return _dateFormatter.format(date);
+		}
+
+		/**
+		 * This is the DateFormatter used by parseDate() and formatDate().
+		 */
+		private static const _dateFormatter:DateFormatter = new DateFormatter();
+		/**
+		 * The number of milliseconds in one minute.
 		 */
-		private static const _dateFormatter:DateFormatter = new DateFormatter();
+		private static const _timezoneMultiplier:Number = 60000;
 	}
 }


added sort()

added sort()

--- WeaveCore/src/weave/compiler/StandardLib.as
+++ WeaveCore/src/weave/compiler/StandardLib.as
@@ -456,6 +456,18 @@
 			for each (var value:Number in args)
 				sum += value;
 			return sum;
+		}
+
+		/**
+		 * This uses AsyncSort.sortImmediately() to sort an Array (or Vector) in place.
+		 * @param array An Array (or Vector) to sort.
+		 * @param compare A function that accepts two items and returns -1, 0, or 1.
+		 * @see weave.utils.AsyncSort#sortImmediately()
+		 * @see Array#sort()
+		 */
+		public static function sort(array:*, compare:Function = null):void
+		{
+			AsyncSort.sortImmediately(array, compare);
 		}

 		/**


refreshing target when it is accessed if root wasn't found earlier

--- WeaveJS/src/weavejs/core/LinkableWatcher.as
+++ WeaveJS/src/weavejs/core/LinkableWatcher.as
@@ -55,6 +55,7 @@

 		protected var _typeRestriction:Class;
 		private var _target:ILinkableObject; // the current target or ancestor of the to-be-target
+		private var _foundRoot:Boolean = false; // false until Weave.getRoot(this) returns non-null
 		private var _foundTarget:Boolean = true; // false when _target is not the desired target
 		protected var _targetPath:Array; // the path that is being watched
 		private var _pathDependencies:Dictionary2D = new Dictionary2D(); // (ILinkableCompositeObject, String) -> child object
@@ -65,6 +66,8 @@
 		 */
 		public function get target():ILinkableObject
 		{
+			if (!_foundRoot && !_foundTarget)
+				handlePath();
 			return _foundTarget ? _target : null;
 		}
 		public function set target(newTarget:ILinkableObject):void
@@ -183,6 +186,7 @@

 			// traverse the path, finding ILinkableDynamicObject path dependencies along the way
 			var node:ILinkableObject = Weave.getRoot(this);
+			_foundRoot = node != null;
 			var subPath:Array = [];
 			for each (var name:* in _targetPath)
 			{


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/modules/ModuleBase.as
+++ frameworks/projects/framework/src/mx/modules/ModuleBase.as
@@ -23,6 +23,11 @@
  *  tag in an MXML file, you instead extend the Module class.
  *
  *  @see mx.modules.Module
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class ModuleBase extends EventDispatcher
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11987
Author:   smgilson@adobe.com
Date:     2009-11-19T16:38:37.133422Z

Log Message:
-----------
ASDoc edits from doc reviews

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

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

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

--- frameworks/projects/spark/src/spark/components/ComboBox.as
+++ frameworks/projects/spark/src/spark/components/ComboBox.as
@@ -258,19 +258,21 @@
      *  It then and scrolls to and highlights the closest match in the item list.
      *
      *
The function referenced by this property takes an input string and returns
-     *  the items in the data provider that match the input.
-     *  The items are returned as a Vector of indices in the data provider.

+     *  the index of the items in the data provider that match the input.
+     *  The items are returned as a Vector.<int> of indices in the data provider.

      *
      *
The callback function must have the following signature:

      *
      *

-     *    function myMatchingFunction(comboBox:ComboBox, inputText:String):Vector

+     *    function myMatchingFunction(comboBox:ComboBox, inputText:String):Vector.<int>

      *
      *
If the value of this property is null, the ComboBox finds matches
      *  using the default algorithm.
      *  By default, if an input string of length n is equivalent to the first n characters
      *  of an item (ignoring case), then it is a match to that item. For example, 'aRiz'
      *  is a match to "Arizona" while 'riz' is not.

+     *
+     *
To disable search, create a callback function that returns an empty Vector.<int>.

      *
      *  @default null
      *


Transferred from the Adobe Open Source Subversion Repository

Revision: 16019
Author:   hmuller@adobe.com
Date:     2010-05-10T23:09:46.617663Z

Log Message:
-----------
New classes: DataGrid, DataGridSkin, SelectionMode.  I've moved event handling from Grid to DataGrid and moved selectionMode property from Grid to GridSelection.  Added Grid.defaultItemRenderer property.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/supportClasses/GridSelection.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/skins/spark/DataGridSkin.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/flex4_5/frameworks/projects/spark/src/spark/components/supportClasses/SelectionMode.as</path>

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -0,0 +1,768 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.components
+{
+
+import flash.events.Event;
+import flash.events.KeyboardEvent;
+import flash.ui.Keyboard;
+
+import mx.collections.IList;
+import mx.core.IFactory;
+import mx.core.mx_internal;
+import mx.managers.IFocusManagerComponent;
+
+import spark.components.supportClasses.GridDimensions;
+import spark.components.supportClasses.GridEvent;
+import spark.components.supportClasses.GridLayout;
+import spark.components.supportClasses.GridSelection;
+import spark.components.supportClasses.SelectionMode;
+import spark.components.supportClasses.SkinnableContainerBase;
+import spark.core.NavigationUnit;
+
+use namespace mx_internal;
+
+/**
+ *  TBD
+ */
+public class DataGrid extends SkinnableContainerBase implements IFocusManagerComponent
+{
+    include "../core/Version.as";
+
+    public function DataGrid()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Skin Parts
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  grid
+    //----------------------------------
+
+    [SkinPart(required="false", type="spark.components.Grid")]
+
+    /**
+     *  TBD
+     */
+    public var grid:spark.components.Grid;
+
+    //----------------------------------
+    //  scroller
+    //----------------------------------
+
+    [SkinPart(required="false", type="spark.components.Scroller")]
+
+    /**
+     *  TBD
+     */
+    public var scroller:Scroller;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    private function dispatchChangeEvent(type:String):void
+    {
+        if (hasEventListener(type))
+            dispatchEvent(new Event(type));
+    }
+
+    // TBD(hmuller): baselinePosition override
+    // TBD(hmuller): methods to expose the selection
+    // TBD(hmuller): methods to enable scrolling
+
+
+    //----------------------------------
+    //  dataProvider (delgates to grid.dataProvider)
+    //----------------------------------
+
+    [Bindable("dataProviderChanged")]
+
+    private var _dataProvider:IList = null;  // same default value as Grid dataProvider
+
+    /**
+     *  @copy spark.components.Grid#dataProvider
+     *
+     *  @default nulll
+     */
+    public function get dataProvider():IList
+    {
+        return (grid) ? grid.dataProvider : _dataProvider;
+    }
+
+    /**
+     *  @private
+     */
+    public function set dataProvider(value:IList):void
+    {
+        if (dataProvider == value) // note: we're using the get method, not _dataProvider
+            return;
+
+        _dataProvider = value;
+        if (grid)
+            grid.dataProvider = value;
+
+        dispatchChangeEvent("dataProviderChanged");
+    }
+
+    /**
+     *  @private
+     */
+    private function getDataProviderLength():uint
+    {
+        const dataProvider:IList = dataProvider;
+        return (dataProvider) ? dataProvider.length : 0;
+    }
+
+
+    //----------------------------------
+    //  columns (delgates to grid.columns)
+    //----------------------------------
+
+    [Bindable("columnsChanged")]
+
+    private var _columns:IList = null;  // same default value as Grid columns
+
+    /**
+     *  @copy spark.components.Grid#columns
+     *
+     *  @default null
+     */
+    public function get columns():IList
+    {
+        return (grid) ? grid.columns : _columns;
+    }
+
+    /**
+     *  @private
+     */
+    public function set columns(value:IList):void
+    {
+        if (columns == value) // note: we're using the get method, not _columns
+            return;
+
+        _columns = value;
+        if (grid)
+            grid.columns = value;
+
+        dispatchChangeEvent("columnsChanged");
+    }
+
+    /**
+     *  @private
+     */
+    private function getColumnsLength():uint
+    {
+        const columns:IList = columns;
+        return (columns) ? columns.length : 0;
+    }
+
+    //----------------------------------
+    //  anchorColumnIndex (delgates to grid.anchorColumnIndex)
+    //----------------------------------
+
+    [Bindable("anchorColumnIndexChanged")]
+
+    private var _anchorColumnIndex:int = 0;  // same default value as Grid anchorColumnIndex
+
+    /**
+     *  @copy spark.components.Grid#anchorColumnIndex
+     *
+     *  @default null
+     */
+    public function get anchorColumnIndex():int
+    {
+        return (grid) ? grid.anchorColumnIndex : _anchorColumnIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set anchorColumnIndex(value:int):void
+    {
+        if (anchorColumnIndex == value) // note: we're using the get method, not _anchorColumnIndex
+            return;
+
+        _anchorColumnIndex = value;
+        if (grid)
+            grid.anchorColumnIndex = value;
+
+        dispatchChangeEvent("anchorColumnIndexChanged");
+    }
+
+
+    //----------------------------------
+    //  anchorRowIndex (delgates to grid.anchorRowIndex)
+    //----------------------------------
+
+    [Bindable("anchorRowIndexChanged")]
+
+    private var _anchorRowIndex:int = 0;  // same default value as Grid anchorRowIndex
+
+    /**
+     *  @copy spark.components.Grid#anchorRowIndex
+     *
+     *  @default null
+     */
+    public function get anchorRowIndex():int
+    {
+        return (grid) ? grid.anchorRowIndex : _anchorRowIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set anchorRowIndex(value:int):void
+    {
+        if (anchorRowIndex == value) // note: we're using the get method, not _anchorRowIndex
+            return;
+
+        _anchorRowIndex = value;
+        if (grid)
+            grid.anchorRowIndex = value;
+
+        dispatchChangeEvent("anchorRowIndexChanged");
+    }
+
+    //----------------------------------
+    //  caretColumnIndex (delgates to grid.caretColumnIndex)
+    //----------------------------------
+
+    [Bindable("caretColumnIndexChanged")]
+
+    private var _caretColumnIndex:int = -1;  // same default value as Grid caretColumnIndex
+
+    /**
+     *  @copy spark.components.Grid#caretColumnIndex
+     *
+     *  @default null
+     */
+    public function get caretColumnIndex():int
+    {
+        return (grid) ? grid.caretColumnIndex : _caretColumnIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set caretColumnIndex(value:int):void
+    {
+        if (caretColumnIndex == value) // note: we're using the get method, not _caretColumnIndex
+            return;
+
+        _caretColumnIndex = value;
+        if (grid)
+            grid.caretColumnIndex = value;
+
+        dispatchChangeEvent("caretColumnIndexChanged");
+    }
+
+
+    //----------------------------------
+    //  caretRowIndex (delgates to grid.caretRowIndex)
+    //----------------------------------
+
+    [Bindable("caretRowIndexChanged")]
+
+    private var _caretRowIndex:int = -1;  // same default value as Grid caretRowIndex
+
+    /**
+     *  @copy spark.components.Grid#caretRowIndex
+     *
+     *  @default null
+     */
+    public function get caretRowIndex():int
+    {
+        return (grid) ? grid.caretRowIndex : _caretRowIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set caretRowIndex(value:int):void
+    {
+        if (caretRowIndex == value) // note: we're using the get method, not _caretRowIndex
+            return;
+
+        _caretRowIndex = value;
+        if (grid)
+            grid.caretRowIndex = value;
+
+        dispatchChangeEvent("caretRowIndexChanged");
+    }
+
+    //----------------------------------
+    //  hoverColumnIndex (delgates to grid.hoverColumnIndex)
+    //----------------------------------
+
+    [Bindable("hoverColumnIndexChanged")]
+
+    private var _hoverColumnIndex:int = -1;  // same default value as Grid hoverColumnIndex
+
+    /**
+     *  @copy spark.components.Grid#hoverColumnIndex
+     *
+     *  @default null
+     */
+    public function get hoverColumnIndex():int
+    {
+        return (grid) ? grid.hoverColumnIndex : _hoverColumnIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set hoverColumnIndex(value:int):void
+    {
+        if (hoverColumnIndex == value) // note: we're using the get method, not _hoverColumnIndex
+            return;
+
+        _hoverColumnIndex = value;
+        if (grid)
+            grid.hoverColumnIndex = value;
+
+        dispatchChangeEvent("hoverColumnIndexChanged");
+    }
+
+
+    //----------------------------------
+    //  hoverRowIndex (delgates to grid.hoverRowIndex)
+    //----------------------------------
+
+    [Bindable("hoverRowIndexChanged")]
+
+    private var _hoverRowIndex:int = -1;  // same default value as Grid hoverRowIndex
+
+    /**
+     *  @copy spark.components.Grid#hoverRowIndex
+     *
+     *  @default null
+     */
+    public function get hoverRowIndex():int
+    {
+        return (grid) ? grid.hoverRowIndex : _hoverRowIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set hoverRowIndex(value:int):void
+    {
+        if (hoverRowIndex == value) // note: we're using the get method, not _hoverRowIndex
+            return;
+
+        _hoverRowIndex = value;
+        if (grid)
+            grid.hoverRowIndex = value;
+
+        dispatchChangeEvent("hoverRowIndexChanged");
+    }
+
+    //----------------------------------
+    //  selectionMode delegates to (delegates to grid.selectionMode)
+    //----------------------------------
+
+    [Bindable("selectionModeChanged")]
+
+    /**
+     *  TBD
+     */
+    public function get selectionMode():String
+    {
+        return grid.selectionMode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set selectionMode(value:String):void
+    {
+        if (selectionMode == value)
+            return;
+
+        grid.selectionMode = value;
+        dispatchChangeEvent("selectionModeChanged");
+    }
+
+    //----------------------------------
+    //  gridDimensions (private, read-only)
+    //----------------------------------
+
+    private var _gridDimensions:GridDimensions = null;
+
+    private function get gridDimensions():GridDimensions
+    {
+        if (!_gridDimensions)
+            _gridDimensions = new GridDimensions();  // TBD(hmuller):delegate to protected createGridDimensions()
+        return _gridDimensions;
+    }
+
+    //----------------------------------
+    //  gridSelection (private)
+    //----------------------------------
+
+    private var _gridSelection:GridSelection = null;
+
+    private function get gridSelection():GridSelection
+    {
+        if (!_gridSelection)
+            _gridSelection = new GridSelection(grid);  // TBD(hmuller):delegate to protected createGridSelection()
+        return _gridSelection;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  GridEvent handlers
+    //
+    //--------------------------------------------------------------------------
+
+    protected function gridRollOverHandler(event:GridEvent):void
+    {
+        hoverRowIndex = event.rowIndex;
+        hoverColumnIndex = event.columnIndex;
+    }
+
+    protected function gridRollOutHandler(event:GridEvent):void
+    {
+        hoverRowIndex = -1;
+        hoverColumnIndex = -1;
+    }
+
+    protected function gridMouseDownHandler(event:GridEvent):void
+    {
+        const rowIndex:int = event.rowIndex;
+        const columnIndex:int = event.columnIndex;
+
+        if (event.ctrlKey)
+        {
+            if (!toggleSelection(rowIndex, columnIndex))
+                return;
+
+            // ctrl-click updates caret and anchor.
+            caretRowIndex = anchorRowIndex = rowIndex;
+            caretColumnIndex = anchorColumnIndex = columnIndex;
+        }
+        else if (event.shiftKey &&
+            (caretRowIndex != -1) && (caretColumnIndex != -1) &&
+            (selectionMode == SelectionMode.MULTIPLE_ROWS ||
+                selectionMode == SelectionMode.MULTIPLE_CELLS))
+        {
+            if (!extendSelection(anchorRowIndex, anchorColumnIndex,
+                rowIndex, columnIndex))
+            {
+                return;
+            }
+
+            // shift-click always updates caret.
+            caretRowIndex = rowIndex;
+            caretColumnIndex = columnIndex;
+        }
+        else
+        {
+            if (gridSelection.isRowSelectionMode())
+                gridSelection.setRow(rowIndex);
+            else if (gridSelection.isCellSelectionMode())
+                gridSelection.setCell(rowIndex, columnIndex);
+            else
+                return;
+
+            // click updates caret and anchor.
+            caretRowIndex = anchorRowIndex = rowIndex;
+            caretColumnIndex = anchorColumnIndex = columnIndex;
+        }
+
+        invalidateDisplayList();
+    }
+
+    private function toggleSelection(rowIndex:int, columnIndex:int):Boolean
+    {
+        if (gridSelection.isRowSelectionMode())
+        {
+            if (gridSelection.containsRow(rowIndex))
+                gridSelection.removeRow(rowIndex);
+            else if (selectionMode == SelectionMode.MULTIPLE_ROWS)
+                gridSelection.addRow(rowIndex);
+            else
+                gridSelection.setRow(rowIndex);
+            return true;
+        }
+        else if (gridSelection.isCellSelectionMode())
+        {
+            if (gridSelection.containsCell(rowIndex, columnIndex))
+                gridSelection.removeCell(rowIndex, columnIndex);
+            else if (selectionMode == SelectionMode.MULTIPLE_CELLS)
+                gridSelection.addCell(rowIndex, columnIndex);
+            else
+                gridSelection.setCell(rowIndex, columnIndex);
+            return true;
+        }
+
+        return false;
+    }
+
+    private function extendSelection(anchorRowIndex:int,
+        anchorColumnIndex:int,
+        caretRowIndex:int,
+        caretColumnIndex:int):Boolean
+    {
+        // The caller is responsible for ensuring there is a valid caret.
+
+        if (anchorRowIndex < 0 || anchorColumnIndex < 0)
+            return false;
+
+        const startRowIndex:int = Math.min(anchorRowIndex, caretRowIndex);
+        const endRowIndex:int = Math.max(anchorRowIndex, caretRowIndex);
+
+        if (selectionMode == SelectionMode.MULTIPLE_ROWS)
+        {
+            const rowIndices:Vector.<int> =
+                new Vector.<int>(1 + (endRowIndex - startRowIndex), true);
+            for (var selectedRowIndex:int = startRowIndex;
+                selectedRowIndex <= endRowIndex; selectedRowIndex++)
+            {
+                rowIndices[selectedRowIndex - startRowIndex] = selectedRowIndex;
+            }
+            gridSelection.setRows(rowIndices);
+            return true;
+        }
+        else if (selectionMode == SelectionMode.MULTIPLE_CELLS)
+        {
+            const startColumnIndex:int =
+                Math.min(anchorColumnIndex, caretColumnIndex);
+            const endColumnIndex:int =
+                Math.max(anchorColumnIndex, caretColumnIndex);
+            gridSelection.setCellRegion(startRowIndex, startColumnIndex,
+                endRowIndex - startRowIndex + 1,
+                endColumnIndex - startColumnIndex + 1);
+            return true;
+        }
+
+        return false;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Build in basic keyboard navigation support in Grid.
+     */
+    override protected function keyDownHandler(event:KeyboardEvent):void
+    {
+        super.keyDownHandler(event);
+
+        if (event.isDefaultPrevented())
+            return;
+
+        // Was the space bar hit?
+        if (event.keyCode == Keyboard.SPACE)
+        {
+            if (caretRowIndex != -1 && caretColumnIndex != -1)
+            {
+                if (event.ctrlKey)
+                {
+                    if (toggleSelection(caretRowIndex, caretColumnIndex))
+                    {
+                        anchorRowIndex = caretRowIndex;
+                        anchorColumnIndex = caretColumnIndex;
+                    }
+                }
+                else if (event.shiftKey)
+                {
+                    extendSelection(anchorRowIndex, anchorColumnIndex,
+                        caretRowIndex, caretColumnIndex);
+                }
+                else
+                {
+                    if (gridSelection.isRowSelectionMode())
+                        gridSelection.addRow(caretRowIndex);
+                    else if (gridSelection.isCellSelectionMode())
+                        gridSelection.addCell(caretRowIndex, caretColumnIndex);
+                }
+                invalidateDisplayList();
+            }
+            event.preventDefault();
+            return;
+        }
+
+        // Was some other navigation key hit in combination with ctrl/cmd
+        // or shift?
+        if (event.ctrlKey || event.shiftKey)
+            adjustSelectionUponNavigation(event);
+    }
+
+    /**
+     *  Adjusts the caret and the selection based on what keystroke is used
+     *  in combination with a ctrl/cmd key or a shift key.
+     */
+    protected function adjustSelectionUponNavigation(event:KeyboardEvent):void
+    {
+        // Some unrecognized key stroke was entered, return.
+        if (!NavigationUnit.isNavigationUnit(event.keyCode))
+            return;
+
+        // If rtl layout, need to swap Keyboard.LEFT and Keyboard.RIGHT.
+        var navigationUnit:uint = mapKeycodeForLayoutDirection(event);
+
+        if (!setCaretToNavigationDestination(navigationUnit))
+            return;
+
+        event.preventDefault();
+
+        // If its a ctrl/cmd key-nav key combination, there is nothing
+        // more to do then set the caret.
+        // The shift key-nav key combination extends the selection.
+        if (event.shiftKey)
+        {
+            if (!extendSelection(anchorRowIndex, anchorColumnIndex,
+                caretRowIndex, caretColumnIndex))
+            {
+                return;
+            }
+        }
+
+        invalidateDisplayList();
+
+        // TBD: ensure caret is visible
+
+    }
+
+    public function setCaretToNavigationDestination(navigationUnit:uint):Boolean
+    {
+        if (caretRowIndex == -1 || caretColumnIndex == -1)
+            return false;
+
+        const inRows:Boolean = gridSelection.isRowSelectionMode();
+
+        const rowCount:int = getDataProviderLength();
+        const columnCount:int = getColumnsLength();
+
+        switch (navigationUnit)
+        {
+            case NavigationUnit.LEFT:
+            {
+                if (!inRows && caretColumnIndex > 0)
+                    caretColumnIndex--;
+                break;
+            }
+
+            case NavigationUnit.RIGHT:
+            {
+                if (!inRows && caretColumnIndex + 1 < columnCount)
+                    caretColumnIndex++;
+                break;
+            }
+
+            case NavigationUnit.UP:
+            {
+                if (caretRowIndex > 0)
+                    caretRowIndex--;
+                break;
+            }
+
+            case NavigationUnit.DOWN:
+            {
+                if (caretRowIndex + 1 < rowCount)
+                    caretRowIndex++;
+                break;
+            }
+
+            case NavigationUnit.PAGE_UP:
+            {
+                // TBD: try for 20 lines for now.
+                caretRowIndex  = Math.max(0, caretRowIndex - 20);
+                break;
+            }
+            case NavigationUnit.PAGE_DOWN:
+            {
+                // TBD: try for 20 lines for now.
+                caretRowIndex = Math.min(rowCount - 1, caretRowIndex + 20);
+                break;
+            }
+
+            case NavigationUnit.HOME:
+            {
+                caretRowIndex = 0;
+                caretColumnIndex = 0;
+                break;
+            }
+
+            case NavigationUnit.END:
+            {
+                caretRowIndex = rowCount - 1;
+                caretColumnIndex = columnCount - 1;
+                break;
+            }
+
+            default:
+            {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function partAdded(partName:String, instance:Object):void
+    {
+        super.partAdded(partName, instance);
+
+        if (instance == grid)
+        {
+            grid.dataProvider = _dataProvider;
+            grid.columns = _columns;
+            grid.layout = new GridLayout();  // TBD(hmuller): delegate to protected createGridLayout()
+            grid.gridDimensions = gridDimensions;
+            grid.gridSelection = gridSelection;
+            grid.addEventListener(GridEvent.GRID_MOUSE_DOWN, gridMouseDownHandler);
+            grid.addEventListener(GridEvent.GRID_ROLL_OVER, gridRollOverHandler);
+            grid.addEventListener(GridEvent.GRID_ROLL_OUT, gridRollOutHandler);
+        }
+    }
+
+    /**
+     * @private
+     */
+    override protected function partRemoved(partName:String, instance:Object):void
+    {
+        super.partRemoved(partName, instance);
+
+        if (instance == grid)
+        {
+            grid.removeEventListener(GridEvent.GRID_MOUSE_DOWN, gridMouseDownHandler);
+            grid.removeEventListener(GridEvent.GRID_ROLL_OVER, gridRollOverHandler);
+            grid.removeEventListener(GridEvent.GRID_ROLL_OUT, gridRollOutHandler);
+            grid.layout = null;
+            grid.gridSelection = null;
+            grid.gridDimensions = null;
+            grid.dataProvider = null;
+            grid.columns = null;
+        }
+    }
+
+
+
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 19665
Author:   eday@adobe.com
Date:     2011-01-09T19:46:39.597874Z

Log Message:
-----------
Bounce/pull bug fixes

QE notes:
Doc notes:
Bugs: SDK-29046, SDK-28972
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -27,6 +27,7 @@
 import mx.core.LayoutDirection;
 import mx.core.mx_internal;
 import mx.events.EffectEvent;
+import mx.events.FlexEvent;
 import mx.events.FlexMouseEvent;
 import mx.events.PropertyChangeEvent;
 import mx.events.TouchInteractionEvent;
@@ -601,6 +602,18 @@

     /**
      *  @private
+     *  The final position in the throw effect's vertical motion path
+     */
+    private var throwFinalVSP:Number;
+
+    /**
+     *  @private
+     *  The final position in the throw effect's horizontal motion path
+     */
+    private var throwFinalHSP:Number;
+
+    /**
+     *  @private
      *  Used to keep track of whether the throw animation
      *  was stopped pre-emptively.  We stop propogation of
      *  the mouse event, but in the throwEffect.EFFECT_END
@@ -660,6 +673,12 @@
      *  both cases, so we must keep track of it ourselves.
      */
     private var hideScrollBarAnimationPrematurelyStopped:Boolean;
+
+    /**
+     *  @private
+     *  Keeps track of whether a touch interaction is in progress.
+     */
+    private var inTouchInteraction:Boolean = false;

     //--------------------------------------------------------------------------
     //
@@ -762,7 +781,7 @@
         installViewport();
         dispatchEvent(new Event("viewportChanged"));
     }
-
+
     private function installViewport():void
     {
         if (skin && viewport)
@@ -876,7 +895,88 @@
     // Event Handlers
     //
     //--------------------------------------------------------------------------
-
+
+    /**
+     *  @private
+     *  Helper function for viewport_propertyChangeHandler below
+     */
+    private function checkForInvalidScrollPositions():void
+    {
+        var snapVSP:Number;
+        var snapHSP:Number;
+        var doVerticalSnap:Boolean = false;
+        var doHorizontalSnap:Boolean = false;
+
+        function updateCompleteHandler(event:FlexEvent):void
+        {
+            viewport.removeEventListener(FlexEvent.UPDATE_COMPLETE,
+                updateCompleteHandler);
+
+            if (doHorizontalSnap)
+                viewport.horizontalScrollPosition = snapHSP;
+
+            if (doVerticalSnap)
+                viewport.verticalScrollPosition = snapVSP;
+        }
+
+        // There are two cases in which we'll potentially need to fix invalid
+        // scroll positions...
+        if (throwEffect && throwEffect.isPlaying)
+        {
+            // 1) A throw effect animation is in progress, and may have been
+            // set up to end at a scroll position that is now invalid.
+            snapVSP = throwFinalVSP;
+            snapHSP = throwFinalHSP;
+        }
+        else if (!inTouchInteraction)
+        {
+            // 2) There's no touch gesture in progress.  The content may be
+            // at a scroll position that is now invalid.
+            snapVSP = viewport.verticalScrollPosition;
+            snapHSP = viewport.horizontalScrollPosition;
+        }
+        else
+        {
+            // If we get here we know that a touch gesture is in progress but
+            // the throw animation portion is not playing.  The user's finger
+            // is down.  We don't need to worry about the scroll position being
+            // invalid because when the finger is released the throw animation
+            // will get us back to a valid position.
+            return;
+        }
+
+        // Determine the maximum valid scroll positions
+        var maxVSP:Number = viewport.contentHeight > viewport.height ?
+            viewport.contentHeight-viewport.height : 0;
+        var maxHSP:Number = viewport.contentWidth > viewport.width ?
+            viewport.contentWidth-viewport.width : 0;
+
+        // See whether the current scroll positions are invalid
+        if (snapVSP > maxVSP)
+        {
+            snapVSP = maxVSP;
+            doVerticalSnap = true;
+        }
+        if (snapHSP > maxHSP)
+        {
+            snapHSP = maxHSP;
+            doHorizontalSnap = true;
+        }
+
+        if (doHorizontalSnap || doVerticalSnap)
+        {
+            // One or both scroll positions are invalid
+
+            // If a throw effect is playing, we need to stop it
+            if (throwEffect && throwEffect.isPlaying)
+                throwEffect.stop();
+
+            // We need to wait until after the current update to change to the new
+            // valid scroll positions.
+            viewport.addEventListener(FlexEvent.UPDATE_COMPLETE,
+                updateCompleteHandler);
+        }
+    }

     private function viewport_propertyChangeHandler(event:PropertyChangeEvent):void
     {
@@ -885,6 +985,14 @@
             case "contentWidth":
             case "contentHeight":
                 invalidateSkin();
+                if (getStyle("interactionMode") == InteractionMode.TOUCH)
+                {
+                    // If the content size changed, particularly because of a device
+                    // orientation (i.e. landscape/portrait) change, then the valid
+                    // scroll position ranges may have changed.  In this case, we may
+                    // need to snap the content scroll position back to a valid value.
+                    checkForInvalidScrollPositions();
+                }
                 break;
         }
     }
@@ -1367,6 +1475,7 @@
         scrollingHorizontally = false;
         var horizontalTime:Number = 0;
         var finalKeyframe:int;
+        throwFinalHSP = 0;
         if (scrollerLayout && scrollerLayout.canScrollHorizontally)
         {
             var hsp:Number = viewport.horizontalScrollPosition;
@@ -1381,12 +1490,14 @@
             {
                 throwEffectMotionPaths.push(horizontalMP);
                 horizontalTime = horizontalMP.keyframes[horizontalMP.keyframes.length-1].time;
+                throwFinalHSP = Number(horizontalMP.keyframes[horizontalMP.keyframes.length-1].value);
                 scrollingHorizontally = true;
             }
         }

         scrollingVertically = false;
         var verticalTime:Number = 0;
+        throwFinalVSP = 0;
         if (scrollerLayout && scrollerLayout.canScrollVertically)
         {
             var vsp:Number = viewport.verticalScrollPosition;
@@ -1401,6 +1512,7 @@
             {
                 throwEffectMotionPaths.push(verticalMP);
                 verticalTime = verticalMP.keyframes[verticalMP.keyframes.length-1].time;
+                throwFinalVSP = Number(verticalMP.keyframes[verticalMP.keyframes.length-1].value);
                 scrollingVertically = true;
             }
         }
@@ -1810,7 +1922,26 @@

             if (verticalScrollBar)
                 verticalScrollBar.alpha = viewport.contentHeight > viewport.height ? 1.0 : 0.0;
-        }
+
+            inTouchInteraction = true;
+        }
+    }
+
+    /**
+     *  @private
+     *  Snap the scroll positions to valid values.
+     */
+    private function snapContentScrollPosition():void
+    {
+        var maxHsp:Number = viewport.contentWidth > viewport.width ?
+            viewport.contentWidth-viewport.width : 0;
+        viewport.horizontalScrollPosition =
+            Math.min(Math.max(0,viewport.horizontalScrollPosition),maxHsp);
+
+        var maxVsp:Number = viewport.contentHeight > viewport.height ?
+            viewport.contentHeight-viewport.height : 0;
+        viewport.verticalScrollPosition =
+            Math.min(Math.max(0,viewport.verticalScrollPosition),maxVsp);
     }

     /**
@@ -1827,10 +1958,7 @@

             // Snap the scroll position to the content in case the empty space beyond the edge was visible
             // due to bounce/pull.
-            var maxHsp:Number = viewport.contentWidth > viewport.width ? viewport.contentWidth-viewport.width : 0;
-            viewport.horizontalScrollPosition = Math.min(Math.max(0,viewport.horizontalScrollPosition),maxHsp);
-            var maxVsp:Number = viewport.contentHeight > viewport.height ? viewport.contentHeight-viewport.height : 0;
-            viewport.verticalScrollPosition = Math.min(Math.max(0,viewport.verticalScrollPosition),maxVsp);
+            snapContentScrollPosition();

             // get new values in case we start scrolling again
             hspBeforeTouchScroll = viewport.horizontalScrollPosition;
@@ -1964,6 +2092,7 @@
             // after that, so we want to block this next mouseClick

             hideScrollBars();
+            inTouchInteraction = false;
         }
     }

@@ -2619,7 +2748,7 @@
         scrollEndEvent.reason = TouchInteractionReason.SCROLL;
 		dispatchBubblingEventOnMouseDownedDisplayObject(scrollEndEvent);
     }
-
+
 }

 import spark.effects.easing.EaseInOutBase;


Transferred from the Adobe Open Source Subversion Repository

Revision: 7929
Author:   hmuller@adobe.com
Date:     2009-06-17T23:06:42.698986Z

Log Message:
-----------
Range et al PARB changes, Opus #1.   In addition to the changes listed below, updated
flex4tests, notably ScrollBarFrenzy, for the new API.   These changes will break
performance test suite (TwoThumbSlider.as).

Range
  valueInterval => snapInterval
  step() => changeValueByStep()
  remove protected nearestValidSize() method

Slider
  Add protected pendingValue property
  Remove protected pointClickToPosition() method

TrackBase
  Add two new protected methods: updateSkinDisplayList(), pointToValue()
  Remove the following protected properties: get trackSize:Number, thumbSize:Number
  Remove the following protected methods:
      clickOffset()
      positionToValue()
      valueToPosition()
      pointToPosition()
      positionThumb()
      sizeThumb()
      calculateThumbSize()
      calculateNewValue()

ScrollBar
  page() => changeValueByPage()

Spinner
  valueWrap => allowValueWrap

NumericStepper
  displayFormatFunction => valueFormatFunction
  extractValueFunction => valueParseFunction
  commitTextInput => make private

QE Notes: Most Mustella tests passed after the protected API changes but prior to the renames.
Doc Notes:
Bugs:
Reviewer: Jason, Chet

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Range.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/mediaClasses/ScrubBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/VideoPlayerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/VideoPlayerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/SkinTest.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/testWheel.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/ScrollbarFrenzy.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/components/CircularScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/CircularScrollBarSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -367,9 +367,9 @@
             // round to ints then the sets of verticalScrollPosition and
             // horizontalScrollPosition will be no-ops which is desirable.
             if (scroller.horizontalScrollBar)
-                scroller.horizontalScrollBar.valueInterval = 0;
+                scroller.horizontalScrollBar.snapInterval = 0;
             if (scroller.verticalScrollBar)
-                scroller.verticalScrollBar.valueInterval = 0;
+                scroller.verticalScrollBar.snapInterval = 0;
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20305
Author:   clucier@adobe.com
Date:     2011-02-11T23:46:10.803368Z

Log Message:
-----------
Clarifying TODO.

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

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/ContentRequest.as

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

--- frameworks/projects/spark/src/spark/core/ContentRequest.as
+++ frameworks/projects/spark/src/spark/core/ContentRequest.as
@@ -286,8 +286,9 @@
         {
             if (_content == e.content)
             {
-                // FIXME(crl): Should recovery be deferred to the owner of this
-                // content request?
+                // TODO(crl): We should defer to the owner of this
+                // content request to decide how to recover, for now
+                // we simply re-request automatically.
                 _shared = false;
                 var loader:Loader = new Loader();
                 var loaderContext:LoaderContext = new LoaderContext();


remove debug if/throw

remove debug if/throw

--- src/aerys/minko/scene/controller/scene/RenderingController.as
+++ src/aerys/minko/scene/controller/scene/RenderingController.as
@@ -615,9 +615,6 @@

     			unbindEffectInstance(effectInstance, meshBindings);

-                if (_numDrawCalls == 0)
-                    throw new Error();
-
     			for (var drawCallId : uint = 0; drawCallId < numDrawCalls; ++drawCallId)
     			{
     				// retrieve drawcall, and shaderInstance


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.formatters
 {