Transferred from the Adobe Open Source Subversion Repository

Revision: 4332
Author:   hmuller@adobe.com
Date:     2008-12-16T23:47:06.628431Z

Log Message:
-----------
Added prototype virtualization support for VerticalLayout and DataGroup.

More information here: https://zerowing.corp.adobe.com/display/flex/Virtualization

QE Notes: Should not effect existing tests
Doc Notes: None
Bugs:
Reviewer: Ryan

Modified Paths:
--------------
<path kind="file" action="A">/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/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -18,10 +18,10 @@
 import flash.events.EventDispatcher;

 import mx.components.baseClasses.GroupBase;
+import mx.containers.utilityClasses.Flex;
 import mx.core.ScrollUnit;
-
-import mx.containers.utilityClasses.Flex;
 import mx.events.PropertyChangeEvent;
+import mx.layout.LinearLayoutVector;

 /**
@@ -119,6 +119,7 @@
             return;

         _gap = value;
+        llv.gap = value;
         invalidateTargetSizeAndDisplayList();
     }

@@ -255,6 +256,8 @@
             return _rowHeight;
         else if (!target || (target.numLayoutElements <= 0))
             return 0;
+        else if (typicalLayoutElement)
+            return typicalLayoutElement.getPreferredHeight();
         else
             return target.getLayoutElementAt(0).getPreferredHeight();
     }
@@ -398,6 +401,8 @@
     //  Methods
     //
     //--------------------------------------------------------------------------
+
+    private var llv:LinearLayoutVector = new LinearLayoutVector();

 	/**
 	 *  An index is "in view" if the corresponding non-null layout element is
@@ -428,29 +433,43 @@
 	    if ((index < 0) || (index >= g.numLayoutElements))
 	       return 0.0;

-        var li:ILayoutElement = g.getLayoutElementAt(index);
-        if ((li == null) || !li.includeInLayout)
-            return 0.0;
-
         if (!clipContent)
             return 1.0;

+
         var r0:int = firstIndexInView;
         var r1:int = lastIndexInView;

         // outside the visible index 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 Y and Height
+	    var eltY:Number;
+	    var eltHeight:Number;
+	    if (virtualLayout)
+	    {
+	        eltY = llv.start(index);
+	        eltHeight = llv.getMajorSize(index);
+	    }
+	    else
+	    {
+            var elt:ILayoutElement = g.getLayoutElementAt(index);
+            if (!elt || !elt.includeInLayout)
+                return 0.0;
+            eltY = elt.getLayoutPositionY();
+            eltHeight = elt.getLayoutHeight();
+	    }
+
         // index is first (r0) or last (r1) visible row
         var y0:Number = g.verticalScrollPosition;
         var y1:Number = y0 + g.height;
-        var iy0:Number = li.getLayoutPositionY();
-        var iy1:Number = iy0 + li.getLayoutHeight();
+        var iy0:Number = eltY;
+        var iy1:Number = iy0 + eltHeight;
         if (iy0 >= iy1)  // element has 0 or negative height
             return 1.0;
         if ((iy0 >= y0) && (iy1 <= y1))
@@ -555,10 +574,20 @@
         }

         // TBD: special case for variableRowHeight false
-
-        var i0:int = findIndexAt(y0 + gap, gap, g, 0, n);
-        var i1:int = findIndexAt(y1, gap, g, 0, n);
-
+
+        var i0:int;
+        var i1:int;
+        if (virtualLayout)
+        {
+            i0 = llv.indexOf(y0);
+            i1 = llv.indexOf(y1);
+        }
+        else
+        {
+            i0 = findIndexAt(y0 + gap, gap, g, 0, n);
+            i1 = findIndexAt(y1, gap, g, 0, n);
+        }
+
         // Special case: no element overlaps y0, is index 0 visible?
         if (i0 == -1)
         {
@@ -586,7 +615,9 @@
                     i1 = index1;
             }
         }
-
+        if (virtualLayout)
+            updateDisplayListInView(i0);  // TBD returns i1
+
         setIndexInView(i0, i1);
     }

@@ -596,15 +627,20 @@
      *
      *  @private
      */
-    private static function layoutElementBounds(g:GroupBase, i:int):Rectangle
-    {
-        var element:ILayoutElement = g.getLayoutElementAt(i);
-        if (element && element.includeInLayout)
-        {
-            return new Rectangle(element.getLayoutPositionX(),
-                                 element.getLayoutPositionY(),
-                                 element.getLayoutWidth(),
-                                 element.getLayoutHeight());
+    private function layoutElementBounds(g:GroupBase, i:int):Rectangle
+    {
+        if (virtualLayout)
+            return llv.getBounds(i);
+        else
+        {
+            var element:ILayoutElement = g.getLayoutElementAt(i);
+            if (element && element.includeInLayout)
+            {
+                return new Rectangle(element.getLayoutPositionX(),
+                                     element.getLayoutPositionY(),
+                                     element.getLayoutWidth(),
+                                     element.getLayoutHeight());
+            }
         }
         return null;
     }
@@ -745,7 +781,7 @@
         var maxDelta:Number = g.contentHeight - scrollR.height - scrollR.y;
         var minDelta:Number = -scrollR.y;
         return Math.min(maxDelta, Math.max(minDelta, delta));
-    }
+    }

     private function variableRowHeightMeasure(layoutTarget:GroupBase):void
     {
@@ -842,6 +878,36 @@
     }

+    /**
+     *  @private
+     *  Compute potentially approximate values for measuredWidth,Height and
+     *  measuredMinWidth,Height.
+     *
+     *  If requestedRows is specified, then measure and cache the dimensions of
+     *  the first requestedRows.
+     *
+     *  Otherwise all dimensions are based exclusively on the values already
+     *  cached in llv.
+     *
+     *  Note that the llv's defaultMajorSize, minorSize, and minMinorSize are
+     *  based on typicalLayoutElement.
+     */
+    private function virtualRowHeightMeasure(layoutTarget:GroupBase):void
+    {
+        var rowCount:uint = layoutTarget.numLayoutElements;
+        llv.length = rowCount;
+        llv.defaultMajorSize = typicalLayoutElement.getPreferredHeight();
+        llv.minorSize = typicalLayoutElement.getPreferredWidth();
+
+        var measuredRowCount:int = (requestedRowCount != -1) ? requestedRowCount : rowCount;
+        layoutTarget.measuredWidth = llv.minorSize;
+        layoutTarget.measuredHeight =  llv.end(measuredRowCount - 1);
+
+        layoutTarget.measuredMinWidth = layoutTarget.measuredWidth;
+        layoutTarget.measuredMinHeight = layoutTarget.measuredHeight;
+    }
+
+
     override public function measure():void
     {
         super.measure();
@@ -849,14 +915,152 @@
     	var layoutTarget:GroupBase = target;
         if (!layoutTarget)
             return;
-        if (variableRowHeight)
+        if (virtualLayout)
+            virtualRowHeightMeasure(layoutTarget);
+        else if (variableRowHeight)
             variableRowHeightMeasure(layoutTarget);
         else
             fixedRowHeightMeasure(layoutTarget);

     }

-
+    //  - virtual layout only -
+    private function calculateElementX(elt:ILayoutElement, eltWidth:Number, contentWidth:Number):Number
+    {
+       switch(horizontalAlign)
+       {
+           case HorizontalAlign.CENTER:
+               return (contentWidth - eltWidth) * 0.5;
+           case HorizontalAlign.RIGHT:
+               return contentWidth - eltWidth;
+       }
+       return 0;
+    }
+
+    //  - virtual layout only -
+    private function calculateElementWidth(elt:ILayoutElement, targetWidth:Number, contentWidth:Number):Number
+    {
+       // If percentWidth is specified then the element's width is the percentage
+       // of targetWidth clipped to min/maxWidth and to (upper limit) targetWidth.
+       var percentWidth:Number = elt.percentWidth;
+       if (!isNaN(percentWidth))
+       {
+          var width:Number = percentWidth * 0.01 * targetWidth;
+          return Math.min(targetWidth, Math.min(elt.getMaxWidth(), Math.max(elt.getMinWidth(), width)));
+       }
+       switch(horizontalAlign)
+       {
+           case HorizontalAlign.JUSTIFY:
+               return targetWidth;
+           case HorizontalAlign.CONTENT_JUSTIFY:
+               return contentWidth;
+       }
+       return elt.getPreferredWidth();
+    }
+
+    /**
+     *  @private
+     *  Update the layout of the virtualized elements that are within
+     *  the scrollRect's vertical extent.
+     *
+     *  The height of each layout element will be its preferred height, and its
+     *  y will be the bottom of the previous item, plus the gap.
+     *
+     *  No support for percentHeight, includeInLayout=false, or null layoutElements,
+     *
+     *  The width of each layout element will be set to its preferred width, unless
+     *  one of the following is true:
+     *
+     *  - If percentWidth is specified for this element, then its width will be the
+     *  specified percentage of the target's actual (unscaled) width, clipped
+     *  the layout element's minimum and maximum width.
+     *
+     *  - If horizontalAlign is "justify", then the element's width will
+     *  be set to the target's actual (unscaled) width.
+     *
+     *  - If horizontalAlign is "contentJustify", then the element's width
+     *  will be set to the target's content width.
+     *
+     *  The X coordinate of each layout element will be set to 0 unless one of the
+     *  following is true:
+     *
+     *  - If horizontalAlign is "center" then x is set so that the element's preferred
+     *  width is centered within the contentWidth:
+     *      x = (contentWidth - layoutElementWidth) * 0.5
+     *
+     *  - If horizontalAlign is "right" the x is set so that the element's right
+     *  edge is aligned with the the right edge of the content:
+     *      x = (contentWidth - layoutElementWidth)
+     *
+     *  Implementation note: unless horizontalAlign is either "justify" or
+     *  "left", the layout elements' x or width depends on the contentWidth.
+     *  The contentWidth 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 contentWidth
+     *  for the initial layout and then, if it has changed, we loop through
+     *  the layout items again and fix up the x/width values.
+     */
+    private function updateDisplayListInView(startIndex:int = -1):void
+    {
+        var layoutTarget:GroupBase = target;
+        var eltCount:int = layoutTarget.numLayoutElements;
+        var targetWidth:Number = layoutTarget.width;
+        var minVisibleY:Number = layoutTarget.verticalScrollPosition;
+        var maxVisibleY:Number = minVisibleY + layoutTarget.height;
+
+        // TBD: don't assume typicalLayoutElement is set, use 1st row...
+        var typicalWidth:Number = typicalLayoutElement.getPreferredWidth();
+        var typicalHeight:Number = typicalLayoutElement.getPreferredHeight();
+        llv.length = layoutTarget.numLayoutElements;
+        llv.minorSize = Math.max(llv.minorSize, typicalWidth);
+        llv.defaultMajorSize = typicalHeight;
+        if (startIndex < 0)
+            startIndex = llv.indexOf(minVisibleY);
+
+        layoutTarget.beginVirtualLayout(startIndex);
+        var contentWidth:Number = llv.minorSize;
+        var y:Number = llv.start(startIndex);
+        var index:int = startIndex;
+
+        // First pass: compute element x,y,width,height based on
+        // current contentWidth; cache computed widths/heights in llv.
+        for (; (y < maxVisibleY) && (index < eltCount); index++)
+        {
+            var elt:ILayoutElement = layoutTarget.getLayoutElementAt(index);
+            var h:Number = elt.getPreferredHeight();
+            var w:Number = calculateElementWidth(elt, targetWidth, contentWidth);
+            var x:Number = calculateElementX(elt, w, contentWidth);
+            elt.setLayoutPosition(x, y);
+            elt.setLayoutSize(w, elt.getPreferredHeight());
+            llv.cacheDimensions(index, elt);
+            y += h + gap;
+        }
+
+        // Second pass: if neccessary, fix up x and width values based
+        // on the updated contentWidth
+        var endIndex:int = index - 1;
+        var finalContentWidth:Number = llv.minorSize;
+        if ((finalContentWidth != contentWidth) &&
+            (horizontalAlign != HorizontalAlign.LEFT) &&
+            (horizontalAlign != HorizontalAlign.JUSTIFY))
+        {
+            contentWidth = finalContentWidth;
+            for (index = startIndex; index < eltCount; index++)
+            {
+                elt = layoutTarget.getLayoutElementAt(index);
+                w = calculateElementWidth(elt, targetWidth, contentWidth);
+                x = calculateElementX(elt, w, contentWidth);
+                elt.setLayoutPosition(x, elt.getLayoutPositionY());
+                elt.setLayoutSize(w, elt.getLayoutHeight());
+            }
+        }
+        setRowCount(index - startIndex);
+        setIndexInView(startIndex, endIndex);
+        layoutTarget.setContentSize(contentWidth, llv.end(llv.length - 1));
+        layoutTarget.endVirtualLayout(startIndex, endIndex);
+    }
+
+
     override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
         super.updateDisplayList(unscaledWidth, unscaledHeight);
@@ -864,7 +1068,13 @@
     	var layoutTarget:GroupBase = target;
         if (!layoutTarget)
             return;
-
+
+        if (virtualLayout)
+        {
+            updateDisplayListInView();
+            return;
+        }
+
         var layoutElement:ILayoutElement;
         var count:uint = layoutTarget.numLayoutElements;

@@ -903,7 +1113,7 @@
             restrictedWidth = unscaledWidth;
         else if (horizontalAlign == HorizontalAlign.CONTENT_JUSTIFY)
             restrictedWidth = contentWidth;
-
+
         distributeHeight(unscaledWidth, unscaledHeight, restrictedWidth);

         // default to left (0)
@@ -937,10 +1147,11 @@
             // Set the layout element's position
             var x:Number = (contentWidth - layoutElement.getLayoutWidth()) * hAlign;
             layoutElement.setLayoutPosition(x, y);
-
+
             // Update maxX,Y, first,lastVisibleIndex, and y
             var dx:Number = layoutElement.getLayoutWidth();
             var dy:Number = layoutElement.getLayoutHeight();
+
             maxX = Math.max(maxX, x + dx);
             maxY = Math.max(maxY, y + dy);
             if (!clipContent ||


Transferred from the Adobe Open Source Subversion Repository

Revision: 7743
Author:   clucier@adobe.com
Date:     2009-06-11T13:53:10.203664Z

Log Message:
-----------
Moving away from using namespace qualifiers in most cases in the SDK.  We've run into a few cases now where the use of qualifiers in code that is called excessively can slow things down.
Bugs: SDK-21337
Reviewer: Ryan, Paul
QE Notes: None
Tests: Ran several random Mustella test groups, checkintests.

Modified Paths:
--------------
106 paths were modified

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

--- frameworks/projects/framework/src/mx/states/RemoveChild.as
+++ frameworks/projects/framework/src/mx/states/RemoveChild.as
@@ -16,6 +16,9 @@
 import flash.display.DisplayObjectContainer;

 import mx.core.UIComponent;
+import mx.core.mx_internal;
+
+use namespace mx_internal;

 /**
  *
@@ -182,7 +185,7 @@
             // Make sure any changes made while the child was removed are reflected
             // properly.
             if (obj is UIComponent)
-                UIComponent(target).mx_internal::updateCallbacks();
+                UIComponent(target).updateCallbacks();

             removed = false;
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 11472
Author:   mhorn@adobe.com
Date:     2009-11-05T19:21:49.242148Z

Log Message:
-----------
ASDoc edits for l10n bug fixes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSSelector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Image.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>

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

--- frameworks/projects/framework/src/mx/styles/CSSSelector.as
+++ frameworks/projects/framework/src/mx/styles/CSSSelector.as
@@ -98,11 +98,11 @@

     /**
      *  This selector may match a subset of components by specifying further
-     *  conditions, i.e. a matching component must have a particular id,
+     *  conditions (for example, a matching component must have a particular id,
      *  styleName (equivalent to a 'class' condition in CSS) or state
-     *  (equivalent to a 'pseudo' condition in CSS).
-     *
-     *  If no conditions are specified this property is null.
+     *  (equivalent to a 'pseudo' condition in CSS)).
+     *
+     *
If no conditions are specified, this property is null.

      *
      *  @return Array of CSSCondition specified for this selector.
      *
@@ -125,11 +125,11 @@
      *  the precedence when applying several matching style declarations. Note
      *  that id conditions contribute 100 points, pseudo and class conditions
      *  each contribute 10 points, types (including descendants in a chain of
-     *  selectors) contribute 1 point. Universal selectors (i.e. *) contribute
+     *  selectors) contribute 1 point. Universal selectors ("*") contribute
      *  nothing. The result is the sum of these contributions. Selectors with a
      *  higher specificity override selectors of lower specificity. If
      *  selectors have equal specificity, the declaration order determines
-     *  the precedence (i.e. the last one wins).
+     *  the precedence (the last one wins).
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -168,12 +168,12 @@

     /**
      *  The subject of this selector node (only). To get a String representation
-     *  of all conditions and descendants of this selector call the toString()
+     *  of all conditions and descendants of this selector call the toString()
      *  method.
      *
-     *  If this selector represents the root node of a potential chain of
+     *
If this selector represents the root node of a potential chain of
      *  selectors, the subject also represents the subject of the entire selector
-     *  expression.
+     *  expression.

      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -281,6 +281,8 @@
     }

     /**
+     *  Returns a String representation of this selector.
+     *
      *  @return A String representation of this selector including all of its
      *  syntax, conditions and ancestors.
      *


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/mx/src/mx/accessibility/TreeAccImpl.as
+++ frameworks/projects/mx/src/mx/accessibility/TreeAccImpl.as
@@ -30,6 +30,11 @@
 /**
  *  TreeAccImpl is a subclass of AccessibilityImplementation
  *  which implements accessibility for the Tree class.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class TreeAccImpl extends AccImpl
 {
@@ -106,6 +111,11 @@
 	 *  Afterwards, when instances of Tree are initialized,
 	 *  their accessibilityImplementation property
 	 *  will be set to an instance of this class.

+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public static function enableAccessibility():void
 	{
@@ -137,6 +147,11 @@
 	 *
 	 *  @param master The UIComponent instance that this AccImpl instance
 	 *  is making accessible.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function TreeAccImpl(master:UIComponent)
 	{


Transferred from the Adobe Open Source Subversion Repository

Revision: 15522
Author:   jszeto@adobe.com
Date:     2010-04-16T22:08:12.278608Z

Log Message:
-----------
ComboBox, DropDownList and PopUpAnchor bug fixes

http://bugs.adobe.com/jira/browse/SDK-25764 - ComboBox will not display first item in dataProvider when dropdown is open

The first item of the dataProvider was the object "Zero". This returns false in an equality check, so I changed the check to compare to undefiend

http://bugs.adobe.com/jira/browse/SDK-25765 - ComboBox does not commit item when closed if Enter key is pressed

Pressing Enter was actually clearing the selection. Fixed ComboBox.applySelection to only commit if the proposed selection is a custom string or if the dropdown is open

http://bugs.adobe.com/jira/browse/SDK-25432 - Spark DropDownList throws RTE when trying to change data provider and open dropdown and use mouse wheel

Added null check

http://bugs.adobe.com/jira/browse/SDK-25132 - Odd rendering of pop up when using PopUpAnchor w/ popUpPosition == center

Rounded off the x/y position of the popUp

QE notes: Add test for PopUpAnchor centered where popup dimensions are odd numbers
Doc notes: none
Bugs: SDK-25764, SDK-25765, SDK-25432, SDK-25132
Reviewer: Kevin
Tests run: checkintests, ComboBox, DropDownList, PopUpAnchor
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/ComboBox.as
+++ frameworks/projects/spark/src/spark/components/ComboBox.as
@@ -582,7 +582,7 @@
             else
                 setSelectedIndex(NO_SELECTION, true);
         }
-        else
+        else if (isDropDownOpen)
         {
             setSelectedIndex(actualProposedSelectedIndex, true);
         }
@@ -618,7 +618,7 @@
         // If selectedIndex was set to CUSTOM_SELECTED_ITEM, and no selectedItem was specified,
         // then don't change the selectedIndex
         if (_proposedSelectedIndex == CUSTOM_SELECTED_ITEM &&
-            !_pendingSelectedItem)
+            _pendingSelectedItem == undefined)
         {
             _proposedSelectedIndex = NO_PROPOSED_SELECTION;
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 8268
Author:   gosmith@adobe.com
Date:     2009-06-25T23:00:03.457046Z

Log Message:
-----------
Integrated TLF build 460. This integration required trivial framework changes due to two renamed APIs.

Build 460
---------

* PARB - TextFilter.as - TEXT_LAYOUT_FORMAT:String = "textLayoutformat" now defined as "textLayoutFormat"

* PARB - TextFlowLine/TextFlowLineLocation - now defined in flashx.textLayout.compose package and not flashx.textLayout.elements.

* PARB - IVJLine - renamed IVerticalJustificationLine

* PARB - IFlowComposer.as - removed hide/showSelection.  Code moved to SelectionManager

* PARB - StandardFlowComposer.as - removed implementation of hide/showSelection.

* PARB - IConfiguration.as/Configuration.as Link[XXX]FormatDefault are all now renamed defaultLink[XXX]Format.

* PARB - scrollDragDelay, scrollDragPixels,  scrollMouseWheelMultiplier are now all of type Number vs int

* PARB - FlowElement.as - FlowElement implements ITextLayoutFormat.  Renamed variables and comments as per PARB requirements.

* PARB - FlowGroupElement.as - renamed getChildAtIndex with getChildAt. addChild/ addChildAt/removeChild/removeChildAt all now return a FlowElement.

 PARB - InlineGraphicElement - float property now tlf_internal.

* PARB - LinkElement - link[XXX]FormatName constants are now declared in standard Flex/Flash format of LINK_XXX_FORMAT_NAME.

* PARB - ParagraphElement.as - removed terminator parameter from getText on paragraph.

* PARB - Updated relativePos references to relativePosition.

* PARB - LinkActiveFormat, LinkHoverFormat, and LinkNormalFormat now descend from TextLayoutFormat rather than TextLayoutFormatValueHolder.

* PARB - StatusChangeEvent.as - INLINE_GRAPHIC_STATUS_CHANGE now defined as "inlineGraphicStatusChanged"

* PARB - TextLineFactoryBase.as - contentBounds now called getContentBounds

* PARB - IEditManager/EditManager.as - insertInlineGraphic now takes an options:Object rather than a float:String. Updated comments to reflect change.

* PARB - ApplyLink first parameter is now href vs uriString.

* PARB - ParaEdit.as - createImage now takes options:Object rather than a float:String.  Default is NULL.  Updated comments to read "options - none supported"

* PARB - ISelectionManager/SelectionManager - renamed setSelection to selectRange and  removed default values.

* PARB - Added selectAll method which calls into selectRange.  Replaced all references to TextRangeUtil with NavigationUtil.

* PARB - ChangeElementIDOperation - renamed ApplyElementIDOperation

* PARB - ChangeElementStyleNameOperation - renamed ApplyElementStyleNameOperation

* PARB - SetUserStyleOperation - renamed ApplyElementUserStyleOperation

* PARB - ApplyFormatToElementOperation.as - reduced char/para/cont formats down to single format which is applied once.  Removed unneeded code to apply separately and replaced with single call.

* PARB - ApplyLinkOperation.as - added getters/setters for constructor parameters

* PARB - ApplyTCYOperation.as - added getters/setters for constructor parameters.  Renamed tcyOnValue to tcyValue.

* PARB - CutOperation.as - added getters/setters for constructor parameters

* PARB - DeleteTextOperation.as - added deleteSelectionState member var as well as getter/setter methods

* PARB - FlowElementOperation.as - added getters/setters for constructor parameters as well as storage member variables where needed.

* PARB - FlowOperation.as - added set method for textFlow member

* PARB - InsertInlineGraphicOperation/ModifyInlineGraphicOperation.as - replace all references to float with options and updated ASDoc comments.

* PARB - PasteOperation.as - added getters/setters for constructor parameter textScrap.

* Fix 2365281, 2365287 content bounds way off  (problem with logic to skip empty columns)

Build 459
---------

* PARB - Modify TextLayoutFormat/nullTabStopFormat.defaults(): make this be a static getter, rename it to defaultFormat, improve doc to make it clear it returns the same object repeatedly

Build 458
---------

* Fix 2362126 TLF SWCs should include debugging information (missing code hints for parameters)

* PARB - Rename nullTextLayoutFormat/nullTabStopFormat to emptyTextLayoutFormat/emptyTabStopFormat, move to tlf_internal

Build 456
---------

* Fix 2361076 Contents bounds appears offset for graphic in vertical direction.

* Fix 2360045 Content Bound is not drawn properly in the second container with multiple columns.

* Fix 2359786 Content Bounds need to resize with specified text alignment.

* Fix 2358780 When verticalAlign is "justify", the content bounds are wrong

* Fix 2357611 ContentBounds Open Issues (except for performance optimization)

* Fix 2359840 Scroll works only once by Dragging mouse or using arrow key.

* Fix SDK-21899 RTE on Spark TextArea when deleting text, setting text, and focusing TextArea

* Candidate fix for "Enter key problem"

Build 455
---------

* Fix 2358923 stripDiscretionaryHyphens being ignored by PlainTextExporter

* Fix 2358921 A final "\n" is being appended when exporting PLAIN_TEXT_FORMAT

* Rework fix for 2355912 to work with new plain text export behavior

Build 454
---------

* Fix 2356890 ContainerController.isDamaged always returns true

* Fix 2355912 Text copied from a TextFlow always has a newline at the end, even if the originally selected text did not

* Partial fix for  2357611 ContentBounds Open Issues (continued)
- RTL text incorrectly includes the paragraph terminator in its left side width in lineBreak="explicit" mode

Build 453
---------

* Fix 2357732 FlowComposer no longer swallows errors

* Partial fix for 2357611 ContentBounds Open Issues
- paragraphIndent “gap” changes missing from explicit.  In lineBreak=”toFit” changes were made to account for the paragraph indents.  They aren’t in the explicit case.
- No lines in parcel test (fix for bug 2523538) will incorrectly assume that a parcel containing zero height lines is empty.

* Change how scrolling & vertical alignment work together so that when scrolling is on, if there is more text than fits in the container, vertical alignment will use TOP even if MIDDLE or BOTTOM is specified. Behavior when the text fits or scrolling is off remains unchanged.

* Fix for 2343041, "[SDK-18884] scrolling issue when flow contains an image." Image was not being correctly included in the content area.

* Fix for 2353258, "[Flex SDK-21019] TextFlowTextLineFactory with columnCount=2 produces incorrect width."

* Fix compilation issue in ContextMenu example (update import statement for UndoManager to reflect its new namespace)

Build 452
---------
* Fix 2354401 TextContainerManager.getText doesn't clear _textDamaged

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: None

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/in/tlf/textLayout.swz</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/tlf/textLayout.swf</path>
<path kind="file" action="M">/flex/sdk/trunk/in/tlf/tlf.properties</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -886,7 +886,7 @@
             staticTextFlowFactory.createTextLines(addTextLine, _textFlow);
         }

-        bounds = factory.contentBounds;
+        bounds = factory.getContentBounds();
         _isTruncated = factory.isTruncated;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 6637
Author:   cframpto@adobe.com
Date:     2009-05-05T13:30:10.480422Z

Log Message:
-----------
Implement proxy model from SkinnableDataGroup in TextBase.  When the textView part is loaded, store all the properties in the textView.  When the textView part is unloaded, store them back in TextBase.  This eliminates the duplicate set of properties that were getting out of sync.  Text is the one exception to this since we only want to extract the text from the textFlow when it is absolutely necessary.

Fix misnamed tlf internal variable so pasting text with restrict, maxChars or displayAsPassword properties doesn't RTE.

QE Notes: all TextArea and TextInput tests pass except
Gumbo_TextInput_widthInChars_property_negative (passed in my test case so I need help from QA with this one)
Gumbo_TextInput_textView_widthInChars_5 (text needs to be revised since expected answer should be 5)
Gumbo_TextInput_textView_widthInChars_25 (test needs to be revised since expected answer should be 25)

Doc Notes:
Bugs: SDK-19980
Reviewers: Gordon

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextInput.as</path>

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

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -96,11 +96,6 @@
 	//
 	//--------------------------------------------------------------------------

-	/**
-	 *  @private
-	 */
-    private var textInvalid:Boolean = false;
-
 	//--------------------------------------------------------------------------
 	//
 	//  Overridden properties
@@ -120,28 +115,13 @@
 	/**
 	 *  @private
 	 */
-    override public function get text():String
-    {
-        if (textInvalid)
-        {
-            mx_internal::_text = textView.text;
-            textInvalid = false;
-        }
-
-        return mx_internal::_text;
-    }
-
-	/**
-	 *  @private
-	 */
     override public function set text(value:String):void
     {
         // Setting 'text' temporarily causes 'content' to become null.
         // Later, after the 'text' has been committed into the TextFlow,
         // getting 'content' will return the TextFlow.
-        _content = null;
-        contentChanged = false;
-
+        content = null;
+
         super.text = value;
     }

@@ -154,16 +134,6 @@
     //----------------------------------
 	//  content
     //----------------------------------
-
-	/**
-	 *  @private
-	 */
-	private var _content:Object;
-
-	/**
-	 *  @private
-	 */
-	private var contentChanged:Boolean = false;

 	[Bindable("change")]
 	[Bindable("contentChanged")]
@@ -179,7 +149,7 @@
 	 */
 	public function get content():Object
 	{
-		return _content;
+		return getContent();
 	}

 	/**
@@ -187,19 +157,11 @@
 	 */
 	public function set content(value:Object):void
 	{
-		if (value == _content)
+		if (value == getContent())
 			return;

-        // Setting 'content' temporarily causes 'text' to become null.
-        // Later, after the 'content' has been committed into the TextFlow,
-        // getting 'text' will extract the text from the TextFlow.
-        mx_internal::_text = null;
-        mx_internal::textChanged = false;
-
-		_content = value;
-		contentChanged = true;
-
-		invalidateProperties();
+        text = null;
+        setContent(value);

 		dispatchEvent(new Event("contentChanged"));
 	}
@@ -209,16 +171,6 @@
     //----------------------------------

 	/**
-	 *  @private
-	 */
-	private var _heightInLines:Number = 10;
-
-	/**
-	 *  @private
-	 */
-	private var heightInLinesChanged:Boolean = false;
-
-	/**
 	 *  Documentation is not currently available.
 	 *
 	 *  @langversion 3.0
@@ -228,7 +180,7 @@
 	 */
 	public function get heightInLines():Number
 	{
-		return _heightInLines;
+		return getHeightInLines();
 	}

 	/**
@@ -236,13 +188,7 @@
 	 */
 	public function set heightInLines(value:Number):void
 	{
-		if (value == _heightInLines)
-			return;
-
-		_heightInLines = value;
-		heightInLinesChanged = true;
-
-		invalidateProperties();
+        setHeightInLines(value);
 	}

 	//----------------------------------
@@ -342,54 +288,7 @@

 		invalidateProperties();
 	}
-
-	//----------------------------------
-	//  widthInChars
-    //----------------------------------
-
-	/**
-	 *  @private
-	 */
-	private var _widthInChars:Number = 15;
-
-	/**
-	 *  @private
-	 */
-	private var widthInCharsChanged:Boolean = false;
-
-	/**
-	 *  The default width for the TextInput, measured in characters.
-	 *  The width of the "0" character is used for the calculation,
-	 *  since in most fonts the digits all have the same width.
-	 *  So if you set this property to 5, it will be wide enough
-	 *  to let the user enter 5 digits.
-	 *
-	 *  @default
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-	public function get widthInChars():Number
-	{
-		return _widthInChars;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set widthInChars(value:Number):void
-	{
-		if (value == _widthInChars)
-			return;
-
-		_widthInChars = value;
-		widthInCharsChanged = true;
-
-		invalidateProperties();
-	}
-
+
 	//--------------------------------------------------------------------------
     //
     //  Overridden methods
@@ -417,24 +316,6 @@
                 scroller.verticalScrollPolicy = _verticalScrollPolicy;
             verticalScrollPolicyChanged = false;
         }
-
-        if (widthInCharsChanged)
-		{
-			textView.widthInChars = _widthInChars;
-			widthInCharsChanged = false;
-		}
-
-        if (heightInLinesChanged)
-		{
-			textView.heightInLines = _heightInLines;
-			heightInLinesChanged = false;
-		}
-
-        if (contentChanged)
-        {
-            textView.content = _content;
-            contentChanged = false;
-        }
 	}

 	/**
@@ -446,14 +327,11 @@

 		if (instance == textView)
 		{
-			// Set the RichEditableText to allow multiple lines of input.
 			// In default.css, the TextArea selector has a declaration
 			// for lineBreak which sets it to "toFit".  It needs to be on
 			// TextArea rather than RichEditableText so that if changed later it
-			// will be inherited.  It needs to be set with the default
-			// before the possibility that it is changed when TextArea is
-			// created.  In this case, setting it here, would overwrite
-			// that change.
+			// will be inherited.
+
 			textView.heightInLines = 10;
 			textView.multiline = true;
             textView.autoSize = false;
@@ -541,9 +419,10 @@
         // That's too expensive for an TextArea,
         // which might have a lot of leaf nodes.

-        // Update our storage variable for the content.
-		_content = textView.content;
-        textInvalid = true;
+        // Use the setter so that the contentChanged event is dispatched.
+        // The text will be set to invalid so it is refreshed the next time
+        // it is requested.
+		content = textView.content;

 		// Redispatch the event that came from the RichEditableText.
 		dispatchEvent(event);
@@ -560,7 +439,7 @@
      */
     private function textView_textInvalidHandler(event:Event):void
     {
-        textInvalid = true;
+        mx_internal::textInvalid = true;
     }
 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/spark/src/spark/effects/easing/Sine.as
+++ frameworks/projects/spark/src/spark/effects/easing/Sine.as
@@ -8,7 +8,7 @@
 //  in accordance with the terms of the license agreement accompanying it.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package mx.effects.fxEasing
+package mx.effects.interpolation
 {
 /**
  * Provides easing functionality using a Sine function and a


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

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

 package mx.charts.chartClasses
 {


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

--- frameworks/projects/mx/src/mx/controls/colorPickerClasses/SwatchPanel.as
+++ frameworks/projects/mx/src/mx/controls/colorPickerClasses/SwatchPanel.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2004-2007 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: 12944
Author:   hhillen@paciellogroup.com
Date:     2009-12-15T05:36:44.243052Z

Log Message:
-----------
Added support for state specific sccessible names in ToggleButtonAccImpl
QE notes: none
Doc notes: none
Bugs: n/a
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ToggleButtonAccImpl.as

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

--- frameworks/projects/spark/src/spark/accessibility/ToggleButtonAccImpl.as
+++ frameworks/projects/spark/src/spark/accessibility/ToggleButtonAccImpl.as
@@ -13,6 +13,7 @@
 {

 import mx.accessibility.AccConst;
+import mx.accessibility.AccImpl
 import mx.core.UIComponent;
 import mx.core.mx_internal;

@@ -102,6 +103,34 @@

     /**
      *  @private
+     *  Returns the name of the component.
+	 *  If accessibilityName is set and divided by a comma, the first part
+     *  will be exposed as the default name, and the second part as the name
+     *  when the button is pressed.
+     *
+     *  @param childID uint.
+     *
+     *  @return Name of the component.
+     *
+     */
+    override public function get_accName(childID:uint):String
+    {
+        var accName:String;
+        if (master.accessibilityName && master.accessibilityName.indexOf(",") != -1)
+        {
+            accName = AccImpl.getFormName(master);
+            var stateNames:Array = master.accessibilityName.split(",");
+            accName += " " + (ToggleButtonBase(master).selected ?
+                stateNames[1] : stateNames[0]);
+        }
+        else
+            accName = super.get_accName(0);
+
+        return accName;
+    }
+
+    /**
+     *  @private
      *  IAccessible method for returning the state of the ToggleButton.
      *  States are predefined for all the components in MSAA.
      *  Values are assigned to each state.
@@ -115,7 +144,8 @@
     override public function get_accState(childID:uint):uint
     {
         var accState:uint = getState(childID);
-        if (ToggleButtonBase(master).selected)
+        if (ToggleButtonBase(master).selected && (!master.accessibilityName ||
+            master.accessibilityName.indexOf(",") == -1))
             accState |= AccConst.STATE_SYSTEM_PRESSED;

         return accState;


Transferred from the Adobe Open Source Subversion Repository

Revision: 17109
Author:   klin@adobe.com
Date:     2010-07-28T23:37:16.977688Z

Log Message:
-----------
First round of changes for Spark DataGrid skinning.

DataGridSkin - Added alpha for disabled state and minWidth/minHeight. Altered the background/border/selection/hover/caret colors to XD specifications. Adjusted the label positioning and the ColumnHeaderBar size and positioning.
DefaultGridItemRenderer - Changed default padding on the left and right to 5. Changed the default height to 26 with padding of 5 on top and bottom.
GridLayout - removed the call to initializeGridElement since alternating row colors aren't default
ColumnHeaderBarLayout - Removed laying out the separators and forced the buttons to overlap one pixel.

QE notes: No
Doc notes: No
Bugs: SDK-26827, SDK-26935, SDK-27051
Reviewer: Hans
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/DefaultColumnHeaderRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DataGridSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ColumnHeaderBarLayout.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as
@@ -1157,7 +1157,7 @@
     private function layoutRowBackground(rowBackground:IVisualElement, rowIndex:int):void
     {
         // TBD: call via IGridElement method
-        Object(rowBackground)["initializeGridElement"](rowIndex, 0);
+        // Object(rowBackground)["initializeGridElement"](rowIndex, 0);
         layoutGridElementR(rowBackground, gridDimensions.getRowBounds(rowIndex));
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19330
Author:   klin@adobe.com
Date:     2010-12-13T21:11:45.439252Z

Log Message:
-----------
Fix for DataGroup and List baselinePosition calculations. DataGroup now uses the typicalItem's renderer to calculate its baselinePosition. To do this, DataGroup delegates the calculations to the layout. ListBase uses the baselinePosition of the DataGroup to calculate its own.

QE notes: No
Doc notes: No
Bugs: SDK-28596
Reviewer: Hans
Tests run: cyclone server, checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
@@ -447,7 +447,20 @@
         if (g)
             g.invalidateSize();
     }
-
+
+    /**
+     *  @private
+     *  Returns the baselinePosition of the typicalLayoutElement as if it were
+     *  the first element to be laid out.
+     */
+    mx_internal function get typicalLayoutElementBaselinePosition():Number
+    {
+        if (!typicalLayoutElement)
+            return 0;
+
+        return typicalLayoutElement.baselinePosition;
+    }
+
     //----------------------------------
     //  dropIndicator
     //----------------------------------


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

--- frameworks/projects/charts/src/mx/charts/chartClasses/NumericAxis.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/NumericAxis.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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: 19253
Author:   jasonsj@adobe.com
Date:     2010-12-10T00:48:41.286807Z

Log Message:
-----------
Explicitly set default stage.quality to HIGH. Fixes rendering issues in mobiletheme skins.

Moved textShadowColor and textShadowAlpha from BasicInheritingTextStyles to only ActionBar and Button

Added mobile DefaultButtonSkin for Button.emphasized, accentColor styling.

Remove text shadow from CheckBox and RadioButton

QE notes: Changing mobile stage quality from MEDIUM to HIGH results in anti aliasing changes in rounded graphics and FTE fonts.
Doc notes:
Bugs:
SDK-28224 [AIR] Android stage quality capped at MEDIUM
SDK-28665 textShadowAlpha and textShadowColor are code hinted in Builder for mobile text controls.
SDK-28522 accentColor not working
SDK-28583 	textShadowAlpha should have a common global value, should only apply to ActionBar and Button
Reviewer: gruehle, jszeto
Tests run: checkintests, cyclone
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/DefaultButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/styles/metadata/BasicInheritingTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as
@@ -11,15 +11,17 @@

 package spark.skins.mobile
 {
-
+
 import flash.display.DisplayObject;
 import flash.display.GradientType;
 import flash.display.Graphics;

 import mx.core.DeviceDensity;
 import mx.core.mx_internal;
+import mx.events.FlexEvent;
 import mx.utils.ColorUtil;

+import spark.components.supportClasses.StyleableTextField;
 import spark.skins.mobile.supportClasses.ButtonSkinBase;
 import spark.skins.mobile160.assets.Button_down;
 import spark.skins.mobile160.assets.Button_up;
@@ -32,8 +34,8 @@
 use namespace mx_internal;

 /*
-    ISSUES:
-    - should we support textAlign
+ISSUES:
+- should we support textAlign

 */
 /**
@@ -136,6 +138,8 @@

     private var borderClass:Class;

+    public var labelDisplayShadow:StyleableTextField;
+
     //--------------------------------------------------------------------------
     //
     //  Properties
@@ -165,12 +169,31 @@
      *  @default Button_down
      */
     protected var downBorderSkin:Class;
-
+
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
+
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        if (!labelDisplayShadow && labelDisplay)
+        {
+            labelDisplayShadow = StyleableTextField(createInFontContext(StyleableTextField));
+            labelDisplayShadow.styleName = this;
+            labelDisplayShadow.colorName = "textShadowColor";
+
+            // add shadow before display
+            addChildAt(labelDisplayShadow, getChildIndex(labelDisplay));
+
+            // update shadow when labelDisplay changes
+            labelDisplay.addEventListener(FlexEvent.VALUE_COMMIT, labelDisplay_valueCommitHandler);
+        }
+    }

     /**
      *  @private
@@ -187,7 +210,7 @@
         // update borderClass and background
         invalidateDisplayList();
     }
-
+
     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
         // Size the FXG background
@@ -213,9 +236,23 @@
         {
             layoutBorder(bgImg, unscaledWidth, unscaledHeight);
         }
-
+
         // The label and icon should be placed on top of the FXG skins
         super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // update label shadow
+        labelDisplayShadow.alpha = getStyle("textShadowAlpha");
+        labelDisplayShadow.commitStyles();
+
+        // FIXME (jasonsj): this resize causes scaling issues at 1.5x and 2x
+        // artifacts show below ActionBar buttons
+        setElementSize(labelDisplayShadow, labelDisplay.width, labelDisplay.height);
+        setElementPosition(labelDisplayShadow, labelDisplay.x, labelDisplay.y + 1);
+
+        // if labelDisplay is truncated, then push it down here as well.
+        // otherwise, it would have gotten pushed in the labelDisplay_valueCommitHandler()
+        if (labelDisplay.isTruncated)
+            labelDisplayShadow.text = labelDisplay.text;
     }

     /**
@@ -232,15 +269,15 @@
         setElementPosition(bgImg, 0, 0);
     }

-	override protected function beginChromeColorFill(chromeColorGraphics:Graphics):void
-	{
-		// In the down state, the fill shadow is defined in the FXG asset
-		if (currentState == "down")
-			chromeColorGraphics.beginFill(getChromeColor());
-		else
-			super.beginChromeColorFill(chromeColorGraphics);
-	}
-
+    override protected function beginChromeColorFill(chromeColorGraphics:Graphics):void
+    {
+        // In the down state, the fill shadow is defined in the FXG asset
+        if (currentState == "down")
+            chromeColorGraphics.beginFill(getChromeColor());
+        else
+            super.beginChromeColorFill(chromeColorGraphics);
+    }
+
     override protected function drawChromeColor(chromeColorGraphics:Graphics, unscaledWidth:Number, unscaledHeight:Number):void
     {
         // inset chrome color by BORDER_SIZE
@@ -266,6 +303,22 @@
         else
             return upBorderSkin;
     }
-
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event Handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function labelDisplay_valueCommitHandler(event:FlexEvent):void
+    {
+        labelDisplayShadow.text = labelDisplay.text;
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3429
Author:   hmuller@adobe.com
Date:     2008-09-30T20:57:43.716432Z

Log Message:
-----------
Removed the flex.layout.ILayout interface.   All references to this interface
have been replaced with flex.layout.LayoutBase.

Added verticalScrollPositionDelta() and horizontalScrollPositionDelta() to
IViewport put provisional implementations in TextView.

Added LayoutBase clipContent property and exposed same in GroupBase
and TextView.  The latter is provisional.

ScrollerSkin measure() and updateDisplayList() now handle a null viewport.
This fixes bugs 17079, 17029.

ScrollerSkin updateDisplayList() now respects the minimum width for
its horizontalScrollBar and the minimum height for verticalScrollBar
(the corresponding HSB height and VSB width are already set to their
preferred sizes).

ScrollSkin's measure now ignores the min size of its viewport, it's
minimum size is only based on its visible scrollbars.  This ensures
that the viewport can get as small as possible.  This change corrects
bug 16840.

QE: Removing ILayout may break some tests
Doc: No
Checkintests: Pass
Reviewer: Evtim
Bugs:
  SDK-17079 - RTE if empty Scroller is created
  SDK-17029 - RTE when Scroller's viewport is set to null
  SDK-16840 - Scroller is unusable if height is set as a percentage height

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/DataComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ItemsComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/intf/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/ScrollerSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/SkinnableContainer.as
+++ frameworks/projects/spark/src/spark/components/SkinnableContainer.as
@@ -17,7 +17,7 @@
 import flex.core.SkinnableComponent;
 import flex.events.FlexEvent;
 import flex.events.ItemExistenceChangedEvent;
-import flex.intf.ILayout;
+import flex.layout.LayoutBase;

 import mx.collections.IList;
 import mx.core.ContainerCreationPolicy;
@@ -234,12 +234,12 @@
     //  layout
     //----------------------------------

-    private var _layout:ILayout = null;
+    private var _layout:LayoutBase = null;

     /**
      *  @copy flex.core.Group#layout
      */
-    public function get layout():ILayout
+    public function get layout():LayoutBase
     {
         return (contentGroup) ? contentGroup.layout : _layout;
     }
@@ -247,7 +247,7 @@
     /**
      * @private
      */
-    public function set layout(value:ILayout):void
+    public function set layout(value:LayoutBase):void
     {
         _layout = value;
         if (contentGroup)


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

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

 package spark.events
 {


Support RasterDataLayerParam parsing & validating its default value.

--- src/widgets/Geoprocessing/parameters/RasterDataLayerParam.as
+++ src/widgets/Geoprocessing/parameters/RasterDataLayerParam.as
@@ -20,6 +20,18 @@

 public class RasterDataLayerParam extends BaseParameter
 {
+    //--------------------------------------------------------------------------
+    //
+    //  Constants
+    //
+    //--------------------------------------------------------------------------
+
+    private static const URL_DELIMITER:String = "url:";
+    private static const FORMAT_DELIMITER:String = "format:";
+    private static const ITEM_ID_DELIMITER:String = "itemID:";
+
+    private static const VALID_URL_REGEX:RegExp = /^(ht|f)tps?:\/\/[^\s\.]+(\.[^\s\.]+)*((\/|\.)[^\s\.]+)+\/?$/;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties
@@ -57,9 +69,48 @@
     //
     //--------------------------------------------------------------------------

-    public override function defaultValueFromString(text:String):void
+    public override function defaultValueFromString(description:String):void
     {
-        //NOT SUPPORTED - OUTPUT PARAM ONLY
+        var dataFile:RasterData = new RasterData();
+
+        if (description.indexOf(URL_DELIMITER) == 0
+            || description.indexOf(FORMAT_DELIMITER) == 0)
+        {
+            var tokens:Array = description.split(",");
+            for each (var token:String in tokens)
+            {
+                if (token.indexOf(URL_DELIMITER) == 0)
+                {
+                    dataFile.url = token.substr(URL_DELIMITER.length);
+                }
+                else if (token.indexOf(FORMAT_DELIMITER) == 0)
+                {
+                    dataFile.format = token.substr(FORMAT_DELIMITER.length);
+                }
+            }
+        }
+        else if (description.indexOf(ITEM_ID_DELIMITER) == 0)
+        {
+            dataFile.itemID = description.substr(ITEM_ID_DELIMITER.length);
+        }
+
+        _defaultValue = dataFile;
+    }
+
+    override public function hasValidValue():Boolean
+    {
+        if (_defaultValue.itemID)
+        {
+            return true;
+        }
+        else if (_defaultValue.url)
+        {
+            return VALID_URL_REGEX.test(_defaultValue.url);
+        }
+        else
+        {
+            return false;
+        }
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 21504
Author:   aaltman@adobe.com
Date:     2011-06-30T16:58:51.113669Z

Log Message:
-----------
Initial checkin of StageText-based skins for mobile TextInput and TextArea. New default skins have not been changed yet. Skins use native text controls on Android and iOS devices.

QE notes: Padding isn't correct yet. Skins do not yet work on iOS because of runtime bug 2906305.
Doc notes:
Bugs:
Reviewer: Carol Frampton, Jason Szeto, Alex Harui
Tests run: Checkin tests, focusManager tests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/MobileComponentsClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/StageTextSkinBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/StageTextAreaSkin.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/StageTextInputSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/StageTextSkinBase.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/StageTextSkinBase.as
@@ -0,0 +1,384 @@
+package spark.skins.mobile.supportClasses
+{
+import flash.display.DisplayObject;
+import flash.events.Event;
+import flash.events.FocusEvent;
+import flash.geom.Rectangle;
+
+import mx.core.DPIClassification;
+
+import spark.components.supportClasses.SkinnableTextBase;
+import spark.components.supportClasses.StyleableStageText;
+import spark.skins.mobile160.assets.TextInput_border;
+import spark.skins.mobile240.assets.TextInput_border;
+import spark.skins.mobile320.assets.TextInput_border;
+
+/**
+ *  ActionScript-based skin for text input controls in mobile applications.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.0
+ *  @productversion Flex 4.5.2
+ */
+public class StageTextSkinBase extends MobileSkin
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     *
+     */
+    public function StageTextSkinBase()
+    {
+        super();
+
+        switch (applicationDPI)
+        {
+            case DPIClassification.DPI_320:
+            {
+                borderClass = spark.skins.mobile320.assets.TextInput_border;
+                layoutCornerEllipseSize = 24;
+                measuredDefaultWidth = 600;
+                measuredDefaultHeight = 66;
+                layoutBorderSize = 2;
+
+                break;
+            }
+            case DPIClassification.DPI_240:
+            {
+                borderClass = spark.skins.mobile240.assets.TextInput_border;
+                layoutCornerEllipseSize = 12;
+                measuredDefaultWidth = 440;
+                measuredDefaultHeight = 50;
+                layoutBorderSize = 1;
+
+                break;
+            }
+            default:
+            {
+                borderClass = spark.skins.mobile160.assets.TextInput_border;
+                layoutCornerEllipseSize = 12;
+                measuredDefaultWidth = 300;
+                measuredDefaultHeight = 33;
+                layoutBorderSize = 1;
+
+                break;
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Graphics variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Defines the border.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    protected var borderClass:Class;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Layout variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Defines the corner radius.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    protected var layoutCornerEllipseSize:uint;
+
+    /**
+     *  Defines the border's thickness.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    protected var layoutBorderSize:uint;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *
+     *  Instance of the border graphics.
+     */
+    protected var border:DisplayObject;
+
+    private var borderVisibleChanged:Boolean = false;
+
+    /**
+     *  @private
+     *
+     *  Multiline flag.
+     */
+    protected var multiline:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Skin parts
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  textDisplay skin part.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    public var textDisplay:StyleableStageText;
+
+    [Bindable]
+    /**
+     *  Bindable promptDisplay skin part. Bindings fire when promptDisplay is
+     *  removed and added for proper updating by the SkinnableTextBase.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    public var promptDisplay:StyleableStageText;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        if (!textDisplay)
+        {
+            textDisplay = new StyleableStageText(multiline);
+            textDisplay.editable = true;
+
+            textDisplay.styleName = this;
+            this.addChild(textDisplay);
+        }
+
+        if (!border)
+        {
+            border = new borderClass();
+            addChild(border);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        if (borderVisibleChanged)
+        {
+            borderVisibleChanged = false;
+
+            var borderVisible:Boolean = getStyle("borderVisible");
+
+            if (borderVisible && !border)
+            {
+                border = new borderClass();
+                addChild(border);
+            }
+            else if (!borderVisible && border)
+            {
+                removeChild(border);
+                border = null;
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.drawBackground(unscaledWidth, unscaledHeight);
+
+        var borderSize:uint = (border) ? layoutBorderSize : 0;
+        var borderWidth:uint = borderSize * 2;
+
+        var contentBackgroundColor:uint = getStyle("contentBackgroundColor");
+        var contentBackgroundAlpha:Number = getStyle("contentBackgroundAlpha");
+
+        if (isNaN(contentBackgroundAlpha))
+            contentBackgroundAlpha = 1;
+
+        // Draw the contentBackgroundColor
+        graphics.beginFill(contentBackgroundColor, contentBackgroundAlpha);
+        graphics.drawRoundRect(borderSize, borderSize, unscaledWidth - borderWidth, unscaledHeight - borderWidth, layoutCornerEllipseSize, layoutCornerEllipseSize);
+        graphics.endFill();
+    }
+
+    /**
+     *  @private
+     */
+    override public function styleChanged(styleProp:String):void
+    {
+        var allStyles:Boolean = !styleProp || styleProp == "styleName";
+
+        if (allStyles || styleProp == "borderVisible")
+        {
+            borderVisibleChanged = true;
+            invalidateProperties();
+        }
+
+        if (allStyles || styleProp.indexOf("padding") == 0)
+        {
+            invalidateDisplayList();
+        }
+
+        super.styleChanged(styleProp);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitCurrentState():void
+    {
+        super.commitCurrentState();
+
+        alpha = currentState.indexOf("disabled") == -1 ? 1 : 0.5;
+
+        var showPrompt:Boolean = currentState.indexOf("WithPrompt") != -1;
+
+        if (showPrompt && !promptDisplay)
+        {
+            promptDisplay = createPromptDisplay();
+            promptDisplay.addEventListener(FocusEvent.FOCUS_IN, promptDisplay_focusInHandler);
+        }
+        else if (!showPrompt && promptDisplay)
+        {
+            promptDisplay.removeEventListener(FocusEvent.FOCUS_IN, promptDisplay_focusInHandler);
+            removeChild(promptDisplay);
+            promptDisplay = null;
+        }
+
+        invalidateDisplayList();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function layoutContents(unscaledWidth:Number,
+                                               unscaledHeight:Number):void
+    {
+        super.layoutContents(unscaledWidth, unscaledHeight);
+
+        // position & size border
+        if (border)
+        {
+            setElementSize(border, unscaledWidth, unscaledHeight);
+            setElementPosition(border, 0, 0);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Create a control appropriate for displaying the prompt text in a mobile
+     *  input field.
+     */
+    protected function createPromptDisplay():StyleableStageText
+    {
+        var prompt:StyleableStageText = new StyleableStageText();
+
+        prompt.styleName = this;
+        prompt.editable = false;
+        prompt.commitStyles();
+
+        // StageText objects appear in their own layer on top of the display
+        // list. So, since StyleableStageText uses a StageText for display, it
+        // goes on top as well. It isn't possible to put StageText objects under
+        // any non-Stage objects.
+        addChild(prompt);
+
+        return prompt;
+    }
+
+    /**
+     *  @private
+     *  Utility function used by subclasses' measure functions to measure their
+     *  text host components.
+     */
+    protected function measureTextComponent(hostComponent:SkinnableTextBase):void
+    {
+        var paddingLeft:Number = getStyle("paddingLeft");
+        var paddingRight:Number = getStyle("paddingRight");
+        var paddingTop:Number = getStyle("paddingTop");
+        var paddingBottom:Number = getStyle("paddingBottom");
+        var textHeight:Number = getStyle("fontSize");
+
+        if (textDisplay)
+            textHeight = getElementPreferredHeight(textDisplay);
+
+        // width is based on maxChars (if set)
+        if (hostComponent && hostComponent.maxChars)
+        {
+            // Grab the fontSize and subtract 2 as the pixel value for each character.
+            // This is just an approximation, but it appears to be a reasonable one
+            // for most input and most font.
+            var characterWidth:int = Math.max(1, (textHeight - 2));
+            measuredWidth =  (characterWidth * hostComponent.maxChars) +
+                paddingLeft + paddingRight;
+        }
+
+        measuredHeight = paddingTop + textHeight + paddingBottom;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  If the prompt is focused, we need to move focus to the textDisplay
+     *  StageText. This needs to happen outside of the process of setting focus
+     *  to the prompt, so we use callLater to do that.
+     */
+    private function focusTextDisplay():void
+    {
+        textDisplay.setFocus();
+    }
+
+    private function promptDisplay_focusInHandler(event:FocusEvent):void
+    {
+        callLater(focusTextDisplay);
+    }
+}
+}


StateOverrideBuilder: Adds layout properties

--- impl/skein-feathers/src/skein/impl/feathers/states/builder/FeathersStateOverrideBuilder.as
+++ impl/skein-feathers/src/skein/impl/feathers/states/builder/FeathersStateOverrideBuilder.as
@@ -50,6 +50,41 @@
         return this;
     }

+    override public function left(value:Object):StateOverrideBuilder
+    {
+        return super.left(value);
+    }
+
+    override public function top(value:Object):StateOverrideBuilder
+    {
+        return super.top(value);
+    }
+
+    override public function right(value:Object):StateOverrideBuilder
+    {
+        return super.right(value);
+    }
+
+    override public function bottom(value:Object):StateOverrideBuilder
+    {
+        return super.bottom(value);
+    }
+
+    override public function horizontalCenter(value:Object):StateOverrideBuilder
+    {
+        return super.horizontalCenter(value);
+    }
+
+    override public function verticalCenter(value:Object):StateOverrideBuilder
+    {
+        return super.verticalCenter(value);
+    }
+
+    override public function includeInLayout(value:Object):StateOverrideBuilder
+    {
+        return super.includeInLayout(value);
+    }
+
     override public function on(event:String, handler:Function):StateOverrideBuilder
     {
         StateGlobals.putHandler(this.state, this.part as String, event, handler);


Transferred from the Adobe Open Source Subversion Repository

Revision: 18556
Author:   cframpto@adobe.com
Date:     2010-11-12T18:18:29.899950Z

Log Message:
-----------
The grid item renderers are using UIFTETextField and UITextField in a non-standard way.  Both are intended to inherit their styles from their parents.  They don't support setStyle() and a few of the styles (direction, locale) are actually properties so when set with MXML, the compiler finds the properties rather than the styles.  In DefaultGridItemRenderer kludge in support for direction and locale.  For both renderers, layoutDirection must be inherited so hide the layoutDirection property and style metadata from FlashBuilder and add this info to the doc.

QE notes:
Doc notes:
Bugs: SDK-28290
Reviewer: Hans, Kevin
Tests run: cyclone
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/UITextFieldGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridItemRenderer.as</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/UITextFieldGridItemRenderer.as
+++ frameworks/projects/spark/src/spark/skins/spark/UITextFieldGridItemRenderer.as
@@ -46,12 +46,25 @@
  */
 [Event(name="dataChange", type="mx.events.FlexEvent")]

+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+// These must be inherited to work correctly.
+
+[Exclude(name="layoutDirection", kind="property")]
+[Exclude(name="layoutDirection", kind="style")]
+
 /**
- *   A simple and efficent IGridItemRenderer that displays a single text label.  For
+ *   A simple and efficient IGridItemRenderer that displays a single text label.  For
  *   applications displaying Grids with large numbers of visible cells, this renderer
  *   provides optimum performance on Windows.   It is based on TextField, not FTE,
  *   so it lacks support for some Spark text features.
  *
+ *
UITextFieldGridItemRenderer will inherit its
+ *   layoutDirection from its parent.
+ *   It should not be set directly on UITextFieldGridItemRenderer.

+ *
  *
Label text wrapping can be controlled with the lineBreak style.  For example
  *   a DataGrid configured like this:
  *   lineBreak="explicit" variableRowHeight="false" yields fixed height


PUBLISH message Qos condition

PUBLISH message Qos condition

PUBLISH message Qos condition

--- MQTTClient_AS3/src/com/godpaper/mqtt/as3/core/MQTT_Protocol.as
+++ MQTTClient_AS3/src/com/godpaper/mqtt/as3/core/MQTT_Protocol.as
@@ -21,8 +21,8 @@
  */
 package com.godpaper.mqtt.as3.core
 {
-	import flash.utils.ByteArray;
-	import flash.utils.IDataInput;
+	import flash.utils.ByteArray;
+	import flash.utils.IDataInput;

 	//--------------------------------------------------------------------------
 	//
@@ -264,7 +264,7 @@
 				case PUBLISH://Remaining Length is the length of the variable header plus the length of the payload
 					var index:int = (this.readUnsignedByte() << 8) + this.readUnsignedByte();//the length of variable header
 					this.position = 2;
-					this.readBytes(varHead, 0 , index + 4);
+					this.readBytes(varHead, 0 , index + (qos?4:2));
 					this.readBytes(payLoad);

 					remainingLength = varHead.length + payLoad.length;
@@ -297,4 +297,4 @@
 		//--------------------------------------------------------------------------
 	}

-}+}


Changes to allow Fluint to be conditionally compiled into code

git-svn-id: 9278a788294a4258aac04586390fc35fb4a5f335@8829 a9308255-753e-0410-a2e9-80b3fbc4fff6

--- FlexUnit4/src/org/flexunit/internals/builders/AllDefaultPossibilitiesBuilder.as
+++ FlexUnit4/src/org/flexunit/internals/builders/AllDefaultPossibilitiesBuilder.as
@@ -76,8 +76,17 @@
 		}

 		protected function fluint1Builder():IRunnerBuilder {
-			//return new Fluint1Builder();\
-			return new NullBuilder();
+			var runner:IRunnerBuilder;
+
+			CONFIG::useFlexClasses {
+				runner = new Fluint1Builder();
+			}
+
+			if ( !runner ) {
+				runner = new NullBuilder();
+			}
+
+			return runner;
 		}

 		protected function flexUnit4Builder():FlexUnit4Builder {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3222
Author:   jimurphy@adobe.com
Date:     2008-09-16T14:09:08.134976Z

Log Message:
-----------
Merged 3.0.x revisions 3157,3162,3165-3166,3168,3177,3180-3183,3185,3187,3189,3199 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TileList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/config/ServerConfig.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/build_framework.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterDragManagerEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextFormat.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterManagerRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>

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

--- frameworks/projects/framework/src/mx/events/InterManagerRequest.as
+++ frameworks/projects/framework/src/mx/events/InterManagerRequest.as
@@ -119,6 +119,24 @@
      *  Value of property, or array of parameters for method.
      */
 	public var value:Object;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods: Event
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+ 	 *  @private
+	 */
+	override public function clone():Event
+	{
+		var cloneEvent:InterManagerRequest = new InterManagerRequest(type, bubbles, cancelable,
+                                                 name, value);
+
+		return cloneEvent;
+	}
+
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 22438
Author:   jszeto@adobe.com
Date:     2011-09-08T00:32:35.089685Z

Log Message:
-----------
SpinnerList bug fixes

SDK-31466 - Empty SpinnerListContainer height doesn't match visual height

Set minHeight to the selectionIndicatorHeight plus some border height

SDK-31454 - SpinnerList.mx_internal::animateToSelectedIndex() animates in the wrong direction for some indices

Fix the logic so we animate to the closest unwrapped index even if that index isn't on screen

SDK-31444 - SpinnerList should have DefaultTriggerEvent metadata on event "change

SDK-31473 - SpinnerList with IconItemRenderer stopped sizing properly between 4.5.2.22385 and 4.5.2.22427

Don't set measuredMinHeight to the measuredHeight in SpinnerListSkin

QE notes: none
Doc notes: none
Bugs: SDK-31466, SDK-31454, SDK-31444, SDK-31473
Reviewer: Tom K
Tests run: checkintests, cyclone
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/SpinnerListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
+++ frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
@@ -433,23 +433,33 @@
 	}

 	/**
-	 *  Takes an index between 0 and numElements and returns the index taking wrapping into account
-	 */
-	public function getUnwrappedElementIndex(index:int):int
-	{
-		// find the non-wrapped (i.e. non-modulo) index of the element on screen
-		if (wrapElements)
-		{
-			var wrapCount:int = Math.floor(verticalScrollPosition / totalHeight);
-			index += wrapCount * target.numElements;
-
-			var firstVisibleItem:int = Math.floor((verticalScrollPosition ) / rowHeight);
-			if (index < firstVisibleItem)
-				index += target.numElements;
-		}
-
-		return index;
-	}
+	 *  Takes an index between 0 and numElements and returns the closest index
+     *  to the current position, taking wrapping into account
+	 */
+    public function getClosestUnwrappedElementIndex(index:int):int
+    {
+        if (wrapElements)
+        {
+            // Figure out the wrapCount of the center index
+            var midVSP:Number = target.getLayoutBoundsHeight() / 2 + verticalScrollPosition;
+            var wrapCount:int = Math.floor(midVSP / totalHeight);
+
+            // Get unwrapped middle index
+            var centerIndex:int = getElementNearestScrollPosition(new Point(0, midVSP), "center");
+
+            // Get the unwrapped index before and after the center index
+            var prevIndex:int = index + (wrapCount - 1) * target.numElements;
+            var nextIndex:int = prevIndex + target.numElements;
+
+            // Figure out which index is closer to the centerIndex and return that value
+            if (Math.abs(centerIndex - prevIndex) < Math.abs(nextIndex - centerIndex))
+                index = prevIndex;
+            else
+                index = nextIndex;
+        }
+
+        return index;
+    }

 	// Helper function to calculate the non-wrapped, non-negative scroll position
 	private function normalizeScrollPosition(vsp:int):int