Transferred from the Adobe Open Source Subversion Repository

Revision: 17217
Author:   hmuller@adobe.com
Date:     2010-08-06T17:47:28.904096Z

Log Message:
-----------
The following bindable, read-only DataGrid and Grid properties are now writable: selectedIndex, selectedIndices, selectedCell, selectedCells, selectedItem, and selectedItems.  The property set methods are intended to enable developers to initialize the selection declaratively, they're not intended for programatic use.

DefaultGridItemRenderer uses createInFontContext() to create its text field to enable embedded fonts, RSLs.

QE notes: DataGrid
Doc notes:
Bugs: SDK-26988, SDK-27252
Reviewer: Carol, Alex
Tests run: DataGrid mustella,checkintests cyclone
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -197,12 +197,29 @@
     {
         include "../core/Version.as";

+        /**
+         *  @private
+         *  A list of functions to be called at commitProperties() time, after the dataProvider
+         *  has been set.  This list is used to defer making grid selection updates per the
+         *  set methods for the selectedIndex, selectedIndices, selectedItem, selectedItems,
+         *  selectedCell and selectedCells properties.
+         */
+        private const deferredOperations:Vector.<Function> = new Vector.<Function>();
+
+        /**
+         *  @private
+         *  True while updateDisplayList is running.
+         */
+        private var inUpdateDisplayList:Boolean = false;
+
+
+        // TODO(hmuller): the following public variables are temporary
+
         public var backgroundGroup:Group;
         public var selectionGroup:Group;
         public var itemRendererGroup:Group;
         public var overlayGroup:Group;

-        private var inUpdateDisplayList:Boolean = false;

         public function Grid()
         {
@@ -1346,6 +1363,13 @@
          *  control, the control dispatches the selectionChange
          *  event. When the user changes the selection programmatically, the
          *  control dispatches the valueCommit event.

+         *
+         *
Attempts to set this property are deferred until commitProperties()
+         *  runs, and the dataProvider property has been set.  This property is not
+         *  intended for programatic selection updates, it can be used to initialize the
+         *  selection in MXML markup.  The setSelectedCell() method should be used
+         *  for programatic selection updates, for example when writing a keyboard
+         *  or mouse event handler.

          *
          *  @default null
          *
@@ -1362,6 +1386,25 @@
             var selectedCells:Vector.<CellPosition> = gridSelection.allCells();
             return selectedCells.length ? selectedCells[0] : null;
         }
+
+        /**
+         *  @private
+         */
+        public function set selectedCell(value:CellPosition):void
+        {
+            const rowIndex:int = (value) ? value.rowIndex : -1;
+            const columnIndex:int = (value) ? value.columnIndex : -1;
+
+            var f:Function = function():void
+            {
+                if ((rowIndex != -1) && (columnIndex != -1))
+                    setSelectedCell(rowIndex, columnIndex);
+                else
+                    clearSelection();
+            }
+            deferredOperations.push(f);  // function f() to be called by commitProperties()
+            invalidateProperties();
+        }

         //----------------------------------
         //  selectedCells
@@ -1381,6 +1424,13 @@
          *  event. When the user changes the selection programmatically, the
          *  control dispatches the valueCommit event.

          *
+         *
Attempts to set this property are deferred until commitProperties()
+         *  runs, and the dataProvider property has been set.  This property is not
+         *  intended for programatic selection updates, it can be used to initialize the
+         *  selection in MXML markup.  The setSelectedCell(), addSelectedCell(),
+         *  and selectCellRegion() methods should be used for programatic selection
+         *  updates, for example when writing a keyboard or mouse event handler.

+         *
          *  @default []
          *
          *  @return Vector of CellPosition objects where each element represents
@@ -1395,6 +1445,32 @@
         {
             return gridSelection.allCells();
         }
+
+        /**
+         *  @private
+         */
+        public function set selectedCells(value:Vector.<CellPosition>):void
+        {
+            // Defensively deep-copy the incoming value; tolerate value=null
+
+            var valueCopy:Vector.<CellPosition> = new Vector.<CellPosition>(0);
+            if (value)
+            {
+                for each (var cell:CellPosition in value)
+                    valueCopy.push(new CellPosition(cell.rowIndex, cell.columnIndex));
+            }
+
+            // Append a deferred operation function that selects the specified cells
+
+            var f:Function = function():void
+            {
+                clearSelection();
+                for each (cell in valueCopy)
+                    addSelectedCell(cell.rowIndex, cell.columnIndex);
+            }
+            deferredOperations.push(f);  // function f() to be called by commitProperties()
+            invalidateProperties();
+        }

         //----------------------------------
         //  selectedIndex
@@ -1412,6 +1488,13 @@
          *  control, the control dispatches the selectionChange
          *  event. When the user changes the selection programmatically, the
          *  control dispatches the valueCommit event.

+         *
+         *
Attempts to set this property are deferred until commitProperties()
+         *  runs, and the dataProvider property has been set.  This property is not
+         *  intended for programatic selection updates, it can be used to initialize the
+         *  selection in MXML markup.  The setSelectedIndex() method should be used
+         *  for programatic selection updates, for example when writing a keyboard
+         *  or mouse event handler.

          *
          *  @default -1
          *
@@ -1426,7 +1509,23 @@
         public function get selectedIndex():int
         {
             var selectedRows:Vector.<int> = gridSelection.allRows();
-            return selectedRows.length ? selectedRows[0] : -1;
+            return (selectedRows.length > 0) ? selectedRows[0] : -1;
+        }
+
+        /**
+         *  @private
+         */
+        public function set selectedIndex(value:int):void
+        {
+            var f:Function = function():void
+            {
+                if (value != -1)
+                    setSelectedIndex(value);
+                else
+                    clearSelection();
+            }
+            deferredOperations.push(f);  // function f() to be called by commitProperties()
+            invalidateProperties();
         }

         //----------------------------------
@@ -1446,6 +1545,13 @@
          *  control, the control dispatches the selectionChange
          *  event. When the user changes the selection programmatically, the
          *  control dispatches the valueCommit event.

+         *
+         *
Attempts to set this property are deferred until commitProperties()
+         *  runs, and the dataProvider property has been set.  This property is not
+         *  intended for programatic selection updates, it can be used to initialize the
+         *  selection in MXML markup.  The setSelectedIndex(), addSelectedIndex(),
+         *  and selectIndices() methods should be used for programatic selection
+         *  updates, for example when writing a keyboard or mouse event handler.

          *
          *  @default []
          *
@@ -1463,6 +1569,27 @@
         {
             return gridSelection.allRows();
         }
+
+        /**
+         *  @private
+         */
+        public function set selectedIndices(value:Vector.<int>):void
+        {
+            // Defensively copy the incoming value; tolerate value=null
+
+            const valueCopy:Vector.<int> = (value) ? value.concat() : new Vector.<int>(0);
+
+            // Append a deferred operation function that selects the specified indices
+
+            var f:Function = function():void
+            {
+                clearSelection();
+                for each (var index:int in valueCopy)
+                    addSelectedIndex(index);
+            }
+            deferredOperations.push(f);  // function f() to be called by commitProperties()
+            invalidateProperties();
+        }

         //----------------------------------
         //  selectedItem
@@ -1481,6 +1608,14 @@
          *  control, the control dispatches the selectionChange
          *  event. When the user changes the selection programmatically, the
          *  control dispatches the valueCommit event.

+         *
+         *
Attempts to set this property are deferred until commitProperties()
+         *  runs, and the dataProvider property has been set.  This property is not
+         *  intended for programatic selection updates, it can be used to initialize the
+         *  selection in MXML markup.  To programatically set the "selected item"
+         *  use dataProvider.getItemIndex() to compute the item's location
+         *  and setSelectedIndex() to change the selection.

+         *
          *  @default undefined
          *
          *  @return Vector of dataProvider items.
@@ -1500,6 +1635,26 @@

             return getDataProviderItem(rowIndex);
         }
+
+        /**
+         *  @private
+         */
+        public function set selectedItem(value:Object):void
+        {
+            var f:Function = function():void
+            {
+                if (!dataProvider)
+                    return;
+
+                const rowIndex:int = dataProvider.getItemIndex(value);
+                if (rowIndex == -1)
+                    clearSelection();
+                else
+                    setSelectedIndex(rowIndex);
+            }
+            deferredOperations.push(f);  // function f() to be called by commitProperties()
+            invalidateProperties();
+        }

         //----------------------------------
         //  selectedItems
@@ -1517,6 +1672,14 @@
          *  control, the control dispatches the selectionChange
          *  event. When the user changes the selection programmatically, the
          *  control dispatches the valueCommit event.

+         *
+         *
Attempts to set this property are deferred until commitProperties()
+         *  runs, and the dataProvider property has been set.  This property is not
+         *  intended for programatic selection updates, it can be used to initialize the
+         *  selection in MXML markup.  To programatically set the "selected item"
+         *  use dataProvider.getItemIndex() to compute the item's location
+         *  and setSelectedIndex() to change the selection.

+         *
          *  @default []
          *
          *  @return Vector of dataProvider items.
@@ -1541,6 +1704,30 @@

             return items;
         }
+
+        /**
+         *  @private
+         */
+        public function set selectedItems(value:Vector.<Object>):void
+        {
+            // Defensively copy the incoming value; tolerate value=null
+
+            const valueCopy:Vector.<Object> = (value) ? value.concat() : new Vector.<Object>(0);
+
+            // Append a deferred operation function that selects the specified indices
+
+            var f:Function = function():void
+            {
+                if (!dataProvider)
+                    return;
+
+                clearSelection();
+                for each (var item:Object in valueCopy)
+                    addSelectedIndex(dataProvider.getItemIndex(item));
+            }
+            deferredOperations.push(f);  // function f() to be called by commitProperties()
+            invalidateProperties();
+        }

         //----------------------------------
         //  selectionIndicator
@@ -2563,6 +2750,15 @@

                 dataProviderChanged = false;
                 columnsChanged = false;
+            }
+
+            // Deferred selection operations
+
+            if (dataProvider)
+            {
+                for each (var deferredOperation:Function in deferredOperations)
+                    deferredOperation();
+                deferredOperations.length = 0;
             }

             // Only want one event if both caretRowIndex and caretColumnIndex


Transferred from the Adobe Open Source Subversion Repository

Revision: 19518
Author:   cframpto@adobe.com
Date:     2010-12-22T18:36:21.729644Z

Log Message:
-----------
invalidateTypicalItem() -> invalidateTypicalItemRenderer() per PARB

QE notes:
Doc notes:
Bugs:
Reviewer: Hans
Tests run: cyclone
Is noteworthy for integration: yes: API change

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -2201,7 +2201,7 @@

         _typicalItem = value;

-        invalidateTypicalItem();
+        invalidateTypicalItemRenderer();

         dispatchChangeEvent("typicalItemChanged");
     }
@@ -2222,7 +2222,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4.5
      */
-    public function invalidateTypicalItem():void
+    public function invalidateTypicalItemRenderer():void
     {
         typicalItemChanged = true;
         invalidateProperties();


Transferred from the Adobe Open Source Subversion Repository

Revision: 19190
Author:   aharui@adobe.com
Date:     2010-12-09T02:52:31.089358Z

Log Message:
-----------
Add ITEM_ROLL_OVER and ITEM_ROLL_OUT to Spark List and ButtonBar

QE notes: New Events
Doc notes: New Events
Bugs: SDK-22334
Reviewer: Ryan
Tests run: checkintests mustella full run
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -1056,14 +1056,7 @@
     {
         super.partAdded(partName, instance);

-        if (instance == dataGroup)
-        {
-            dataGroup.addEventListener(
-                RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddHandler);
-            dataGroup.addEventListener(
-                RendererExistenceEvent.RENDERER_REMOVE, dataGroup_rendererRemoveHandler);
-        }
-        else if (instance == scroller)
+        if (instance == scroller)
         {
             scroller.hasFocusableChildren = hasFocusableChildren;

@@ -1082,22 +1075,6 @@
         }
     }

-    /**
-     *  @private
-     */
-    override protected function partRemoved(partName:String, instance:Object):void
-    {
-        if (instance == dataGroup)
-        {
-            dataGroup.removeEventListener(
-                RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddHandler);
-            dataGroup.removeEventListener(
-                RendererExistenceEvent.RENDERER_REMOVE, dataGroup_rendererRemoveHandler);
-        }
-
-        super.partRemoved(partName, instance);
-    }
-
     /**
      *  @private
      *  Called when an item has been added to this component.
@@ -2309,9 +2286,10 @@
      *  @private
      *  Called when an item has been added to this component.
      */
-    private function dataGroup_rendererAddHandler(event:RendererExistenceEvent):void
-    {
-        var index:int = event.index;
+    override protected function dataGroup_rendererAddHandler(event:RendererExistenceEvent):void
+    {
+        super.dataGroup_rendererAddHandler(event);
+
         var renderer:IVisualElement = event.renderer;

         if (!renderer)
@@ -2324,9 +2302,10 @@
      *  @private
      *  Called when an item has been removed from this component.
      */
-    private function dataGroup_rendererRemoveHandler(event:RendererExistenceEvent):void
-    {
-        var index:int = event.index;
+    override protected function dataGroup_rendererRemoveHandler(event:RendererExistenceEvent):void
+    {
+        super.dataGroup_rendererRemoveHandler(event);
+
         var renderer:Object = event.renderer;

         if (!renderer)


Transferred from the Adobe Open Source Subversion Repository

Revision: 3553
Author:   chaase@adobe.com
Date:     2008-10-09T23:14:18.257660Z

Log Message:
-----------
Fixed sdk-17113, sdk-17139, sdk-16526, sdk-16884, sdk-17154, sdk-16999, sdk-16631, sdk-17214. Most of these fixes are related to making effects work when contraints are enabled on the target. For that, two new attributes were added to FxAnimate: disableLayout (default false) and adjustConstraints (default false). Fixes were also made for various other effects issues, such as running all animations and startDelays off of the same global timer.
The change also includes renames of some effects classes and the easing API (now in mx.effects.interpolation).

Reviewed by: Jason (effects code) and Hans (renames)
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxResizeInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/fxEasing/IEaser.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/IEaser.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/fxEasing/Linear.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="dir" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/fxEasing</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/Animate3DInstance.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animate3D.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/Animate3DInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Timeline.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/fxEasing/Constant.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Constant.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/Rotate3DInstance.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateFilter.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Rotate3D.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxRotate3D.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/fxEasing/EaseInOut.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/EaseInOut.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/fxEasing/Power.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Power.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/Rotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/fxEasing/Sine.as" copyfrom-rev="3548" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Sine.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Rotate3D.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Animate.as
+++ frameworks/projects/spark/src/spark/effects/Animate.as
@@ -11,8 +11,8 @@
 package mx.effects
 {

-import mx.effects.fxEasing.IEaser;
-import mx.effects.fxEasing.Sine;
+import mx.effects.interpolation.IEaser;
+import mx.effects.interpolation.Sine;
 import mx.effects.effectClasses.FxAnimateInstance;
 import mx.events.AnimationEvent;

@@ -165,6 +165,38 @@
      */
     public var repeatBehavior:String = Animation.LOOP;

+    /**
+     * This flag indicates whether the layout constraints (left, right, top,
+     * and bottom) should be adjusted when the effect ends, based on where
+     * the target has been positioned by the effect. This behavior can
+     * be useful for effects that change the position or size of a component
+     * during the course of running the effect, and when the desired result
+     * is that the target object stays in the resulting position without
+     * adjusting to the original constraints. For example, a Rotate effect
+     * run on a target with left/top constraints might otherwise be moved
+     * to the original constraint position, which has a different effect
+     * than rotating around a specified rotation center.
+     *
+     *
The default value
+     * is false, which means that the original constraints will
+     * be obeyed. To adjust the constraints based on the effect result,
+     * set this property to true.

+     *
+     * @default false
+     */
+    public var adjustConstraints:Boolean = false;
+
+    /**
+     * This property indicates whether the effect should disable layout on its
+     * targets' parents while the effect is running. If set to true, the effect
+     * will set the parent containers' autoLayout property to
+     * false for the duration of the effect. Note that other events may
+     * occur in those containers that force layout to happen anyway.
+     *
+     * @default false
+     */
+    public var disableLayout:Boolean = false;
+
     //--------------------------------------------------------------------------
     //
     // Methods
@@ -219,6 +251,8 @@
             animateInstance.repeatCount = repeatCount;

         animateInstance.repeatBehavior = repeatBehavior;
+        animateInstance.adjustConstraints = adjustConstraints;
+        animateInstance.disableLayout = disableLayout;

         // Deep-copy the propertyValuesList into the instance
         if (propertyValuesList != null)


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Fixed bug that broke the rollover for the right lead down.  Textfield bounds were not previously set and blocked rollover of arrow.

--- activities/module-2/series-measuring/ResistorLead.as
+++ activities/module-2/series-measuring/ResistorLead.as
@@ -169,6 +169,7 @@
             breakButton.alpha = 0;
             restoreButton.alpha = 1;
             restoreButton.addEventListener(MouseEvent.MOUSE_UP, onRestore);
+			breakButton.removeEventListener(MouseEvent.MOUSE_UP, onBreak);
             lead.alpha=0;
             lead.x += 1000;
             brokenLead.alpha=1;
@@ -181,6 +182,7 @@
             breakButton.alpha=1;
             restoreButton.alpha=0;
             restoreButton.removeEventListener(MouseEvent.MOUSE_UP, onRestore);
+			breakButton.addEventListener(MouseEvent.MOUSE_UP, onBreak);
             lead.alpha=1;
             lead.x -= 1000;
             brokenLead.alpha=0;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/mx/src/mx/controls/HRule.as
+++ frameworks/projects/mx/src/mx/controls/HRule.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.controls
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5119
Author:   smgilson@adobe.com
Date:     2009-03-01T15:19:39.936226Z

Log Message:
-----------
Clean up some ASDoc tags from the addition of the @productversion/@playerversion tags

QE Notes: None
Doc Notes: None
Bugs: -

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToolTip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/ResultEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/HTML.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/config/ServerConfig.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/HTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/HTTPRequestMessage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CalendarLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/halo/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/videoClasses/NCManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/AbstractConsumer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/Base64Encoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/StringValidator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SchemaMarshaller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework_textLayout/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IInteractiveObjectInterface.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ContainerRawChildrenList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/AMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/FaultEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/wsdl/WSDL.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/SparkSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Tween.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/videoClasses/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/HistoryManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/Schema.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/utils/HexEncoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/Operation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IDisplayObjectInterface.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IDisplayObjectContainerInterface.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SoundEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Text.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISpriteInterface.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/haloclassic/src/haloclassic/HaloRectBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/mxml/Operation.as</path>

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

--- frameworks/projects/mx/src/mx/core/Container.as
+++ frameworks/projects/mx/src/mx/core/Container.as
@@ -400,16 +400,6 @@
         In this example, _firstChildIndex would be 3 and _numChildren
         would be 4.

-    *
-
-    *  @langversion 3.0
-
-    *  @playerversion Flash 9
-
-    *  @playerversion AIR 1.1
-
-    *  @productversion Flex 3
-
     */

     //--------------------------------------------------------------------------
@@ -2396,11 +2386,6 @@
         childAdded(child);

         return child;
-        *
-        *  @langversion 3.0
-        *  @playerversion Flash 9
-        *  @playerversion AIR 1.1
-        *  @productversion Flex 3
         */
     }

@@ -2451,14 +2436,14 @@
     {
         var formerParent:DisplayObjectContainer = child.parent;
         if (formerParent && !(formerParent is Loader))
-	{
+    {
             // Adjust index if necessary when former parent happens
             // to be the same container.
             if (formerParent == this)
                 index = (index == numChildren) ? index - 1 : index;

             formerParent.removeChild(child);
-	}
+    }

         addingChild(child);

@@ -2567,16 +2552,6 @@

         Shouldn't implement removeChildAt() in terms of removeChild().

-        *
-
-        *  @langversion 3.0
-
-        *  @playerversion Flash 9
-
-        *  @playerversion AIR 1.1
-
-        *  @productversion Flex 3
-
         */
     }

@@ -3035,7 +3010,7 @@
             if ("addToCreationQueue" in mainApp)
                 mainApp.addToCreationQueue(this, creationIndex, null, this);
             else
-            	// TODO: Clarify error message and add to resource manager
+                // TODO: Clarify error message and add to resource manager
                 throw new Error("addToCreationQueue called but method does not exist within application");
         }
         else if (recursionFlag)


Transferred from the Adobe Open Source Subversion Repository

Revision: 5099
Author:   gauravj@adobe.com
Date:     2009-02-27T03:43:02.639229Z

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:
--------------
147 paths were modified

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

--- frameworks/projects/rpc/src/mx/rpc/Responder.as
+++ frameworks/projects/rpc/src/mx/rpc/Responder.as
@@ -14,6 +14,11 @@

 /**
  *  This class provides a default implementation mx.rpc.IResponder
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class Responder implements IResponder
 {
@@ -24,6 +29,11 @@
 	 *           completed successfully.
 	 *  @param	fault Function that should be called when the request has
 	 *			completed with errors.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function Responder(result:Function, fault:Function)
 	{
@@ -37,6 +47,11 @@
 	 *  received.
          *
          * @param data While data is typed as Object, it is often (but not always) an mx.rpc.events.ResultEvent.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function result(data:Object):void
 	{
@@ -47,6 +62,11 @@
 	 *  This method is called by a service when an error has been received.
          *
          * @param info While info is typed as Object, it is often (but not always) an mx.rpc.events.FaultEvent.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function fault(info:Object):void
 	{


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/rpc/src/mx/utils/URLUtil.as
+++ frameworks/projects/rpc/src/mx/utils/URLUtil.as
@@ -0,0 +1,620 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.utils
+{
+
+import mx.messaging.config.LoaderConfig;
+
+/**
+ *  The URLUtil class is a static class with methods for working with
+ *  full and relative URLs within Flex.
+ *
+ *  @see mx.managers.BrowserManager
+ */
+public class URLUtil
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    /**
+     *  @private
+     */
+    public function URLUtil()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Returns the domain and port information from the specified URL.
+     *
+     *  @param url The URL to analyze.
+     *  @return The server name and port of the specified URL.
+     */
+    public static function getServerNameWithPort(url:String):String
+    {
+        // Find first slash; second is +1, start 1 after.
+        var start:int = url.indexOf("/") + 2;
+        var length:int = url.indexOf("/", start);
+        return length == -1 ? url.substring(start) : url.substring(start, length);
+    }
+
+    /**
+     *  Returns the server name from the specified URL.
+     *
+     *  @param url The URL to analyze.
+     *  @return The server name of the specified URL.
+     */
+    public static function getServerName(url:String):String
+    {
+        var sp:String = getServerNameWithPort(url);
+
+        // If IPv6 is in use, start looking after the square bracket.
+        var delim:int = sp.indexOf("]");
+        delim = (delim > -1)? sp.indexOf(":", delim) : sp.indexOf(":");
+
+        if (delim > 0)
+            sp = sp.substring(0, delim);
+        return sp;
+    }
+
+    /**
+     *  Returns the port number from the specified URL.
+     *
+     *  @param url The URL to analyze.
+     *  @return The port number of the specified URL.
+     */
+    public static function getPort(url:String):uint
+    {
+        var sp:String = getServerNameWithPort(url);
+        // If IPv6 is in use, start looking after the square bracket.
+        var delim:int = sp.indexOf("]");
+        delim = (delim > -1)? sp.indexOf(":", delim) : sp.indexOf(":");
+        var port:uint = 0;
+        if (delim > 0)
+        {
+            var p:Number = Number(sp.substring(delim + 1));
+            if (!isNaN(p))
+                port = int(p);
+        }
+
+        return port;
+    }
+
+    /**
+     *  Converts a potentially relative URL to a fully-qualified URL.
+     *  If the URL is not relative, it is returned as is.
+     *  If the URL starts with a slash, the host and port
+     *  from the root URL are prepended.
+     *  Otherwise, the host, port, and path are prepended.
+     *
+     *  @param rootURL URL used to resolve the URL specified by the url parameter, if url is relative.
+     *  @param url URL to convert.
+     *
+     *  @return Fully-qualified URL.
+     */
+    public static function getFullURL(rootURL:String, url:String):String
+    {
+        if (url != null && !URLUtil.isHttpURL(url))
+        {
+            if (url.indexOf("./") == 0)
+            {
+                url = url.substring(2);
+            }
+            if (URLUtil.isHttpURL(rootURL))
+            {
+                var slashPos:Number;
+
+                if (url.charAt(0) == '/')
+                {
+                    // non-relative path, "/dev/foo.bar".
+                    slashPos = rootURL.indexOf("/", 8);
+                    if (slashPos == -1)
+                        slashPos = rootURL.length;
+                }
+                else
+                {
+                    // relative path, "dev/foo.bar".
+                    slashPos = rootURL.lastIndexOf("/") + 1;
+                    if (slashPos <= 8)
+                    {
+                        rootURL += "/";
+                        slashPos = rootURL.length;
+                    }
+                }
+
+                if (slashPos > 0)
+                    url = rootURL.substring(0, slashPos) + url;
+            }
+        }
+
+        return url;
+    }
+
+    // Note: The following code was copied from Flash Remoting's
+    // NetServices client components.
+    // It is reproduced here to keep the services APIs
+    // independent of the deprecated NetServices code.
+    // Note that it capitalizes any use of URL in method or class names.
+
+    /**
+     *  Determines if the URL uses the HTTP, HTTPS, or RTMP protocol.
+     *
+     *  @param url The URL to analyze.
+     *
+     *  @return true if the URL starts with "http://", "https://", or "rtmp://".
+     */
+    public static function isHttpURL(url:String):Boolean
+    {
+        return url != null &&
+               (url.indexOf("http://") == 0 ||
+                url.indexOf("https://") == 0);
+    }
+
+    /**
+     *  Determines if the URL uses the secure HTTPS protocol.
+     *
+     *  @param url The URL to analyze.
+     *
+     *  @return true if the URL starts with "https://".
+     */
+    public static function isHttpsURL(url:String):Boolean
+    {
+        return url != null && url.indexOf("https://") == 0;
+    }
+
+    /**
+     *  Returns the protocol section of the specified URL.
+     *  The following examples show what is returned based on different URLs:
+     *
+     *

+     *  getProtocol("https://localhost:2700/") returns "https"
+     *  getProtocol("rtmp://www.myCompany.com/myMainDirectory/groupChatApp/HelpDesk") returns "rtmp"
+     *  getProtocol("rtmpt:/sharedWhiteboardApp/June2002") returns "rtmpt"
+     *  getProtocol("rtmp::1234/chatApp/room_name") returns "rtmp"
+     *

+     *
+     *  @param url String containing the URL to parse.
+     *
+     *  @return The protocol or an empty String if no protocol is specified.
+     */
+    public static function getProtocol(url:String):String
+    {
+        var slash:int = url.indexOf("/");
+        var indx:int = url.indexOf(":/");
+        if (indx > -1 && indx < slash)
+        {
+            return url.substring(0, indx);
+        }
+        else
+        {
+            indx = url.indexOf("::");
+            if (indx > -1 && indx < slash)
+                return url.substring(0, indx);
+        }
+
+        return "";
+    }
+
+    /**
+     *  Replaces the protocol of the
+     *  specified URI with the given protocol.
+     *
+     *  @param uri String containing the URI in which the protocol
+     *  needs to be replaced.
+     *
+     *  @param newProtocol String containing the new protocol to use.
+     *
+     *  @return The URI with the protocol replaced,
+     *  or an empty String if the URI does not contain a protocol.
+     */
+    public static function replaceProtocol(uri:String,
+                                           newProtocol:String):String
+    {
+        return uri.replace(getProtocol(uri), newProtocol);
+    }
+
+    /**
+     *  Returns a new String with the port replaced with the specified port.
+     *  If there is no port in the specified URI, the port is inserted.
+     *  This method expects that a protocol has been specified within the URI.
+     *
+     *  @param uri String containing the URI in which the port is replaced.
+     *  @param newPort uint containing the new port to subsitute.
+     *
+     *  @return The URI with the new port.
+     */
+    public static function replacePort(uri:String, newPort:uint):String
+    {
+        var result:String = "";
+
+        // First, determine if IPv6 is in use by looking for square bracket
+        var indx:int = uri.indexOf("]");
+
+        // If IPv6 is not in use, reset indx to the first colon
+        if (indx == -1)
+            indx = uri.indexOf(":");
+
+        var portStart:int = uri.indexOf(":", indx+1);
+        var portEnd:int;
+
+        // If we have a port
+        if (portStart > -1)
+        {
+            portStart++; // move past the ":"
+            portEnd = uri.indexOf("/", portStart);
+            //@TODO: need to throw an invalid uri here if no slash was found
+            result = uri.substring(0, portStart) +
+                     newPort.toString() +
+                     uri.substring(portEnd, uri.length);
+        }
+        else
+        {
+            // Insert the specified port
+            portEnd = uri.indexOf("/", indx);
+            if (portEnd > -1)
+            {
+                // Look to see if we have protocol://host:port/
+                // if not then we must have protocol:/relative-path
+                if (uri.charAt(portEnd+1) == "/")
+                    portEnd = uri.indexOf("/", portEnd + 2);
+
+                if (portEnd > 0)
+                {
+                    result = uri.substring(0, portEnd) +
+                             ":"+ newPort.toString() +
+                             uri.substring(portEnd, uri.length);
+                }
+                else
+                {
+                    result = uri + ":" + newPort.toString();
+                }
+            }
+            else
+            {
+                result = uri + ":"+ newPort.toString();
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     *  Returns a new String with the port and server tokens replaced with
+     *  the port and server from the currently running application.
+     *
+     *  @param url String containing the SERVER_NAME_TOKEN and/or SERVER_NAME_PORT
+     *  which should be replaced by the port and server from the application.
+     *
+     *  @return The URI with the port and server replaced.
+     */
+    public static function replaceTokens(url:String):String
+    {
+        var loaderURL:String = LoaderConfig.url == null ? "" : LoaderConfig.url;
+
+        // if the LoaderConfig.url hasn't been configured yet we need to
+        // throw, informing the user that this value must be setup first
+        // TODO: add this back in after each new player build
+        //if (LoaderConfig.url == null)
+        //    trace("WARNING: LoaderConfig.url hasn't been initialized.");
+
+        // Replace {server.name}
+        if (url.indexOf(SERVER_NAME_TOKEN) > 0)
+        {
+            var loaderProtocol:String = URLUtil.getProtocol(loaderURL);
+            var loaderServerName:String = "localhost";
+            if (loaderProtocol.toLowerCase() != "file")
+                loaderServerName = URLUtil.getServerName(loaderURL);
+
+            url = url.replace(SERVER_NAME_REGEX, loaderServerName);
+        }
+
+        // Replace {server.port} either with the loader's port, or
+        // remove it and the proceeding token if a port is not
+        // specified for the SWF Loader.
+        var portToken:int = url.indexOf(SERVER_PORT_TOKEN);
+        if (portToken > 0)
+        {
+            var loaderPort:uint = URLUtil.getPort(loaderURL);
+            if (loaderPort > 0)
+            {
+                url = url.replace(SERVER_PORT_REGEX, loaderPort);
+            }
+            else
+            {
+                if (url.charAt(portToken - 1) == ":")
+                    url = url.substring(0, portToken - 1) + url.substring(portToken);
+
+                url = url.replace(SERVER_PORT_REGEX, "");
+            }
+        }
+
+        return url;
+    }
+
+    /**
+     * Tests whether two URI Strings are equivalent, ignoring case and
+     * differences in trailing slashes.
+     *
+     *  @param uri1 The first URI to compare.
+     *  @param uri2 The second URI to compare.
+     *
+     *  @return true if the URIs are equal. Otherwise, false.
+     */
+    public static function urisEqual(uri1:String, uri2:String):Boolean
+    {
+        if (uri1 != null && uri2 != null)
+        {
+            uri1 = StringUtil.trim(uri1).toLowerCase();
+            uri2 = StringUtil.trim(uri2).toLowerCase();
+
+            if (uri1.charAt(uri1.length - 1) != "/")
+                uri1 = uri1 + "/";
+
+            if (uri2.charAt(uri2.length - 1) != "/")
+                uri2 = uri2 + "/";
+        }
+
+        return uri1 == uri2;
+    }
+
+    /**
+     * If the LoaderConfig.url property is not available, the replaceTokens() method will not
+     * replace the server name and port properties properly.
+     *
+     * @return true if the LoaderConfig.url property is not available. Otherwise, false.
+     */
+    public static function hasUnresolvableTokens():Boolean
+    {
+        return LoaderConfig.url != null;
+    }
+
+    /**
+     *  The pattern in the String that is passed to the replaceTokens() method that
+     *  is replaced by the application's server name.
+     */
+    public static const SERVER_NAME_TOKEN:String = "{server.name}";
+
+    /**
+     *  The pattern in the String that is passed to the replaceTokens() method that
+     *  is replaced by the application's port.
+     */
+    public static const SERVER_PORT_TOKEN:String = "{server.port}";
+
+    /**
+     *  Enumerates an object's dynamic properties (by using a for..in loop)
+     *  and returns a String. You typically use this method to convert an ActionScript object to a String that you then append to the end of a URL.
+     *  By default, invalid URL characters are URL-encoded (converted to the %XX format).
+     *
+     *
For example:
+     *

+     *  var o:Object = { name: "Alex", age: 21 };
+     *  var s:String = URLUtil.objectToString(o,";",true);
+     *  trace(s);
+     *

+     *  Prints "name=Alex;age=21" to the trace log.
+     *

+     *
+     *  @param object The object to convert to a String.
+     *  @param separator The character that separates each of the object's property:value pair in the String.
+     *  @param encodeURL Whether or not to URL-encode the String.
+     *
+     *  @return The object that was passed to the method.
+     */
+    public static function objectToString(object:Object, separator:String=';',
+                                encodeURL:Boolean = true):String
+    {
+        var s:String = internalObjectToString(object, separator, null, encodeURL);
+        return s;
+    }
+
+    private static function internalObjectToString(object:Object, separator:String, prefix:String, encodeURL:Boolean):String
+    {
+        var s:String = "";
+        var first:Boolean = true;
+
+        for (var p:String in object)
+        {
+            if (first)
+            {
+                first = false;
+            }
+            else
+                s += separator;
+
+            var value:Object = object[p];
+            var name:String = prefix ? prefix + "." + p : p;
+            if (encodeURL)
+                name = encodeURIComponent(name);
+
+            if (value is String)
+            {
+                s += name + '=' + (encodeURL ? encodeURIComponent(value as String) : value);
+            }
+            else if (value is Number)
+            {
+                value = value.toString();
+                if (encodeURL)
+                    value = encodeURIComponent(value as String);
+
+                s += name + '=' + value;
+            }
+            else if (value is Boolean)
+            {
+                s += name + '=' + (value ? "true" : "false");
+            }
+            else
+            {
+                if (value is Array)
+                {
+                    s += internalArrayToString(value as Array, separator, name, encodeURL);
+                }
+                else // object
+                {
+                    s += internalObjectToString(value, separator, name, encodeURL);
+                }
+            }
+        }
+        return s;
+    }
+
+    private static function internalArrayToString(array:Array, separator:String, prefix:String, encodeURL:Boolean):String
+    {
+        var s:String = "";
+        var first:Boolean = true;
+
+        var n:int = array.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            if (first)
+            {
+                first = false;
+            }
+            else
+                s += separator;
+
+            var value:Object = array[i];
+            var name:String = prefix + "." + i;
+            if (encodeURL)
+                name = encodeURIComponent(name);
+
+            if (value is String)
+            {
+                s += name + '=' + (encodeURL ? encodeURIComponent(value as String) : value);
+            }
+            else if (value is Number)
+            {
+                value = value.toString();
+                if (encodeURL)
+                    value = encodeURIComponent(value as String);
+
+                s += name + '=' + value;
+            }
+            else if (value is Boolean)
+            {
+                s += name + '=' + (value ? "true" : "false");
+            }
+            else
+            {
+                if (value is Array)
+                {
+                    s += internalArrayToString(value as Array, separator, name, encodeURL);
+                }
+                else // object
+                {
+                    s += internalObjectToString(value, separator, name, encodeURL);
+                }
+            }
+        }
+        return s;
+    }
+
+    /**
+     *  Returns an object from a String. The String contains name=value pairs, which become dynamic properties
+     *  of the returned object. These property pairs are separated by the specified separator.
+     *  This method converts Numbers and Booleans, Arrays (defined by "[]"),
+     *  and sub-objects (defined by "{}"). By default, URL patterns of the format %XX are converted
+     *  to the appropriate String character.
+     *
+     *
For example:
+     *

+     *  var s:String = "name=Alex;age=21";
+     *  var o:Object = URLUtil.stringToObject(s, ";", true);
+     *

+     *
+     *  Returns the object: { name: "Alex", age: 21 }.
+     *

+     *
+     *  @param string The String to convert to an object.
+     *  @param separator The character that separates name=value pairs in the String.
+     *  @param decodeURL Whether or not to decode URL-encoded characters in the String.
+     *
+     *  @return The object containing properties and values extracted from the String passed to this method.
+     */
+    public static function stringToObject(string:String, separator:String = ";",
+                                decodeURL:Boolean = true):Object
+    {
+        var o:Object = {};
+
+        var arr:Array = string.split(separator);
+
+        // if someone has a name or value that contains the separator
+        // this will not work correctly, nor will it work well if there are
+        // '=' or '.' in the name or value
+
+        var n:int = arr.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            var pieces:Array = arr[i].split('=');
+            var name:String = pieces[0];
+            if (decodeURL)
+                name = decodeURIComponent(name);
+
+            var value:Object = pieces[1];
+            if (decodeURL)
+                value = decodeURIComponent(value as String);
+
+            if (value == "true")
+                value = true;
+            else if (value == "false")
+                value = false;
+            else
+            {
+                var temp:Object = int(value);
+                if (temp.toString() == value)
+                    value = temp;
+                else
+                {
+                    temp = Number(value)
+                    if (temp.toString() == value)
+                        value = temp;
+                }
+            }
+
+            var obj:Object = o;
+
+            pieces = name.split('.');
+            var m:int = pieces.length;
+            for (var j:int = 0; j < m - 1; j++)
+            {
+                var prop:String = pieces[j];
+                if (obj[prop] == null && j < m - 1)
+                {
+                    var subProp:String = pieces[j + 1];
+                    var idx:Object = int(subProp);
+                    if (idx.toString() == subProp)
+                        obj[prop] = [];
+                    else
+                        obj[prop] = {};
+                }
+                obj = obj[prop];
+            }
+            obj[pieces[j]] = value;
+        }
+
+        return o;
+    }
+
+    // Reusable reg-exp for token replacement. The . means any char, so this means
+    // we should handle server.name and server-name, etc...
+    private static const SERVER_NAME_REGEX:RegExp = new RegExp("\\{server.name\\}", "g");
+    private static const SERVER_PORT_REGEX:RegExp = new RegExp("\\{server.port\\}", "g");
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/airframework/src/mx/managers/WindowedSystemRawChildrenList.as
+++ frameworks/projects/airframework/src/mx/managers/WindowedSystemRawChildrenList.as
@@ -0,0 +1,162 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+import flash.display.DisplayObject;
+import flash.geom.Point;
+import mx.core.IChildList;
+import mx.core.mx_internal;
+
+[ExcludeClass]
+
+/**
+ *  @private
+ *  A SystemManager has various types of children,
+ *  such as the Application, popups,
+ *  tooltips, and custom cursors.
+ *  You can access the just the custom cursors through
+ *  the cursors property,
+ *  the tooltips via toolTips, and
+ *  the popups via popUpChildren.  Each one returns
+ *  a SystemChildrenList which implements IChildList.  The SystemManager's
+ *  IChildList methods return the set of children that aren't popups, tooltips
+ *  or cursors.  To get the list of all children regardless of type, you
+ *  use the rawChildrenList property which returns this SystemRawChildrenList.
+ */
+public class WindowedSystemRawChildrenList implements IChildList
+{
+    include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 */
+	public function WindowedSystemRawChildrenList(owner:WindowedSystemManager)
+	{
+		super();
+
+		this.owner = owner;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var owner:WindowedSystemManager;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @copy mx.core.IChildList#numChildren
+	 */
+	public function get numChildren():int
+	{
+		return owner.mx_internal::$numChildren;
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#getChildAt
+	 */
+  	public function getChildAt(index:int):DisplayObject
+  	{
+		return owner.mx_internal::rawChildren_getChildAt(index);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#addChild
+	 */
+	public function addChild(child:DisplayObject):DisplayObject
+  	{
+		return owner.mx_internal::rawChildren_addChild(child);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#addChildAt
+	 */
+	public function addChildAt(child:DisplayObject, index:int):DisplayObject
+  	{
+		return owner.mx_internal::rawChildren_addChildAt(child,index);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#removeChild
+	 */
+	public function removeChild(child:DisplayObject):DisplayObject
+  	{
+		return owner.mx_internal::rawChildren_removeChild(child);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#removeChildAt
+	 */
+	public function removeChildAt(index:int):DisplayObject
+  	{
+		return owner.mx_internal::rawChildren_removeChildAt(index);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#getChildByName
+	 */
+  	public function getChildByName(name:String):DisplayObject
+  	{
+		return owner.mx_internal::rawChildren_getChildByName(name);
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#getChildIndex
+	 */
+  	public function getChildIndex(child:DisplayObject):int
+  	{
+		return owner.mx_internal::rawChildren_getChildIndex(child);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#setChildIndex
+	 */
+	public function setChildIndex(child:DisplayObject, newIndex:int):void
+  	{
+		owner.mx_internal::rawChildren_setChildIndex(child, newIndex);
+  	}
+
+	/**
+	 *  @copy mx.core.IChildList#getObjectsUnderPoint
+	 */
+	public function getObjectsUnderPoint(point:Point):Array
+	{
+		return owner.mx_internal::rawChildren_getObjectsUnderPoint(point);
+	}
+
+	/**
+	 *  @copy mx.core.IChildList#contains
+	 */
+	public function contains(child:DisplayObject):Boolean
+	{
+		return owner.mx_internal::rawChildren_contains(child);
+	}
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/spark/src/spark/globalization/supportClasses/FormatPattern.as
+++ frameworks/projects/spark/src/spark/globalization/supportClasses/FormatPattern.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2011 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.globalization.supportClasses
 {


- change: Added ability to get the containing DocumentView to nested DocumentViews

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@840 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/ui/DocumentView.as
+++ src/reprise/ui/DocumentView.as
@@ -11,6 +11,7 @@

 package reprise.ui
 {
+	import reprise.utils.DisplayListUtil;
 	import reprise.core.ApplicationContext;
 	import reprise.core.FocusManager;
 	import reprise.core.UIRendererFactory;
@@ -47,6 +48,7 @@

 		protected var m_appContext : ApplicationContext;
 		protected var m_focusManager : FocusManager;
+		protected var m_parentDocument : DocumentView;

 		protected var m_invalidChildren : Array;
 		protected var m_validatedElementsCount : int;
@@ -93,6 +95,11 @@
 			return m_appContext;
 		}

+		public function get parentDocument() : DocumentView
+		{
+			return m_parentDocument;
+		}
+
 		/**
 		 * Returns the time that's used as the time for all timed actions executed in the
 		 * current frame.
@@ -126,6 +133,20 @@
 		public override function setParent(parent:UIObject) : UIObject
 		{
 			super.setParent(parent);
+
+			if (!parent)
+			{
+				m_parentDocument = null;
+			}
+			else
+			{
+				var container : UIObject =
+					DisplayListUtil.locateElementContainingDisplayObject(parent);
+				if (container)
+				{
+					m_parentDocument = container.document;
+				}
+			}
 			//TODO: remove these after making sure that that's ok (it really should be)
 			m_rootElement = this;
 			m_containingBlock = this;