Transferred from the Adobe Open Source Subversion Repository

Revision: 18322
Author:   dloverin@adobe.com
Date:     2010-10-26T17:25:39.514942Z

Log Message:
-----------
DataGrid item editor fixes.

 * Changed the bounds of the item editor to include the cell separators.
 * Changed the Text editor padding to keep the text from changing position when transitioning from the renderer to the editor.
 * General cleanup in DataGridEditor – creating common functions, removing unused code.
 * Protect grid mouse event handlers from out of range row indexes and column indexes.
 * Made the GridItemEditor.value property bindable.

QE notes: None.
Doc notes: None.
Bugs: SDK-28310
Reviewer: Carol
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/gridClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DefaultGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/ComboBoxGridItemEditor.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
@@ -51,6 +51,8 @@
 import spark.components.Grid;
 import spark.events.GridEvent;
 import spark.events.GridItemEditorEvent;
+import mx.core.IVisualElementContainer;
+import flash.events.IEventDispatcher;

 use namespace mx_internal;

@@ -122,8 +124,7 @@
      *  @private
      *  the last editedItemPosition and the last
      *  position where editing was attempted if editing
-     *  was cancelled.  We restore editing
-     *  to this point if we get focus from the TAB key
+     *  was cancelled.
      */
     private var lastEditedItemPosition:*;

@@ -238,7 +239,72 @@
      */
     private function setEditedItemPosition(coord:Object):void
     {
-        commitEditedItemPosition(coord);
+        if (!grid.enabled || !dataGrid.editable)
+            return;
+
+        if (!grid.dataProvider || grid.dataProvider.length == 0)
+            return;
+
+        // just give focus back to the itemEditorInstance
+        if (itemEditorInstance && coord &&
+            itemEditorInstance is IFocusManagerComponent &&
+            _editedItemPosition.rowIndex == coord.rowIndex &&
+            _editedItemPosition.columnIndex == coord.columnIndex)
+        {
+            IFocusManagerComponent(itemEditorInstance).setFocus();
+            return;
+        }
+
+        // dispose of any existing editor, saving away its data first
+        if (itemEditorInstance)
+        {
+            if (!dataGrid.endItemEditorSession())
+                return;
+        }
+
+        // store the value
+        _editedItemPosition = coord;
+
+        // allow setting of undefined to dispose item editor instance
+        if (!coord)
+            return;
+
+        var rowIndex:int = coord.rowIndex;
+        var columnIndex:int = coord.columnIndex;
+
+        dataGrid.ensureCellIsVisible(rowIndex, columnIndex);
+
+        createItemEditor(rowIndex, columnIndex);
+
+        if (itemEditorInstance is IInvalidating)
+            IInvalidating(itemEditorInstance).validateNow();
+
+        var column:GridColumn = dataGrid.columns.getItemAt(columnIndex) as GridColumn;
+        if (itemEditorInstance is IIMESupport)
+            IIMESupport(itemEditorInstance).imeMode =
+                (column.imeMode == null) ? dataGrid.imeMode : column.imeMode;
+
+        var fm:IFocusManager = grid.focusManager;
+        // trace("setting focus to item editor");
+        if (itemEditorInstance is IFocusManagerComponent)
+            fm.setFocus(IFocusManagerComponent(itemEditorInstance));
+
+        lastEditedItemPosition = _editedItemPosition;
+
+        // Notify event that a new editor is starting.
+        // Don't dispatch life cycle events for item renderers.
+        var dataGridEvent:GridItemEditorEvent = null;
+
+        if (column.rendererIsEditable == false)
+            dataGridEvent = new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_START);
+
+        if (dataGridEvent)
+        {
+            dataGridEvent.columnIndex = editedItemPosition.columnIndex;
+            dataGridEvent.column = column;
+            dataGridEvent.rowIndex = editedItemPosition.rowIndex;
+            dataGrid.dispatchEvent(dataGridEvent);
+        }
     }

     /**
@@ -528,15 +594,23 @@
             itemEditorInstance.rowIndex = rowIndex;
             itemEditorInstance.column = col;
             itemEditorInstance.hasFocusableChildren = true;
+
             if (itemEditorInstance is ISimpleStyleClient)
                 ISimpleStyleClient(itemEditorInstance).styleName = item;
+
+            // Add the editor to the grid before setting the data so that
+            // the editor's children will be created.
+            grid.addElement(itemEditorInstance);
+
             itemEditorInstance.data = item.data;

-            grid.addElement(itemEditorInstance);
-
-            // position the editor over the cell with the same size as the cell.
-            itemEditorInstance.width = cellBounds.width;
-            itemEditorInstance.height = cellBounds.height;
+            // The editor will overlay the cell, covering the first pixel of the
+            // cell separators. This is done so that a cell editor with borders
+            // will overlay the cell separators. It prevents the cell separators
+            // from adding borders to the editor for the common case when the cell
+            // separators are only 1 pixel wide.
+            itemEditorInstance.width = cellBounds.width + 1;
+            itemEditorInstance.height = cellBounds.height + 1;
             itemEditorInstance.setLayoutBoundsPosition(localCellOrigin.x, localCellOrigin.y);

             if (itemEditorInstance is IInvalidating)
@@ -545,77 +619,23 @@
             // Allow the user code to make any final adjustments and make the editor visible.
             itemEditorInstance.prepare();
             itemEditorInstance.visible = true;
-
-            itemEditorInstance.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
-
+        }
+        else
+        {
+            setFocusInItemRenderer(item);
+        }
+
+        if (itemEditorInstance || editedItemRenderer)
+        {
+            var editor:IEventDispatcher = itemEditorInstance ? itemEditorInstance : editedItemRenderer;
+
+            editor.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
+
             // listen for keyStrokes on the itemEditorInstance (which lets the grid supervise for ESC/ENTER)
-            itemEditorInstance.addEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
-            itemEditorInstance.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler, false, 1000);
-            addRemoveFlexEventEnterListener(DisplayObject(itemEditorInstance), true);
-        }
-        else
-        {
-            // if the item renderer is editable
-            // add the itemRenderer to focus manager to get the
-            // focusable objects under its control. Next set focus
-            // to the first item that should get focus.
-            if (grid.focusManager && grid.focusManager is FocusManager)
-            {
-                var fm:FocusManager = grid.focusManager as FocusManager;
-                var o:DisplayObject = item as DisplayObject;
-                var found:Boolean = false;
-                do
-                {
-                    fm.fauxFocus = o;
-                    o = fm.getNextFocusManagerComponent(false) as DisplayObject;
-                    if (o == item ||
-                        item is DisplayObjectContainer &&
-                        DisplayObjectContainer(item).contains(o))
-                    {
-                        found = true;
-                        break;
-                    }
-                } while (o && dataGrid.contains(o));
-
-                if (lastEvent && lastEvent.type == KeyboardEvent.KEY_DOWN &&
-                    KeyboardEvent(lastEvent).keyCode == Keyboard.TAB &&
-                    KeyboardEvent(lastEvent).shiftKey)
-                {
-                    // put focus on last item in cell editor instead of first.
-                    var lastItem:DisplayObject = o;
-                    do
-                    {
-                        fm.fauxFocus = o;
-                        lastItem = o;
-                        o = fm.getNextFocusManagerComponent(false) as DisplayObject;
-                    } while (o && DisplayObjectContainer(item).contains(o));
-
-                    o = lastItem;
-                }
-
-                fm.fauxFocus = null;
-
-                if (found)
-                {
-                    fm.setFocus(IFocusManagerComponent(o));
-
-                    // Since we may have gotton here with the F2 key show the focus
-                    // indicator to make it obvious which control has focus.
-                    fm.showFocus();
-                }
-
-                editedItemRenderer.addEventListener(FocusEvent.FOCUS_OUT, editor_focusOutHandler);
-
-                // listen for keyStrokes on the itemEditorInstance (which lets the grid supervise for ESC/ENTER)
-                editedItemRenderer.addEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
-                editedItemRenderer.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler, false, 1000);
-                addRemoveFlexEventEnterListener(DisplayObject(editedItemRenderer), true);
-
-                // It would be nice to hide the selection on the cell while it is
-                // being edited to provide better contrast for the focus rect
-                // around the controls.
-
-            }
+            editor.addEventListener(KeyboardEvent.KEY_DOWN, editor_keyDownHandler);
+            editor.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, editor_keyFocusChangeHandler, false, 1000);
+            addRemoveFlexEventEnterListener(DisplayObject(editor), true);
+
         }

         if (grid.focusManager)
@@ -635,6 +655,62 @@
         // we disappear if stage or our grid is resized
         grid.systemManager.addEventListener(Event.RESIZE, editorAncestorResizeHandler);
         grid.addEventListener(Event.RESIZE, editorAncestorResizeHandler);
+    }
+
+    /**
+     *  @private
+     */
+    private function setFocusInItemRenderer(item:IGridItemRenderer):void
+    {
+        // if the item renderer is editable
+        // add the itemRenderer to focus manager to get the
+        // focusable objects under its control. Next set focus
+        // to the first item that should get focus.
+        if (grid.focusManager && grid.focusManager is FocusManager)
+        {
+            var fm:FocusManager = grid.focusManager as FocusManager;
+            var o:DisplayObject = item as DisplayObject;
+            var found:Boolean = false;
+            do
+            {
+                fm.fauxFocus = o;
+                o = fm.getNextFocusManagerComponent(false) as DisplayObject;
+                if (o == item ||
+                    item is DisplayObjectContainer &&
+                    DisplayObjectContainer(item).contains(o))
+                {
+                    found = true;
+                    break;
+                }
+            } while (o && dataGrid.contains(o));
+
+            if (lastEvent && lastEvent.type == KeyboardEvent.KEY_DOWN &&
+                KeyboardEvent(lastEvent).keyCode == Keyboard.TAB &&
+                KeyboardEvent(lastEvent).shiftKey)
+            {
+                // put focus on last item in cell editor instead of first.
+                var lastItem:DisplayObject = o;
+                do
+                {
+                    fm.fauxFocus = o;
+                    lastItem = o;
+                    o = fm.getNextFocusManagerComponent(false) as DisplayObject;
+                } while (o && DisplayObjectContainer(item).contains(o));
+
+                o = lastItem;
+            }
+
+            fm.fauxFocus = null;
+
+            if (found)
+            {
+                fm.setFocus(IFocusManagerComponent(o));
+
+                // Since we may have gotton here with the F2 key show the focus
+                // indicator to make it obvious which control has focus.
+                fm.showFocus();
+            }
+        }
     }

     /**
@@ -814,89 +890,6 @@
         return true;
     }

-    /**
-     *  @private
-     *  focus an item renderer in the grid
-     */
-    private function commitEditedItemPosition(coord:Object):void
-    {
-        if (!grid.enabled || !dataGrid.editable)
-            return;
-
-        if (!grid.dataProvider || grid.dataProvider.length == 0)
-            return;
-
-        // just give focus back to the itemEditorInstance
-        if (itemEditorInstance && coord &&
-            itemEditorInstance is IFocusManagerComponent &&
-            _editedItemPosition.rowIndex == coord.rowIndex &&
-            _editedItemPosition.columnIndex == coord.columnIndex)
-        {
-            IFocusManagerComponent(itemEditorInstance).setFocus();
-            return;
-        }
-
-        // dispose of any existing editor, saving away its data first
-        if (itemEditorInstance)
-        {
-            if (!dataGrid.endItemEditorSession())
-                return;
-        }
-
-        // store the value
-        _editedItemPosition = coord;
-
-        // allow setting of undefined to dispose item editor instance
-        if (!coord)
-            return;
-
-        var rowIndex:int = coord.rowIndex;
-        var columnIndex:int = coord.columnIndex;
-
-        dataGrid.ensureCellIsVisible(rowIndex, columnIndex);
-
-        // get the actual references for the column, row, and item
-        var item:IVisualElement = grid.getItemRendererAt(rowIndex, columnIndex);
-        if (!item)
-        {
-            // assume that editing was cancelled
-            commitEditedItemPosition(null);
-            return;
-        }
-
-        createItemEditor(rowIndex, columnIndex);
-
-        if (itemEditorInstance is IInvalidating)
-            IInvalidating(itemEditorInstance).validateNow();
-
-        var column:GridColumn = dataGrid.columns.getItemAt(columnIndex) as GridColumn;
-        if (itemEditorInstance is IIMESupport)
-            IIMESupport(itemEditorInstance).imeMode =
-                (column.imeMode == null) ? dataGrid.imeMode : column.imeMode;
-
-        var fm:IFocusManager = grid.focusManager;
-        // trace("setting focus to item editor");
-        if (itemEditorInstance is IFocusManagerComponent)
-            fm.setFocus(IFocusManagerComponent(itemEditorInstance));
-
-        lastEditedItemPosition = _editedItemPosition;
-
-        // Notify event that a new editor is starting.
-        // Don't dispatch life cycle events for item renderers.
-        var dataGridEvent:GridItemEditorEvent = null;
-
-        if (column.rendererIsEditable == false)
-            dataGridEvent = new GridItemEditorEvent(GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_START);
-
-        if (dataGridEvent)
-        {
-            dataGridEvent.columnIndex = editedItemPosition.columnIndex;
-            dataGridEvent.column = column;
-            dataGridEvent.rowIndex = editedItemPosition.rowIndex;
-            dataGrid.dispatchEvent(dataGridEvent);
-        }
-    }
-
     /**
      *  @private
      *  Save the editor session. The developer can still cancel out so the
@@ -1092,6 +1085,35 @@

     }

+    /**
+     *  @private
+     *  Check if a mouse click occured within the editor.
+     */
+    private function editorOwnsClick(event:Event):Boolean
+    {
+        return (event is MouseEvent &&
+            event.target is IUIComponent &&
+            editorOwns(IUIComponent(event.target)));
+    }
+
+    /**
+     *  @private
+     *  Check if a mouse click occured within the editor. The editor can be either
+     *  editedItemRenderer or itemEditorInstance.
+     *
+     *  @param child - child to test.
+     *  @return true if the child is owned by the editor.
+     */
+    private function editorOwns(child:IUIComponent):Boolean
+    {
+        return (itemEditorInstance &&
+                (itemEditorInstance == child ||
+                    IUIComponent(itemEditorInstance).owns(DisplayObject(child))) ||
+            (editedItemRenderer &&
+                (editedItemRenderer == child ||
+                     IUIComponent(editedItemRenderer).owns(DisplayObject(child)))));
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Event handlers
@@ -1101,6 +1123,28 @@
     /**
      *  @private
      *
+     *  Default handler for the startItemEditorSession event.
+     *
+     */
+    private function dataGrid_gridItemEditorSessionStartingHandler(event:GridItemEditorEvent):void
+    {
+        // trace("itemEditorItemEditBeginningHandler");
+        if (!event.isDefaultPrevented())
+        {
+            setEditedItemPosition({columnIndex: event.column.columnIndex, rowIndex: event.rowIndex});
+        }
+        else if (!itemEditorInstance)
+        {
+            _editedItemPosition = null;
+
+            // return focus to the grid w/o selecting an item
+            dataGrid.setFocus();
+        }
+    }
+
+    /**
+     *  @private
+     *
      *  Handle the F2 key to start editing a cell.
      */
     private function dataGrid_keyboardDownHandler(event:KeyboardEvent):void
@@ -1115,7 +1159,7 @@

         if (event.keyCode == dataGrid.editKey)
         {
-            // ignore F2 if we are already editting a cell.
+            // ignore F2 if we are already editing a cell.
             if (itemEditorInstance)
                 return;

@@ -1144,12 +1188,16 @@
     private function grid_gridMouseDownHandler(event:GridEvent):void
     {
         //trace("grid_gridMouseDownHandler");
-
         gotDoubleClickEvent = false;
-
+
+        // check if the mouse was clicked outside of the editor. If it was
+        // then end the editing session.
         if (!dataGrid.editable || editorOwnsClick(event))
             return;

+        if (!isValidCellPosition(event.rowIndex, event.columnIndex))
+            return;
+
         lastEvent = event;

         const rowIndex:int = event.rowIndex;
@@ -1199,6 +1247,9 @@
         if (!dataGrid.editable)
             return;

+        if (!isValidCellPosition(event.rowIndex, event.columnIndex))
+            return;
+
         lastEvent = event;

         const eventRowIndex:int = event.rowIndex;
@@ -1215,13 +1266,9 @@
         var r:IVisualElement = event.itemRenderer;
         //trace("grid_gridMouseUpHandler: itemRenderer = " + event.itemRenderer);
         if (r && r != editedItemRenderer &&
-            (lastItemDown == r || (lastItemDown && grid.contains(DisplayObject(lastItemDown)))))
-        {
-            // if lastItemDown != r, we clicked in one cell and dragged to another.
-            if (lastItemDown != r)
-                r = lastItemDown;
-
-            if (columnIndex >= 0 && dataGrid.editable)
+            lastItemDown && lastItemDown == r)
+        {
+            if (columnIndex >= 0)
             {
                 if (grid.columns.getItemAt(columnIndex).editable)
                 {
@@ -1252,7 +1299,7 @@
                     if (dataGrid.editOnDoubleClick ||
                         InteractiveObject(lastItemDown).doubleClickEnabled == false)
                     {
-                        // we don't need to wait on the time since editting double click is ok.
+                        // we don't need to wait on the time since editing double click is ok.
                         startItemEditorSession(rowIndex, columnIndex);
                     }
                     else
@@ -1262,59 +1309,8 @@
                         doubleClickTimer.start();
                     }
                 }
-                else
-                    // if the item is not editable, set lastPosition to it anyways
-                    // so future tabbing starts from there
-                    lastEditedItemPosition = { columnIndex: columnIndex, rowIndex: rowIndex };
             }
         }
-        else if (lastItemDown && lastItemDown != editedItemRenderer)
-        {
-            if (columnIndex >= 0 && dataGrid.editable)
-            {
-                if (grid.columns.getItemAt(columnIndex).editable)
-                {
-                    // Check if clicking again on the same item
-                    if (doubleClickTimer)
-                    {
-                        if (rowIndex == lastItemClickedPosition.rowIndex &&
-                            columnIndex == lastItemClickedPosition.columnIndex)
-                        {
-                            // click on the same item again and we already have a timer
-                            // do, wait on the timer
-                            lastItemDown == null;
-                            return;
-                        }
-                        else
-                        {
-                            // click on a different item. Stop the timer and start a new one
-                            doubleClickTimer.stop();
-                            doubleClickTimer = null;
-                        }
-                    }
-
-                    lastItemClickedPosition = { columnIndex: columnIndex, rowIndex: rowIndex};
-
-                    // start timer to make sure a double click does not cancel the edit.
-                    if (dataGrid.editOnDoubleClick ||
-                        InteractiveObject(lastItemDown).doubleClickEnabled == false)
-                    {
-                        // we don't need to wait on the time since editting double click is ok.
-                        startItemEditorSession(rowIndex, columnIndex);
-                    }
-                    else
-                    {
-                        doubleClickTimer = new Timer(dataGrid.doubleClickTime, 1);
-                        doubleClickTimer.addEventListener(TimerEvent.TIMER, doubleClickTimerHandler);
-                        doubleClickTimer.start();
-                    }
-                }
-                else
-                    // if the item is not editable, set lastPosition to it anyways
-                    // so future tabbing starts from there
-                    lastEditedItemPosition = { columnIndex: columnIndex, rowIndex: rowIndex};
-            }
-        }

         lastItemDown = null;
     }
@@ -1329,6 +1325,9 @@
         //trace("grid_gridDoubleClickHandler: got double click");

         if (!dataGrid.editable)
+            return;
+
+        if (!isValidCellPosition(event.rowIndex, event.columnIndex))
             return;

         lastEvent = event;
@@ -1359,31 +1358,11 @@

     /**
      *  @private
-     *
-     *  Default handler for the startItemEditorSession event.
-     *
-     */
-    private function dataGrid_gridItemEditorSessionStartingHandler(event:GridItemEditorEvent):void
-    {
-        // trace("itemEditorItemEditBeginningHandler");
-        if (!event.isDefaultPrevented())
-            setEditedItemPosition({columnIndex: event.column.columnIndex, rowIndex: event.rowIndex});
-        else if (!itemEditorInstance)
-        {
-            _editedItemPosition = null;
-
-            // return focus to the grid w/o selecting an item
-            dataGrid.setFocus();
-        }
-    }
-
-    /**
-     *  @private
      */
     private function deactivateHandler(event:Event):void
     {
-        // if stage losing activation, set focus to DG so when we get it back
-        // we popup an editor again
+        // If stage losing activation, set focus to DG close the editor and set
+        // focus back to the dataGrid.
         if (itemEditorInstance || editedItemRenderer)
         {
             dataGrid.endItemEditorSession();
@@ -1393,16 +1372,16 @@

     /**
      *  @private
-     *  Closes the itemEditorInstance if the foucs is outside of the dataGrid.
+     *  Closes the itemEditorInstance if the focus is outside of the data grid.
      */
     private function editor_focusOutHandler(event:FocusEvent):void
     {
         //trace("editor_focusOutHandler " + event.relatedObject);
         if (event.relatedObject &&
-            ((itemEditorInstance && DisplayObjectContainer(itemEditorInstance).contains(event.relatedObject)) ||
-                (editedItemRenderer && DisplayObjectContainer(editedItemRenderer).contains(event.relatedObject))) ||
             dataGrid.contains(event.relatedObject))
-            return;
+        {
+            return;
+        }

         // ignore textfields losing focus on mousedowns
         if (!event.relatedObject)
@@ -1410,8 +1389,6 @@

         if (itemEditorInstance || editedItemRenderer)
             dataGrid.endItemEditorSession();
-        else
-            destroyItemEditor();

     }

@@ -1521,7 +1498,7 @@
                 (itemEditorInstance && !DisplayObjectContainer(itemEditorInstance).contains(DisplayObject(nextObject))) ||
                 (!itemEditorInstance &&
                     (nextObject == editedItemRenderer ||
-                        (editedItemRenderer && !DisplayObjectContainer(editedItemRenderer).contains(DisplayObject(nextObject))))))
+                    (editedItemRenderer && !DisplayObjectContainer(editedItemRenderer).contains(DisplayObject(nextObject))))))
             {
                 event.preventDefault();

@@ -1570,25 +1547,6 @@
         // end up somewhere else
         dataGrid.setFocus();
     }
-
-    private function editorOwnsClick(event:Event):Boolean
-    {
-        // check if the mouse was clicked outside of the editor. If it was
-        // then end the editing session.
-        if (event is MouseEvent &&
-            (itemEditorInstance &&
-                (itemEditorInstance == event.target ||
-                IUIComponent(itemEditorInstance).owns(DisplayObject(event.target)))) ||
-            (editedItemRenderer &&
-                (editedItemRenderer == event.target ||
-                IUIComponent(editedItemRenderer).owns(DisplayObject(event.target)))))
-        {
-            return true;
-        }
-
-        return false;
-    }
-
-
+
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 2805
Author:   chaase@adobe.com
Date:     2008-08-11T20:37:18.700675Z

Log Message:
-----------
First checkin for the "Arbitrary Type Interpolation" feature. This feature has a rewritten Tween class (now named flex.effects.Animation). This class supports the old Tween capabilities, but adds functionality such as the ability to supply alternate interpolation objects (to allow animation of non-Number types), a new Easing API, and new 'repeat behavior' that will allow terser looping or reversing animations. The existing new effects were slightly changed to use the new Animation class (instead of Tween), and the superclass of the new effects, AnimateProperties (renamed 'Animate'), is now a subclass of Effect (not TweenEffect).

Added various new interpolation and easing classes, along with the new packages flex.effects.interpolation and flex.effects.easing. Also added new color-interpolation effect, 'Tint'.

Expect slight tweaks to the API during i7, but the bulk of the functionality and API changes are being checked in now.

Reviewed by Jason S.
Testing: checkintests & mustella tests/Effects (passed)

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animation.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/.actionScriptProperties</path>
<path kind="file" action="A">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/EffectsProperties.mxml</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimatePropertiesInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/AnimateProperties.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/components/AnimationPropertiesForm.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/FadeInstance.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/flex/effects/Fade.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Constant.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Power.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/ColorInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimateInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/TintInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/IEaser.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Tint.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/NumberArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/IInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/NumberInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/IAnimationTarget.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Resize.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Move.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/events/AnimationEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/ArrayInterpolator.as</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/ResizeInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/ResizeInstance.as
@@ -13,6 +13,7 @@
 import flash.events.Event;

 import flex.component.Panel;
+import flex.effects.Animation;
 import flex.effects.PropertyValuesHolder;
 import flex.graphics.IGraphicElement;

@@ -23,7 +24,7 @@
 import mx.events.TweenEvent;
 import mx.styles.IStyleClient;

-public class ResizeInstance extends AnimatePropertiesInstance
+public class ResizeInstance extends AnimateInstance
 {
     include "../../core/Version.as";

@@ -311,7 +312,7 @@
         super.play();

         if (childrenHiding)
-            tween.pause();
+            animation.pause();

     }

@@ -319,9 +320,9 @@
      * Handles the end event from the tween. The value here is an Array of
      * values, one for each 'property' in our propertyValuesList.
      */
-    override protected function endHandler(value:Object):void
-    {
-        super.endHandler(value);
+    override public function animationEnd(tween:Animation, value:Object):void
+    {
+        super.animationEnd(tween, value);

         restorePanelChildren();
     }
@@ -573,7 +574,7 @@
             // If all panels have finished their "hide children" effect,
             // then it's time to start our Resize effect.
             if (--numHideEffectsPlaying == 0)
-                tween.resume();
+                animation.resume();
         }
     }


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

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

 package mx.managers
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 6288
Author:   cframpto@adobe.com
Date:     2009-04-27T18:37:55.057029Z

Log Message:
-----------
imeMode support for TextInput, TextArea, RichEditableText and NumbericSteeper

QE Notes: needs testing
Doc Notes:
Bugs:
Reviewers: Gordon

Modified Paths:
--------------
<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/RichEditableText2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.as</path>

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

--- frameworks/projects/spark/src/spark/components/NumericStepper.as
+++ frameworks/projects/spark/src/spark/components/NumericStepper.as
@@ -16,6 +16,7 @@
 import flash.events.Event;
 import flash.events.FocusEvent;

+import mx.core.IIMESupport;
 import mx.events.FlexEvent;
 import mx.managers.IFocusManagerComponent;

@@ -62,7 +63,8 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class NumericStepper extends Spinner implements IFocusManagerComponent
+public class NumericStepper extends Spinner
+    implements IFocusManagerComponent, IIMESupport
 {
     include "../core/Version.as";

@@ -238,6 +240,56 @@
     {
         _extractValueFunction = value;
         extractValueFunctionChanged = true;
+        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  imeMode
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _imeMode:String = null;
+
+    [Inspectable(defaultValue="")]
+
+    /**
+     *  @private
+     */
+    private var imeModeChanged:Boolean = false;
+
+    /**
+     *  Specifies the IME (Input Method Editor) mode.
+     *  The IME enables users to enter text in Chinese, Japanese, and Korean.
+     *  Flex sets the specified IME mode when the control gets the focus
+     *  and sets it back to previous value when the control loses the focus.
+     *
+     *
The flash.system.IMEConversionMode class defines constants for the
+     *  valid values for this property.
+     *  You can also specify null to specify no IME.

+     *
+     *  @see flash.system.IMEConversionMode
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get imeMode():String
+    {
+        return _imeMode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set imeMode(value:String):void
+    {
+        _imeMode = value;
+        imeModeChanged = true;
         invalidateProperties();
     }

@@ -355,6 +407,12 @@
             textInput.maxChars = _maxChars;
             maxCharsChanged = false;
         }
+
+        if (imeModeChanged)
+        {
+            textInput.imeMode = _imeMode;
+            imeModeChanged = false;
+        }
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 8142
Author:   srahim@adobe.com
Date:     2009-06-23T23:38:44.347619Z

Log Message:
-----------
ASDoc updates

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

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

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

--- frameworks/projects/spark/src/spark/components/NumericStepper.as
+++ frameworks/projects/spark/src/spark/components/NumericStepper.as
@@ -60,7 +60,74 @@
  *  component, or steps the NumericStepper by pressing an arrow button
  *  or by calling the changeValueByStep() method.

  *
- *  @see mx.components.Spinner
+ *  @mxml
+ *
+ *
The <NumericStepper> tag inherits all of the tag
+ *  attributes of its superclass and adds the following tag attributes:

+ *
+ *

+ *  <NumericStepper
+ *
+ *    Properties
+ *    imeMode="null"
+ *    maxChars="0"
+ *    maximum="10"
+ *    valueFormatFunction=""
+ *    valueParseFunction=""
+ *
+ *    Styles
+ *
+*    alignmentBaseline="USE_DOMINANT_BASELINE"
+*    baselineShift="0.0"
+*    blockProgression="TB"
+*    breakOpportunity="AUTO"
+*    cffHinting="HORIZONTAL_STEM"
+*    color="0"
+*    contentBackgroundColor=""
+*    digitCase="DEFAULT"
+*    digitWidth="DEFAULT"
+*    direction="LTR"
+*    dominantBaseline="AUTO"
+*    firstBaselineOffset="AUTO"
+*    focusedTextSelectionColor=""
+*    fontFamily="Times New Roman"
+*    fontLookup="DEVICE"
+*    fontSize="12"
+*    fontStyle="NORMAL"
+*    fontWeight="NORMAL"
+*    inactiveTextSelection=""
+*    justificationRule="AUTO"
+*    justificationStyle="AUTO"
+*    kerning="AUTO"
+*    leadingModel="AUTO"
+*    ligatureLevel="COMMON"
+*    lineHeight="120%"
+*    lineThrough="false"
+*    locale="en"
+*    paragraphEndIndent="0"
+*    paragraphSpaceAfter="0"
+*    paragraphSpaceBefore="0"
+*    paragraphStartIndent="0"
+*    renderingMode="CFF"
+*    tabStops="null"
+*    textAlign="START"
+*    textAlignLast="START"
+*    textAlpha="1"
+*    textDecoration="NONE"
+*    textIndent="0"
+*    textJustify="INTER_WORD"
+*    textRotation="AUTO"
+*    trackingLeft="0"
+*    trackingRight="0"
+*    typographicCase="DEFAULT"
+*    unfocusedTextSelectionColor=""
+*    whiteSpaceCollapse="COLLAPSE"
+*  />
+*

+*
+ *  @see spark.components.Spinner
+ *  @see spark.skins.spark.NumericStepperSkin
+ *  @see spark.skins.spark.NumericStepperTextInputSkin
  *
  *  @includeExample examples/NumericStepperExample.mxml
  *
@@ -176,7 +243,7 @@

      /**
      *  Callback function that formats the value displayed
-     *  in the textDisplay field.
+     *  in the skin's textDisplay property.
      *  The function takes a single Number as an argument
      *  and returns a formatted String.
      *
@@ -217,7 +284,7 @@
      /**
      *  Callback function that extracts the numeric
      *  value from the displayed value in the
-     *  textDisplay field.
+     *  skin's textDisplay field.
      *
      *  The function takes a single String as an argument
      *  and returns a Number.


Add a better toString, for debugging.

Add a better toString, for debugging.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@5963 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/io/Streamer.as
+++ src/as/com/threerings/io/Streamer.as
@@ -125,6 +125,11 @@
         (obj as Streamable).readObject(ins);
     }

+    public function toString () :String
+    {
+        return "[Streamer(" + _jname + ")]";
+    }
+
     protected static function registerStreamer (st :Streamer) :void
     {
         _byJName[st.getJavaClassName()] = st;


Skip stabbystabby

Skip stabbystabby

--- Game/Resources/final_event/MainScript.as
+++ Game/Resources/final_event/MainScript.as
@@ -45,6 +45,13 @@
                 pos.x -= speed * deltaTime;
                 minecart.SetWorldPosition(pos);
                 break;
+            }
+            case 1: { // Waiting for monster to eat/die
+            	// Puzzle Skip
+                if(!IsVRActive() && Input(PuzzleSkip, @self)) {
+                	phase = 2;
+                	SendMessage(monster, 1); // Monster died
+                }
             }
             case 2: { // Wait for monster to collapse
                 waitForMonsterTimer += deltaTime;


More module text tweaks

More module text tweaks

--- src/Modules/DataWriterT.as
+++ src/Modules/DataWriterT.as
@@ -37,11 +37,11 @@
 			var lineNode:InternalNode = new PortNode(this, InternalNode.DIM_WIDE, new Point(layout.ports[2].offset.x, layout.ports[2].offset.y + 2), layout.ports[2]);

 			var dataNode:InternalNode = new BigNode(this, new Point(layout.ports[2].offset.x + 1, layout.ports[0].offset.y), [writeNode, lineNode], [],
-														  getValue, "Memory at line");
+														  getValue, "Memory value at line");
 			var controlNode:InternalNode = new StandardNode(this, new Point(layout.ports[1].offset.x, layout.ports[1].offset.y + 2), [layout.ports[1]],
 															[new NodeTuple(dataNode, writeNode, writeOK)],
 															function getValue():BooleanValue { return writeOK() ? BooleanValue.TRUE : BooleanValue.FALSE; },
-															"Write-control: Memory at line will be set to input value" );
+															"Write-control: Memory value at line will be set to input value" );
 			return new InternalLayout([writeNode, dataNode, lineNode, controlNode]);
 		}


Prevented possible null errors from errorType and errorCode in XMPPStanza.

git-svn-id: c197267f952b24206666de142881703007ca05d5@12847 b35dd754-fafc-0310-a699-88a17e54d16e

--- src/org/igniterealtime/xiff/data/XMPPStanza.as
+++ src/org/igniterealtime/xiff/data/XMPPStanza.as
@@ -359,7 +359,7 @@
 		 */
 		public function get errorType():String
 		{
-			return myErrorNode.attributes.type;
+			return myErrorNode && myErrorNode.attributes ? myErrorNode.attributes.type : null;
 		}

 		public function set errorType( value:String ):void
@@ -382,7 +382,7 @@
 		 */
 		public function get errorCode():int
 		{
-			return parseInt( myErrorNode.attributes.code );
+			return myErrorNode && myErrorNode.attributes ? parseInt( myErrorNode.attributes.code ) : 0;
 		}

 		public function set errorCode( value:int ):void


improved performance and fixed metadata bugs in
ForeignDataMappingTransform

Change-Id: Idc8e57106a55651c14ac73a6a963c6418f21d254

--- WeaveData/src/weave/data/Transforms/ForeignDataMappingTransform.as
+++ WeaveData/src/weave/data/Transforms/ForeignDataMappingTransform.as
@@ -24,7 +24,6 @@
     import weave.api.data.IAttributeColumn;
     import weave.api.data.IDataSource;
     import weave.api.data.IWeaveTreeNode;
-    import weave.api.detectLinkableObjectChange;
     import weave.api.newLinkableChild;
     import weave.api.registerLinkableChild;
     import weave.api.ui.ISelectableAttributes;
@@ -135,26 +134,92 @@
 			proxyColumn.setMetadata(metadata);

             var dataColumn:IAttributeColumn = dataColumns.getObject(dataColumnName) as IAttributeColumn;
-            var equationColumn:EquationColumn = proxyColumn.getInternalColumn() as EquationColumn || new EquationColumn();
-
-			metadata[ColumnMetadata.TITLE] = "{dataColumn.getMetadata('title')}";
-			metadata[ColumnMetadata.DATA_TYPE] = "{dataColumn.getMetadata('dataType')}";
-            equationColumn.variables.requestObjectCopy("keyColumn", keyColumn);
-            equationColumn.variables.requestObjectCopy("dataColumn", dataColumn);
-            equationColumn.metadata.value = metadata;
-            equationColumn.filterByKeyType.value = true;
-            equationColumn.equation.value = <![CDATA[
-				function(key, dataType)
-				{
-					var kt = keyColumn.getMetadata('dataType');
-					if (kt == 'string')
-						kt = dataColumn.getMetadata('keyType');
-					var ln = keyColumn.getValueFromKey(key, String);
-					return dataColumn.getValueFromKey(getQKey(kt, ln), dataType);
-				}
-			]]>;
-
-            proxyColumn.setInternalColumn(equationColumn);
+            var foreignDataColumn:ForeignDataColumn = proxyColumn.getInternalColumn() as ForeignDataColumn || new ForeignDataColumn(this);
+			foreignDataColumn.setup(metadata, dataColumn);
+
+            proxyColumn.setInternalColumn(foreignDataColumn);
         }
     }
 }
+
+import weave.api.data.ColumnMetadata;
+import weave.api.data.DataType;
+import weave.api.data.IAttributeColumn;
+import weave.api.data.IPrimitiveColumn;
+import weave.api.data.IQualifiedKey;
+import weave.api.registerLinkableChild;
+import weave.core.SessionManager;
+import weave.data.AttributeColumns.AbstractAttributeColumn;
+import weave.data.Transforms.ForeignDataMappingTransform;
+import weave.utils.ColumnUtils;
+import weave.utils.VectorUtils;
+
+internal class ForeignDataColumn extends AbstractAttributeColumn implements IPrimitiveColumn
+{
+	public function ForeignDataColumn(source:ForeignDataMappingTransform)
+	{
+		registerLinkableChild(this, source);
+		_keyColumn = source.keyColumn;
+	}
+
+	private var _keyColumn:IAttributeColumn;
+	private var _dataColumn:IAttributeColumn;
+	private var _keyType:String;
+
+	public function setup(metadata:Object, dataColumn:IAttributeColumn):void
+	{
+		if (_dataColumn && _dataColumn != dataColumn)
+			(WeaveAPI.SessionManager as SessionManager).unregisterLinkableChild(this, _dataColumn);
+
+		_metadata = copyValues(metadata);
+		_dataColumn = registerLinkableChild(this, dataColumn);
+		_keyType = _keyColumn.getMetadata(ColumnMetadata.DATA_TYPE);
+		if (_keyType == DataType.STRING)
+			_keyType = dataColumn.getMetadata(ColumnMetadata.KEY_TYPE);
+		triggerCallbacks();
+	}
+
+	override public function getMetadata(propertyName:String):String
+	{
+		return super.getMetadata(propertyName)
+			|| _dataColumn.getMetadata(propertyName);
+	}
+
+	override public function getMetadataPropertyNames():Array
+	{
+		if (_dataColumn)
+			return VectorUtils.union(super.getMetadataPropertyNames(), _dataColumn.getMetadataPropertyNames());
+		return super.getMetadataPropertyNames();
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	override public function get keys():Array
+	{
+		return _keyColumn.keys;
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	override public function containsKey(key:IQualifiedKey):Boolean
+	{
+		return _dataColumn.containsKey(key);
+	}
+
+	public function deriveStringFromNumber(value:Number):String
+	{
+		return ColumnUtils.deriveStringFromNumber(_dataColumn, value);
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	override public function getValueFromKey(key:IQualifiedKey, dataType:Class = null):*
+	{
+		var localName:String = _keyColumn.getValueFromKey(key, String);
+		var foreignKey:IQualifiedKey = WeaveAPI.QKeyManager.getQKey(_keyType, localName);
+		return _dataColumn.getValueFromKey(foreignKey, dataType);
+	}
+}


- change: Small cleanup in CSSDeclaration

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

--- src/reprise/css/CSSDeclaration.as
+++ src/reprise/css/CSSDeclaration.as
@@ -24,7 +24,8 @@
 	import reprise.css.propertyparsers.Transition;
 	import reprise.css.transitions.CSSTransitionsManager;
 	import reprise.css.transitions.TransitionVOFactory;
-
+	import reprise.data.AdvancedColor;
+
 	import flash.text.StyleSheet;

 	use namespace reprise;
@@ -284,15 +285,7 @@
 					tfObject[key] = CSSProperty(m_properties[key]).valueOf();
 				}
 			}
-			if (tfObject.color != null)
-			{
-				var colorStr:String = tfObject.color.rgb().toString(16);
-				while(colorStr.length < 6)
-				{
-					colorStr = '0' + colorStr;
-				}
-				tfObject.color = '#' + colorStr;
-			}
+			tfObject.color &&= AdvancedColor(tfObject.color).toString().substr(0, 7);
 			return tfObject;
 		}


OFC-845	Do not allow first tab to be removed or reordered

--- collect-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
+++ collect-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
@@ -89,9 +89,9 @@

 			addMainEntityFormContainer(formContainer, rootEntity, version);

-			var tabSet:UITabSetProxy = getRootEntityTabSet(rootEntity);
-			if ( tabSet != null && tabSet.tabs != null) {
-				for each (var tab:UITabProxy in tabSet.tabs) {
+			var rootTabSet:UITabSetProxy = getRootEntityTabSet(rootEntity);
+			if ( rootTabSet != null && rootTabSet.tabs != null) {
+				for each (var tab:UITabProxy in rootTabSet.tabs) {
 					if ( ! isMainTab(rootEntity, tab) ) {
 						addChildEntityFormContainer(formContainer, rootEntity, version, tab);
 					}
@@ -100,8 +100,12 @@
 			return formContainer;
 		}

+		/**
+		 * Returns true if the tab is the first tab in the corresponding root tab set
+		 */
 		private static function isMainTab(rootEntity:EntityDefinitionProxy, tab:UITabProxy):Boolean {
-			return tab.name == rootEntity.uiTabName;
+			var rootTabSet:UITabSetProxy = getRootEntityTabSet(rootEntity);
+			return rootTabSet.tabs.getItemIndex(tab) == 0;
 		}

 		private static function addMainEntityFormContainer(formContainer:FormContainer, rootEntity:EntityDefinitionProxy, version:ModelVersionProxy):void {


fix bug in xmldiffer

fix bug in xmldiffer

--- mustella/as3/src/mustella/CompareBitmap.as
+++ mustella/as3/src/mustella/CompareBitmap.as
@@ -1363,7 +1363,27 @@
 		return a;
 	}

-	// static text seems to float around a bit so ignore it.
+    // attempt to strip off random unique name chars for embedded assets
+    private function trimName(a:String):String
+    {
+        var c:int;
+        var d:int;
+
+        c = a.length;
+        for (var i:int = c - 1;i > 0; i--)
+        {
+            var ch:String = a.charAt(i);
+            if ((ch >= '0' && ch <= '9') || ch == '_')
+            {
+                // assume it is a random char
+            }
+            else
+                break;
+        }
+        return a.substring(0, i + 1);
+    }
+
+    // static text seems to float around a bit so ignore it.
 	private function nullChildOrStaticText(a:String, b:String):Boolean
 	{
 		if (a.indexOf("<NullChild") != -1)
@@ -1414,10 +1434,10 @@
         var tparts:Array = tn.split(".");
         n = sparts.length;
         for (i = 0; i < n; i++)
-            sparts[i] = trimTag(sparts[i]);
+            sparts[i] = trimName(sparts[i]);
         n = tparts.length;
         for (i = 0; i < n; i++)
-            tparts[i] = trimTag(tparts[i]);
+            tparts[i] = trimName(tparts[i]);
         sn = sparts.join(".");
         tn = tparts.join(".");
         if (tn != sn)


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

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

 package mx.charts.renderers
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 11382
Author:   dloverin@adobe.com
Date:     2009-11-02T22:42:30.388708Z

Log Message:
-----------
Fix RTE when getting overrides from a merged style declaration.

FlexModuleFactory.as
Merge 3.x module leak fix that didn’t make it into the trunk.

ModuleLoader.as
Don’t update the applicationDomain property when we choose a child applicationDomain. Put the results in temporary variable so the applicationDomain property is left for the user.

CSSMergedStyleDeclaration:
Create an array if one does not already exist. This fixes a null pointer RTE when creating a merged array of properties.

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

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

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

--- frameworks/projects/framework/src/mx/styles/CSSMergedStyleDeclaration.as
+++ frameworks/projects/framework/src/mx/styles/CSSMergedStyleDeclaration.as
@@ -303,28 +303,34 @@
             return super.overrides;

         var obj:Object;
-        var tempOverrides:Object = null; // collect the overrides before setting
+        var mergedOverrides:Object = null;
+
         if (style && style.overrides)
         {
+            mergedOverrides = [];
+
             var childOverrides:Object = style.overrides;
             for (obj in childOverrides)
-                tempOverrides[obj] = childOverrides[obj];
+                mergedOverrides[obj] = childOverrides[obj];
         }

         if (parentStyle && parentStyle.overrides)
         {
+            if (!mergedOverrides)
+                mergedOverrides = [];
+
             var parentOverrides:Object = parentStyle.overrides;
             for (obj in parentOverrides)
             {
-                if (tempOverrides[obj] === undefined)
-                    tempOverrides[obj] = parentOverrides[obj];
+                if (mergedOverrides[obj] === undefined)
+                    mergedOverrides[obj] = parentOverrides[obj];
             }
         }

-        super.overrides = tempOverrides;
+        super.overrides = mergedOverrides;
         updateOverrides = false;

-        return tempOverrides;
+        return mergedOverrides;
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 8679
Author:   jimurphy@adobe.com
Date:     2009-07-20T13:23:31.007823Z

Log Message:
-----------
These are Asdoc edit from 3.x rev 8623.  I somehow missed committing these when they were supposed to be committed during my previous merge.

bug: no
qa: no
doc: no
checkintests: pass

Modified Paths:
--------------
<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/rpc/src/mx/messaging/channels/PollingChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.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/rpc/src/mx/messaging/Consumer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicProducer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureAMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/StreamingAMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/StreamingConnectionHandler.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/rpc/CallResponder.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/rpc/src/mx/messaging/MultiTopicConsumer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MessageResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureStreamingAMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/config/ConfigMap.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractInvoker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/Responder.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureHTTPChannel.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/rpc/src/mx/messaging/channels/StreamingHTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/XMLLoadEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/IResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/Producer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureStreamingHTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncToken.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/WSDLLoadEvent.as</path>

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

--- frameworks/projects/rpc/src/mx/messaging/channels/StreamingAMFChannel.as
+++ frameworks/projects/rpc/src/mx/messaging/channels/StreamingAMFChannel.as
@@ -71,7 +71,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  Creates an new StreamingAMFChannel instance.
+     *  Constructor.
      *
      *  @param id The id of this Channel.
      *
@@ -429,7 +429,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  Creates an new StreamingAMFConnectionHandler instance.
+     *  Constructor.
      *
      *  @param channel The Channel that uses this class.
      *  @param log Reference to the logger for the associated Channel.


Transferred from the Adobe Open Source Subversion Repository

Revision: 17528
Author:   smgilson@adobe.com
Date:     2010-08-31T11:53:03.095561Z

Log Message:
-----------
Fix broken ASDoc build by adding HTML closing tags to comments.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.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@1281413 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
@@ -596,7 +596,7 @@
      *
      *  <p>If this property's value is undefined(the default), then the grid's showDataTips
      *  property determines if dataTips will be shown.   If this property is set, then
-     *  the grid's showDataTips property is ignored.
+     *  the grid's showDataTips property is ignored. </p>
      *
      *  @default undefined
      *


fixed bug handling unary assignment operators immediately following }

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -1331,6 +1331,7 @@
 		 */
 		private function compileUnaryOperators(compiledTokens:Array, operatorSymbols:Array):void
 		{
+			var call:CompiledFunctionCall;
 			var index:int = compiledTokens.length;
 			while (index--) // right to left
 			{
@@ -1358,22 +1359,26 @@

 				// skip infix operator
 				if (index > 0 && compiledTokens[index - 1] is ICompiledObject)
-					continue;
+				{
+					call = compiledTokens[index - 1] as CompiledFunctionCall;
+					if (!call || call.evaluatedMethod != operators[';'])
+						continue;
+				}

 				// compile unary operator
 				if (debug)
 					trace("compile unary operator", compiledTokens.slice(index, index + 2).join(' '));

-				if (assignmentOperators.hasOwnProperty(token))
-				{
-					var call:CompiledFunctionCall = nextToken as CompiledFunctionCall;
+				if (assignmentOperators.hasOwnProperty(token)) // unary assignment operators
+				{
+					call = nextToken as CompiledFunctionCall;
 					if (call && !call.compiledParams) // variable lookup
 					{
 						compiledTokens.splice(index, 2, compileOperator(token, [call.compiledMethod, newUndefinedConstant()]));
 					}
 					else if (call && call.evaluatedMethod == operators['.'])
 					{
-						// switch '.' to the unary operator
+						// switch '.' to the unary assignment operator
 						call.compiledParams.push(newUndefinedConstant());
 						compiledTokens.splice(index, 2, compileOperator(token, call.compiledParams));
 					}


Transferred from the Adobe Open Source Subversion Repository

Revision: 18051
Author:   rfrishbe@adobe.com
Date:     2010-10-07T04:15:11.763153Z

Log Message:
-----------
Removing iconDisplayHolder form MobileIconItemRenderer.  In order to do this, MobileIconItemRenderer now implements IGraphicElementContainer.  This requires some extra work, but from an API perspective, getting rid of iconDisplayHolder is a good thing.  MobileIconItemRenderer implements IGraphicElementContainer, but is only made to hold one graphicelement--the iconDisplay.  This change also seems to help with performance some, though, not as much as one would hope.

During this process, I also found a small bug in GraphicElement around invalidation.

QE notes: None
Doc notes: None
Bugs: -
Reviewer: Evtim
Tests run: checkintests, mustella Group, spark/primitives
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as
@@ -12,37 +12,26 @@
 package spark.components
 {
 import flash.display.DisplayObject;
-import flash.events.MouseEvent;
-import flash.geom.Point;
-import flash.text.TextField;
-import flash.text.TextFieldType;
-import flash.text.TextFormat;
-import flash.text.TextFormatAlign;
+import flash.events.TimerEvent;
+import flash.utils.Timer;

 import mx.controls.listClasses.*;
-import mx.core.IDataRenderer;
 import mx.core.IFlexDisplayObject;
-import mx.core.IFlexModuleFactory;
 import mx.core.IVisualElement;
-import mx.core.UIComponent;
 import mx.core.UITextField;
 import mx.core.UITextFormat;
 import mx.core.mx_internal;
-import mx.events.FlexEvent;
 import mx.graphics.BitmapFillMode;
 import mx.graphics.BitmapScaleMode;
 import mx.styles.CSSStyleDeclaration;
-import mx.styles.IStyleClient;
-import mx.utils.StringUtil;
-
-import spark.components.Group;
-import spark.components.IItemRenderer;
-import spark.components.Image;
-import spark.components.Label;
+
 import spark.components.supportClasses.MobileTextField;
-import spark.components.supportClasses.TextBase;
 import spark.core.ContentCache;
+import spark.core.DisplayObjectSharingMode;
 import spark.core.IContentLoader;
+import spark.core.IGraphicElement;
+import spark.core.IGraphicElementContainer;
+import spark.core.ISharedDisplayObject;
 import spark.primitives.BitmapImage;

 use namespace mx_internal;
@@ -125,7 +114,8 @@
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
-public class MobileIconItemRenderer extends MobileItemRenderer
+public class MobileIconItemRenderer extends MobileItemRenderer
+    implements IGraphicElementContainer, ISharedDisplayObject
 {

     //--------------------------------------------------------------------------
@@ -206,6 +196,27 @@
      */
     private var messageText:String = "";

+    /**
+     *  @private
+     *  Since iconDisplay is a GraphicElement, we have to call its lifecycle methods
+     *  directly.
+     */
+    private var iconNeedsValidateProperties:Boolean = false;
+
+    /**
+     *  @private
+     *  Since iconDisplay is a GraphicElement, we have to call its lifecycle methods
+     *  directly.
+     */
+    private var iconNeedsValidateSize:Boolean = false;
+
+    /**
+     *  @private
+     *  Since iconDisplay is a GraphicElement, we have to call help assign
+     *  its display object
+     */
+    private var iconNeedsDisplayObjectAssignment:Boolean = false;
+
     //--------------------------------------------------------------------------
     //
     //  Public Properties: Overridden
@@ -512,27 +523,17 @@
      *  The bitmap image component used to
      *  display the icon data of the item renderer.
      *
+     *
Because MobileIconItemRenderer implements ISharedDisplayObject
+     *  and IGraphicElementContainer, we don't need to wrap iconDisplay
+     *  in a Group; however, it does require a little more work when instantiating
+     *  and destroying iconDisplay.

+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
     protected var iconDisplay:BitmapImage;
-
-    /**
-     *  The Group that holds the iconDisplay BitmapImage.
-     *
-     *
The Group is necessary since GraphicElements must live inside
-     *  of one.

-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected var iconDisplayHolder:Group;
-    // Need a holder for the iconDisplay since it's a GraphicElement
-    // TODO (rfrishbe): would be nice to fix above somehow

     /**
      *  The name of the field in the data item to display as the icon.
@@ -901,6 +902,138 @@
         invalidateProperties();
     }

+    //----------------------------------
+    //  redrawRequested
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _redrawRequested:Boolean = false;
+
+    /**
+     *  @inheritDoc
+     *
+     *
We implement this as part of ISharedDisplayObject so the iconDisplay
+     *  can share our display object.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get redrawRequested():Boolean
+    {
+        return _redrawRequested;
+    }
+
+    /**
+     *  @private
+     */
+    public function set redrawRequested(value:Boolean):void
+    {
+        _redrawRequested = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  IGraphicElementContainer
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Notify the host that an element layer has changed.
+     *
+     *  The IGraphicElementHost must re-evaluates the sequences of
+     *  graphic elements with shared DisplayObjects and may need to re-assign the
+     *  DisplayObjects and redraw the sequences as a result.
+     *
+     *  Typically the host will perform this in its
+     *  validateProperties() method.
+     *
+     *  @param element The element that has changed size.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function invalidateGraphicElementSharing(element:IGraphicElement):void
+    {
+        // since the only graphic element is hooked up to drawing with the background,
+        // just invalidate display list
+        iconNeedsDisplayObjectAssignment = true;
+        invalidateProperties();
+    }
+
+    /**
+     *  Notify the host component that an element changed and needs to validate properties.
+     *
+     *  The IGraphicElementHost must call the validateProperties()
+     *  method on the IGraphicElement to give it a chance to commit its properties.
+     *
+     *  Typically the host will validate the elements' properties in its
+     *  validateProperties() method.
+     *
+     *  @param element The element that has changed.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function invalidateGraphicElementProperties(element:IGraphicElement):void
+    {
+        iconNeedsValidateProperties = true;
+        invalidateProperties();
+    }
+
+    /**
+     *  Notify the host component that an element size has changed.
+     *
+     *  The IGraphicElementHost must call the validateSize()
+     *  method on the IGraphicElement to give it a chance to validate its size.
+     *
+     *  Typically the host will validate the elements' size in its
+     *  validateSize() method.
+     *
+     *  @param element The element that has changed size.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function invalidateGraphicElementSize(element:IGraphicElement):void
+    {
+        iconNeedsValidateSize = true;
+        invalidateSize();
+    }
+
+    /**
+     *  Notify the host component that an element has changed and needs to be redrawn.
+     *
+     *  The IGraphicElementHost must call the validateDisplayList()
+     *  method on the IGraphicElement to give it a chance to redraw.
+     *
+     *  Typically the host will validate the elements' display lists in its
+     *  validateDisplayList() method.
+     *
+     *  @param element The element that has changed.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function invalidateGraphicElementDisplayList(element:IGraphicElement):void
+    {
+        if (element.displayObject is ISharedDisplayObject)
+            ISharedDisplayObject(element.displayObject).redrawRequested = true;
+
+        invalidateDisplayList();
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods: UIComponent
@@ -995,29 +1128,32 @@
             if ((iconField || (iconFunction != null)) && !iconDisplay)
             {
                 // need to create it
-                iconDisplayHolder = new Group();

                 iconDisplay = new iconDisplayClass();
-                iconDisplay.left = 0;
-                iconDisplay.right = 0;
-                iconDisplay.top = 0;
-                iconDisplay.bottom = 0;

                 iconDisplay.contentLoader = iconContentLoader;
                 iconDisplay.fillMode = iconFillMode;
                 iconDisplay.scaleMode = iconScaleMode;
+
+                iconDisplay.parentChanged(this);

-                // add iconDisplayHolder to the display list first in case
-                // bitmap needs to check its layoutDirection.
-                addChild(iconDisplayHolder);
-                iconDisplayHolder.addElement(iconDisplay);
+                iconNeedsDisplayObjectAssignment = true;
             }
             else if (!(iconField || (iconFunction != null)) && iconDisplay)
             {
-                // need to remove it
-                removeChild(iconDisplayHolder);
-                iconDisplayHolder.removeElement(iconDisplay);
-                iconDisplayHolder = null;
+                // need to remove the display object
+                var oldDisplayObject:DisplayObject = iconDisplay.displayObject;
+                if (oldDisplayObject)
+                {
+                    // If the element created the display object
+                    if (iconDisplay.displayObjectSharingMode != DisplayObjectSharingMode.USES_SHARED_OBJECT &&
+                        oldDisplayObject.parent == this)
+                    {
+                        removeChild(oldDisplayObject);
+                    }
+                }
+
+                iconDisplay.parentChanged(null);
                 iconDisplay = null;
             }

@@ -1170,6 +1306,47 @@
             invalidateSize();
             invalidateDisplayList();
         }
+
+        if (iconNeedsDisplayObjectAssignment)
+        {
+            iconNeedsDisplayObjectAssignment = false;
+            if (iconDisplay)
+            {
+                // try using this display object first
+                if (iconDisplay.setSharedDisplayObject(this))
+                {
+                    iconDisplay.displayObjectSharingMode = DisplayObjectSharingMode.USES_SHARED_OBJECT;
+                }
+                else
+                {
+                    // if we can't use this as the display object, then let's see if
+                    // the icon already has and owns a display object
+                    var ownsDisplayObject:Boolean = (iconDisplay.displayObjectSharingMode != DisplayObjectSharingMode.USES_SHARED_OBJECT);
+
+                    // If the element doesn't have a DisplayObject or it doesn't own
+                    // the DisplayObject it currently has, then create a new one
+                    var displayObject:DisplayObject = iconDisplay.displayObject;
+                    if (!ownsDisplayObject || !displayObject)
+                        displayObject = iconDisplay.createDisplayObject();
+
+                    // Add the display object as a child
+                    // Check displayObject for null, some graphic elements
+                    // may choose not to create a DisplayObject during this pass.
+                    if (displayObject)
+                        addChild(displayObject);
+
+                    iconDisplay.displayObjectSharingMode = DisplayObjectSharingMode.OWNS_UNSHARED_OBJECT;
+                }
+            }
+
+        }
+
+        if (iconNeedsValidateProperties)
+        {
+            iconNeedsDisplayObjectAssignment = false;
+            if (iconDisplay)
+                iconDisplay.validateProperties();
+        }
     }

     /**
@@ -1200,6 +1377,25 @@
     /**
      *  @private
      */
+    override public function validateSize(recursive:Boolean = false):void
+    {
+        // Since IGraphicElement is not ILayoutManagerClient, we need to make sure we
+        // validate sizes of the elements, even in cases where recursive==false.
+
+        // Validate element size
+        if (iconNeedsValidateSize)
+        {
+            iconNeedsValidateSize = false;
+            if (iconDisplay)
+                iconDisplay.validateSize();
+        }
+
+        super.validateSize(recursive);
+    }
+
+    /**
+     *  @private
+     */
     override protected function measure():void
     {
         // don't call super.measure() because there's no need to do the work that's
@@ -1308,6 +1504,17 @@

         measuredMinWidth = myMeasuredMinWidth;
         measuredMinHeight = Math.max(80, myMeasuredMinHeight);
+    }
+
+    /**
+     *  @private
+     *  If we invalidate display list, we need to redraw any graphic elements sharing
+     *  our display object since we call graphics.clear() in super.updateDisplayList()
+     */
+    override public function invalidateDisplayList():void
+    {
+        redrawRequested = true;
+        super.invalidateDisplayList();
     }

     /**
@@ -1349,11 +1556,11 @@
         if (iconDisplay)
         {
             // set the icon's position and size
-            iconDisplayHolder.setLayoutBoundsSize(this.iconWidth, this.iconHeight);
-            iconDisplayHolder.setLayoutBoundsPosition(paddingLeft, paddingTop);
-
-            iconWidth = iconDisplayHolder.getLayoutBoundsWidth();
-            iconHeight = iconDisplayHolder.getLayoutBoundsHeight();
+            iconDisplay.setLayoutBoundsSize(this.iconWidth, this.iconHeight);
+            iconDisplay.setLayoutBoundsPosition(paddingLeft, paddingTop);
+
+            iconWidth = iconDisplay.getLayoutBoundsWidth();
+            iconHeight = iconDisplay.getLayoutBoundsHeight();
         }

         // decorator is aligned next to icon
@@ -1477,6 +1684,16 @@
             if (messageDisplay)
                 positionElement(messageDisplay, labelComponentsX, labelComponentsY + labelHeight + verticalGap);
         }
+
+
+        // see if we have an icon that needs to be validated
+        if (iconDisplay &&
+            iconDisplay.displayObject is ISharedDisplayObject &&
+            ISharedDisplayObject(iconDisplay.displayObject).redrawRequested)
+        {
+            ISharedDisplayObject(iconDisplay.displayObject).redrawRequested = false;
+            iconDisplay.validateDisplayList();
+        }
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 12685
Author:   klin@adobe.com
Date:     2009-12-09T03:23:32.740879Z

Log Message:
-----------
Fix for RTE in VideoPlayer when trying to capture bitmaps. Put try-catch block around bitmapData.draw() and use a Rectangle if it throws an error. Also, added some documentation in BitmapUtil for getSnapshot since it may throw the same type of error.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/HighlightBitmapCaptureSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/BitmapUtil.as</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/HighlightBitmapCaptureSkin.as
+++ frameworks/projects/spark/src/spark/skins/spark/HighlightBitmapCaptureSkin.as
@@ -25,8 +25,8 @@
     import mx.core.mx_internal;
     import mx.events.FlexEvent;

+    import spark.components.supportClasses.Skin;
     import spark.components.supportClasses.SkinnableComponent;
-    import spark.components.supportClasses.Skin;

     use namespace mx_internal;

@@ -175,7 +175,22 @@

             m.tx = borderWeight;
             m.ty = borderWeight;
-            bitmapData.draw(target as IBitmapDrawable, m);
+
+            try
+            {
+                bitmapData.draw(target as IBitmapDrawable, m);
+            }
+            catch (e:SecurityError)
+            {
+                // If capture fails, substitute with a Rect
+                var fillRect:Rectangle
+                if (skin)
+                    fillRect = new Rectangle(skin.x, skin.y, skin.width, skin.height);
+                else
+                    fillRect = new Rectangle(target.x, target.y, target.width, target.height);
+
+                bitmapData.fillRect(fillRect, 0);
+            }

             if (skin)
             {


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

--- frameworks/projects/advancedgrids/src/mx/collections/SummaryRow.as
+++ frameworks/projects/advancedgrids/src/mx/collections/SummaryRow.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  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.
+//  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.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

Revision: 1098
Author:   jimurphy@adobe.com
Date:     2008-04-03T21:50:39.896200Z

Log Message:
-----------
Merge 3.0.x -- 362:394, 427:429, 603:608, 644:645, 651:663, 672:676, 755:756, 763:766, 785:790, 812:814, 854:861, 862:866, 866:933,971:1009, 1050:1056 --> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/DefaultDataDescriptor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VRule.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/IList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/StreamingConnectionHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IRepeaterClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/videoClasses/VideoError.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectProxy.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/resources/Locale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/Responder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/errors/MessageSerializationError.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/SOAPMessage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IBrowserManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ComponentDescriptor.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/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/IViewCursor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/AbstractWebService.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/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/IMenuItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MessageResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/Preloader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ILayoutManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Spacer.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/rpc/src/mx/rpc/Fault.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/XMLListCollection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectTargetFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SliderEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncToken.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/resources/ResourceManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/ScrollEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/mxml/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/videoClasses/CuePointManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/CrossDomainRSLItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/NumericStepperEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/BrowserManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/events/ChannelFaultEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/CursorBookmark.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/IXMLEncoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/WSDLLoadEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/LoadEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ListCollectionView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/FlexClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/SubscriptionInfo.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/DescribeTypeCache.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/logging/LogLogger.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MessageAgent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/build_framework.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/HeaderEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridDragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/DownloadProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/ITreeDataDescriptor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/RemoteObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemDragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as</path>

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

--- frameworks/projects/framework/src/mx/collections/CursorBookmark.as
+++ frameworks/projects/framework/src/mx/collections/CursorBookmark.as
@@ -106,11 +106,12 @@
     //--------------------------------------------------------------------------

     /**
-     *  Get the approximate index of the item represented by this bookmark
-     *  in its view.  If the item has been paged out this method could throw an
-     *  ItemPendingError.  If the item is not in the current view -1 is
-     *  returned.  This method also returns -1 if index-based location is not
-     *  possible.
+     *  Gets the approximate index of the item represented by this bookmark
+     *  in its view. If the item has been paged out, this method could throw an
+     *  ItemPendingError.
+     *
+     *  @return The index of the item. If the item is not in the current view, this method returns
+     *  -1. This method also returns -1 if index-based location is not possible.
      */
     public function getViewIndex():int
     {


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

--- frameworks/projects/framework/src/mx/effects/easing/Exponential.as
+++ frameworks/projects/framework/src/mx/effects/easing/Exponential.as
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.effects.easing
+{
+
+/**
+ *  The Exponential class defines three easing functions to implement
+ *  motion with Flex effect classes, where the motion is defined by
+ *  an exponentially decaying sine wave.
+ *
+ *  For more information, see http://www.robertpenner.com/profmx.
+ */
+public class Exponential
+{
+	include "../../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+     *  The easeIn() method starts motion slowly,
+     *  and then accelerates motion as it executes.
+     *
+     *  @param t Specifies time.
+	 *
+     *  @param b Specifies the initial position of a component.
+	 *
+     *  @param c Specifies the total change in position of the component.
+	 *
+     *  @param d Specifies the duration of the effect, in milliseconds.
+     *
+     *  @return Number corresponding to the position of the component.
+     */
+	public static function easeIn(t:Number, b:Number,
+								  c:Number, d:Number):Number
+	{
+		return t == 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
+	}
+
+    /**
+     *  The easeOut() method starts motion fast,
+     *  and then decelerates motion as it executes.
+     *
+     *  @param t Specifies time.
+	 *
+     *  @param b Specifies the initial position of a component.
+	 *
+     *  @param c Specifies the total change in position of the component.
+	 *
+     *  @param d Specifies the duration of the effect, in milliseconds.
+     *
+     *  @return Number corresponding to the position of the component.
+     */
+	public static function easeOut(t:Number, b:Number,
+								   c:Number, d:Number):Number
+	{
+		return t == d ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
+	}
+
+    /**
+     *  The easeInOut() method combines the motion
+     *  of the easeIn() and easeOut() methods
+	 *  to start the motion slowly, accelerate motion, then decelerate.
+     *
+     *  @param t Specifies time.
+	 *
+     *  @param b Specifies the initial position of a component.
+	 *
+     *  @param c Specifies the total change in position of the component.
+	 *
+     *  @param d Specifies the duration of the effect, in milliseconds.
+     *
+     *  @return Number corresponding to the position of the component.
+     */
+	public static function easeInOut(t:Number, b:Number,
+									 c:Number, d:Number):Number
+	{
+		if (t == 0)
+			return b;
+
+		if (t == d)
+			return b + c;
+
+		if ((t /= d / 2) < 1)
+			return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
+
+		return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
+	}
+}
+
+}