Transferred from the Adobe Open Source Subversion Repository

Revision: 4446
Author:   hmuller@adobe.com
Date:     2009-01-08T19:53:52.711496Z

Log Message:
-----------
Added support for virtualiztaion to HorizontalLayout.

Some refactoring and commenting of Horizontal,Verticallayout.

QE Notes: Existing mustella tests pass, virtualization tests are still TBD
Doc Notes: None
Bugs:
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -23,6 +23,7 @@

 import mx.containers.utilityClasses.Flex;
 import mx.events.PropertyChangeEvent;
+import mx.layout.LinearLayoutVector;

 /**
@@ -102,10 +103,13 @@
     [Inspectable(category="General")]

     /**
-     *  Horizontal space between columns.
+     *  The horizontal space between layout elements.
+     *
+     *  Note that the gap is only applied between layout elements, so if there's
+     *  just one element, the gap has no effect on the layout.
      *
      *  @default 6
-     */
+     */
     public function get gap():int
     {
         return _gap;
@@ -171,13 +175,15 @@
     [Inspectable(category="General")]

     /**
-     *  Specifies the number of elements to display.
-     *
-     *  If requestedColumnCount is -1, then all of them elements are displayed.
-     *
-     *  This property implies the layout's measuredWidth.
-     *
-     *  If the width of the target has been explicitly set,
+     *  The measured size of this layout will be big enough to display
+     *  the first requestedColumnCount layout elements.
+     *
+     *  If requesteColumnCount is -1, then the measured
+     *  size will be big enough for all of the layout elements.
+     *
+     *  This property implies the layout target's measuredWidth.
+     *
+     *  If the actual size of the target has been explicitly set,
      *  then this property has no effect.
      *
      *  @default -1
@@ -208,20 +214,24 @@
     [Inspectable(category="General")]

     /**
-     *  Specifies the width of the columns if variableColumnWidth
-     *  is false.
-     *
-     *  If this property isn't explicitly set, then the measured width
-     *  of the first element is returned.
+     *  If variableColumnWidth="false" then
+     *  this property specifies the actual width of each layout element.
+     *
+     *  If variableColumnWidth="true" (the default), then this property
+     *  has no effect.
+     *
+     *  The default value of this property is the preferred width
+     *  of the typicalLayoutElement.
      */
     public function get columnWidth():Number
     {
         if (!isNaN(_columnWidth))
             return _columnWidth;
-        else if (!target || (target.numLayoutElements <= 0))
-            return 0;
-        else
-            return target.getLayoutElementAt(0).getPreferredBoundsWidth();
+        else
+        {
+            var elt:ILayoutElement = typicalLayoutElement
+            return (elt) ? elt.getPreferredBoundsWidth() : 0;
+        }
     }

     /**
@@ -248,17 +258,16 @@
     [Inspectable(category="General")]

     /**
-     *  If false, i.e. "fixed column width" is specified, the width of
-     *  each element is set to the value of columnWidth.
-     *
-     *  If the columnWidth property wasn't explicitly set,
-     *  then it's initialized with the measuredWidth of
-     *  the first element.
-     *
-     *  The elements' includeInLayout,
-     *  measuredWidth, minWidth,
-     *  and percentWidth properties are ignored when
-     *  variableColumnWidth is false.
+     *  Specifies that layout elements are to be allocated their
+     *  preferred width.
+     *
+     *  Setting this property to false specifies fixed width columns.
+     *
+     *  If false, the actual width of each layout element will be
+     *  the value value of columnWidth.
+     *
+     *  Setting this property to false causes the layout to ignore
+     *  layout elements' percentWidth.
      *
      *  @default true
      */
@@ -344,16 +353,23 @@
      */
     private var _verticalAlign:String = VerticalAlign.TOP;

-    [Inspectable(category="General")]
+    [Inspectable(category="General", enumeration="top,bottom,middle,justify,contentJustify", defaultValue="top")]

     /**
-     *  Vertical alignment of children in the container.
-     *  Possible values are "top", "middle",
-     *  "bottom", "justify",
-     *  and "contentJustify".
-     *  The default value is "top", but some containers,
-     *  such as List, use a different default value.  There are constants
-     *  for these values in mx.layout.VerticalAlign.
+     *  Vertical alignment of layout elements.
+     *
+     *  If the value is one of "bottom", "middle", "top"  then the
+     *  layout element is aligned relative to the target's contentHeight.
+     *
+     *  If the value is "contentJustify" then the layout element's actual
+     *  height is set to the contentHeight.
+     *
+     *  If the value is "justify" then the layout element's actual height
+     *  is set to the target's height.
+     *
+     *  This property does not affect the layout's measured size.
+     *
+     *  @default "top"
      */
     public function get verticalAlign():String
     {
@@ -396,7 +412,7 @@
         _lastIndexInView = lastIndex;
         dispatchEvent(new Event("indexInViewChanged"));
     }
-
+
     /**
      *  An index is "in view" if the corresponding non-null layout element is
      *  within the horizontal limits of the layout target's scrollRect
@@ -417,45 +433,61 @@
      *  @see firstIndexInView
      *  @see lastIndexInView
      */
-   public function inView(index:int):Number
-    {
-        var g:GroupBase = GroupBase(target);
+    public function inView(index:int):Number
+    {
+        var g:GroupBase = target;
         if (!g)
             return 0.0;
-
+
         if ((index < 0) || (index >= g.numLayoutElements))
-           return 0.0;
-
-        var le:ILayoutElement = g.getLayoutElementAt(index);
-        if ((le == null) || !le.includeInLayout)
             return 0.0;
-
+
         if (!clipContent)
             return 1.0;
+
+        var r0:int = firstIndexInView;
+        var r1:int = lastIndexInView;
+
+        // index is outside the "in view" or visible range
+        if ((r0 == -1) || (r1 == -1) || (index < r0) || (index > r1))
+            return 0.0;
+
+        // within the visible index range, but not first or last
+        if ((index > r0) && (index < r1))
+            return 1.0;
+
+        // get the layout element's X and Width
+        var eltX:Number;
+        var eltWidth:Number;
+        if (virtualLayout)
+        {
+            eltX = llv.start(index);
+            eltWidth = llv.getMajorSize(index);
+        }
+        else
+        {
+            var elt:ILayoutElement = g.getLayoutElementAt(index);
+            if (!elt || !elt.includeInLayout)
+                return 0.0;
+            eltX = elt.getLayoutBoundsX();
+            eltWidth = elt.getLayoutBoundsWidth();
+        }

-        var c0:int = firstIndexInView;
-        var c1:int = lastIndexInView;
-
-        // outside the visible index range
-        if ((c0 == -1) || (c1 == -1) || (index < c0) || (index > c1))
-            return 0.0;
-
-        // within the visible index range, but not first or last
-        if ((index > c0) && (index < c1))
-            return 1.0;
-
-        // index is first (c0) or last (c1) visible column
-        var x0:Number = g.horizontalScrollPosition;
+        // index is either the first or last column in the scrollRect
+        // and potentially partially visible.
+        //   x0,x1 - scrollRect left,right edges
+        //   ix0, ix1 - layout element left,right edges
+        var x0:Number = g.horizontalScrollPosition;
         var x1:Number = x0 + g.width;
-        var ix0:Number = le.getLayoutBoundsX();
-        var ix1:Number = ix0 + le.getLayoutBoundsWidth();
-        if (ix0 >= ix1)  // element has 0 or negative width
+        var ix0:Number = eltX;
+        var ix1:Number = ix0 + eltWidth;
+        if (ix0 >= ix1)  // element has 0 or negative height
             return 1.0;
         if ((ix0 >= x0) && (ix1 <= x1))
             return 1.0;
         return (Math.min(x1, ix1) - Math.max(x0, ix0)) / (ix1 - ix0);
-    }
-
+    }
+
     /**
      *  Binary search for the first layout element that contains y.
      *
@@ -551,10 +583,19 @@
             return;
         }

-        // TBD: special case for variableRowHeight false
-
-        var i0:int = findIndexAt(x0 + gap, gap, g, 0, n);
-        var i1:int = findIndexAt(x1, gap, g, 0, n);
+        var i0:int;
+        var i1:int;
+        if (virtualLayout)
+        {
+            i0 = llv.indexOf(x0);
+            i1 = llv.indexOf(x1);
+        }
+        else
+        {
+            i0 = findIndexAt(x0 + gap, gap, g, 0, n);
+            i1 = findIndexAt(x1, gap, g, 0, n);
+        }
+
         // Special case: no element overlaps x0, is index 0 visible?
         if (i0 == -1)
         {
@@ -583,6 +624,9 @@
             }
         }

+        if (virtualLayout)
+            updateDisplayListVirtual(i0);
+
         setIndexInView(i0, i1);
     }

@@ -592,15 +636,19 @@
      *
      *  @private
      */
-    private static function layoutElementBounds(g:GroupBase, i:int):Rectangle
-    {
-        var element:ILayoutElement = g.getLayoutElementAt(i);
-        if (element && element.includeInLayout)
-        {
-            return new Rectangle(element.getLayoutBoundsX(),
-                                 element.getLayoutBoundsY(),
-                                 element.getLayoutBoundsWidth(),
-                                 element.getLayoutBoundsHeight());
+    private function layoutElementBounds(g:GroupBase, i:int):Rectangle
+    {
+        if (virtualLayout)
+            return llv.getBounds(i);
+        {
+            var element:ILayoutElement = g.getLayoutElementAt(i);
+            if (element && element.includeInLayout)
+            {
+                return new Rectangle(element.getLayoutBoundsX(),
+                                     element.getLayoutBoundsY(),
+                                     element.getLayoutBoundsWidth(),
+                                     element.getLayoutBoundsHeight());
+            }
         }
         return null;
     }
@@ -741,122 +789,313 @@
         var maxDelta:Number = g.contentWidth - scrollR.width - scrollR.x;
         var minDelta:Number = -scrollR.x;
         return Math.min(maxDelta, Math.max(minDelta, delta));
-    }
-
-    public function variableColumnWidthMeasure(layoutTarget:GroupBase):void
-    {
-        var minWidth:Number = 0;
-        var minHeight:Number = 0;
-        var preferredWidth:Number = 0;
-        var preferredHeight:Number = 0;
-        var visibleWidth:Number = 0;
-        var visibleColumns:uint = 0;
-        var reqColumns:int = requestedColumnCount;
-
-        var count:uint = layoutTarget.numLayoutElements;
-        var totalCount:uint = count; // How many elements will be laid out
-        for (var i:int = 0; i < count; i++)
-        {
-            var le:ILayoutElement = layoutTarget.getLayoutElementAt(i);
-            if (!le || !le.includeInLayout)
-            {
-            	totalCount--;
+    }
+
+
+    /**
+     *  @private
+     *  Compute exact values for measuredWidth,Height and  measuredMinWidth,Height.
+     *
+     *  If requestedColumnCount is not -1, measure as many layout elements,
+     *  padding with typicalLayoutElement if needed, starting with index 0.
+     *  Otherwise measure all of the layout elements.
+     */
+    private function measureReal(layoutTarget:GroupBase):void
+    {
+        var layoutEltCount:int = layoutTarget.numLayoutElements;
+        var reqEltCount:int = requestedColumnCount; // -1 means "all elements"
+        var eltCount:uint = Math.max(reqEltCount, layoutEltCount);
+        var eltInLayoutCount:uint = 0; // elts that have been measured
+
+        var preferredHeight:Number = 0; // max of the elt preferred heights
+        var preferredWidth:Number = 0;  // sum of the elt preferred widths
+        var minHeight:Number = 0; // max of the elt minimum heights
+        var minWidth:Number = 0;  // sum of the elt minimum widths
+
+        var fixedColumnWidth:Number = NaN;
+        if (!variableColumnWidth)
+            fixedColumnWidth = columnWidth;  // may query typicalLayoutElement, elt at index=0
+
+        for (var i:uint = 0; i < eltCount; i++)
+        {
+            if ((reqEltCount != -1) && (eltInLayoutCount >= reqEltCount))
+                break;
+
+            if (i < layoutEltCount) // target.numLayoutElements
+                var elt:ILayoutElement = layoutTarget.getLayoutElementAt(i);
+            else // target.numLayoutElements < requestedElementCount, so "pad"
+                elt = typicalLayoutElement;
+            if (!elt || !elt.includeInLayout)
                 continue;
-            }
-
-            preferredHeight = Math.max(preferredHeight, le.getPreferredBoundsHeight());
-            preferredWidth += le.getPreferredBoundsWidth();
-
-            var vcr:Boolean = (reqColumns != -1) && (visibleColumns < reqColumns);
-            if (vcr || (reqColumns == -1))
-            {
-                var mw:Number = hasPercentWidth(le)  ? le.getMinBoundsWidth() : le.getPreferredBoundsWidth();
-                var mh:Number = hasPercentHeight(le) ? le.getMinBoundsHeight() : le.getPreferredBoundsHeight();
-                minWidth += mw;
-                minHeight = Math.max(minHeight, mh);
-            }
-            if (vcr)
-            {
-            	visibleWidth = preferredWidth;
-            	visibleColumns += 1;
-            }
-        }
-
-        if (totalCount > 1)
+
+            var height:Number = elt.getPreferredBoundsHeight();
+            var width:Number = isNaN(fixedColumnWidth) ? elt.getPreferredBoundsWidth() : fixedColumnWidth;
+            preferredHeight = Math.max(preferredHeight, height);
+            preferredWidth += width;
+            minHeight = Math.max(minHeight, (isNaN(elt.percentHeight)) ? height : elt.getMinBoundsHeight());
+            minWidth += (isNaN(elt.percentWidth)) ? width : elt.getMinBoundsWidth();
+
+            eltInLayoutCount += 1;
+        }
+
+        if (eltInLayoutCount > 1)
         {
-            preferredWidth += gap * (totalCount - 1);
-            var vgap:Number = (visibleColumns > 1) ? ((visibleColumns - 1) * gap) : 0;
-            visibleWidth +=  vgap;
-            minWidth += vgap;
-        }
-
-        layoutTarget.measuredWidth = (reqColumns == -1) ? preferredWidth : visibleWidth;
+            var hgap:Number = gap * (eltInLayoutCount - 1);
+            preferredWidth += hgap;
+            minWidth += hgap;
+        }
+
         layoutTarget.measuredHeight = preferredHeight;
-
-        layoutTarget.measuredMinWidth = minWidth;
+        layoutTarget.measuredWidth = preferredWidth;
         layoutTarget.measuredMinHeight = minHeight;
-
-        layoutTarget.setContentSize(preferredWidth, preferredHeight);
-    }
-
-
-    private function fixedColumnWidthMeasure(layoutTarget:GroupBase):void
-    {
-        var cols:uint = layoutTarget.numLayoutElements;
-        var visibleCols:uint = (requestedColumnCount == -1) ? cols : requestedColumnCount;
-
-        var cw:Number = columnWidth; // can be expensive to compute
-        var contentWidth:Number = (cols * cw) + ((cols > 1) ? (gap * (cols - 1)) : 0);
-        var visibleWidth:Number = (visibleCols * cw) + ((visibleCols > 1) ? (gap * (visibleCols - 1)) : 0);
-
-        var rowHeight:Number = layoutTarget.explicitHeight;
-        var minRowHeight:Number = rowHeight;
-        if (isNaN(rowHeight))
-        {
-			minRowHeight = rowHeight = 0;
-	        var count:uint = layoutTarget.numLayoutElements;
-	        for (var i:int = 0; i < count; i++)
-	        {
-	            var layoutElement:ILayoutElement = layoutTarget.getLayoutElementAt(i);
-	            if (!layoutElement || !layoutElement.includeInLayout) continue;
-	            rowHeight = Math.max(rowHeight, layoutElement.getPreferredBoundsHeight());
-	            var elementMinHeight:Number = hasPercentHeight(layoutElement) ? layoutElement.getMinBoundsHeight() : layoutElement.getPreferredBoundsHeight();
-	            minRowHeight = Math.max(minRowHeight, elementMinHeight);
-	        }
-        }
-
-        layoutTarget.measuredWidth = visibleWidth;
-        layoutTarget.measuredHeight = rowHeight;
-
-        layoutTarget.measuredMinWidth = visibleWidth;
-        layoutTarget.measuredMinHeight = minRowHeight;
-
-        layoutTarget.setContentSize(contentWidth, rowHeight);
-    }
-
-
+        layoutTarget.measuredMinWidth  = minWidth;
+    }
+
+    private var llv:LinearLayoutVector = new LinearLayoutVector(LinearLayoutVector.HORIZONTAL);
+
+    /**
+     *  @private
+     *  Syncs the LinearLayoutVector llv with typicalLayoutElement and
+     *  the target's numLayoutElements.  Calling this function accounts
+     *  for the possibility that the typicalLayoutElement has changed, or
+     *  something that its preferred size depends on has changed.
+     */
+     private function updateLLV(layoutTarget:GroupBase):void
+     {
+        var typicalElt:ILayoutElement = typicalLayoutElement;
+        if (typicalElt)
+        {
+            var typicalWidth:Number = typicalElt.getPreferredBoundsWidth();
+            var typicalHeight:Number = typicalElt.getPreferredBoundsHeight();
+            llv.minorSize = Math.max(llv.minorSize, typicalHeight);
+            llv.defaultMajorSize = typicalWidth;
+        }
+        if (layoutTarget)
+            llv.length = layoutTarget.numLayoutElements;
+        llv.gap = gap;
+     }
+
+    /**
+     *  @private
+     *  Compute potentially approximate values for measuredWidth,Height and
+     *  measuredMinWidth,Height.
+     *
+     *  This method does not get layout elements from the target except
+     *  as a side effect of calling typicalLayoutElement.
+     *
+     *  If variableColumnWidth="false" then all dimensions are based on
+     *  typicalLayoutElement and the sizes already cached in llv.  The
+     *  llv's defaultMajorSize, minorSize, and minMinorSize
+     *  are based on typicalLayoutElement.
+     */
+    private function measureVirtual(layoutTarget:GroupBase):void
+    {
+        var eltCount:uint = layoutTarget.numLayoutElements;
+        var measuredEltCount:int = (requestedColumnCount != -1) ? requestedColumnCount : eltCount;
+
+        updateLLV(layoutTarget);
+        if (variableColumnWidth)
+            layoutTarget.measuredWidth =  llv.end(measuredEltCount - 1);
+        else
+        {
+            var hgap:Number = (measuredEltCount > 1) ? (measuredEltCount - 1) * gap : 0;
+            layoutTarget.measuredWidth = (measuredEltCount * columnWidth) + hgap;
+        }
+        layoutTarget.measuredHeight = llv.minorSize;
+
+        layoutTarget.measuredMinWidth = layoutTarget.measuredWidth;
+        layoutTarget.measuredMinHeight = layoutTarget.measuredHeight;
+    }
+
+    /**
+     *  If requestedColumnCount is specified then as many layout elements
+     *  or "columns" are measured, starting with element 0, otherwise all of the
+     *  layout elements are measured.
+     *
+     *  If requestedColumnCount is specified and is greater than the
+     *  number of layout elements, then the typicalLayoutElement is used
+     *  in place of the missing layout elements.
+     *
+     *  If variableColumnWidth="true", then the layoutTarget's measuredWidth
+     *  is the sum of preferred widths of the layout elements, plus the sum of the
+     *  gaps between elements, and its measuredHeight is the max of the elements'
+     *  preferred heights.
+     *
+     *  If variableColumnWidth="false", then the layoutTarget's measuredWidth
+     *  is columnWidth multiplied by the number or layout elements, plus the
+     *  sum of the gaps between elements.
+     *
+     *  The layoutTarget's measuredMinWidth is the sum of the minWidths of
+     *  layout elements that have specified a value for the percentWidth
+     *  property, and the preferredWidtj of the elements that have not,
+     *  plus the sum of the gaps between elements.
+     *
+     *  The difference reflects the fact that elements which specify
+     *  percentWidth are considered to be "flexible" and updateDisplayList
+     *  will give flexible components at least their minWidth.
+     *
+     *  Layout elements that aren't flexible always get their preferred width.
+     *
+     *  The layoutTarget's measuredMinHeight is the max of the minHeights for
+     *  elements that have specified percentHeight (that are "flexible") and the
+     *  preferredHeight of the elements that have not.
+     *
+     *  As before the difference is due to the fact that flexible items are only
+     *  guaranteed their minHeight.
+     *
+    */
     override public function measure():void
     {
-        super.measure();
-
-    	var layoutTarget:GroupBase = target;
+        var layoutTarget:GroupBase = target;
         if (!layoutTarget)
             return;
+        if (virtualLayout)
+            measureVirtual(layoutTarget);
+        else
+            measureReal(layoutTarget);
+    }
+
+    //  - virtual layout only -
+    private function calculateElementHeight(elt:ILayoutElement, targetHeight:Number, contentHeight:Number):Number
+    {
+       // If percentHeight is specified then the element's height is the percentage
+       // of targetHeight clipped to min/maxHeight and to (upper limit) targetHeight.
+       var percentHeight:Number = elt.percentHeight;
+       if (!isNaN(percentHeight))
+       {
+          var height:Number = percentHeight * 0.01 * targetHeight;
+          return Math.min(targetHeight, Math.min(elt.getMaxBoundsHeight(), Math.max(elt.getMinBoundsHeight(), height)));
+       }
+       switch(verticalAlign)
+       {
+           case VerticalAlign.JUSTIFY:
+               return targetHeight;
+           case VerticalAlign.CONTENT_JUSTIFY:
+               return contentHeight;
+       }
+       return elt.getPreferredBoundsHeight();
+    }
+
+    //  - virtual layout only -
+    private function calculateElementY(elt:ILayoutElement, eltHeight:Number, contentHeight:Number):Number
+    {
+       switch(verticalAlign)
+       {
+           case VerticalAlign.MIDDLE:
+               return (contentHeight - eltHeight) * 0.5;
+           case VerticalAlign.BOTTOM:
+               return contentHeight - eltHeight;
+       }
+       return 0;  // VerticalAlign.TOP
+    }
+
+    /**
+     *  @private
+     *  Update the layout of the virtualized elements that overlap
+     *  the scrollRect's horizontal extent.
+     *
+     *  The width of each layout element will be its preferred width, and its
+     *  x will be the right edge of the previous item, plus the gap.
+     *
+     *  No support for percentWidth, includeInLayout=false, or null layoutElements,
+     *
+     *  The height of each layout element will be set to its preferred height, unless
+     *  one of the following is true:
+     *
+     *  - If percentHeight is specified for this element, then its height will be the
+     *  specified percentage of the target's actual (unscaled) height, clipped
+     *  the layout element's minimum and maximum height.
+     *
+     *  - If verticalAlign is "justify", then the element's height will
+     *  be set to the target's actual (unscaled) height.
+     *
+     *  - If verticalAlign is "contentJustify", then the element's height
+     *  will be set to the target's content height.
+     *
+     *  The Y coordinate of each layout element will be set to 0 unless one of the
+     *  following is true:
+     *
+     *  - If verticalAlign is "middle" then y is set so that the element's preferred
+     *  height is centered within the contentHeight:
+     *      y = (contentHeight - layoutElementHeight) * 0.5
+     *
+     *  - If verticalAlign is "bottom" the y is set so that the element's bottom
+     *  edge is aligned with the the bottom edge of the content:
+     *      y = (contentHeight - layoutElementHeight)
+     *
+     *  Implementation note: unless verticalAlign is either "justify" or
+     *  "top", the layout elements' y or height depends on the contentHeight.
+     *  The contentHeight is a maximum and although it may be updated to
+     *  different value after all (viewable) elements have been laid out, it
+     *  often does not change.  For that reason we use the current contentHeight
+     *  for the initial layout and then, if it has changed, we loop through
+     *  the layout items again and fix up the y/height values.
+     */
+    private function updateDisplayListVirtual(startIndex:int = -1):void
+    {
+        var layoutTarget:GroupBase = target;
+        var eltCount:int = layoutTarget.numLayoutElements;
+        var targetHeight:Number = layoutTarget.height;
+        var minVisibleX:Number = layoutTarget.horizontalScrollPosition;
+        var maxVisibleX:Number = minVisibleX + layoutTarget.width;
+
+        updateLLV(layoutTarget);
+        if (startIndex < 0)
+            startIndex = llv.indexOf(minVisibleX);

-        if (variableColumnWidth)
-        	variableColumnWidthMeasure(layoutTarget);
-        else
-        	fixedColumnWidthMeasure(layoutTarget);
-    }
-
-
-    override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        super.updateDisplayList(unscaledWidth, unscaledHeight);
-
-    	var layoutTarget:GroupBase = target;
-        if (!layoutTarget)
-            return;
+        var fixedColumnWidth:Number = NaN;
+        if (!variableColumnWidth)
+            fixedColumnWidth = columnWidth;  // may query typicalLayoutElement, elt at index=0
+
+        layoutTarget.beginVirtualLayout(startIndex);
+        var contentHeight:Number = llv.minorSize;
+        var x:Number = llv.start(startIndex);
+        var index:int = startIndex;
+
+        // First pass: compute element x,y,width,height based on
+        // current contentHeight; cache computed widths/heights in llv.
+        for (; (x < maxVisibleX) && (index < eltCount); index++)
+        {
+            var elt:ILayoutElement = layoutTarget.getLayoutElementAt(index);
+            var w:Number = (isNaN(fixedColumnWidth)) ? elt.getPreferredBoundsWidth() : fixedColumnWidth;
+            var h:Number = calculateElementHeight(elt, targetHeight, contentHeight);
+            var y:Number = calculateElementY(elt, h, contentHeight);
+            elt.setLayoutBoundsPosition(x, y);
+            elt.setLayoutBoundsSize(w, h);
+            llv.cacheDimensions(index, elt);
+            x += w + gap;
+        }
+        var endIndex:int = index - 1;
+
+        // Second pass: if neccessary, fix up y and height values based
+        // on the updated contentHeight
+        if (llv.minorSize != contentHeight)
+        {
+            contentHeight = llv.minorSize;
+            if ((verticalAlign != VerticalAlign.TOP) && (verticalAlign != VerticalAlign.JUSTIFY))
+            {
+                for (index = startIndex; index <= endIndex; index++)
+                {
+                    elt = layoutTarget.getLayoutElementAt(index);
+                    h = calculateElementHeight(elt, targetHeight, contentHeight);
+                    y = calculateElementY(elt, h, contentHeight);
+                    elt.setLayoutBoundsPosition(elt.getLayoutBoundsX(), y);
+                    elt.setLayoutBoundsSize(elt.getLayoutBoundsWidth(), h);
+                }
+             }
+        }
+
+        setColumnCount(index - startIndex);
+        setIndexInView(startIndex, endIndex);
+        layoutTarget.setContentSize(llv.end(llv.length - 1), contentHeight);
+        layoutTarget.endVirtualLayout(startIndex, endIndex);
+    }
+
+    private function updateDisplayListReal():void
+    {
+        var layoutTarget:GroupBase = target;
+        var targetWidth:Number = layoutTarget.width;
+        var targetHeight:Number = layoutTarget.height;

         var layoutElement:ILayoutElement;
         var count:uint = layoutTarget.numLayoutElements;
@@ -864,7 +1103,7 @@
         // If verticalAlign is top, we don't need to figure out the contentHeight.
         // Otherwise the contentHeight is used to position the element and even size
         // the element if it's "contentJustify" or "justify".
-        var contentHeight:Number = unscaledHeight;
+        var contentHeight:Number = targetHeight;

         // TODO: in the middle or bottom case, we end up calculating percentHeight
@@ -880,7 +1119,7 @@

                 var layoutElementHeight:Number;
                 if (hasPercentHeight(layoutElement))
-                    layoutElementHeight = calculatePercentHeight(layoutElement, unscaledHeight);
+                    layoutElementHeight = calculatePercentHeight(layoutElement, targetHeight);
                 else
                     layoutElementHeight = layoutElement.getPreferredBoundsHeight();

@@ -889,16 +1128,16 @@
         }

         // If we're justifying the elements, then all heights should be set to
-        // unscaledHeight.  If we're content justifying the elements, then
+        // targetHeight.  If we're content justifying the elements, then
         // all heights should be set to the contentHeight.
         // Otherwise restrictedHeight is ignored in distributedWidth.
         var restrictedHeight:Number;
         if (verticalAlign == VerticalAlign.JUSTIFY)
-            restrictedHeight = unscaledHeight;
+            restrictedHeight = targetHeight;
         else if (verticalAlign == VerticalAlign.CONTENT_JUSTIFY)
             restrictedHeight = contentHeight;

-        distributeWidth(unscaledWidth, unscaledHeight, restrictedHeight);
+        distributeWidth(targetWidth, targetHeight, restrictedHeight);

         // default to top (0)
         var vAlign:Number = 0;
@@ -911,7 +1150,7 @@
         // we'll count how many columns fall within the layoutTarget's scrollRect
         var visibleColumns:uint = 0;
         var minVisibleX:Number = layoutTarget.horizontalScrollPosition;
-        var maxVisibleX:Number = minVisibleX + unscaledWidth
+        var maxVisibleX:Number = minVisibleX + targetWidth

         // Finally, position the LayoutElements and find the first/last
         // visible indices, the content size, and the number of
@@ -1037,6 +1276,20 @@
         }
         return spaceToDistribute;
     }
+
+    override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        var layoutTarget:GroupBase = target;
+        if (!layoutTarget)
+            return;
+
+        if (virtualLayout)
+            updateDisplayListVirtual();
+        else
+            updateDisplayListReal();
+    }

 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 9225
Author:   egeorgie@adobe.com
Date:     2009-08-11T18:36:09.811287Z

Log Message:
-----------
Fix bug: Rows disappear in Spark List when using negative gap in layout and using virtualization

Fix: Change H/V layouts first-visible-element lookup logic to accommodate negative gaps.

QE notes: None
Doc notes: None
Bugs: SDK-22497
Reviewer: Hans
Tests run: checkintests,
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -1461,7 +1461,13 @@
         var maxVisibleX:Number = minVisibleX + layoutTarget.width;

         updateLLV(layoutTarget);
-        var startIndex:int = llv.indexOf(minVisibleX + gap);
+
+		// Find the index of the first visible item. Since the item's bounds includes the gap
+		// that follows it, we want to avoid looking at an item that has only a portion of
+		// its gap intersecting with the visible region.
+		// We have to also be careful, as gap could be negative and in that case, we should
+		// simply start from minVisibleX - SDK-22497.
+        var startIndex:int = llv.indexOf(Math.max(0, minVisibleX + gap));
         if (startIndex == -1)
             return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 12912
Author:   pfarland@adobe.com
Date:     2009-12-14T20:08:35.669487Z

Log Message:
-----------
With TLF 571 checked in we can now revert the MXML 2009 changes for how the id language attribute is processed.

An unqualified id property will no longer be seen as a setter for a normal public, writable, non-static "id" property - which matches Flex 3 behavior.

As in earlier versions of Flex, the mechanism to retain MXML id attribute information at runtime is to implement mx.core.IMXMLObject. The compiler will generate a call to the intialized() method and pass in the id information.

Note: One exception to this rule seems to be UIComponent which instead get id attribute information via mx.core.IDeferredInstantiationUIComponent (although there seems to be a TODO in the codebase to remove this mechanism and thus should not be relied on by third parties).

QE notes: Please add tests for the TLF id property on flow elements (div, span, p, etc).
Doc notes: Please check that we have not documented
Bugs: N/A
Reviewer: Paul
Tests run: Checkintests, local test cases.
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/TypeTable.java</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IID.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.java</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/modules/compiler/src/java/flex2/compiler/mxml/reflect/Type.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -32,9 +32,9 @@

 import mx.core.AdvancedLayoutFeatures;
 import mx.core.DesignLayer;
-import mx.core.IID;
 import mx.core.IInvalidating;
 import mx.core.ILayoutElement;
+import mx.core.IMXMLObject;
 import mx.core.IUIComponent;
 import mx.core.IVisualElement;
 import mx.core.UIComponent;
@@ -93,7 +93,7 @@
  *  @productversion Flex 4
  */
 public class GraphicElement extends EventDispatcher
-    implements IGraphicElement, IInvalidating, ILayoutElement, IVisualElement, IID
+    implements IGraphicElement, IInvalidating, ILayoutElement, IVisualElement, IMXMLObject
 {
     include "../../core/Version.as";

@@ -211,43 +211,6 @@
      *  storage for the y property. This property is used when a GraphicElement has a simple transform.
      */
     private var _y:Number = 0;
-
-    //--------------------------------------------------------------------------
-    //
-    //  Properties - IID
-    //
-    //--------------------------------------------------------------------------
-
-    //----------------------------------
-    //  id
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the id property.
-     */
-    private var _id:String;
-
-    /**
-     *  The identity of the component.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get id():String
-    {
-        return _id;
-    }
-
-    /**
-     *  @private
-     */
-    public function set id(value:String):void
-    {
-        _id = value;
-    }

     //--------------------------------------------------------------------------
     //
@@ -1031,6 +994,37 @@
         _horizontalCenter = value;
         invalidateParentSizeAndDisplayList();
     }
+
+	//----------------------------------
+	//  id
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the id property.
+	 */
+	private var _id:String;
+
+	/**
+	 *  The identity of the component.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.5
+	 *  @productversion Flex 4
+	 */
+	public function get id():String
+	{
+		return _id;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set id(value:String):void
+	{
+		_id = value;
+	}

     //----------------------------------
     //  left
@@ -2855,6 +2849,25 @@
     //  Methods
     //
     //--------------------------------------------------------------------------
+
+	/**
+	 *  Called automatically by the MXML compiler when the GraphicElement
+	 *  is created using an MXML tag.
+	 *  If you create the GraphicElement through ActionScript you must set the
+	 * id property manually.
+	 *
+	 *  @param document The MXML document containing this GraphicElement (not used).
+	 *  @param id The MXML id for this GraphicElement.
+	 *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+	 */
+	public function initialized(document:Object, id:String):void
+	{
+		this.id = id;
+	}

     /**
      * Converts the point object from the object's (local) coordinates


translate comments to English

translate comments to English

translate comments to English

--- src/control/LoadFLADataCommand.as
+++ src/control/LoadFLADataCommand.as
@@ -1,4 +1,4 @@
-package control{
+package control{
 	import dragonBones.utils.ConstValues;

 	import flash.events.Event;
@@ -47,7 +47,7 @@
 			if(isLoading){
 				return;
 			}
-			//读取 Flash Pro 中符合骨骼结构的 element 列表
+			//Load armature elements from Flash Pro
 			jsflProxy.getArmatureList(_isSelected);
 		}

@@ -56,7 +56,7 @@
 				addSkeletonXML(_skeletonXML);
 			}
 			if(armatureNameList.length == 0){
-				//骨骼读取完毕，放置贴图
+				//Load armature complete, start to handle texture
 				MessageDispatcher.dispatchEvent(MessageDispatcher.LOAD_ARMATURE_DATA_COMPLETE);
 				jsflProxy.clearTextureSWFItem();
 				return;
@@ -71,7 +71,7 @@
 				textureAtlasXML.appendChild(_subTextureXML);
 			}
 			if(subTextureAddedIndex < 0){
-				//贴图放置完毕，排序贴图
+				//load texture complete, start to place texture
 				MessageDispatcher.dispatchEvent(MessageDispatcher.LOAD_TEXTURE_DATA_COMPLETE);
 				MessageDispatcher.addEventListener(JSFLProxy.PACK_TEXTURES, jsflProxyHandler);
 				TextureUtil.packTextures(ImportDataProxy.getInstance().textureMaxWidth, ImportDataProxy.getInstance().texturePadding, textureAtlasXML);
@@ -90,10 +90,10 @@
 			switch(_e.type){
 				case JSFLProxy.GET_ARMATURE_LIST:
 					if(_result == "false"){
-						//没有符合骨骼结构的 element
+						//no armature element
 						MessageDispatcher.dispatchEvent(MessageDispatcher.LOAD_FLADATA, 0);
 					}else{
-						//开始逐个读取骨骼
+						//start load armature data
 						armatureNameList = _result.split(",");
 						totalCount = armatureNameList.length - 1;
 						MessageDispatcher.dispatchEvent(MessageDispatcher.LOAD_FLADATA, totalCount, armatureNameList.shift());
@@ -105,7 +105,7 @@
 					}
 					break;
 				case JSFLProxy.GENERATE_ARMATURE:
-					//逐个读取骨骼
+					//read next armature data
 					addAndReadNextArmature(_result != "false"?XML(_result):null);
 					break;
 				case JSFLProxy.CLEAR_TEXTURE_SWFITEM:
@@ -115,21 +115,21 @@
 					subTextureXMLList = textureAtlasXML.elements(ConstValues.SUB_TEXTURE);
 					totalCount = subTextureXMLList.length();
 					subTextureAddedIndex = totalCount - 1;
-					//开始逐个放置贴图
+					//start to place texture
 					addAndReadNextSubTexture();
 					break;
 				case JSFLProxy.ADD_TEXTURE_TO_SWFITEM:
-					//逐个放置贴图
+					//place texture one by one
 					addAndReadNextSubTexture(_result != "false"?XML(_result):null);
 					break;
 				case JSFLProxy.PACK_TEXTURES:
-					//贴图排序完毕，从 Flash Pro 导出贴图 SWF
+					//placed textures finished and then export
 					MessageDispatcher.removeEventListener(JSFLProxy.PACK_TEXTURES, jsflProxyHandler);
 					MessageDispatcher.addEventListener(JSFLProxy.EXPORT_SWF, jsflProxyHandler);
 					jsflProxy.exportSWF();
 					break;
 				case JSFLProxy.EXPORT_SWF:
-					//导出 SWF 完毕，读取 SWF
+					//export swf finised, then load
 					MessageDispatcher.removeEventListener(JSFLProxy.EXPORT_SWF, jsflProxyHandler);
 					MessageDispatcher.dispatchEvent(MessageDispatcher.LOAD_SWF);
 					urlLoader.addEventListener(Event.COMPLETE, onURLLoaderCompleteHandler);


Transferred from the Adobe Open Source Subversion Repository

Revision: 14483
Author:   smgilson@adobe.com
Date:     2010-03-01T19:01:18.459430Z

Log Message:
-----------
merge 14456: Adding ASDoc version tags classes

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkRangeAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkRadioButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkPanelAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarAutomationImpl.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/mx/automation/air/AirFunctionsHelper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkSkinnableContainerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/events/SparkValueChangeAutomationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBarBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkNavigatorContentAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTrackBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation/src/mx/automation/events/EventDetails.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/events/SparkListItemSelectEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTabBarAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkSkinnableContainerBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/mediaClasses/SparkMuteButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/mx/automation/air/AirDragManagerAutomationHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/SOAPResult.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTextBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTitleWindowAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTileGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkToggleButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkSpinnerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccConst.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkLabelAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkBorderContainerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkGroupBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkVideoPlayerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkSkinnableComponentAutomationImpl.as</path>

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonAutomationImpl.as
@@ -11,56 +11,71 @@

 package spark.automation.delegates.components
 {
-	import flash.display.DisplayObject;
-
-	import mx.automation.Automation;
-	import mx.core.mx_internal;
-
-	import spark.automation.delegates.components.supportClasses.SparkButtonBaseAutomationImpl;
-	import spark.components.Button;
-
-	use namespace mx_internal;
-
-	[Mixin]
-	/**
-	 *
-	 *  Defines methods and properties required to perform instrumentation for the
-	 *  Button control.
-	 *
-	 *  @see spark.components.Button
-	 *
-	 */
-	public class SparkButtonAutomationImpl extends SparkButtonBaseAutomationImpl
-	{
-
-		include "../../../core/Version.as";
-		//--------------------------------------------------------------------------
-		//
-		//  Class methods
-		//
-		//--------------------------------------------------------------------------
-
-		/**
-		 *  Registers the delegate class for a component class with automation manager.
-		 *
-		 *  @param root The SystemManger of the application.
-		 */
-		public static function init(root:DisplayObject):void
-		{
-			Automation.registerDelegateClass(spark.components.Button, SparkButtonAutomationImpl);
-		}
-
-		/**
-		 *  Constructor.
-		 * @param obj Button object to be automated.
-		 */
-		public function SparkButtonAutomationImpl(obj:spark.components.Button)
-		{
-			super(obj);
-
-		}
-
-
-	}
-
+    import flash.display.DisplayObject;
+
+    import mx.automation.Automation;
+    import mx.core.mx_internal;
+
+    import spark.automation.delegates.components.supportClasses.SparkButtonBaseAutomationImpl;
+    import spark.components.Button;
+
+    use namespace mx_internal;
+
+    [Mixin]
+    /**
+     *
+     *  Defines methods and properties required to perform instrumentation for the
+     *  Button control.
+     *
+     *  @see spark.components.Button
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     *
+     */
+    public class SparkButtonAutomationImpl extends SparkButtonBaseAutomationImpl
+    {
+
+        include "../../../core/Version.as";
+        //--------------------------------------------------------------------------
+        //
+        //  Class methods
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  Registers the delegate class for a component class with automation manager.
+         *
+         *  @param root The SystemManger of the application.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 9
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public static function init(root:DisplayObject):void
+        {
+            Automation.registerDelegateClass(spark.components.Button, SparkButtonAutomationImpl);
+        }
+
+        /**
+         *  Constructor.
+         * @param obj Button object to be automated.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 9
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function SparkButtonAutomationImpl(obj:spark.components.Button)
+        {
+            super(obj);
+
+        }
+
+
+    }
+
 }


Export points as "x,y" pairs

Export points as "x,y" pairs

--- runtime/src/main/as/flump/xfl/XflKeyframe.as
+++ runtime/src/main/as/flump/xfl/XflKeyframe.as
@@ -129,13 +129,18 @@

         if (symbol != null) {
             xml.@ref = symbol;
-            if (x != 0)         { xml.@x = x; }
-            if (y != 0)         { xml.@y = y; }
-            if (scaleX != 1)    { xml.@scaleX = scaleX; }
-            if (scaleY != 1)    { xml.@scaleY = scaleY; }
-            if (rotation != 0)  { xml.@rotation = rotation; }
-            if (pivotX != 0)    { xml.@pivotX = pivotX; }
-            if (pivotY != 0)    { xml.@pivotY = pivotY; }
+            if (x != 0 || y != 0) {
+                xml.@loc = "" + x + "," + y;
+            }
+            if (scaleX != 1 || scaleY != 1) {
+                xml.@scale = "" + scaleX + "," + scaleY;
+            }
+            if (rotation != 0) {
+                xml.@rotation = rotation;
+            }
+            if (pivotX != 0 || pivotY != 0) {
+                xml.@pivot = "" + pivotX + "," + pivotY;
+            }
             //if (alpha != 1)     { xml.@alpha = alpha; }
             //if (!visible)       { xml.@visible = visible; }
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20319
Author:   chiedozi@adobe.com
Date:     2011-02-15T08:10:16.873320Z

Log Message:
-----------
ViewTransitionBase now cleans up its internal effect object before dispatching TRANSITION_END

QE notes:
Doc notes:
Bugs: SDK-29476
Reviewer: Corey
Tests run:
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/ViewTransitionBase.as

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

--- frameworks/projects/mobilecomponents/src/spark/transitions/ViewTransitionBase.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/ViewTransitionBase.as
@@ -1297,8 +1297,9 @@
     private function enterFrameHandler(event:Event):void
     {
         navigator.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
+        effect = null;
+
         transitionComplete();
-        effect = null;
     }

     /**


Make Windmill base lib a subclass of Sprite so it can be dynamically loaded.

--- flash/org/windmill/Windmill.as
+++ flash/org/windmill/Windmill.as
@@ -20,11 +20,12 @@
   // to avoid infinite recursion in build script
   import flash.utils.*;
   import mx.core.Application;
+  import flash.display.Sprite;
   import flash.display.Stage;
   import flash.display.DisplayObject;
   import flash.external.ExternalInterface;

-  public class Windmill {
+  public class Windmill extends Sprite {
     public static var context:*; // A reference to the Stage
     public static var controllerMethods:Array = [];
     public static var assertMethods:Array = [];


Transferred from the Adobe Open Source Subversion Repository

Revision: 6137
Author:   egeorgie@adobe.com
Date:     2009-04-10T23:58:54.405311Z

Log Message:
-----------
Fix bugs: http://bugs.adobe.com/jira/browse/SDK-20513 distributeHeight() method should be protected or private for VerticalLayout;
http://bugs.adobe.com/jira/browse/SDK-20514 distributeWidth() method should be private or protected for HorizontalLayout;
http://bugs.adobe.com/jira/browse/SDK-20460 typo in Flex 4 language reference for requestedRowCount property of VerticalLayout;
http://bugs.adobe.com/jira/browse/SDK-18713 Layouts are missing enum metadata for alignment

Fix: update the layouts, add initial padding support.

QE Notes: None
Doc Notes: None
Bugs: SDK-20513, SDK-20514, SDK-20460, SDK-18713
Reviewer: Hans
tests: checkintests, mustella (layout, group, datagroup)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as
@@ -278,6 +278,37 @@
     }

     //----------------------------------
+    //  majorAxisOffset
+    //----------------------------------
+
+    private var _majorAxisOffset:Number = 0;
+
+    /**
+     *  The offset of the first item from the origin in the majorAxis
+     *  direction. This is useful when implementing padding,
+     *  in addition to gaps, for virtual layouts.
+     *
+     *  @see #gap
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get majorAxisOffset():Number
+    {
+        return _majorAxisOffset;
+    }
+
+    /**
+     * @private
+     */
+    public function set majorAxisOffset(value:Number):void
+    {
+        _majorAxisOffset = value;
+    }
+
+    //----------------------------------
     //  gap
     //----------------------------------

@@ -523,13 +554,13 @@

     /**
      *  The cumulative distance to the start of the item at index, including
-     *  the gaps between items.
-     *
-     *  The value of start(0) is 0.
+     *  the gaps between items and the majorAxisOffset.
+     *
+     *  The value of start(0) is majorAxisOffset.
      *
      *  Equivalent to:
      *  <pre>
-     *  var distance:Number = 0;
+     *  var distance:Number = majorAxisOffset;
      *  for (var i:int = 0; i < index; i++)
      *      distance += get(i);
      *  return distance + (gap * index);
@@ -548,12 +579,12 @@
     public function start(index:uint):Number
     {
         if ((_length == 0) || (index == 0))
-            return 0;
+            return majorAxisOffset;

         if (index >= _length)
             throw new Error(resourceManager.getString("layout", "invalidIndex"));

-        var distance:Number = 0;
+        var distance:Number = majorAxisOffset;
         var blockIndex:uint = index >> BLOCK_SHIFT;
         for (var i:int = 0; i < blockIndex; i++)
         {
@@ -625,8 +656,12 @@
     {
         if ((_length == 0) || (distance < 0))
             return -1;
-
-        var curDistance:Number = 0;
+
+        // The area of the first item includes the majorAxisOffset
+        var curDistance:Number = majorAxisOffset;
+        if (distance < curDistance)
+            return 0;
+
         var index:int = -1;
         var block:Block = null;
         var blockGap:Number = _gap * BLOCK_SIZE;


touch so it has a later date than the framework's version

--- frameworks/as/src/mx/states/AddItems.as
+++ frameworks/as/src/mx/states/AddItems.as
@@ -17,7 +17,9 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-// shim the mx classes for states
+// shim the mx classes for states.  Be careful about updates to the main SDK's
+// version as that will move the timestamp ahead of this one and then it will
+// take precedence over this one at link time.
 package mx.states
 {
     import org.apache.flex.core.IDocument;


OFC-528 User with role DATA_ENTRY can edit records in phase 2 and 3. He can even reject the record\!\!\!

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/DropDownInputFieldPresenter.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/presenter/DropDownInputFieldPresenter.as
@@ -135,7 +135,7 @@
 				item = getItem(_view.defaultValue);
 			}
 			contextMenu.updateItems();
-			_view.editable = Application.activeRecord.step != CollectRecord$Step.ANALYSIS;
+			_view.editable = Application.activeRecordEditable;
 			_view.dropDownList.selectedItem = item;
 			_view.hasRemarks = hasRemarks;
 		}


Signal.removeAll() now clears the onceListeners Dictionary. Thanks to Thomas Brekelmans for the tip.

git-svn-id: 9085b6c627c116a57de1019657806a8c000cc042@16 6e9afafe-9be5-11de-811b-9ff18243e0fd

--- src/com/robertpenner/signals/Signal.as
+++ src/com/robertpenner/signals/Signal.as
@@ -71,6 +71,7 @@
 		public function removeAll():void
 		{
 			listeners.length = 0;
+			onceListeners = new Dictionary();
 		}

 		/** @inheritDoc */


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkCheckBoxAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkCheckBoxAutomationImpl.as
@@ -0,0 +1,114 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.automation.delegates.components
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+
+	import spark.automation.delegates.components.supportClasses.SparkToggleButtonBaseAutomationImpl;
+	import spark.components.CheckBox;
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  CheckBox control.
+	 *
+	 *  @see spark.components.CheckBox
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class SparkCheckBoxAutomationImpl extends SparkToggleButtonBaseAutomationImpl
+	{
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(spark.components.CheckBox, SparkCheckBoxAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 * @param obj CheckBox object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		private var _checkBox:CheckBox;
+		public function SparkCheckBoxAutomationImpl(obj:spark.components.CheckBox)
+		{
+			super(obj);
+			_checkBox = obj;
+		}
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected function get chk():spark.components.CheckBox
+		{
+			return _checkBox as spark.components.CheckBox;
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden properties
+		//
+		//--------------------------------------------------------------------------
+
+		//----------------------------------
+		//  automationValue
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationValue():Array
+		{
+			var result:String = chk.selected ? "[X]" : "[ ]";
+			if (chk.label || chk.toolTip)
+				result += " " + (chk.label || chk.toolTip);
+			return [ result ];
+		}
+
+	}
+}


- error handling for stream time

- error handling for stream time

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -64,7 +64,11 @@
 		}

 		public function currentTime():Number {
-			return _stream.time;
+			if (_stream != null) {
+				return _stream.time;
+			} else {
+				return 0;
+			}
 		}

 		// (1) load()


Disable pen icon while game is running

Disable pen icon while game is running

--- src/LevelStates/LevelState.as
+++ src/LevelStates/LevelState.as
@@ -565,7 +565,7 @@

 			switch (mode) {
 				case MODE_CONNECT:
-					if (listOpen == LIST_NONE)
+					if (listOpen == LIST_NONE && !time.moment)
 						newGraphic = _pen_cursor;
 					break;
 				case MODE_REMOVE:


修复空字符串导致序列化为错误的文本格式的bug

修复空字符串导致序列化为错误的文本格式的bug

--- as3/com/netease/protobuf/TextFormat.as
+++ as3/com/netease/protobuf/TextFormat.as
@@ -275,7 +275,7 @@
 			} else {
 				output.writeUTFBytes(printSetting.simpleFieldSeperator)
 				const stringValue:String = value as String
-				if (stringValue) {
+				if (stringValue !== null) {
 					printString(output, stringValue)
 				} else {
 					const enumFieldDescriptor:FieldDescriptor$TYPE_ENUM =


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

--- frameworks/projects/mobilecomponents/src/spark/transitions/ZoomViewTransition.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/ZoomViewTransition.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2010 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  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
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      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: 21811
Author:   chiedozi@adobe.com
Date:     2011-08-04T04:12:41.617040Z

Log Message:
-----------
Added a divider to SplitViewNavigatorSkin.  Added a getViewNavigatorAt() method to SplitViewNavigator and removed the firstViewNavigator and secondViewNavigator properties.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SplitViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SplitViewNavigator.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/SplitViewNavigatorSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/SplitViewNavigatorSkin.as
@@ -90,7 +90,11 @@
     {
         // Create the layout for the content group
         var hLayout:HorizontalLayout = new HorizontalLayout();
-        hLayout.gap = 0;
+
+        // A gap of 1 is used to reveal a thin line of the background between
+        // each child navigator.  This serves as a divider.  To change the look
+        // of the divider, change the backgroundColor style.
+        hLayout.gap = 1;

         // Create the contentGroup
         contentGroup = new Group();
@@ -127,5 +131,17 @@
         contentGroup.setLayoutBoundsSize(unscaledWidth, unscaledHeight);
         contentGroup.setLayoutBoundsPosition(0, 0);
     }
+
+    /**
+     *  @private
+     */
+    override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        // Background is used to draw the divider between each navigator
+        var color:uint = getStyle("backgroundColor");
+        graphics.beginFill(color);
+        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+        graphics.endFill();
+    }
 }
 }


Get arguments for the ROM

Get arguments for the ROM

--- index.as
+++ index.as
@@ -55,42 +55,10 @@
 let L: *uint8 = (&HL as *uint8) + 0;
 let SP: uint16 = 0;

-def main() {
+def main(argc: int32, argv: *str, environ: *str) {
   init();

-  // open_rom("./bgblogo.gb");
-
-  // open_rom("./missile-command.gb");
-  open_rom("./tetris.gb");
-  // open_rom("./opus5.gb");
-  // open_rom("./dr-mario.gb");
-  // open_rom("./boxxle.gb");
-  // open_rom("./super-mario-land.gb");
-  // open_rom("./asteroids.gb");
-  // open_rom("./dragon-slayer.gb");
-
-  // Are you sure it's executing correctly? You can test the blargg ROM
-  // without any graphics by storing the last byte written to 0xFF01 and
-  // printing the ASCII character written there to a console window if
-  // the byte 0x81 is written to 0xFF02. Also, the main test Roms
-  // won't execute properly without MBC1 support, but the individual
-  // Roms will work fine.
-
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/02-interrupts.gb");
-
-  // PASS
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/01-special.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/03-op sp,hl.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/04-op r,imm.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/05-op rp.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/06-ld r,r.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/07-jr,jp,call,ret,rst.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/08-misc instrs.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/09-op r,r.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/10-bit ops.gb");
-  // open_rom("/Users/mehcode/Workspace/gb-test-roms/cpu_instrs/individual/11-op a,(hl).gb");
-
-  // open_rom("../gb-test-roms/halt_bug.gb");
+  open_rom(*(argv + 1));

   dump_rom();

@@ -101,7 +69,7 @@
   fini();
 }

-main();
+// main();

 def init() {
   sdl_init();
@@ -337,8 +305,8 @@
   // Video RAM: $8000 – $9FFF
   if (address & 0xF000) <= 0x9000 {
     // VRAM can be accessed as long as we're not mode 3
-    let mode = mmu_read8(0xFF41) & 3;
-    if mode == 3 { return; }
+    // let mode = mmu_read8(0xFF41) & 3;
+    // if mode == 3 { return; }

     // GPU VRAM
     *(vram + (address & 0x1FFF)) = value;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/automation/src/mx/automation/delegates/controls/AlertAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/controls/AlertAutomationImpl.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.automation.delegates.controls
+{
+	import flash.display.DisplayObject;
+
+	import mx.automation.Automation;
+	import mx.automation.IAutomationObject;
+	import mx.automation.delegates.containers.PanelAutomationImpl;
+	import mx.controls.Alert;
+	import mx.core.mx_internal;
+	import mx.controls.Button;
+
+	use namespace mx_internal;
+
+
+
+	[Mixin]
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the Alert control.
+	 *
+	 *  @see mx.controls.Alert
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class AlertAutomationImpl extends PanelAutomationImpl
+	{
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(Alert, AlertAutomationImpl);
+		}
+
+		/**
+		 *  Constructor.
+		 * @param obj Alert object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function AlertAutomationImpl(obj:Alert)
+		{
+			super(obj);
+			alert = obj;
+		}
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected var alert:Alert;
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden properties
+		//
+		//--------------------------------------------------------------------------
+
+		//----------------------------------
+		//  automationName
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get automationName():String
+		{
+			return alert.title || super.automationName;
+		}
+
+		//----------------------------------
+		//  numAutomationChildren
+		//----------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function get numAutomationChildren():int
+		{
+			return super.numAutomationChildren + alert.alertForm.buttons.length;
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function getAutomationChildAt(index:int):IAutomationObject
+		{
+			if (index < super.numAutomationChildren)
+				return super.getAutomationChildAt(index);
+
+			var button:Button = alert.alertForm.buttons[index - super.numAutomationChildren] as Button;
+			return button as IAutomationObject;
+		}
+
+
+		/**
+		 * @private
+		 */
+		override public function getAutomationChildren():Array
+		{
+			// get the basic children
+			var childList:Array = new Array();
+			var tempArray1:Array = super.getAutomationChildren();
+			var n:int = 0;
+			var i:int = 0
+			if (tempArray1)
+			{
+				n = tempArray1.length;
+				for(i = 0; i < n ; i++)
+				{
+					childList.push(tempArray1[i]);
+				}
+			}
+
+			// get the buttons on the form
+			var tempArray:Array =  alert.alertForm.buttons;
+			n = tempArray?tempArray.length:0;
+
+			for (i = 0; i< n ; i++)
+			{
+				childList.push(tempArray[i]);
+			}
+
+			return childList;
+		}
+	}
+}


Fix anonymous rooms; more JID escaping fallout

--- src/org/jivesoftware/xiff/conference/Room.as
+++ src/org/jivesoftware/xiff/conference/Room.as
@@ -1148,7 +1148,7 @@
 	  		else if( aPresence.type != Presence.UNAVAILABLE_TYPE )
 	  		{
 		 		// We didn't know about this occupant yet, so we add them, then let everyone know that we did.
-		 		addItem( new RoomOccupant(userNickname, aPresence.show, item.affiliation, item.role, item.jid.unescaped, this) );
+		 		addItem( new RoomOccupant(userNickname, aPresence.show, item.affiliation, item.role, item.jid ? item.jid.unescaped : null, this) );

 				e = new RoomEvent(RoomEvent.USER_JOIN);
 				e.nickname = userNickname;


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

--- frameworks/projects/automation_dmv/src/mx/automation/delegates/advancedDataGrid/AdvancedDataGridGroupItemRendererAutomationImpl.as
+++ frameworks/projects/automation_dmv/src/mx/automation/delegates/advancedDataGrid/AdvancedDataGridGroupItemRendererAutomationImpl.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.automation.delegates.advancedDataGrid
 {


Test for copying Array in CompositeCloneableClass.

--- dolly-framework/src/test/actionscript/dolly/CopyingOfCompositeCopyableClassTest.as
+++ dolly-framework/src/test/actionscript/dolly/CopyingOfCompositeCopyableClassTest.as
@@ -9,7 +9,14 @@
 import org.as3commons.reflect.Field;
 import org.as3commons.reflect.Type;
 import org.flexunit.asserts.assertEquals;
+import org.flexunit.asserts.assertFalse;
 import org.flexunit.asserts.assertNotNull;
+import org.hamcrest.assertThat;
+import org.hamcrest.collection.array;
+import org.hamcrest.collection.arrayWithSize;
+import org.hamcrest.collection.everyItem;
+import org.hamcrest.core.isA;
+import org.hamcrest.object.equalTo;

 use namespace dolly_internal;

@@ -40,5 +47,17 @@
 		assertNotNull(writableFields);
 		assertEquals(4, writableFields.length);
 	}
+
+	[Test]
+	public function copyingOfArray():void {
+		const copy:CompositeCopyableClass = Copier.copy(compositeCopyableClass);
+
+		assertNotNull(copy.array);
+		assertThat(copy.array, arrayWithSize(5));
+		assertThat(copy.array, compositeCopyableClass.array);
+		assertFalse(copy.array == compositeCopyableClass.array);
+		assertThat(copy.array, everyItem(isA(Number)));
+		assertThat(copy.array, array(equalTo(1), equalTo(2), equalTo(3), equalTo(4), equalTo(5)));
+	}
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 21629
Author:   jasonsj@adobe.com
Date:     2011-07-19T23:02:20.729244Z

Log Message:
-----------
Callout
* CalloutPosition.AUTO support with automatic re-positioning/nudging (similar to PopUpAnchor)
* Fixed arrow positioning when scaling
* Fixed centering arrow on owner when owner is off screen
* Updated skins to XD design

CalloutButton
* Proxy properties before Callout is created
* Create Callout as a dynamic skin part

Skins
* CalloutViewNavigatorSkin and CalloutActionBarSkin to support ViewNavigators in Callouts
* Allow ActionBar borderClass to be optional

QE notes: Ready for visual review
Doc notes:
Bugs:
Reviewer: chiedozi
Tests run: checkintests, mustella-mobile
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutViewNavigatorSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/CalloutContentBackground.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/Callout.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutViewNavigatorSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutViewNavigatorSkin.as
@@ -0,0 +1,208 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2011 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.skins.mobile
+{
+
+import mx.core.DPIClassification;
+import mx.core.mx_internal;
+
+import spark.components.ActionBar;
+import spark.components.Group;
+import spark.components.ViewNavigator;
+import spark.core.SpriteVisualElement;
+import spark.skins.mobile160.assets.CalloutContentBackground;
+import spark.skins.mobile240.assets.CalloutContentBackground;
+import spark.skins.mobile320.assets.CalloutContentBackground;
+
+use namespace mx_internal;
+
+/**
+ *  The ActionScript-based skin for view navigators inside a callout.
+ *  This skin lays out the action bar and content
+ *  group in a vertical fashion, where the action bar is on top.
+ *  Unlike the default skin, overlay modes are not supported.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3
+ *  @productversion Flex 4.5.2
+ */
+public class CalloutViewNavigatorSkin extends ViewNavigatorSkin
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    public function CalloutViewNavigatorSkin()
+    {
+        super();
+
+        switch (applicationDPI)
+        {
+            case DPIClassification.DPI_320:
+            {
+                contentBackgroundClass = spark.skins.mobile320.assets.CalloutContentBackground;
+                contentCornerRadius = 10;
+                gap = 20;
+                break;
+            }
+            case DPIClassification.DPI_240:
+            {
+                contentBackgroundClass = spark.skins.mobile240.assets.CalloutContentBackground;
+                contentCornerRadius = 7;
+                gap = 15;
+                break;
+            }
+            default:
+            {
+                // default DPI_160
+                contentBackgroundClass = spark.skins.mobile160.assets.CalloutContentBackground;
+                contentCornerRadius = 5;
+                gap = 10;
+                break;
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Layout variables
+    //
+    //--------------------------------------------------------------------------
+
+    mx_internal var gap:Number;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    mx_internal var contentBackgroundClass:Class;
+
+    mx_internal var contentBackgroundGraphic:SpriteVisualElement;
+
+    mx_internal var contentCornerRadius:Number;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        contentBackgroundGraphic = new contentBackgroundClass() as SpriteVisualElement;
+        addChild(contentBackgroundGraphic);
+
+        super.createChildren();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        measuredWidth = Math.max(actionBar.getPreferredBoundsWidth(),
+            contentGroup.getPreferredBoundsWidth());
+        measuredHeight = actionBar.getPreferredBoundsHeight()
+            + contentGroup.getPreferredBoundsHeight()
+            + gap;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitCurrentState():void
+    {
+        super.commitCurrentState();
+
+        // Force a layout pass on the components
+        invalidateProperties();
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        // omit super call
+
+        var actionBarHeight:Number = 0;
+
+        // The action bar is always placed at 0,0 and stretches the entire
+        // width of the navigator
+        if (actionBar.includeInLayout)
+        {
+            actionBarHeight = Math.min(actionBar.getPreferredBoundsHeight(), unscaledHeight);
+            setElementSize(actionBar, unscaledWidth, actionBarHeight);
+            setElementPosition(actionBar, 0, 0);
+            actionBarHeight = actionBar.getLayoutBoundsHeight();
+        }
+
+        if (contentGroup.includeInLayout)
+        {
+            // If the hostComponent is in overlay mode, the contentGroup extends
+            // the entire bounds of the navigator and the alpha for the action
+            // bar changes
+            // If this changes, also update validateEstimatedSizesOfChild
+            var contentGroupHeight:Number = Math.max(unscaledHeight - actionBarHeight - gap, 0);
+
+            setElementSize(contentGroup, unscaledWidth, contentGroupHeight);
+            setElementPosition(contentGroup, 0, actionBarHeight + gap);
+
+            setElementSize(contentBackgroundGraphic, unscaledWidth, contentGroupHeight);
+            setElementPosition(contentBackgroundGraphic, 0, actionBarHeight + gap);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.drawBackground(unscaledWidth, unscaledHeight);
+
+        // draw the contentBackgroundColor
+        // the shading and highlight are drawn in FXG
+        var contentEllipseSize:Number = contentCornerRadius * 2;
+        var contentBackgroundAlpha:Number = getStyle("contentBackgroundAlpha");
+
+        graphics.beginFill(getStyle("contentBackgroundColor"),
+            contentBackgroundAlpha);
+        graphics.drawRoundRect(contentBackgroundGraphic.getLayoutBoundsX(),
+            contentBackgroundGraphic.getLayoutBoundsY(),
+            contentBackgroundGraphic.getLayoutBoundsWidth(),
+            contentBackgroundGraphic.getLayoutBoundsHeight(),
+            contentEllipseSize,
+            contentEllipseSize);
+        graphics.endFill();
+
+        contentBackgroundGraphic.alpha = contentBackgroundAlpha;
+    }
+}
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2011 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
 package spark.skins.mobile
 {
 import flash.display.Graphics;


Transferred from the Adobe Open Source Subversion Repository

Revision: 2509
Author:   chaase@adobe.com
Date:     2008-07-16T17:27:37.792321Z

Log Message:
-----------
New Resize effect that works with Flex4 components as well as GraphicElement objects. Minor fixes to infrastructure classes (mostly the new effects classes, but also SetProperty) as necessary, plus a minor bugfix for the old Resize effect.
As with the other 'new effects', triggers are non-functional for now, but manual playing and transitions using the effects should work.
checkintests: passed
reviewer: Jason S.

Modified Paths:
--------------
<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/manifest.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/NewEffects.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetProperty.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/AddAction.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/effects/effectClasses/AnimatePropertiesInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/RemoveActionInstance.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/flex/effects/AnimateProperties.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/RemoveAction.as</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/RemoveActionInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/RemoveActionInstance.as
@@ -15,6 +15,8 @@
 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
 import flash.events.Event;
+
+import flex.core.Group;

 import mx.core.mx_internal;
 import mx.effects.effectClasses.ActionEffectInstance;
@@ -95,7 +97,7 @@

     private function addChild(container:*, child:*):void
     {
-        if (hasParent)
+        if (hasParent && !(container is Group))
            container.addChild(child);
         else
            container.addItem(child);
@@ -103,7 +105,7 @@

     private function removeChild(container:*, child:*):void
     {
-        if (hasParent)
+        if (hasParent && !(container is Group))
            container.removeChild(child);
         else
            container.removeItem(child);
@@ -111,7 +113,7 @@

     private function addChildAt(container:*, child:*, index:int):void
     {
-        if (hasParent)
+        if (hasParent && !(container is Group))
            container.addChildAt(child, index);
         else
            container.addItemAt(child, index);
@@ -119,7 +121,7 @@

     private function getChildIndex(container:*, child:*):int
     {
-        if (hasParent)
+        if (hasParent && !(container is Group))
            return container.getChildIndex(child);
         else
            return container.getItemIndex(child);


OPEN - issue REPRISE-55: Complete API documentation for core classes: UIObject, UIComponent, DocumentView, Application and UIRendererFactory
http://j.fork.de:8080/browse/REPRISE-55

	- doc: completed documentation of public methods in Application

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

--- src/reprise/core/Application.as
+++ src/reprise/core/Application.as
@@ -54,10 +54,45 @@
 		/***************************************************************************
 		*							public methods								   *
 		***************************************************************************/
+		public function Application()
+		{
+			if (stage)
+			{
+				initialize();
+			}
+			else
+			{
+				addEventListener(Event.ADDED_TO_STAGE, self_addedToStage, false, 0, true);
+			}
+		}
+
+		/**
+		 * Returns the URL of the SWF file this application is associated with
+		 *
+		 * @return The URL of the SWF file this application is associated with
+		 */
 		public function applicationURL() : String
 		{
 			return loaderInfo.url;
 		}
+
+		/**
+		 * Returns the base path part of the URL of the SWF file this application is associated with
+		 *
+		 * @return The base path part of the URL of the SWF file this application is associated with
+		 */
+		public function basePath() : String
+		{
+			return PathUtil.stringByDeletingLastPathComponent(stage.loaderInfo.url);
+		}
+
+		/**
+		 * Returns the complete current location String of the browser content the application is
+		 * embedded in
+		 *
+		 * @return The current location String of the browser or an empty String
+		 * @see https://developer.mozilla.org/en/DOM/window.location
+		 */
 		public function browserLocation() : String
 		{
 			if (ExternalInterface.available)
@@ -76,31 +111,20 @@
 			return '';
 		}

+		/**
+		 * Returns the DocumentView acting as the root element of the Applications view structure
+		 *
+		 * @return The DocumentView acting as the root element of the Applications view structure
+		 */
 		public function rootElement() : DocumentView
 		{
 			return m_rootElement;
 		}

-		public function basePath() : String
-		{
-			return PathUtil.stringByDeletingLastPathComponent(stage.loaderInfo.url);
-		}
-

 		/***************************************************************************
 		*							protected methods								   *
 		***************************************************************************/
-		public function Application()
-		{
-			if (stage)
-			{
-				initialize();
-			}
-			else
-			{
-				addEventListener(Event.ADDED_TO_STAGE, self_addedToStage, false, 0, true);
-			}
-		}
 		protected function self_addedToStage(event : Event) : void
 		{
 			removeEventListener(Event.ADDED_TO_STAGE, self_addedToStage);


Fixed JS version of WebBrowser to intercept correct location change events and dispatch proper FlexJS event.

--- frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/WebBrowserView.as
+++ frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/WebBrowserView.as
@@ -168,7 +168,7 @@
 			model.addEventListener("urlChanged", loadPage);

 			var iframe:HTMLIFrameElement = (host as UIBase).element as HTMLIFrameElement;
-			iframe.addEventListener("pageshow", handlePageShow, false);
+			iframe.addEventListener("load", handlePageShow, false);
 		}

 		/**