Transferred from the Adobe Open Source Subversion Repository

Revision: 3522
Author:   jimurphy@adobe.com
Date:     2008-10-08T19:35:01.705756Z

Log Message:
-----------
rename of the rename:
-FxItemsComponent to FxContainer
-FxDataComponent to FxDataContainer
-FxItemsComponentSkin to FxContainerSkin
-FxDataComponentSkin to FxDataContainerSkin
-FxSelector to FxListBase

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxItemsComponentSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/Flex4Classes.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDataComponentSkin.mxml" copyfrom-rev="3519" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDataContainerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxSelector.as" copyfrom-rev="3519" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxSelectorSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxApplication.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxItemsComponentSkin.mxml" copyfrom-rev="3519" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxContainerSkin.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxItemsComponent.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/tests/flex4/flex4test.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxSelector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/states/AddItems.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataComponent.as" copyfrom-rev="3519" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDataComponentSkin.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxItemsComponent.as" copyfrom-rev="3519" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/framework/src/mx/states/AddItems.as
+++ frameworks/projects/framework/src/mx/states/AddItems.as
@@ -12,7 +12,7 @@
 package mx.states
 {
 import flash.display.DisplayObject;
-import mx.components.FxItemsComponent;
+import mx.components.FxContainer;
 import mx.components.Group;
 import mx.collections.ArrayCollection;
 import mx.collections.ArrayList;
@@ -381,7 +381,7 @@
                 break;
         }

-        if ( (propertyName == null || propertyName == "content") && (dest is Group || dest is FxItemsComponent))
+        if ( (propertyName == null || propertyName == "content") && (dest is Group || dest is FxContainer))
         {
             addItemsToContentHolder(dest, localItems);
         }
@@ -421,7 +421,7 @@
         else
             localItems = [items];

-        if ((propertyName == null || propertyName == "content") && (dest is Group || dest is FxItemsComponent))
+        if ((propertyName == null || propertyName == "content") && (dest is Group || dest is FxContainer))
         {
             for (i = 0; i < numAdded; i++)
                 dest.removeItemAt(startIndex);
@@ -462,7 +462,7 @@
     {
         try
         {
-            if (propertyName == null && (dest is Group || dest is FxItemsComponent))
+            if (propertyName == null && (dest is Group || dest is FxContainer))
                 return dest.getItemIndex(object);

             if (propertyName == null && dest is Container)


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

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

 package mx.rpc.events
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3243
Author:   rfrishbe@adobe.com
Date:     2008-09-17T16:14:14.399661Z

Log Message:
-----------
DataGroup/Group split work.  DataGroup is for holding data items that may require item rendering. Group only holds visual items now.  The Group APIs stay the same (numItems, addItem, etc...).  DataGroup uses the IList APIs through its dataProvider.  So the equivalent methods are now dataProvider.length, dataProvider, addItem, etc...  This is just the initial split work as there's more to come to get the files up to spec.  We will also have to visit how we deal with graphic elements in DataGroup vs. Group.  For now the implementations are roughly the same.

QE: Yes - tests may break.  please update them.
Doc: Yes
Bugs: -
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/BasicLayout.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/DataComponent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/DataComponentSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/PanelSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/Flex4Classes.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/events/FlexEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ItemsComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/ListSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/DataGroup.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Selector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/SelectorSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/intf/ILayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/ComplexPanelSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -67,17 +67,6 @@
 [Event(name="itemRemove", type="flex.events.ItemExistenceChangedEvent")]

 //--------------------------------------
-//  Styles
-//--------------------------------------
-
-include "../styles/metadata/BasicContainerFormatTextStyles.as"
-include "../styles/metadata/AdvancedContainerFormatTextStyles.as"
-include "../styles/metadata/BasicParagraphFormatTextStyles.as"
-include "../styles/metadata/AdvancedParagraphFormatTextStyles.as"
-include "../styles/metadata/BasicCharacterFormatTextStyles.as"
-include "../styles/metadata/AdvancedCharacterFormatTextStyles.as"
-
-//--------------------------------------
 //  Other metadata
 //--------------------------------------

@@ -86,26 +75,16 @@
 /**
  *  The Group class.
  */
-public class Group extends UIComponent implements IGraphicElementHost, IViewport
-{
+public class Group extends GroupBase
+{
     public function Group():void
     {
-        super();
-        tabChildren = true;
-        _layout = new BasicLayout();
-        ILayout(_layout).target = this;
-    }
-
-    private var skinRegistry:Dictionary;
+        super();
+    }
+
     private var contentChanged:Boolean = false;
-    private var layoutChanged:Boolean = true;
-    private var transformChanged:Boolean = false;
     private var needsDisplayObjectAssignment:Boolean = false;

-    // item renderer
-    public var itemRenderer:IFactory;
-    public var itemRendererFunction:Function; // signature: itemRendererFunction(item:*):IFactory
-    public var alwaysUseItemRenderer:Boolean = false; // if true, always use the itemRenderer
     private var _content:*;
     private var _contentType:int;
     private var contentCollection:ICollectionView;
@@ -146,135 +125,6 @@
     public function get content():*
     {
         return _content;
-    }
-
-    private var _resizeMode:uint = ResizeMode._NORMAL_UINT;
-
-    public function get resizeMode():String
-    {
-        return ResizeMode.toString(_resizeMode);
-    }
-
-    public function set resizeMode(stringValue:String):void
-    {
-        var value:uint = ResizeMode.toUINT(stringValue);
-        if (_resizeMode == value)
-            return;
-
-        _resizeMode = value;
-
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-        {
-            super.scaleX = 1;
-            super.scaleY = 1;
-        }
-
-        // We need the measured values and _resizeMode affects
-        // our measure (skipMeasure implementation checks resizeMode) so
-        // we need to invalidate the size.
-        invalidateSize();
-
-        // TODO EGeorgie: can we directly call setActualSize instead?
-        invalidateParentSizeAndDisplayList();
-    }
-
-    /**
-     *  @inheritDoc
-     */
-    override public function setActualSize(w:Number, h:Number):void
-    {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-        {
-            // TODO EGeorgie: make sure we don't invalidate again while
-            // setting the scale!
-            if (measuredWidth != 0)
-            {
-                $scaleX = w / measuredWidth;
-                w = measuredWidth;
-            }
-            if (measuredHeight != 0)
-            {
-                $scaleY = h / measuredHeight;
-                h = measuredHeight;
-            }
-        }
-
-        super.setActualSize(w, h);
-    }
-
-    /**
-     *  Make sure we return 1 whenever resizeMode is set to scale.
-     */
-    override public function get scaleX():Number
-    {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-            return 1;
-
-        return super.scaleX;
-    }
-
-    /**
-     *  Make sure setting scale is no-op when resizeMode is set to scale.
-     */
-    override public function set scaleX(value:Number):void
-    {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-            return;
-
-        super.scaleX = value;
-    }
-
-    /**
-     *  Make sure we return 1 whenever resizeMode is set to scale.
-     */
-    override public function get scaleY():Number
-    {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-            return 1;
-
-        return super.scaleY;
-    }
-
-    /**
-     *  Make sure setting scale is no-op when resizeMode is set to scale.
-     */
-    override public function set scaleY(value:Number):void
-    {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-            return;
-
-        super.scaleY = value;
-    }
-
-    /**
-     *  Override so that we can return correct width when in scale mode.
-     */
-    override public function get width():Number
-    {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-            return super.width * $scaleX;
-
-        return super.width;
-    }
-
-    /**
-     *  Override so that we can return correct height when in scale mode.
-     */
-    override public function get height():Number
-    {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-            return super.height * $scaleY;
-
-        return super.height;
-    }
-
-    /**
-     *  @inheritDoc
-     */
-    override protected function skipMeasure():Boolean
-    {
-        // We never want to skip measure, if we resize by scaling
-        return _resizeMode == ResizeMode._SCALE_UINT ? false : super.skipMeasure();
     }

     protected function initializeChildrenArray():void
@@ -329,76 +179,6 @@
         dispatchEvent(new FlexEvent(FlexEvent.CONTENT_CHANGED));
     }

-    protected function createVisualForItem(item:*):DisplayObject
-    {
-        var itemSkin:DisplayObject;
-
-        if (item === undefined || item === null)
-            throw new Error("Group content can not contain null or undefined items.");
-
-        // Rules for skin lookup:
-        // 0. if the item is a deferred instance, instantiate it and fall through to the other item(s)
-        // 1. if the item is a display object, use it directly
-        // 2. if itemRendererFunction is defined, call it to get the renderer factory and instantiate it
-        // 3. if itemRenderer is defined, instantiate one
-        // 4. create a Label component and call toString() on the item
-
-        // 0. if the item is a deferred instance, instantiate it and fall through to the other item(s)
-        if (item is IDeferredInstance)
-            item = IDeferredInstance(item).getInstance();
-
-        // 1. if the item is a display object, use it directly unless the alwaysUseItemRenderer
-        // flag is set.
-        if (item is DisplayObject && !(alwaysUseItemRenderer && (itemRenderer || itemRendererFunction)))
-            itemSkin = item;
-
-        // 2. if itemRendererFunction is defined, call it to get the renderer factory and instantiate it
-        if (!itemSkin && itemRendererFunction != null)
-        {
-            var rendererFactory:IFactory = itemRendererFunction(item);
-
-            if (rendererFactory)
-                itemSkin = rendererFactory.newInstance();
-        }
-
-        // 3. if itemRenderer is defined, instantiate one
-        if (!itemSkin && itemRenderer != null)
-            itemSkin = itemRenderer.newInstance();
-
-        // 4. create a Label component and call toString() on the item
-        if (!itemSkin)
-        {
-            // No custom skin, use a Label
-            itemSkin = new Label();
-            Label(itemSkin).condenseWhite = true;
-            Label(itemSkin).htmlText = item.toString();
-        }
-
-        // Set the skin data to the item, but only if the item and skin are different
-        if (itemSkin is IDataRenderer && itemSkin != item)
-            IDataRenderer(itemSkin).data = item;
-
-        registerSkin(item, itemSkin);
-
-        return itemSkin;
-    }
-
-    protected function registerSkin(item:*, itemSkin:DisplayObject):void
-    {
-        if (!skinRegistry)
-            skinRegistry = new Dictionary(true);
-
-        skinRegistry[item] = itemSkin;
-    }
-
-    protected function unregisterSkin(item:*, itemSkin:DisplayObject):void
-    {
-        if (!skinRegistry)
-            return;
-
-        delete skinRegistry[item];
-    }
-
     override protected function commitProperties():void
     {
         super.commitProperties();
@@ -408,86 +188,24 @@
             contentChanged = false;
             initializeChildrenArray();

-            maskChanged = true;
-        }
-
-        if (maskChanged)
-        {
-            maskChanged = false;
-            if (_mask && (!_mask.parent || _mask.parent !== this))
-            {
-                super.addChild(_mask);
-                if (_mask is UIComponent)
-                {
-                    var maskComp:UIComponent = _mask as UIComponent;
-                    maskComp.validateSize();
-                    maskComp.setActualSize(maskComp.getExplicitOrMeasuredWidth(),
-                                           maskComp.getExplicitOrMeasuredHeight());
-                }
-            }
-        }
-
-        if (maskTypeChanged)
-        {
-            maskTypeChanged = false;
-
-            if (_mask)
-            {
-                if (_maskType == MaskType.CLIP)
-                {
-                    // Turn off caching on mask
-                    _mask.cacheAsBitmap = false;
-                    // Save the original filters and clear the filters property
-                    originalMaskFilters = _mask.filters;
-                    _mask.filters = [];
-                }
-                else if (_maskType == MaskType.ALPHA)
-                {
-                    _mask.cacheAsBitmap = true;
-                    cacheAsBitmap = true;
-                }
-            }
-        }
-
-        if (transformChanged)
-        {
-            transformChanged = false;
-            // Apply the transform props or matrix
-            TransformUtil.applyTransforms(this, _matrix, NaN, NaN, NaN, NaN,
-                                          _rotation, _transformX, _transformY);
-            _matrix = null;
-            _rotation = NaN;
-
-            invalidateParentSizeAndDisplayList();
-        }
-
+            // maskChanged = true; TODO (rfrishbe): need this maskChanged?
+        }
+
         // Check whether we manage the elements, or are they managed by an ItemRenderer
-        if (!alwaysUseItemRenderer)
-        {
-            // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
-            // Validate element properties
-            var length:int = numItems;
-            for (var i:int = 0; i < length; i++)
-            {
-                var element:GraphicElement = getItemAt(i) as GraphicElement;
-                if (element)
-                    element.validateProperties();
-            }
-        }
-
-		if (needsDisplayObjectAssignment)
-		{
-			needsDisplayObjectAssignment = false;
-			assignDisplayObjects();
-		}
-
-        if (scrollPositionChanged) {
-            scrollPositionChanged = false;
-            var r:Rectangle = scrollRect;
-            if (r == null) r = new Rectangle(0, 0, width, height);
-            r.x = _horizontalScrollPosition;
-            r.y = _verticalScrollPosition;
-            scrollRect = r;
+        // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
+        // Validate element properties
+        var length:int = numItems;
+        for (var i:int = 0; i < length; i++)
+        {
+            var element:GraphicElement = getItemAt(i) as GraphicElement;
+            if (element)
+                element.validateProperties();
+        }
+
+        if (needsDisplayObjectAssignment)
+        {
+            needsDisplayObjectAssignment = false;
+            assignDisplayObjects();
         }
     }

@@ -497,360 +215,40 @@
         // validate sizes of the elements, even in cases where recursive==false.

         // Check whether we manage the elements, or are they managed by an ItemRenderer
-        if (!alwaysUseItemRenderer)
-        {
-            // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
-            // Validate element size
-            var length:int = numItems;
-            for (var i:int = 0; i < length; i++)
-            {
-                var element:GraphicElement = getItemAt(i) as GraphicElement;
-                if (element)
-                    element.validateSize();
-            }
+        // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
+        // Validate element size
+        var length:int = numItems;
+        for (var i:int = 0; i < length; i++)
+        {
+            var element:GraphicElement = getItemAt(i) as GraphicElement;
+            if (element)
+                element.validateSize();
         }

         super.validateSize(recursive);
-    }
-
-    override protected function measure():void
-    {
-        super.measure();
-
-        if (_layout)
-            _layout.measure();
-    }
-
-    /**
-     *  @private
-     *  Conditionally sets the origin of the scrollRect to
-     *  verticalScrollPosition,horizontalScrollPosition and its width
-     *  width,height to w,h (unscaledWidth,unscaledHeight).  We avoid setting
-     *  the scrollRect (and therefore clipping) when scrolling isn't indicated:
-     *  if the scrollRect is currently null and the scrollPosition properties
-     *  are 0, and the Group's contentWidth,Height is <= to
-     *  unscaledWidth/Height, then the scrollRect is not set.
-     */
-    private function updateScrollRect(w:Number, h:Number):void
-    {
-        var r:Rectangle = scrollRect;
-        if (r)
-        {
-            r.width = w;
-            r.height = h;
-            scrollRect = r;
-        }
-        else // scrollRect wasn't set
-        {
-            var hsp:Number = horizontalScrollPosition;
-            var vsp:Number = verticalScrollPosition;
-            var cw:Number = contentWidth;
-            var ch:Number = contentHeight;
-
-            // Don't set the scrollRect needlessly.
-            if ((hsp != 0) || (vsp != 0) || (cw > w) || (ch > h))
-            {
-                scrollRect = new Rectangle(hsp, vsp, w, h);
-            }
-        }
-    }
+    }

     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
-        if (_resizeMode == ResizeMode._SCALE_UINT)
-        {
-            unscaledWidth = measuredWidth;
-            unscaledHeight = measuredHeight;
-        }
-
         super.updateDisplayList(unscaledWidth, unscaledHeight);

-        if (_layout)
-            _layout.updateDisplayList(unscaledWidth, unscaledHeight);
-
-        // Check whether we manage the elements, or are they managed by an ItemRenderer
-        if (!alwaysUseItemRenderer)
-        {
-            graphics.clear(); // Clear the group's graphic because graphic elements might be drawing to it
-            // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
-            // Iterate through the graphic elements, clear their graphics and draw them
-            var length:int = numItems;
-            for (var i:int = 0; i < length; i++)
-            {
-                var element:GraphicElement = getItemAt(i) as GraphicElement;
-                if (element)
-                    element.validateDisplayList();
-            }
-        }
-
-        updateScrollRect(unscaledWidth, unscaledHeight);
-    }
-
-    override public function addChild(child:DisplayObject):DisplayObject
-    {
-        throw(new Error("addChild is not available in Group. Use addItem instead."));
-    }
-
-    override public function addChildAt(child:DisplayObject, index:int):DisplayObject
-    {
-        throw(new Error("addChildAt is not available in Group. Use addItemAt instead."));
-    }
-
-    override public function removeChild(child:DisplayObject):DisplayObject
-    {
-        throw(new Error("removeChild is not available in Group. Use removeItem instead."));
-    }
-
-    override public function removeChildAt(index:int):DisplayObject
-    {
-        throw(new Error("removeChildAt is not available in Group. Use removeItemAt instead."));
-    }
-
-    override public function setChildIndex(child:DisplayObject, index:int):void
-    {
-        throw(new Error("setChildIndex is not available in Group. Use setItemIndex instead."));
-    }
-
-    override public function swapChildren(child1:DisplayObject, child2:DisplayObject):void
-    {
-        throw(new Error("swapChildren is not available in Group. Use swapItems instead."));
-    }
-
-    override public function swapChildrenAt(index1:int, index2:int):void
-    {
-        throw(new Error("swapChildrenAt is not available in Group. Use swapItemsAt instead."));
-    }
-
-
-    //----------------------------------
-    //  layout
-    //----------------------------------
-
-    private var _layout:ILayout;  // initialized in the ctor
-
-    public function get layout():ILayout
-    {
-        return _layout;
-    }
-
-    /**
-     * @private
-     */
-    public function set layout(value:ILayout):void
-    {
-        if (_layout == value)
-            return;
-
-        _layout = value;
-        if (_layout)
-            ILayout(_layout).target = this;
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-
-    //----------------------------------
-    //  horizontalScrollPosition
-    //----------------------------------
-
-    private var scrollPositionChanged:Boolean = false;
-    private var _horizontalScrollPosition:Number = 0;
-
-    [Bindable]
-    [Inspectable(category="General")]
-
-    /**
-     *  The X coordinate of the origin of the region this Group is
-     *  scrolled to.
-     *
-     *  Setting this property causes the scrollRect to
-     *  be set, if necessary, to:
-     *

-     *  new Rectangle(horizontalScrollPosition, verticalScrollPosition, width, height)
-     *

-     *
-     *  @default 0
-     */
-    public function get horizontalScrollPosition():Number
-    {
-        return _horizontalScrollPosition;
-    }
-
-    /**
-     *  @private
-     */
-    public function set horizontalScrollPosition(value:Number):void
-    {
-        if (value == _horizontalScrollPosition)
-            return;
-
-        _horizontalScrollPosition = value;
-        scrollPositionChanged = true;
-        invalidateProperties();
-    }
-
-
-    //----------------------------------
-    //  verticalScrollPosition
-    //----------------------------------
-
-    private var _verticalScrollPosition:Number = 0;
-
-    [Bindable]
-    [Inspectable(category="General")]
-
-    /**
-     *  The Y coordinate of the origin of the region this Group is
-     *  scrolled to.
-     *
-     *  Setting this property causes the scrollRect to
-     *  be set, if necessary, to:
-     *

-     *  new Rectangle(horizontalScrollPosition, verticalScrollPosition, width, height)
-     *

-     *
-     *  @default 0
-     */
-    public function get verticalScrollPosition():Number
-    {
-        return _verticalScrollPosition;
-    }
-
-    /**
-     *  @private
-     */
-    public function set verticalScrollPosition(value:Number):void
-    {
-        if (value == _verticalScrollPosition)
-            return;
-
-        _verticalScrollPosition = value;
-        scrollPositionChanged = true;
-        invalidateProperties();
-    }
-
-
-    //----------------------------------
-    //  contentWidth
-    //----------------------------------
-
-    private var _contentWidth:Number = 0;
-
-    [Bindable("propertyChange")]
-    [Inspectable(category="General")]
-
-    /**
-     * The positive extent of this Group's content, relative to the 0,0
-     * origin, along the X axis.
-     */
-    public function get contentWidth():Number
-    {
-        return _contentWidth;
-    }
-
-    private function setContentWidth(value:Number):void
-    {
-        if (value == _contentWidth)
-            return;
-    	var oldValue:Number = _contentWidth;
-        _contentWidth = value;
-        dispatchPropertyChangeEvent("contentWidth", oldValue, value);
-    }
-
-    //----------------------------------
-    //  contentHeight
-    //----------------------------------
-
-    private var _contentHeight:Number = 0;
-
-    [Bindable("propertyChange")]
-    [Inspectable(category="General")]
-
-    /**
-     * The positive extent of this Group's content, relative to the 0,0
-     * origin, along the Y axis.
-     */
-    public function get contentHeight():Number
-    {
-        return _contentHeight;
-    }
-
-    private function setContentHeight(value:Number):void
-    {
-        if (value == _contentHeight)
-            return;
-        var oldValue:Number = _contentHeight;
-        _contentHeight = value;
-        dispatchPropertyChangeEvent("contentHeight", oldValue, value);
-    }
-
-    /**
-     *  Sets this Group's contentWidth and contentHeight
-     *  properties.
-     *
-     *  This method is is intended for layout class developers who should
-     *  call it from measure() and updateDisplayList().
-     *
-     *  @param w The new value of contentWidth.
-     *  @param h The new value of contentHeight.
-     */
-    public function setContentSize(w:Number, h:Number):void
-    {
-        if ((w == _contentWidth) && (h == _contentHeight))
-           return;
-        setContentWidth(w);
-        setContentHeight(h);
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Properties: Overriden Focus management
-    //
-    //--------------------------------------------------------------------------
-
-    //----------------------------------
-    //  focusPane
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the focusPane property.
-     */
-    private var _focusPane:Sprite;
-
-    [Inspectable(environment="none")]
-
-    // TODO (rfrishbe): only reason we need to override focusPane getter/setter
-    // is because addChild/removeChild for Groups throw an RTE.
-    // This is the same as UIComponent's focusPane getter/setter but it uses
-    // super.add/removeChild.
-
-    override public function get focusPane():Sprite
-    {
-        return _focusPane;
-    }
-
-    override public function set focusPane(value:Sprite):void
-    {
-        if (value)
-        {
-            super.addChild(value);
-
-            value.x = 0;
-            value.y = 0;
-            value.scrollRect = null;
-
-            _focusPane = value;
-        }
-        else
-        {
-             super.removeChild(_focusPane);
-
-             // TODO: remove mask?  SDK-15310
-            _focusPane = null;
-        }
-    }
-
+        // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
+        // Iterate through the graphic elements, clear their graphics and draw them
+
+        graphics.clear(); // Clear the group's graphic because graphic elements might be drawing to it
+        // This isn't needed for DataGroup because there's not much DisplayObject sharing
+
+        // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
+        // Iterate through the graphic elements, clear their graphics and draw them
+        var length:int = numItems;
+        for (var i:int = 0; i < length; i++)
+        {
+            var element:GraphicElement = getItemAt(i) as GraphicElement;
+            if (element)
+                element.validateDisplayList();
+        }
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Content management
@@ -1042,7 +440,7 @@
      *  The number of layout items in this Group. Typically this is the same
      *  as the number of items in the Group.
      */
-    public function get numLayoutItems():int
+    override public function get numLayoutItems():int
     {
         return numItems;
     }
@@ -1056,12 +454,9 @@
      *
      *  @return The layout item at the specified index.
      */
-    public function getLayoutItemAt(index:int):ILayoutItem
+    override public function getLayoutItemAt(index:int):ILayoutItem
     {
         var item:* = getItemAt(index);
-
-        if (alwaysUseItemRenderer || !(item is IGraphicElement))
-            item = getItemSkin(item);

         return LayoutItemFactory.getLayoutItemFor(item);
     }
@@ -1077,7 +472,7 @@
     {
         var child:DisplayObject;

-        if (item is GraphicElement && !alwaysUseItemRenderer)
+        if (item is GraphicElement)
         {
             item.elementHost = this;

@@ -1088,9 +483,9 @@
         }
         else
         {
-        	// This always adds the child to the end of the display list. Any
-        	// ordering discrepancies will be fixed up in assignDisplayObjects().
-            child = addItemToDisplayList(createVisualForItem(item), item);
+            // This always adds the child to the end of the display list. Any
+            // ordering discrepancies will be fixed up in assignDisplayObjects().
+            child = addItemToDisplayList(item, item);
         }

         dispatchEvent(new ItemExistenceChangedEvent(
@@ -1103,7 +498,6 @@
     protected function itemRemoved(index:int):void
     {
         var item:* = getItemAt(index);
-        var skin:* = getItemSkin(item);
         var childDO:DisplayObject = item as DisplayObject;

         dispatchEvent(new ItemExistenceChangedEvent(
@@ -1114,15 +508,6 @@
             item.sharedDisplayObject = null;
             childDO = GraphicElement(item).displayObject;
         }
-        else if (skin && skin is DisplayObject)
-        {
-            childDO = skin as DisplayObject;
-        }
-        // If the item and skin are different objects, set the skin data to
-        // null here to clear it out. Otherwise, the skin keeps a reference to the item,
-        // which can cause problems later.
-        if (item && skin && item != skin)
-            skin.data = null;

         if (childDO)
             super.removeChild(childDO);
@@ -1186,9 +571,6 @@
     {
         var currentAssignableDO:DisplayObject = canShareDisplayObject ? this : null;
         var lastDisplayObject:DisplayObject = this;
-
-        if (alwaysUseItemRenderer)
-            return;

         // Iterate through all of the items
         var len:int = numItems;
@@ -1196,9 +578,6 @@
         {
             var item:* = getItemAt(i);
             var insertIndex:int;
-
-            if (!(item is GraphicElement))
-                item = getItemSkin(item);

         	if (lastDisplayObject == this)
         		insertIndex = 0;
@@ -1266,6 +645,12 @@
         // Remove the item from the group if that group isn't this group
         if (host && host is Group && host != this)
             Group(host).removeItem(item);
+        else if (host && host is DataGroup && host != this)
+        {
+            var dp:IList = DataGroup(host).dataProvider;
+            var index:int = dp.getItemIndex(item);
+            dp.removeItemAt(index);
+        }

         // Calling removeItem should have already removed the child. This
         // should handle the case when we don't call removeItem
@@ -1292,289 +677,17 @@
         return super.addChildAt(child, index != -1 ? index : super.numChildren);
     }

-
-    //--------------------------------------------------------------------------
-    //
-    //  Item -> Skin mapping
-    //
-    //--------------------------------------------------------------------------
-
-    public function getItemSkin(item:*):DisplayObject
-    {
-        var result:DisplayObject = null;
-
-        if (skinRegistry)
-            result = skinRegistry[item];
-
-        if (!result && item is DisplayObject)
-            result = item;
-
-        return result;
-    }
-
-    public function getSkinItem(skin:DisplayObject):*
-    {
-        // !! This implementation is really slow...
-        var item:*;
-
-        for (var i:int = 0; i < numItems; i++)
-        {
-            item = getItemAt(i);
-            if (getItemSkin(item) == skin)
-                return item;
-        }
-
-        return null;
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  IGraphicElement Implementation
-    //
-    //--------------------------------------------------------------------------
-
-    //----------------------------------
-    //  mask
-    //----------------------------------
-    private var _mask:DisplayObject;
-    private var maskChanged:Boolean;
-
-    [Inspectable(category="General")]
-    override public function get mask():DisplayObject
-    {
-        return _mask;
-    }
-
-    /*
-     *  sets the mask. The mask will be added to the display list. The mask must
-     *  not already on a display list nor in the elements array.
-     */
-    override public function set mask(value:DisplayObject):void
-    {
-        if (_mask !== value)
-        {
-            _mask = value;
-            maskChanged = true;
-            invalidateProperties();
-            //addDrawnElements();
-
-        }
-        super.mask = value;
-    }
-
-    //----------------------------------
-    //  maskType
-    //----------------------------------
-
-    [Bindable("propertyChange")]
-    [Inspectable(category="General",enumeration="clip,alpha", defaultValue="clip")]
-    private var _maskType:String = MaskType.CLIP;
-    private var _oldMaskType:String = MaskType.CLIP;
-    private var maskTypeChanged:Boolean;
-    private var originalMaskFilters:Array;
-
-    public function get maskType():String
-    {
-        return _maskType;
-    }
-
-    public function set maskType(value:String):void
-    {
-        if (_maskType != value)
-        {
-            _oldMaskType = _maskType;
-            _maskType = value;
-            maskTypeChanged = true;
-            invalidateProperties();
-        }
-    }
-
-    //----------------------------------
-    //  rotation
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _rotation:Number = 0;
-
-    [Bindable("propertyChange")]
-    [Inspectable(category="General")]
-
-    /**
-     *  The rotation for this group, in degrees.
-     */
-    override public function get rotation():Number
-    {
-        return !isNaN(_rotation) ? _rotation : super.rotation;
-    }
-
-    override public function set rotation(value:Number):void
-    {
-        if (_rotation != value)
-        {
-            var oldValue:Number = _rotation;
-
-            _rotation = value;
-            transformChanged = true;
-            invalidateProperties();
-        }
-    }
-
-    //----------------------------------
-    //  transform
-    //----------------------------------
-    private var _transform:flash.geom.Transform;
-    private var _matrix:Matrix;
-    private var _colorTransform:ColorTransform;
-
-    override public function set transform(value:flash.geom.Transform):void
-    {
-        // Clean up the old event listeners
-        var oldTransform:flex.geom.Transform = _transform as flex.geom.Transform;
-        if (oldTransform)
-        {
-            oldTransform.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
-        }
-
-        var newTransform:flex.geom.Transform = value as flex.geom.Transform;
-
-        if (newTransform)
-        {
-            newTransform.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
-            _matrix = value.matrix.clone(); // Make sure it is a copy
-            _colorTransform = value.colorTransform;
-        }
-
-        _transform = value;
-        super.transform = value;
-    }
-
-    //----------------------------------
-    //  transformX
-    //----------------------------------
-    private var _transformX:Number = 0;
-
-    /**
-     *  The x position transform point of the element.
-     */
-    public function get transformX():Number
-    {
-        return _transformX;
-    }
-
-    public function set transformX(value:Number):void
-    {
-        if (_transformX != value)
-        {
-            _transformX = value;
-            transformChanged = true;
-            invalidateProperties();
-        }
-    }
-
-    //----------------------------------
-    //  transformY
-    //----------------------------------
-    private var _transformY:Number = 0;
-
-    /**
-     *  The y position transform point of the element.
-     */
-    public function get transformY():Number
-    {
-        return _transformY;
-    }
-
-    public function set transformY(value:Number):void
-    {
-        if (_transformY != value)
-        {
-            _transformY = value;
-            transformChanged = true;
-            invalidateProperties();
-        }
-    }
-
-    private function transformPropertyChangeHandler(event:PropertyChangeEvent):void
-    {
-        if (event.kind == PropertyChangeEventKind.UPDATE)
-        {
-            if (event.property == "matrix")
-            {
-                // Apply matrix
-                if (_transform)
-                {
-                    _matrix = _transform.matrix.clone();
-                    transformChanged = true;
-                    invalidateProperties();
-                }
-            }
-            else if (event.property == "colorTransform")
-            {
-                // Apply colorTranform
-                if (_transform)
-                {
-                    _colorTransform = _transform.colorTransform;
-                    // TODO EGeorgie: figure out what to invalidate when we implement
-                    // colotTransform being applied.
-                    transformChanged = true;
-                    invalidateProperties();
-                }
-            }
-        }
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  IGraphicElementHost Implementation
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @inheritDoc
-     */
-    public function elementChanged(e:IGraphicElement):void
-    {
-        // TODO!!! Optimize
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    /**
-     *  @inheritDoc
-     */
-    public function elementSizeChanged(e:IGraphicElement):void
-    {
-        // TODO!!! Optimize
-        invalidateSize();
-        invalidateDisplayList();
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function elementLayerChanged(e:IGraphicElement):void
-    {
-        // TODO!!! Optimize
-        // TODO!!! Need to recalculate the elements
-        invalidateSize();
-        invalidateDisplayList();
+    override public function elementLayerChanged(e:IGraphicElement):void
+    {
+        super.elementLayerChanged(e);
+
         // One of our children have told us they might need a displayObject
         assignDisplayObjects();
     }

-    /**
-     *  @inheritDoc
-     */
-    public function get parentGraphic():Graphic
-    {
-        return null;
-    }
-
     protected var maskElements:Dictionary;

-    public function addMaskElement(mask:DisplayObject, target:IGraphicElement):void
+    override public function addMaskElement(mask:DisplayObject, target:IGraphicElement):void
     {
         if (!maskElements)
             maskElements = new Dictionary();
@@ -1587,7 +700,7 @@

     }

-    public function removeMaskElement(mask:DisplayObject, target:IGraphicElement):void
+    override public function removeMaskElement(mask:DisplayObject, target:IGraphicElement):void
     {
         if (maskElements && mask in maskElements)
         {
@@ -1599,10 +712,9 @@
         }
     }

-
     //--------------------------------------------------------------------------
     //
-    //  ScaleGrid Implementation
+    //  Properties: ScaleGrid
     //
     //--------------------------------------------------------------------------

@@ -1727,10 +839,42 @@
             dispatchPropertyChangeEvent("scaleGridTop", oldValue, value);
         }
     }
-
-    private function dispatchPropertyChangeEvent(prop:String, oldValue:*, value:*):void
-    {
-        dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, prop, oldValue, value));
+
+    // TODO (rfrishbe): need to figure out if we must duplicate these
+    // RTEs across DataGroup and Group.
+    override public function addChild(child:DisplayObject):DisplayObject
+    {
+        throw(new Error("addChild is not available in Group. Use addItem instead."));
+    }
+
+    override public function addChildAt(child:DisplayObject, index:int):DisplayObject
+    {
+        throw(new Error("addChildAt is not available in Group. Use addItemAt instead."));
+    }
+
+    override public function removeChild(child:DisplayObject):DisplayObject
+    {
+        throw(new Error("removeChild is not available in Group. Use removeItem instead."));
+    }
+
+    override public function removeChildAt(index:int):DisplayObject
+    {
+        throw(new Error("removeChildAt is not available in Group. Use removeItemAt instead."));
+    }
+
+    override public function setChildIndex(child:DisplayObject, index:int):void
+    {
+        throw(new Error("setChildIndex is not available in Group. Use setItemIndex instead."));
+    }
+
+    override public function swapChildren(child1:DisplayObject, child2:DisplayObject):void
+    {
+        throw(new Error("swapChildren is not available in Group. Use swapItems instead."));
+    }
+
+    override public function swapChildrenAt(index1:int, index2:int):void
+    {
+        throw(new Error("swapChildrenAt is not available in Group. Use swapItemsAt instead."));
     }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 2792
Author:   egeorgie@adobe.com
Date:     2008-08-08T23:59:11.812057Z

Log Message:
-----------
A fix for Group x & y getting out of sync with the display object x & y

reviewed by Jason

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -331,6 +331,18 @@
                 }
             }
         }
+
+        if (transformChanged)
+        {
+            transformChanged = false;
+            // Apply the transform props or matrix
+            TransformUtil.applyTransforms(this, _matrix, NaN, NaN, NaN, NaN,
+                                          _rotation, _transformX, _transformY);
+            _matrix = null;
+            _rotation = NaN;
+
+            invalidateParentSizeAndDisplayList();
+        }

         // Check whether we manage the elements, or are they managed by an ItemRenderer
         if (!alwaysUseItemRenderer)
@@ -396,16 +408,6 @@
                 if (element)
                     element.validateDisplayList();
             }
-        }
-
-        // TODO EGeorgie: maybe move this to commitProperties, or at least before
-        // children validateDisplayList()
-        if (transformChanged)
-        {
-            transformChanged = false;
-            // Apply the transform props or matrix
-            TransformUtil.applyTransforms(this, _matrix, _x, _y, _scaleX, _scaleY,
-                                          _rotation, _transformX, _transformY);
         }
     }

@@ -1064,58 +1066,9 @@

             _rotation = value;
             transformChanged = true;
-            invalidateDisplayList();
-        }
-    }
-
-    //----------------------------------
-    //  scaleX
-    //----------------------------------
-
-    private var _scaleX:Number;
-
-    /**
-     *  Indicates the horizontal scale (percentage) of the element as applied from the transform point.
-     */
-    override public function get scaleX():Number
-    {
-        return !isNaN(_scaleX) ? _scaleX : super.scaleX;
-    }
-
-
-    override public function set scaleX(value:Number):void
-    {
-        if (_scaleX != value)
-        {
-            _scaleX = value;
-            transformChanged = true;
-            invalidateDisplayList();
-        }
-
-    }
-
-    //----------------------------------
-    //  scaleY
-    //----------------------------------
-    private var _scaleY:Number;
-
-    /**
-     *  Indicates the vertical scale (percentage) of the element as applied from the transform point.
-     */
-    override public function get scaleY():Number
-    {
-        return !isNaN(_scaleY) ? _scaleY : super.scaleY;
-    }
-
-    override public function set scaleY(value:Number):void
-    {
-        if (_scaleY != value)
-        {
-            _scaleY = value;
-            transformChanged = true;
-            invalidateDisplayList();
-        }
-    }
+            invalidateProperties();
+        }
+    }

     //----------------------------------
     //  transform
@@ -1165,7 +1118,7 @@
         {
             _transformX = value;
             transformChanged = true;
-            invalidateDisplayList();
+            invalidateProperties();
         }
     }

@@ -1188,52 +1141,10 @@
         {
             _transformY = value;
             transformChanged = true;
-            invalidateDisplayList();
-        }
-    }
-
-    //----------------------------------
-    //  x
-    //----------------------------------
-
-    private var _x:Number;
-
-    override public function get x():Number
-    {
-        return !isNaN(_x) ? _x : super.x;
-    }
-
-    override public function set x(value:Number):void
-    {
-        if (_x != value)
-        {
-            _x = value;
-            transformChanged = true;
-            invalidateDisplayList();
-        }
-    }
-
-    //----------------------------------
-    //  y
-    //----------------------------------
-
-    private var _y:Number;
-
-    override public function get y():Number
-    {
-        return !isNaN(_y) ? _y : super.y;
-    }
-
-    override public function set y(value:Number):void
-    {
-        if (_y != value)
-        {
-            _y = value;
-            transformChanged = true;
-            invalidateDisplayList();
-        }
-    }
-
+            invalidateProperties();
+        }
+    }
+
     private function transformPropertyChangeHandler(event:PropertyChangeEvent):void
     {
         if (event.kind == PropertyChangeEventKind.UPDATE)
@@ -1245,7 +1156,7 @@
                 {
                     _matrix = _transform.matrix.clone();
                     transformChanged = true;
-                    invalidateDisplayList();
+                    invalidateProperties();
                 }
             }
             else if (event.property == "colorTransform")
@@ -1254,8 +1165,10 @@
                 if (_transform)
                 {
                     _colorTransform = _transform.colorTransform;
+                    // TODO EGeorgie: figure out what to invalidate when we implement
+                    // colotTransform being applied.
                     transformChanged = true;
-                    invalidateDisplayList();
+                    invalidateProperties();
                 }
             }
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3208
Author:   gruehle@adobe.com
Date:     2008-09-15T18:42:33.841729Z

Log Message:
-----------
More fallout from display object sharing optimizations.
* Fixed performance issue by batching up display object assignment into a single call from commitProperties()
* Make sure all display objects are correctly ordered in assignDisplayObjects()
* Always set x and y properties when a GraphicElement has its own displayObject.

Bugs: SDK-16800, and other unlogged mustella failures
Reviewer: Deepa
Checkintests: pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -30,8 +30,8 @@
 import mx.core.IDataRenderer;
 import mx.core.IDeferredInstance;
 import mx.core.IFactory;
+import mx.core.UIComponent;
 import mx.core.mx_internal;
-import mx.core.UIComponent;
 import mx.events.CollectionEvent;
 import mx.events.PropertyChangeEvent;
 import mx.events.PropertyChangeEventKind;
@@ -97,6 +97,7 @@
     private var contentChanged:Boolean = false;
     private var layoutChanged:Boolean = true;
     private var transformChanged:Boolean = false;
+    private var needsDisplayObjectAssignment:Boolean = false;

     // item renderer
     public var itemRenderer:IFactory;
@@ -329,6 +330,7 @@
         }

         assignDisplayObjects();
+        needsDisplayObjectAssignment = false;

         /* if (maskElements)
         {
@@ -510,6 +512,12 @@
             }
         }

+		if (needsDisplayObjectAssignment)
+		{
+			needsDisplayObjectAssignment = false;
+			assignDisplayObjects();
+		}
+
         if (scrollPositionChanged) {
             scrollPositionChanged = false;
             var r:Rectangle = scrollRect;
@@ -939,7 +947,8 @@

         itemAdded(item, index);

-        assignDisplayObjects();
+        needsDisplayObjectAssignment = true;
+        invalidateProperties();

         return item;
     }
@@ -983,7 +992,8 @@
             }
         }

-        assignDisplayObjects();
+        needsDisplayObjectAssignment = true;
+        invalidateProperties();

         return item;
     }
@@ -1098,41 +1108,10 @@
                 IStyleClient(item).regenerateStyleCache(true);
         }
         else
-        {
-            var childIndex:int = -1;
-
-            if (index == 0)
-            {
-                childIndex = 0;
-            }
-            else if (index != numItems - 1)
-            {
-                for (var i:int = index - 1; i >= 0; i--)
-                {
-                    var prevItem:* = getItemAt(i);
-
-                    if (!(prevItem is GraphicElement))
-                    	prevItem = getItemSkin(prevItem);
-
-                    if (prevItem is DisplayObject)
-                        childIndex = super.getChildIndex(DisplayObject(prevItem)) ;
-                    else if (prevItem is GraphicElement)
-                    {
-                        var prevElement:GraphicElement = prevItem as GraphicElement;
-                        if (prevElement.displayObject)
-                            childIndex = super.getChildIndex(prevElement.displayObject);
-                    }
-
-                    if (childIndex != -1)
-                    {
-                        childIndex++;
-                        break;
-                    }
-
-                }
-            }
-
-            child = addItemToDisplayList(createVisualForItem(item), item, childIndex);
+        {
+        	// This always adds the child to the end of the display list. Any
+        	// ordering discrepancies will be fixed up in assignDisplayObjects().
+            child = addItemToDisplayList(createVisualForItem(item), item);
         }

         dispatchEvent(new ItemExistenceChangedEvent(
@@ -1237,12 +1216,20 @@
         for (var i:int = startIndex; i < len; i++)
         {
             var item:* = getItemAt(i);
+            var insertIndex:int;

             if (!(item is GraphicElement))
                 item = getItemSkin(item);

+        	if (lastDisplayObject == this)
+        		insertIndex = 0;
+        	else
+        		insertIndex = super.getChildIndex(lastDisplayObject) + 1;
+
             if (item is DisplayObject)
             {
+            	super.setChildIndex(item as DisplayObject, insertIndex);
+
                 lastDisplayObject = item as DisplayObject;
                 // Null this out so that we are forced to create one for the next item
                 currentAssignableDO = null;
@@ -1253,13 +1240,7 @@

                 if (currentAssignableDO == null || element.needsDisplayObject)
                 {
-                    var insertIndex:int;
                     var newChild:DisplayObject = element.displayObject;
-
-                    if (lastDisplayObject == this)
-                        insertIndex = 0;
-                    else
-                        insertIndex = super.getChildIndex(lastDisplayObject) + 1;

                     if (newChild == null)
                     {
@@ -1315,7 +1296,7 @@
             {
                 var insertIndex:int;
                 if (index == -1)
-                    insertIndex = super.numChildren;
+                    insertIndex = super.numChildren - 1;
                 else if (index == 0)
                     insertIndex = 0;
                 else


Transferred from the Adobe Open Source Subversion Repository

Revision: 6295
Author:   egreenfi@adobe.com
Date:     2009-04-27T19:25:10.102526Z

Log Message:
-----------
- Added a workaround for 3D bugs in 10.0 release of flash player when multiplying vectors against 3D matrices.
- integrated offset animation from Animate3D class into AnimateTransform class. AnimateTRansform can now correctly capture and animate values for target.offsets as well as target.
- integrated projection matrix management from Animate3D into AnimateTransform and subclasses.
- added affectsLayout flag to subclasses of AnimateTRansform.  THeir parameters can now optionally be used to animate the offsets of the target.
- setup correct defaults on all 3D subclasses of AnimateTransform, so they don't affect layout and do modify the local projection matrix by default.

Reviewer: Chet
QA: Yes!
Doc: Yes.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Rotate3D.as
+++ frameworks/projects/spark/src/spark/effects/Rotate3D.as
@@ -26,7 +26,7 @@
  * effect instance on any given target at a time, which means that they will
  * share the transform center set by any of the contributing effects.

  */
-public class AnimateTransformRotate3D extends AnimateTransformRotate
+public class AnimateTransformRotate3D extends AnimateTransform
 {
     include "../core/Version.as";

@@ -44,6 +44,7 @@
     public function AnimateTransformRotate3D(target:Object=null)
     {
         super(target);
+        applyLocalProjection = true;
         instanceClass = AnimateTransformInstance;
     }

@@ -52,6 +53,17 @@
     //  Properties
     //
     //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  affectLayout
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     * whether or not this effect should animate the target directly or its post layout transform offsets.
+     */
+    public var affectLayout:Boolean = false;

     //----------------------------------
     //  angleXFrom
@@ -154,14 +166,76 @@
      * set this value to a large positive or small negative number.

      */
     public var angleYBy:Number;
-
+
+    //----------------------------------
+    //  angleXFrom
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     * The starting angle of rotation of the target object around
+     * the z axis, expressed in degrees.
+     * Valid values range from 0 to 360.
+     */
+    public var angleZFrom:Number;
+
+    //----------------------------------
+    //  angleZTo
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     * The ending angle of rotation of the target object around
+     * the z axis, expressed in degrees.
+     * Values can be either positive or negative.
+     *
+     *
If the value of angleTo is less
+     * than the value of angleFrom,
+     * the target rotates in a counterclockwise direction.
+     * Otherwise, it rotates in clockwise direction.
+     * If you want the target to rotate multiple times,
+     * set this value to a large positive or small negative number.

+     */
+    public var angleZTo:Number;
+
+    //----------------------------------
+    //  angleZBy
+    //----------------------------------
+
+    [Inspectable(category="General")]
+
+    /**
+     * Degrees by which to rotate the target object around the
+     * z axis. Value may be negative.
+     *
+     *
If the value of angleZBy is negative,
+     * the target rotates in a counterclockwise direction.
+     * Otherwise, it rotates in clockwise direction.
+     * If you want the target to rotate multiple times,
+     * set this value to a large positive or small negative number.

+     */
+    public var angleZBy:Number;
+
+
     /**
      * @private
      */
     override protected function initInstance(instance:IEffectInstance):void
     {
-        addMotionPath("rotationX", angleXFrom, angleXTo, angleXBy);
-        addMotionPath("rotationY", angleYFrom, angleYTo, angleYBy);
+    	if(affectLayout)
+    	{
+	        addMotionPath("rotationX", angleXFrom, angleXTo, angleXBy);
+	        addMotionPath("rotationY", angleYFrom, angleYTo, angleYBy);
+	        addMotionPath("rotationZ", angleZFrom, angleZTo, angleZBy);
+	    }
+	    else
+	    {
+            addPostLayoutMotionPath("postLayoutRotationX", angleXFrom, angleXTo, angleXBy);
+            addPostLayoutMotionPath("postLayoutRotationY", angleYFrom, angleYTo, angleYBy);
+            addPostLayoutMotionPath("postLayoutRotationZ", angleZFrom, angleZTo, angleZBy);
+	    }
         super.initInstance(instance);
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3243
Author:   rfrishbe@adobe.com
Date:     2008-09-17T16:14:14.399661Z

Log Message:
-----------
DataGroup/Group split work.  DataGroup is for holding data items that may require item rendering. Group only holds visual items now.  The Group APIs stay the same (numItems, addItem, etc...).  DataGroup uses the IList APIs through its dataProvider.  So the equivalent methods are now dataProvider.length, dataProvider, addItem, etc...  This is just the initial split work as there's more to come to get the files up to spec.  We will also have to visit how we deal with graphic elements in DataGroup vs. Group.  For now the implementations are roughly the same.

QE: Yes - tests may break.  please update them.
Doc: Yes
Bugs: -
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/BasicLayout.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/DataComponent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/DataComponentSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/PanelSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/Flex4Classes.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/events/FlexEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ItemsComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/ListSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/DataGroup.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Selector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/SelectorSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/intf/ILayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/ComplexPanelSkin.mxml</path>

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

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -27,6 +27,8 @@
 import flex.graphics.Parser; Parser;
 import flex.skin.ButtonSkin; ButtonSkin;
 import flex.skin.CheckBoxSkin; CheckBoxSkin;
+import flex.skin.ComplexPanelSkin; ComplexPanelSkin;
+import flex.skin.DataComponentSkin; DataComponentSkin;
 import flex.skin.HScrollBarSkin; HScrollBarSkin;
 import flex.skin.HScrollBarThumbSkin; HScrollBarThumbSkin;
 import flex.skin.HSliderSkin; HSliderSkin;


add AbstractScriptController.time protected property

--- src/aerys/minko/scene/controller/AbstractScriptController.as
+++ src/aerys/minko/scene/controller/AbstractScriptController.as
@@ -16,6 +16,7 @@
 	{
         private var _scene              : Scene;
         private var _started            : Dictionary;
+		private var _time				: Number;
 		private var _lastTime		    : Number;
 		private var _deltaTime		    : Number;
 		private var _currentTarget	    : ISceneNode;
@@ -25,12 +26,17 @@
         private var _targetsToAdd       : Vector.<ISceneNode>;
         private var _targetsToRemove    : Vector.<ISceneNode>;

-		private var _updateRate			: Number	= 0.;
+		private var _updateRate			: Number;

         protected function get scene() : Scene
         {
             return _scene;
         }
+
+		protected function get time() : Number
+		{
+			return _time;
+		}

 		protected function get deltaTime() : Number
 		{
@@ -102,12 +108,12 @@
 														   time			: Number) : void
 		{
 			_deltaTime = time - _lastTime;
+			_time = time;

 			if (_updateRate != 0. && deltaTime < 1000. / _updateRate)
 				return;

 			_viewport = viewport;
-			_lastTime = time;

             lockTargetsList();
             beforeUpdate();
@@ -137,6 +143,8 @@

             afterUpdate();
             unlockTargetsList();
+
+			_lastTime = time;
 		}

         /**


fix coding style and typo

fix coding style and typo

--- src/aerys/minko/type/binding/DataBindings.as
+++ src/aerys/minko/type/binding/DataBindings.as
@@ -65,7 +65,8 @@

 				if (_bindingNames.indexOf(bindingName) != -1)
 					throw new Error(
-						'Another data provider is already declaring the \'' + bindingName + '\' property.'
+						'Another data provider is already declaring the \'' + bindingName
+                        + '\' property.'
 					);

 				_bindingNameToProvider[bindingName] = provider;
@@ -85,7 +86,7 @@
 			var tmpValues				: Object			= {};

 			if (providerBindingsNames == null)
-				throw new ArgumentError('Unkown provider.');
+				throw new ArgumentError('Unknown provider.');

 			var numBindings : uint = _bindingNames.length;
 			for (var indexRead : uint = 0, indexWrite : uint = 0; indexRead < numBindings; ++indexRead)


Transferred from the Adobe Open Source Subversion Repository

Revision: 3257
Author:   jimurphy@adobe.com
Date:     2008-09-18T18:16:26.838722Z

Log Message:
-----------
-Merged 3.0.X revisions 3232,3236,3238,3244 -> trunk
-integrated:
 Player build d604
 flex-messaging-common.jar 4.0.0.3256

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/lib/flex-messaging-common.jar</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/win/Install Flash Player 10 Plugin.exe</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/mac/Install Flash Player 10 UB.dmg</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/win/Install Flash Player 10 ActiveX.exe</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.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/libs/player/10/playerglobal.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults-2.0.0.css</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults-2.0.1.css</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/in/player/10/lnx/flashplayer.tar.gz</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.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/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/lnx/install_flash_player_10_linux.tar.gz</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<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/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/lnx/libflashplayer.so.tar.gz</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/win/FlashPlayer.exe</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/player/10/mac/Flash Player.app.zip</path>

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

--- frameworks/projects/mx/src/mx/controls/TextArea.as
+++ frameworks/projects/mx/src/mx/controls/TextArea.as
@@ -301,7 +301,7 @@
      *  @private
      *  Previous imeMode.
      */
-    private var prevMode:String = null;
+    private var prevMode:String = IMEConversionMode.UNKNOWN;

     /**
      *  @private


data on sockets needs to be explicitly flushed on some platforms.

"On some operating systems, flush() is called automatically between execution frames, but on other operating systems, such as Windows, the data is never sent unless you call flush() explicitly. To ensure your application behaves reliably across all operating systems, it is a good practice to call the flush() method after writing each message (or related group of data) to the socket."

--- lib/com/nesium/remoting/DuplexGateway.as
+++ lib/com/nesium/remoting/DuplexGateway.as
@@ -206,6 +206,7 @@
 			var ba:ByteArray = actionMessageToByteArray(am);
 			m_socket.writeUnsignedInt(ba.length);
 			m_socket.writeBytes(ba);
+			m_socket.flush();
 		}

 		protected function actionMessageToByteArray(am:AMFActionMessage):ByteArray


Use spawnRadius parameter in world space.

--- Bin/Data/Scripts/Editor/EditorSpawn.as
+++ Bin/Data/Scripts/Editor/EditorSpawn.as
@@ -238,17 +238,21 @@
     SetSceneModified();
 }

+Vector3 RandomizeSpawnPosition(const Vector3&in position)
+{
+    float angle = Random() * 360.0;
+    float distance = Random() * spawnRadius;
+    return position + Quaternion(0, angle, 0) * Vector3(0, 0, distance);
+}
+
 void SpawnObject()
 {
     if(spawnedObjectsNames.length==0) return;
     IntRect view = activeViewport.viewport.rect;

     for(int i=0;i<spawnCount;i++)
-    {
-        Vector2 norm=Vector2(Random(-1,1),Random(-1,1));
-        norm.Normalize();
-        norm=norm*(spawnRadius*Random(0,1));
-        IntVector2 pos = IntVector2(ui.cursorPosition.x+norm.x,ui.cursorPosition.y+norm.y);
+    {
+        IntVector2 pos = IntVector2(ui.cursorPosition.x,ui.cursorPosition.y);
         Ray cameraRay = camera.GetScreenRay(
             float(pos.x - view.left) / view.width,
             float(pos.y - view.top) / view.height);
@@ -257,8 +261,19 @@
         {
             if (editorScene.octree is null)
                 return;
+
             RayQueryResult result = editorScene.octree.RaycastSingle(cameraRay, RAY_TRIANGLE, camera.farClip,
                 pickModeDrawableFlags[pickMode], 0x7fffffff);
+
+            // Randomize in a circle around original hit position
+            if (spawnRadius > 0)
+            {
+                Vector3 position = RandomizeSpawnPosition(result.position);
+                position.y += spawnRadius;
+                result = editorScene.octree.RaycastSingle(Ray(position, Vector3(0, -1, 0)), RAY_TRIANGLE, spawnRadius * 2.0,
+                    pickModeDrawableFlags[pickMode], 0x7fffffff);
+            }
+
             if (result.drawable !is null)
                 PlaceObject(result.position, result.normal);
         }
@@ -272,6 +287,15 @@
                 editorScene.physicsWorld.UpdateCollisions();

             PhysicsRaycastResult result = editorScene.physicsWorld.RaycastSingle(cameraRay, camera.farClip);
+
+            // Randomize in a circle around original hit position
+            if (spawnRadius > 0)
+            {
+                Vector3 position = RandomizeSpawnPosition(result.position);
+                position.y += spawnRadius;
+                result = editorScene.physicsWorld.RaycastSingle(Ray(position, Vector3(0, -1, 0)), spawnRadius * 2.0);
+            }
+
             if (result.body !is null)
                 PlaceObject(result.position, result.normal);
         }


Add 0x30 to 0x5F (all simple 8-bit loads)


Fix 533274 -  avmfeatures.as allows a FEATURE without any DEFINES clauses (r+edwsmith)

--- core/avmfeatures.as
+++ core/avmfeatures.as
@@ -757,9 +757,13 @@
     var name = feature.name;
     var requires = feature.requires;
     var precludes = feature.precludes;
+    var defines = feature.defines;
     var s = [];
-	var items;
-
+    var items;
+
+    if (defines.length() == 0)
+        fail("Feature has no DEFINES clauses: " + name);
+
     if (requires.length() + precludes.length() > 0)
         s.push("#if " + name);


need these classes in here, not in manifest

--- frameworks/projects/HTML/as/src/HTMLClasses.as
+++ frameworks/projects/HTML/as/src/HTMLClasses.as
@@ -163,7 +163,12 @@
     import org.apache.flex.html.beads.TitleBarView; TitleBarView;
     import org.apache.flex.html.beads.TitleBarMeasurementBead; TitleBarMeasurementBead;

-
+	COMPILE::AS3
+	{
+		import org.apache.flex.html.beads.HRuleView; HRuleView;
+		import org.apache.flex.html.beads.VRuleView; VRuleView;
+		import org.apache.flex.html.beads.MultilineTextFieldView; MultilineTextFieldView;
+	}
 }

 }


Ray the eagle-eyed and merciless. I need coffee.

--- tamarin-central/thane/flash/utils/Timer.as
+++ tamarin-central/thane/flash/utils/Timer.as
@@ -48,7 +48,7 @@
             return;
         }

-        queueTimer(getTimer() + _delay);
+        enqueue(new Buddy(this, getTimer() + _delay));
     }

     public function stop () :void
@@ -75,7 +75,8 @@
         _currentCount ++;
         dispatchEvent(new TimerEvent(TimerEvent.TIMER));
         if (_currentCount < _repeatCount) {
-            queueTimer(buddy.expiration + _delay);
+            buddy.expiration += _delay;
+            enqueue(buddy);

         } else {
             dispatchEvent(new TimerEvent(TimerEvent.TIMER_COMPLETE));
@@ -83,10 +84,9 @@
         }
     }

-    private function queueTimer (when :int) :void
+    private function enqueue (buddy :Buddy) :void
     {
-        // spawn a new buddy and toss it on the heap
-        _buddy = new Buddy(this, when);
+        _buddy = buddy;
         if (_heap.enqueue(_buddy)) {
             return;
         }
@@ -101,7 +101,9 @@

         while (_heap.size > 0 && _heap.front.expiration <= now) {
             var buddy :Buddy = _heap.dequeue();
-            buddy.budette.expire(buddy);
+            if (buddy.budette != null) {
+                buddy.budette.expire(buddy);
+            }
         }
     }


Fix minor bug on CloneOptions

Fix minor bug on CloneOptions

--- src/aerys/minko/type/clone/CloneOptions.as
+++ src/aerys/minko/type/clone/CloneOptions.as
@@ -52,7 +52,7 @@
 			var cloneOptions : CloneOptions = new CloneOptions();

 			cloneOptions._ignoredControllerTypes.push(MeshVisibilityController, CameraController);
-			cloneOptions._defaultControllerAction = ControllerCloneAction.REASSIGN;
+			cloneOptions._defaultControllerAction = ControllerCloneAction.CLONE;

 			return cloneOptions;
 		}


Include the dispatcher here so we know if it was null or unresponsive.

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

--- src/as/com/threerings/util/CommandEvent.as
+++ src/as/com/threerings/util/CommandEvent.as
@@ -78,7 +78,7 @@
             // never cancelled, so we complain.
             if (disp == null || disp.dispatchEvent(event)) {
                 Log.getLog(CommandEvent).warning("Unhandled controller command " +
-                    "[cmd=" + cmd + ", arg=" + arg + "].");
+                    "[cmd=" + cmd + ", arg=" + arg + ", disp=" + disp + "].");
             }

         } else {