Transferred from the Adobe Open Source Subversion Repository

Revision: 4337
Author:   egeorgie@adobe.com
Date:     2008-12-17T01:41:36.131845Z

Log Message:
-----------
ILayoutElement methods renames

Interface ILayoutElement
{
getLayoutWidth -> getLayoutBoundsWidth
getLayoutHeight -> getLayoutBoundsHeight
getLayoutPositionX -> getLayoutBoundsX
getLayoutPositionY -> getLayoutBoundsY
setLayoutSize -> setLayoutBoundsSize
setLayoutPosition -> setLayoutBoundsPosition
getPreferredWidth -> getPreferredBoundsWidth
getPreferredHeight -> getPreferredBoundsHeight
getMinWidth -> getMinBoundsWidth
getMinHeight -> getMinBoundsHeight
getMaxWidth -> getMaxBoundsWidth
getMaxHeight -> getMaxBoundsHeight

…unrelated stuff…
}

Reviewed by Gordon

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/layout/layout_tester.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/layouts/WheelLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/ILayoutElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.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>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/graphics/GraphicTags_checkintests.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxScrollerSkin.mxml</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/components/FxVSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/Ellipse.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutElementUIC.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -40,8 +40,8 @@
     private static function calculatePercentWidth(layoutElement:ILayoutElement, width:Number):Number
     {
     	var percentWidth:Number = LayoutElementHelper.pinBetween(layoutElement.percentWidth * 0.01 * width,
-    	                                                         layoutElement.getMinWidth(),
-    	                                                         layoutElement.getMaxWidth() );
+    	                                                         layoutElement.getMinBoundsWidth(),
+    	                                                         layoutElement.getMaxBoundsWidth() );
     	return percentWidth < width ? percentWidth : width;
     }

@@ -67,9 +67,9 @@
         }

         if (variableRowHeight)
-            layoutElement.setLayoutSize(newWidth, height);
+            layoutElement.setLayoutBoundsSize(newWidth, height);
         else
-            layoutElement.setLayoutSize(newWidth, rowHeight);
+            layoutElement.setLayoutBoundsSize(newWidth, rowHeight);
     }

     //--------------------------------------------------------------------------
@@ -257,9 +257,9 @@
         else if (!target || (target.numLayoutElements <= 0))
             return 0;
         else if (typicalLayoutElement)
-            return typicalLayoutElement.getPreferredHeight();
+            return typicalLayoutElement.getPreferredBoundsWidth();
         else
-            return target.getLayoutElementAt(0).getPreferredHeight();
+            return target.getLayoutElementAt(0).getPreferredBoundsWidth();
     }

     /**
@@ -461,8 +461,8 @@
             var elt:ILayoutElement = g.getLayoutElementAt(index);
             if (!elt || !elt.includeInLayout)
                 return 0.0;
-            eltY = elt.getLayoutPositionY();
-            eltHeight = elt.getLayoutHeight();
+            eltY = elt.getLayoutBoundsY();
+            eltHeight = elt.getLayoutBoundsHeight();
 	    }

         // index is first (r0) or last (r1) visible row
@@ -494,8 +494,8 @@
 	{
 	    var index:int = (i0 + i1) / 2;
         var element:ILayoutElement = g.getLayoutElementAt(index);
-	    var elementY:Number = element.getLayoutPositionY();
-        var elementHeight:Number = element.getLayoutHeight();
+	    var elementY:Number = element.getLayoutBoundsY();
+        var elementHeight:Number = element.getLayoutBoundsHeight();
         // TBD: deal with null element, includeInLayout false.
         if ((y >= elementY) && (y < elementY + elementHeight + gap))
             return index;
@@ -595,8 +595,8 @@
             if (index0 != -1)
             {
                 var element0:ILayoutElement = g.getLayoutElementAt(index0);
-                var element0Y:Number = element0.getLayoutPositionY();
-                var elementHeight:Number = element0.getLayoutHeight();
+                var element0Y:Number = element0.getLayoutBoundsY();
+                var elementHeight:Number = element0.getLayoutBoundsHeight();
                 if ((element0Y < y1) && ((element0Y + elementHeight) > y0))
                     i0 = index0;
             }
@@ -609,8 +609,8 @@
             if (index1 != -1)
             {
                 var element1:ILayoutElement = g.getLayoutElementAt(index1);
-                var element1Y:Number = element1.getLayoutPositionY();
-                var element1Height:Number = element1.getLayoutHeight();
+                var element1Y:Number = element1.getLayoutBoundsY();
+                var element1Height:Number = element1.getLayoutBoundsHeight();
                 if ((element1Y < y1) && ((element1Y + element1Height) > y0))
                     i1 = index1;
             }
@@ -636,10 +636,10 @@
             var element:ILayoutElement = g.getLayoutElementAt(i);
             if (element && element.includeInLayout)
             {
-                return new Rectangle(element.getLayoutPositionX(),
-                                     element.getLayoutPositionY(),
-                                     element.getLayoutWidth(),
-                                     element.getLayoutHeight());
+                return new Rectangle(element.getLayoutBoundsX(),
+                                     element.getLayoutBoundsY(),
+                                     element.getLayoutBoundsWidth(),
+                                     element.getLayoutBoundsHeight());
             }
         }
         return null;
@@ -804,15 +804,15 @@
                 continue;
             }

-            preferredWidth = Math.max(preferredWidth, li.getPreferredWidth());
-            preferredHeight += li.getPreferredHeight();
+            preferredWidth = Math.max(preferredWidth, li.getPreferredBoundsWidth());
+            preferredHeight += li.getPreferredBoundsWidth();

             var vrr:Boolean = (reqRows != -1) && (visibleRows < reqRows);

             if (vrr || (reqRows == -1))
             {
-                var mw:Number =  hasPercentWidth(li) ? li.getMinWidth() : li.getPreferredWidth();
-                var mh:Number = hasPercentHeight(li) ? li.getMinHeight() : li.getPreferredHeight();
+                var mw:Number =  hasPercentWidth(li) ? li.getMinBoundsWidth() : li.getPreferredBoundsWidth();
+                var mh:Number = hasPercentHeight(li) ? li.getMinBoundsHeight() : li.getPreferredBoundsWidth();
                 minWidth = Math.max(mw, minWidth);
                 minHeight += mh;
             }
@@ -862,8 +862,8 @@
 	            var layoutElement:ILayoutElement = layoutTarget.getLayoutElementAt(i);
 	            if (!layoutElement || !layoutElement.includeInLayout)
 	               continue;
-	            columnWidth = Math.max(columnWidth, layoutElement.getPreferredWidth());
-	            var elementMinWidth:Number = hasPercentWidth(layoutElement) ? layoutElement.getMinWidth() : layoutElement.getPreferredWidth();
+	            columnWidth = Math.max(columnWidth, layoutElement.getPreferredBoundsWidth());
+	            var elementMinWidth:Number = hasPercentWidth(layoutElement) ? layoutElement.getMinBoundsWidth() : layoutElement.getPreferredBoundsWidth();
 	            minColumnWidth = Math.max(minColumnWidth, elementMinWidth);
 	        }
         }
@@ -896,8 +896,8 @@
     {
         var rowCount:uint = layoutTarget.numLayoutElements;
         llv.length = rowCount;
-        llv.defaultMajorSize = typicalLayoutElement.getPreferredHeight();
-        llv.minorSize = typicalLayoutElement.getPreferredWidth();
+        llv.defaultMajorSize = typicalLayoutElement.getPreferredBoundsWidth();
+        llv.minorSize = typicalLayoutElement.getPreferredBoundsWidth();

         var measuredRowCount:int = (requestedRowCount != -1) ? requestedRowCount : rowCount;
         layoutTarget.measuredWidth = llv.minorSize;
@@ -946,7 +946,7 @@
        if (!isNaN(percentWidth))
        {
           var width:Number = percentWidth * 0.01 * targetWidth;
-          return Math.min(targetWidth, Math.min(elt.getMaxWidth(), Math.max(elt.getMinWidth(), width)));
+          return Math.min(targetWidth, Math.min(elt.getMaxBoundsWidth(), Math.max(elt.getMinBoundsWidth(), width)));
        }
        switch(horizontalAlign)
        {
@@ -955,7 +955,7 @@
            case HorizontalAlign.CONTENT_JUSTIFY:
                return contentWidth;
        }
-       return elt.getPreferredWidth();
+       return elt.getPreferredBoundsWidth();
     }

     /**
@@ -1009,8 +1009,8 @@
         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();
+        var typicalWidth:Number = typicalLayoutElement.getPreferredBoundsWidth();
+        var typicalHeight:Number = typicalLayoutElement.getPreferredBoundsWidth();
         llv.length = layoutTarget.numLayoutElements;
         llv.minorSize = Math.max(llv.minorSize, typicalWidth);
         llv.defaultMajorSize = typicalHeight;
@@ -1027,11 +1027,11 @@
         for (; (y < maxVisibleY) && (index < eltCount); index++)
         {
             var elt:ILayoutElement = layoutTarget.getLayoutElementAt(index);
-            var h:Number = elt.getPreferredHeight();
+            var h:Number = elt.getPreferredBoundsWidth();
             var w:Number = calculateElementWidth(elt, targetWidth, contentWidth);
             var x:Number = calculateElementX(elt, w, contentWidth);
-            elt.setLayoutPosition(x, y);
-            elt.setLayoutSize(w, elt.getPreferredHeight());
+            elt.setLayoutBoundsPosition(x, y);
+            elt.setLayoutBoundsSize(w, elt.getPreferredBoundsWidth());
             llv.cacheDimensions(index, elt);
             y += h + gap;
         }
@@ -1050,8 +1050,8 @@
                 elt = layoutTarget.getLayoutElementAt(index);
                 w = calculateElementWidth(elt, targetWidth, contentWidth);
                 x = calculateElementX(elt, w, contentWidth);
-                elt.setLayoutPosition(x, elt.getLayoutPositionY());
-                elt.setLayoutSize(w, elt.getLayoutHeight());
+                elt.setLayoutBoundsPosition(x, elt.getLayoutBoundsY());
+                elt.setLayoutBoundsSize(w, elt.getLayoutBoundsHeight());
             }
         }
         setRowCount(index - startIndex);
@@ -1098,7 +1098,7 @@
                 if (hasPercentWidth(layoutElement))
                     layoutElementWidth = calculatePercentWidth(layoutElement, unscaledWidth);
                 else
-                    layoutElementWidth = layoutElement.getPreferredWidth();
+                    layoutElementWidth = layoutElement.getPreferredBoundsWidth();

                 contentWidth = Math.max(contentWidth, layoutElementWidth);
             }
@@ -1145,12 +1145,12 @@
                 continue;

             // Set the layout element's position
-            var x:Number = (contentWidth - layoutElement.getLayoutWidth()) * hAlign;
-            layoutElement.setLayoutPosition(x, y);
+            var x:Number = (contentWidth - layoutElement.getLayoutBoundsWidth()) * hAlign;
+            layoutElement.setLayoutBoundsPosition(x, y);

             // Update maxX,Y, first,lastVisibleIndex, and y
-            var dx:Number = layoutElement.getLayoutWidth();
-            var dy:Number = layoutElement.getLayoutHeight();
+            var dx:Number = layoutElement.getLayoutBoundsWidth();
+            var dy:Number = layoutElement.getLayoutBoundsHeight();

             maxX = Math.max(maxX, x + dx);
             maxY = Math.max(maxY, y + dy);
@@ -1219,8 +1219,8 @@
                 childInfo = new LayoutElementFlexChildInfo();
                 childInfo.layoutElement = layoutElement;
                 childInfo.percent    = layoutElement.percentHeight;
-                childInfo.min        = layoutElement.getMinHeight();
-                childInfo.max        = layoutElement.getMaxHeight();
+                childInfo.min        = layoutElement.getMinBoundsHeight();
+                childInfo.max        = layoutElement.getMaxBoundsHeight();

                 childInfoArray.push(childInfo);
             }
@@ -1229,7 +1229,7 @@
                 sizeLayoutElement(layoutElement, width, horizontalAlign,
                                restrictedWidth, NaN, variableRowHeight, rh);

-                spaceToDistribute -= layoutElement.getLayoutHeight();
+                spaceToDistribute -= layoutElement.getLayoutBoundsHeight();
             }
         }


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 3702
Author:   clucier@adobe.com
Date:     2008-10-17T12:11:36.350721Z

Log Message:
-----------
Null check for alpha blocker MXMLG-246.
Reviewer: Evtim (retroactive)
Bugs: MXMLG-246
QE: Yes

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/BitmapGraphic.as

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

--- frameworks/projects/spark/src/spark/primitives/BitmapImage.as
+++ frameworks/projects/spark/src/spark/primitives/BitmapImage.as
@@ -373,6 +373,9 @@
         /* if (!displayObject || !(displayObject is Sprite))
             return; */

+        if (!source)
+            return;
+
         if (displayObject is Sprite)
             Sprite(displayObject).graphics.clear();
         else if (displayObject is Shape)
@@ -389,7 +392,7 @@
         _fill.scaleY = 1;
         var fillWidth:Number;
         var fillHeight:Number;
-
+
         switch(_resizeMode)
         {
             case _NORMAL_UINT:


Transferred from the Adobe Open Source Subversion Repository

Revision: 21584
Author:   aaltman@adobe.com
Date:     2011-07-15T22:40:24.389074Z

Log Message:
-----------
Plumbed soft keyboard hint properties from SkinnableTextBase to StageText.
Fixed some excessive padding around StageText.
Added a style to control when prompt text disappears from text controls.
Changed prompt to be a non-StageText to fix z-order issues.
Added a workaround for the lack of a StageText "enter" event (only works on Android).

QE notes: The fix for SDK-30728 is only a partial workaround. It still does not work on iOS.
Doc notes:
Bugs: SDK-30781 - iOS: SoftKeyboard hints don't appear when StageText is used on iPodTouch, and iPad2
SDK-30740 - StageText: Prompt displays over content.
SDK-30737 - SoftKeyboard does not appears on the first tap on TextInput
SDK-30736 - Text prompt disappears when text got focus
SDK-30728 - "Enter" key does not work correctly in StageText
Reviewer: aharui
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/StageTextSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/StageTextAreaSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/core/ISoftKeyboardHintClient.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/StageTextInputSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
@@ -25,6 +25,8 @@
 import flash.geom.Rectangle;
 import flash.geom.Vector3D;
 import flash.system.Capabilities;
+import flash.text.AutoCapitalize;
+import flash.text.ReturnKeyLabel;
 import flash.text.SoftKeyboardType;
 import flash.text.StageText;
 import flash.text.StageTextInitOptions;
@@ -44,6 +46,7 @@
 import mx.core.UIComponent;
 import mx.core.UITextFormat;
 import mx.core.mx_internal;
+import mx.events.FlexEvent;
 import mx.geom.TransformOffsets;
 import mx.managers.FocusManager;
 import mx.styles.CSSStyleDeclaration;
@@ -51,6 +54,7 @@
 import mx.styles.IStyleClient;

 import spark.core.IEditableText;
+import spark.core.ISoftKeyboardHintClient;
 import spark.events.TextOperationEvent;
 import spark.primitives.Rect;

@@ -81,6 +85,18 @@
  *  @productversion Flex 4.5.2
  */
 [Event(name="change", type="flash.events.Event")]
+
+/**
+ *  Dispatched if the StageText is not multiline and the user presses the enter
+ *  key.
+ *
+ *  @eventType mx.events.FlexEvent.ENTER
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.0
+ *  @productversion Flex 4.5.2
+ */
+[Event(name="enter", type="mx.events.FlexEvent")]

 /**
  *  Dispatched after the native text control gains focus. This happens when a
@@ -240,7 +256,7 @@
  *  @playerversion AIR 3.0
  *  @productversion Flex 4.5.2
  */
-public class StyleableStageText extends UIComponent implements IEditableText
+public class StyleableStageText extends UIComponent implements IEditableText, ISoftKeyboardHintClient
 {
     //--------------------------------------------------------------------------
     //
@@ -323,7 +339,7 @@
      *  The runtime StageText object that this field uses for text display and
      *  editing.
      */
-    protected var stageText:StageText;
+    private var stageText:StageText;

     /**
      *  Flag indicating one or more styles have changed. If invalidateStyleFlag
@@ -898,6 +914,160 @@

     //--------------------------------------------------------------------------
     //
+    //  ISoftKeyboardHint properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  autoCapitalize
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Hint indicating what captialization behavior soft keyboards should use.
+     *
+     *  Supported values are defined in flash.text.AutoCapitalize:
+     *      "none" - no automatic capitalization
+     *      "word" - capitalize the first letter following any space or
+     *          punctuation
+     *      "sentence" - captitalize the first letter following any period
+     *      "all" - capitalize every letter
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    public function set autoCapitalize(value:String):void
+    {
+        if (stageText != null)
+        {
+            if (value == null || value.length == 0)
+                value = AutoCapitalize.NONE;
+
+            stageText.autoCapitalize = value;
+        }
+    }
+
+    public function get autoCapitalize():String
+    {
+        if (stageText != null)
+            return stageText.autoCapitalize;
+
+        return AutoCapitalize.NONE;
+    }
+
+    //----------------------------------
+    //  autoCorrect
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Hint indicating whether a soft keyboard should use its auto-correct
+     *  behavior, if supported.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    public function get autoCorrect():Boolean
+    {
+        if (stageText != null)
+            return stageText.autoCorrect;
+
+        return false;
+    }
+
+    public function set autoCorrect(value:Boolean):void
+    {
+        if (stageText != null)
+            stageText.autoCorrect = value;
+    }
+
+    //----------------------------------
+    //  returnKeyLabel
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Hint indicating what label should be displayed for the return key on
+     *  soft keyboards.
+     *
+     *  Supported values are defined in flash.text.ReturnKeyLabel:
+     *      "default" - default icon or label text
+     *      "done" - icon or label text indicating completed text entry
+     *      "go" - icon or label text indicating that an action should start
+     *      "next" - icon or label text indicating a move to the next field
+     *      "search" - icon or label text indicating that the entered text
+     *          should be searched for
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    public function get returnKeyLabel():String
+    {
+        if (stageText != null)
+            return stageText.returnKeyLabel;
+
+        return ReturnKeyLabel.DEFAULT;
+    }
+
+    public function set returnKeyLabel(value:String):void
+    {
+        if (stageText != null)
+        {
+            if (value == null || value.length == 0)
+                value = ReturnKeyLabel.DEFAULT;
+
+            stageText.returnKeyLabel = value;
+        }
+    }
+
+    //----------------------------------
+    //  softKeyboardType
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Hint indicating what kind of soft keyboard should be displayed for this
+     *  component.
+     *
+     *  Supported values are defined in flash.text.SoftKeyboardType:
+     *      "default" - the default keyboard
+     *      "punctuation" - puts the keyboard into punctuation/symbol entry mode
+     *      "url" - present soft keys appropriate for URL entry, such as a
+     *          specialized key that inserts '.com'
+     *      "number" - puts the keyboard into numeric keypad mode
+     *      "contact" - puts the keyboard into a mode appropriate for entering
+     *          contact information
+     *      "email" - puts the keyboard into e-mail addres entry mode, which may
+     *          make it easier to enter '@' or '.com'
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.5.2
+     */
+    public function get softKeyboardType():String
+    {
+        if (stageText != null)
+            return stageText.softKeyboardType;
+
+        return SoftKeyboardType.DEFAULT;
+    }
+
+    public function set softKeyboardType(value:String):void
+    {
+        if (stageText != null)
+        {
+            if (value == null || value.length == 0)
+                value = SoftKeyboardType.DEFAULT;
+
+            stageText.softKeyboardType = value;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
@@ -991,9 +1161,7 @@

         var minMetrics:TextLineMetrics = measureText("Wj");
         var currentMetrics:TextLineMetrics = measureText(text);
-
-        var minSize:Point = new Point(minMetrics.width, minMetrics.height);
-        var padding:Point = calculateInternalPadding(minSize);
+        var padding:Point = calculateInternalPadding();

         measuredMinWidth = minMetrics.width + 2 * padding.x;
         measuredMinHeight = minMetrics.height + 2 * padding.y;
@@ -1237,73 +1405,58 @@
         }
     }

-    mx_internal function calculateInternalPadding(textSize:Point):Point
+    mx_internal function calculateInternalPadding():Point
     {
         // TODO: This shouldn't be necessary once we get an API to determine
         // what a StageText's height should be
         const applicationDPI:Number = FlexGlobals.topLevelApplication.applicationDPI;
         const isAndroid:Boolean = Capabilities.version.indexOf("AND") == 0;
-        const isIOS:Boolean = Capabilities.version.indexOf("IOS") == 0;

         var verticalPadPerPixel:Number = 0;
         var baseHorizontalPad:Number = 0;
         var baseVerticalPad:Number = 0;
-
-        if (isIOS)
-        {
-            verticalPadPerPixel = 0.0625;
-        }
-        else if (isAndroid)
+        var minMetrics:TextLineMetrics = measureText("Wj");
+        var minSize:Point = new Point(minMetrics.width, minMetrics.height);
+
+        if (isAndroid)
         {
             switch (applicationDPI)
             {
                 case DPIClassification.DPI_320:
                     verticalPadPerPixel = 0.75;
-                    baseHorizontalPad = 7;
+                    baseHorizontalPad = 11;
                     baseVerticalPad = 15;
                     break;
                 case DPIClassification.DPI_240:
-                    verticalPadPerPixel = 0.375;
-                    baseHorizontalPad = 5;
-                    baseVerticalPad = 10;
+                    verticalPadPerPixel = 0.36;
+                    baseHorizontalPad = 9;
+                    baseVerticalPad = 12;
                     break;
                 default:
                     verticalPadPerPixel = 0.125;
-                    baseHorizontalPad = 3;
-                    baseVerticalPad = 5;
+                    baseHorizontalPad = 7;
+                    baseVerticalPad = 7;
                     break;
             }
         }

         return new Point(baseHorizontalPad,
-            baseVerticalPad + Math.ceil(textSize.y * verticalPadPerPixel));
+            baseVerticalPad + Math.ceil(minSize.y * verticalPadPerPixel));
     }

     /**
      *  StageText does not have any provision for measuring text. To get
-     *  approximate sizing, this uses a TextField to measure a line of text made
-     *  up of an ascender and a descender. Because platform rendering and
-     *  TextField rendering differ, the measurement should only be used as an
-     *  approximation.
+     *  approximate sizing, this uses UIComponent's text measurement method on a
+     *  string with an ascender and a descender. Because platform rendering and
+     *  UIComponent's rendering differ, the measurement should only be used as
+     *  an approximation.
      */
     private function measureTextLineHeight():Number
     {
-        var measuringField:TextField = new TextField();
-        var format:TextFormat = new TextFormat();
-
-        format.font = getStyle("fontFamily");
-        format.size = getStyle("fontSize");
-        format.bold = getStyle("fontWeight") == "bold";
-        format.italic = getStyle("fontStyle") == "italic";
-
-        measuringField.text = "Wj";
-        measuringField.setTextFormat(format);
-
-        var lineMetrics:TextLineMetrics = measuringField.getLineMetrics(0);
-        var lineSize:Point = new Point(lineMetrics.width, lineMetrics.height);
-        var internalPadding:Point = calculateInternalPadding(lineSize);
-
-        return lineSize.y + internalPadding.y;
+        var lineMetrics:TextLineMetrics = measureText("Wj");
+        var internalPadding:Point = calculateInternalPadding();
+
+        return lineMetrics.height + internalPadding.y;
     }

     //--------------------------------------------------------------------------
@@ -1333,9 +1486,54 @@

     private function stageText_changeHandler(event:Event):void
     {
-        if (stageText != null)
-            _text = stageText.text;
-        dispatchEvent(new TextOperationEvent(event.type));
+        var foundChange:Boolean = false;
+        var foundEnter:Boolean = false;
+
+        if (stageText != null)
+        {
+            var oldText:String = _text;
+            var oldLength:int = oldText.length;
+            var newText:String = stageText.text;
+            var newLength:int = newText.length;
+
+            if (!_multiline && newText.substr(0, oldLength) == oldText)
+            {
+                // This is a single-line text field, so the enter key should
+                // dispatch an enter event instead of inserting a newline
+                // character. StageText does not dispatch a key-down event for
+                // us to use to intercept the enter key, so our only choice
+                // right now is to trap it here, after the field's text has
+                // changed.
+
+                if (oldLength == newLength - 1)
+                {
+                    var lastChar:String = newText.substr(oldLength, 1);
+                    foundEnter = lastChar == "\r" || lastChar == "\n";
+                }
+                else if (oldLength == newLength - 2)
+                {
+                    var tail:String = newText.substr(oldLength, 2);
+                    foundEnter = tail == "\r\n" || tail == "\n\r";
+                }
+            }
+
+            if (foundEnter)
+            {
+                foundChange = true;
+                stageText.text = _text;
+            }
+            else
+            {
+                foundChange = newText != oldText;
+                _text = stageText.text;
+            }
+        }
+
+        if (foundEnter)
+            dispatchEvent(new FlexEvent(FlexEvent.ENTER));
+
+        if (foundChange)
+            dispatchEvent(new TextOperationEvent(event.type));
     }

     private function stageText_focusInHandler(event:FocusEvent):void


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

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

 package spark.components
 {


:memo:

:memo:

--- index.as
+++ index.as
@@ -2,7 +2,7 @@
 // [x] Parse/Build: Pointer Arithmetic
 // [x] Cast: Alias (pointer)
 // [x] Relational: Pointer
-// [ ] !? Pointer to Unit (what does this do and should it be allowed)
+// [ ] Unit should be an empty llvm struct instead of <nothing>
 // [ ] Type alias of a type alias should refer to the canoncial type
 // [x] str is just a name for *int8 (not alias)
 // [x] Implicit cast to type alias from unnamed _literal_ of underlying type
@@ -17,3 +17,6 @@
 // [x] warning: unreachable code
 // [x] Type cast
 // [x] Function hoisting segfaults compiler in type deduction
+// [ ] Function type literal
+// [ ] Struct
+// [ ] Implement (T)


Widening.

Widening.

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

--- src/as/com/threerings/presents/client/InvocationDirector.as
+++ src/as/com/threerings/presents/client/InvocationDirector.as
@@ -94,8 +94,7 @@
     {
         // remove the receiver from the list
         for (var ii :int = _reclist.length - 1; ii >= 0; ii--) {
-            var decoder :InvocationDecoder =
-                (_reclist[ii] as InvocationDecoder);
+            var decoder :InvocationDecoder = (_reclist[ii] as InvocationDecoder);
             if (decoder.getReceiverCode() === receiverCode) {
                 _reclist.splice(ii, 1);
             }
@@ -104,15 +103,13 @@
         // if we're logged on, clear out any receiver id mapping
         if (_clobj != null) {
             var rreg :InvocationReceiver_Registration =
-                (_clobj.receivers.get(receiverCode) as
-                    InvocationReceiver_Registration);
+                (_clobj.receivers.get(receiverCode) as InvocationReceiver_Registration);
             if (rreg == null) {
-                log.warning("Receiver unregistered for which we have no " +
-                            "id to code mapping [code=" + receiverCode + "].");
+                log.warning("Receiver unregistered for which we have no id to code mapping " +
+                            "[code=" + receiverCode + "].");
             } else {
                 var odecoder :Object = _receivers.remove(rreg.receiverId);
-//                 log.info("Cleared receiver " +
-//                          StringUtil.shortClassName(odecoder) +
+//                 log.info("Cleared receiver " + StringUtil.shortClassName(odecoder) +
 //                          " " + rreg + ".");
             }
             _clobj.removeFromReceivers(receiverCode);
@@ -120,21 +117,19 @@
     }

     /**
-     * Assigns a receiver id to this decoder and publishes it in the
-     * {@link ClientObject#receivers} field.
+     * Assigns a receiver id to this decoder and publishes it in the {@link ClientObject#receivers}
+     * field.
      */
     internal function assignReceiverId (decoder :InvocationDecoder) :void
     {
         var reg :InvocationReceiver_Registration =
-            new InvocationReceiver_Registration(decoder.getReceiverCode(),
-                nextReceiverId());
+            new InvocationReceiver_Registration(decoder.getReceiverCode(), nextReceiverId());
         _clobj.addToReceivers(reg);
         _receivers.put(reg.receiverId, decoder);
     }

     /**
-     * Called when we log on; generates mappings for all receivers
-     * registered prior to logon.
+     * Called when we log on; generates mappings for all receivers registered prior to logon.
      */
     internal function assignReceiverIds () :void
     {
@@ -149,11 +144,10 @@
     }

     /**
-     * Requests that the specified invocation request be packaged up and
-     * sent to the supplied invocation oid.
-     */
-    public function sendRequest (
-            invOid :int, invCode :int, methodId :int, args :Array) :void
+     * Requests that the specified invocation request be packaged up and sent to the supplied
+     * invocation oid.
+     */
+    public function sendRequest (invOid :int, invCode :int, methodId :int, args :Array) :void
     {
         // configure any invocation listener marshallers among the args
         for each (var arg :Object in args) {
@@ -164,34 +158,26 @@
                 lm.requestId = nextRequestId();
                 lm.mapStamp = getTimer();

-                // create a mapping for this marshaller so that we can
-                // properly dispatch responses sent to it
+                // create a mapping for this marshaller so that we can properly dispatch responses
+                // sent to it
                 _listeners.put(lm.requestId, lm);
             }
         }

-        // create an invocation request event
-        var event :InvocationRequestEvent =
-            new InvocationRequestEvent(invOid, invCode, methodId, args);
-
-        // now, dispatch the event
-        _omgr.postEvent(event);
+        // create an invocation request event and dispatch it
+        _omgr.postEvent(new InvocationRequestEvent(invOid, invCode, methodId, args));
     }

     // documentation inherited from interface EventListener
     public function eventReceived (event :DEvent) :void
     {
         if (event is InvocationResponseEvent) {
-            var ire :InvocationResponseEvent =
-                (event as InvocationResponseEvent);
-            handleInvocationResponse(ire.getRequestId(), ire.getMethodId(),
-                ire.getArgs());
+            var ire :InvocationResponseEvent = (event as InvocationResponseEvent);
+            handleInvocationResponse(ire.getRequestId(), ire.getMethodId(), ire.getArgs());

         } else if (event is InvocationNotificationEvent) {
-            var ine :InvocationNotificationEvent =
-                (event as InvocationNotificationEvent);
-            handleInvocationNotification(ine.getReceiverId(), ine.getMethodId(),
-                ine.getArgs());
+            var ine :InvocationNotificationEvent = (event as InvocationNotificationEvent);
+            handleInvocationNotification(ine.getReceiverId(), ine.getMethodId(), ine.getArgs());

         } else if (event is MessageEvent) {
             var me :MessageEvent = (event as MessageEvent);
@@ -204,35 +190,29 @@
     /**
      * Dispatches an invocation response.
      */
-    protected function handleInvocationResponse
-            (reqId :int, methodId :int, args :Array) :void
+    protected function handleInvocationResponse (reqId :int, methodId :int, args :Array) :void
     {
         var listener :InvocationMarshaller_ListenerMarshaller =
             (_listeners.remove(reqId) as InvocationMarshaller_ListenerMarshaller);
         if (listener == null) {
-            log.warning("Received invocation response for which we have " +
-                        "no registered listener [reqId=" + reqId +
-                        ", methId=" + methodId +
-                        ", args=" + args + "]. " +
-                        "It is possble that this listener was flushed " +
-                        "because the response did not arrive within " +
-                        LISTENER_MAX_AGE + " milliseconds.");
+            log.warning("Received invocation response for which we have no registered listener " +
+                        "[reqId=" + reqId + ", methId=" + methodId + ", args=" + args + "]. " +
+                        "It is possble that this listener was flushed because the response did " +
+                        "not arrive within " + LISTENER_MAX_AGE + " milliseconds.");
             return;
         }

         unwrapArgs(args);

-//         log.info("Dispatching invocation response " +
-//                  "[listener=" + listener + ", methId=" + methodId +
-//                  ", args=" + StringUtil.toString(args) + "].");
+//         log.info("Dispatching invocation response [listener=" + listener +
+//                  ", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].");

         // dispatch the response
         try {
             listener.dispatchResponse(methodId, args);
         } catch (e :Error) {
-            log.warning("Invocation response listener choked " +
-                        "[listener=" + listener + ", methId=" + methodId +
-                        ", args=" + args + "].");
+            log.warning("Invocation response listener choked [listener=" + listener +
+                        ", methId=" + methodId + ", args=" + args + "].");
             log.logStackTrace(e);
         }

@@ -251,52 +231,43 @@
         receiverId :int, methodId :int, args :Array) :void
     {
         // look up the decoder registered for this receiver
-        var decoder :InvocationDecoder =
-            (_receivers.get(receiverId) as InvocationDecoder);
+        var decoder :InvocationDecoder = (_receivers.get(receiverId) as InvocationDecoder);
         if (decoder == null) {
-            log.warning("Received notification for which we have no " +
-                        "registered receiver [recvId=" + receiverId +
-                        ", methodId=" + methodId +
+            log.warning("Received notification for which we have no registered receiver " +
+                        "[recvId=" + receiverId + ", methodId=" + methodId +
                         ", args=" + args + "].");
             return;
         }

         unwrapArgs(args);

-//         log.info("Dispatching invocation notification " +
-//                  "[receiver=" + decoder.receiver + ", methodId=" + methodId +
-//                  ", args=" + StringUtil.toString(args) + "].");
+//         log.info("Dispatching invocation notification [receiver=" + decoder.receiver +
+//                  ", methodId=" + methodId + ", args=" + StringUtil.toString(args) + "].");

         try {
             decoder.dispatchNotification(methodId, args);
         } catch (e :Error) {
-            log.warning("Invocation notification receiver choked " +
-                        "[receiver=" + decoder.receiver +
-                        ", methId=" + methodId +
-                        ", args=" + args + "].");
+            log.warning("Invocation notification receiver choked [receiver=" + decoder.receiver +
+                        ", methId=" + methodId + ", args=" + args + "].");
             log.logStackTrace(e);
         }
     }

     /**
-     * Flushes listener mappings that are older than {@link
-     * #LISTENER_MAX_AGE} milliseconds. An alternative to flushing
-     * listeners that did not explicitly receive a response within our
-     * expiry time period is to have the server's proxy listener send a
-     * message to the client when it is finalized. We then know that no
-     * server entity will subsequently use that proxy listener to send a
-     * response to the client. This involves more network traffic and
-     * complexity than seems necessary and if a user of the system does
-     * respond after their listener has been flushed, an informative
-     * warning will be logged. (Famous last words.)
+     * Flushes listener mappings that are older than {@link #LISTENER_MAX_AGE} milliseconds. An
+     * alternative to flushing listeners that did not explicitly receive a response within our
+     * expiry time period is to have the server's proxy listener send a message to the client when
+     * it is finalized. We then know that no server entity will subsequently use that proxy
+     * listener to send a response to the client. This involves more network traffic and complexity
+     * than seems necessary and if a user of the system does respond after their listener has been
+     * flushed, an informative warning will be logged. (Famous last words.)
      */
     protected function flushListeners (now :Number) :void
     {
         var then :Number = now - LISTENER_MAX_AGE;
         for each (var reqId :int in _listeners.keys()) {
             var lm :InvocationMarshaller_ListenerMarshaller =
-                (_listeners.get(reqId) as
-                    InvocationMarshaller_ListenerMarshaller);
+                (_listeners.get(reqId) as InvocationMarshaller_ListenerMarshaller);
             if (lm.mapStamp < then) {
                 _listeners.remove(reqId);
             }
@@ -304,10 +275,9 @@
     }

     /**
-     * Called when the server has informed us that our previous client
-     * object is going the way of the Dodo because we're changing screen
-     * names. We subscribe to the new object and report to the client once
-     * we've got our hands on it.
+     * Called when the server has informed us that our previous client object is going the way of
+     * the Dodo because we're changing screen names. We subscribe to the new object and report to
+     * the client once we've got our hands on it.
      */
     protected function handleClientObjectChanged (newCloid :int) :void
     {
@@ -315,8 +285,7 @@
     }

     /**
-     * Unwrap any arguments that have arrived from the server in wrapped
-     * types.
+     * Unwrap any arguments that have arrived from the server in wrapped types.
      */
     protected function unwrapArgs (args :Array) :void
     {
@@ -346,8 +315,8 @@
     }

     /**
-     * Called by the ClientObject SubscriberAdapter when the client object
-     * has been returned by the server.
+     * Called by the ClientObject SubscriberAdapter when the client object has been returned by the
+     * server.
      */
     internal function gotClientObject (clobj :ClientObject) :void
     {
@@ -355,18 +324,16 @@
         clobj.setReceivers(new DSet());
         _clobj = clobj;
         assignReceiverIds();
-
         _client.gotClientObject(clobj);
     }

     /**
      * Called by the ClientObject SubscriberAdapter when it fails.
      */
-    internal function gotClientObjectFailed (
-            oid :int, cause :ObjectAccessError) :void
-    {
-        log.warning("Invocation director unable to subscribe to " +
-            "client object [cloid=" + oid + ", cause=" + cause + "]!");
+    internal function gotClientObjectFailed (oid :int, cause :ObjectAccessError) :void
+    {
+        log.warning("Invocation director unable to subscribe to client object [cloid=" + oid +
+                    ", cause=" + cause + "]!");
         _client.getClientObjectFailed(cause);
     }

@@ -376,8 +343,7 @@
     /** The client for whom we're working. */
     internal var _client :Client;

-    /** Our client object; invocation responses and notifications are
-     * received on this object. */
+    /** Our client object; invocation responses and notifications are received on this object. */
     internal var _clobj :ClientObject;

     /** Used to generate monotonically increasing request ids. */
@@ -386,15 +352,15 @@
     /** Used to generate monotonically increasing receiver ids. */
     protected var _receiverId :int;

-    /** Used to keep track of invocation service listeners which will
-     * receive responses from invocation service requests. */
+    /** Used to keep track of invocation service listeners which will receive responses from
+     * invocation service requests. */
     protected var _listeners :HashMap = new HashMap();

     /** Used to keep track of invocation notification receivers. */
     protected var _receivers :HashMap = new HashMap();

-    /** All registered receivers are maintained in a list so that we can
-     * assign receiver ids to them when we go online. */
+    /** All registered receivers are maintained in a list so that we can assign receiver ids to
+     * them when we go online. */
     internal var _reclist :Array = [];

     /** The last time we flushed our listeners. */


Ensure that BusyIndicator works correctly with mx:Applicaton Fix for https://issues.apache.org/jira/browse/FLEX-34750

--- frameworks/projects/spark/src/spark/skins/spark/BusyIndicatorSkin.as
+++ frameworks/projects/spark/src/spark/skins/spark/BusyIndicatorSkin.as
@@ -25,6 +25,7 @@
 	import flash.utils.Timer;

 	import mx.core.DPIClassification;
+	import mx.core.FlexGlobals;

 	import spark.components.BusyIndicator;
 	import spark.skins.ActionScriptSkinBase;
@@ -76,41 +77,56 @@
 				rotationInterval = 30;
 			rotationSpeed = 60;

-			switch(applicationDPI)
-			{
-				case DPIClassification.DPI_640:
-				{
-					busyIndicatorDiameter = 144;
-					break;
-				}
-				case DPIClassification.DPI_480:
-				{
-					busyIndicatorDiameter = 108;
-					break;
-				}
-				case DPIClassification.DPI_320:
-				{
-					busyIndicatorDiameter = 72;
-					break;
-				}
-				case DPIClassification.DPI_240:
-				{
-					busyIndicatorDiameter = 54;
-					break;
-				}
-				case DPIClassification.DPI_120:
-				{
-					busyIndicatorDiameter = 27;
-					break;
-				}
-				default://160 DPI
-				{
-					busyIndicatorDiameter = 36;
-					break;
-				}
-			}
-		}
-
+			//mx:Application does not have an applicationDPI property
+			//In that case, use a default value
+			var dpi:Number;
+			if(FlexGlobals.topLevelApplication.hasOwnProperty("applicationDPI"))
+			{
+				dpi = FlexGlobals.topLevelApplication["applicationDPI"];
+			}
+
+			if(dpi)
+			{
+				switch(dpi)
+				{
+					case DPIClassification.DPI_640:
+					{
+						busyIndicatorDiameter = 144;
+						break;
+					}
+					case DPIClassification.DPI_480:
+					{
+						busyIndicatorDiameter = 108;
+						break;
+					}
+					case DPIClassification.DPI_320:
+					{
+						busyIndicatorDiameter = 72;
+						break;
+					}
+					case DPIClassification.DPI_240:
+					{
+						busyIndicatorDiameter = 54;
+						break;
+					}
+					case DPIClassification.DPI_120:
+					{
+						busyIndicatorDiameter = 27;
+						break;
+					}
+					default://160 DPI
+					{
+						busyIndicatorDiameter = 36;
+						break;
+					}
+				}
+			}
+			else
+			{
+				busyIndicatorDiameter = 27;
+			}
+		}
+
 		private var _hostComponent:spark.components.BusyIndicator;

 		public function get hostComponent():spark.components.BusyIndicator
@@ -145,41 +161,56 @@

             // Set the default measured size depending on the
             // applicationDPI
-            if (applicationDPI == DPIClassification.DPI_640)
-            {
-                measuredWidth = 104;
-                measuredHeight = 104;
-            }
-            else if (applicationDPI == DPIClassification.DPI_480)
-            {
-                measuredWidth = 80;
-                measuredHeight = 80;
-            }
-            else if (applicationDPI == DPIClassification.DPI_320)
-            {
-                measuredWidth = 52;
-                measuredHeight = 52;
-            }
-            else if (applicationDPI == DPIClassification.DPI_240)
-            {
-                measuredWidth = 40;
-                measuredHeight = 40;
-            }
-            else if (applicationDPI == DPIClassification.DPI_160)
-            {
-                measuredWidth = 26;
-                measuredHeight = 26;
-            }
-            else if (applicationDPI == DPIClassification.DPI_120)
-            {
-                measuredWidth = 20;
-                measuredHeight = 20;
-            }
-            else
-            {
-                measuredWidth = DEFAULT_MINIMUM_SIZE;
-                measuredHeight = DEFAULT_MINIMUM_SIZE;
-            }
+			//mx:Application does not have an applicationDPI property
+			//In that case, use a default value
+			var dpi:Number;
+			if(FlexGlobals.topLevelApplication.hasOwnProperty("applicationDPI"))
+			{
+				dpi = FlexGlobals.topLevelApplication["applicationDPI"];
+			}
+			if(dpi)
+			{
+				if (dpi == DPIClassification.DPI_640)
+				{
+					measuredWidth = 104;
+					measuredHeight = 104;
+				}
+				else if (dpi == DPIClassification.DPI_480)
+				{
+					measuredWidth = 80;
+					measuredHeight = 80;
+				}
+				else if (dpi == DPIClassification.DPI_320)
+				{
+					measuredWidth = 52;
+					measuredHeight = 52;
+				}
+				else if (dpi == DPIClassification.DPI_240)
+				{
+					measuredWidth = 40;
+					measuredHeight = 40;
+				}
+				else if (dpi == DPIClassification.DPI_160)
+				{
+					measuredWidth = 26;
+					measuredHeight = 26;
+				}
+				else if (dpi == DPIClassification.DPI_120)
+				{
+					measuredWidth = 20;
+					measuredHeight = 20;
+				}
+				else
+				{
+					measuredWidth = DEFAULT_MINIMUM_SIZE;
+					measuredHeight = DEFAULT_MINIMUM_SIZE;
+				}
+			}
+			else
+			{
+				measuredWidth = 20;
+				measuredHeight = 20;
+			}

             measuredMinWidth = DEFAULT_MINIMUM_SIZE;
             measuredMinHeight = DEFAULT_MINIMUM_SIZE;


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

--- frameworks/projects/advancedgrids/src/mx/olap/IOLAPCubeImpl.as
+++ frameworks/projects/advancedgrids/src/mx/olap/IOLAPCubeImpl.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.olap
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 2878
Author:   gosmith@adobe.com
Date:     2008-08-19T01:47:49.628691Z

Log Message:
-----------
Added an ObjectUtil.getUnqualifiedClassName() utility method for use in the className getter in four classes, which previously had copy-and-paste code.

Moved the STYLE_UNINITIALIZED constant from StyleManager to StyleProtoChain, since it indicates an uninitialized style proto chain.

Reviewer: Jono
Bugs: -
QA: No
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>

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

--- frameworks/projects/framework/src/mx/effects/EffectInstance.as
+++ frameworks/projects/framework/src/mx/effects/EffectInstance.as
@@ -24,6 +24,7 @@
 import mx.effects.effectClasses.PropertyChanges;
 import mx.events.EffectEvent;
 import mx.events.FlexEvent;
+import mx.utils.ObjectUtil;

 use namespace mx_internal;

@@ -161,14 +162,7 @@
      */
     public function get className():String
     {
-        var name:String = getQualifiedClassName(this);
-
-        // If there is a package name, strip it off.
-        var index:int = name.indexOf("::");
-        if (index != -1)
-            name = name.substr(index + 2);
-
-        return name;
+        return ObjectUtil.getUnqualifiedClassName(this);
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 17116
Author:   dloverin@adobe.com
Date:     2010-07-29T13:27:01.624740Z

Log Message:
-----------
Prevent sub-applications and modules from being pinned in memory by ResourceManager.

This set of changes fixes a module leak that is cause by resource bundles. The ResourceManager is a singleton the holds a reference to all resource bundles in the system. This includes sub-applications and modules. The leaks occurs when a sub-application or module defines a new resource bundle that is not in the application domain of the main application. Creating a new instance of this resource bundle creates a reference from the main application to the application domain of the sub-application or module, pinning it in memory.

The solution to the module leak problem is to modify the ResourceManager API to allow an application to opt-in to maintaining references to their own resource bundles instead of allowing ResourceManager to do it. Since the resource bundles are referenced by the applications or modules, the ResourceManager can keep a weak reference to the resource bundles which will allow the references to be garbage collected when the sub-applications or modules are garbage collected.

So how are does the ResourceManager allow you to opt-in? A useWeakReference parameter was added to both the addResourceBundle and installCompiledResourceBundles functions. The new parameter has a default value of "false" if no value is supplied. A value of "false" provides the old behavior so older applications compiling with the new API will see no change in behavior. A value of "true" for useWeakReference tells the ResourceManager to provide a weak reference with the agreement that the caller will provide a hard reference. Flex sub-applications and modules automatically opt-in to use the new weak reference capability.

The addResourceBundle function adds just the new useWeakReference. A value of true means the caller should store the passed resourceBundle in an application instance variable.

The installCompiledResourceBundles function also has a new parameter useWeakReference and now returns an Array (used to return void). The useWeakReference parameter has the same meaning as in addResourceBundle. The installCompiledResourceBundles function returns and array of resource bundles to give the caller and opportunity to had a hard reference to them.

QE notes: None.
Doc notes: None.
Bugs: SDK-24306
Reviewer: Alex (code), Gordon (API)
Tests run: checkintests, cyclone server
Is noteworthy for integration: No.

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="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/resources/ResourceManagerImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/FlexModuleFactory.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/resources/IResourceManager.as</path>

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

--- frameworks/projects/framework/src/mx/managers/SystemManager.as
+++ frameworks/projects/framework/src/mx/managers/SystemManager.as
@@ -435,6 +435,25 @@
      */
     private var readyForKickOff:Boolean;

+    /**
+     *  @private
+     *
+     *  This variable exists only to provide a reference to this
+     *  app's resource bundles. This application is opting
+     *  into referencing its own resource bundles so the
+     *  ResourceManager does not need to do it. This
+     *  arrangement keeps the ResourceManager from pinning
+     *  the application in memory.
+     *
+     *  If this is the main app, then this variable will be null.
+     *  If this is a sub-app then ResourceManagerImpl set
+     *  this variable to the apps resource bundles. This variable
+     *  is public so it is visible to ResourceManagerImpl but starts
+     *  with an underscore to hint that it is an implementation detail
+     *  and should not be relied on.
+     */
+    public var _resourceBundles:Array;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties: DisplayObject


Transferred from the Adobe Open Source Subversion Repository

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

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

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

Modified Paths:
--------------
147 paths were modified

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

--- frameworks/projects/rpc/src/mx/messaging/FlexClient.as
+++ frameworks/projects/rpc/src/mx/messaging/FlexClient.as
@@ -24,12 +24,24 @@
  *  Listeners must be added via FlexClient.getInstance().addEventListener(...).
  *
  *  @eventType mx.events.PropertyChangeEvent.PROPERTY_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion BlazeDS 4
+ *  @productversion LCDS 3
  */
 [Event(name="propertyChange", type="mx.events.PropertyChangeEvent")]

 /**
  *  Singleton class that stores the global Id for this Player instance that is
  *  server assigned when the client makes its initial connection to the server.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion BlazeDS 4
+ *  @productversion LCDS 3
  */
 public class FlexClient extends EventDispatcher
 {
@@ -70,6 +82,12 @@
          *
          *  @return Returns the sole instance of this singleton class,
 	 *  creating it if it does not already exist.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion BlazeDS 4
+	 *  @productversion LCDS 3
 	 */
 	public static function getInstance():FlexClient
 	{
@@ -117,6 +135,12 @@
      *  This value is server assigned and is set as part of the Channel connect process.
      *  Once set, it will not change for the duration of the Player instance's lifespan.
      *  If no Channel has connected to a server this value is null.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3
      */
     public function get id():String
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 18323
Author:   smgilson@adobe.com
Date:     2010-10-26T17:50:12.524532Z

Log Message:
-----------
Fix invalid HTML in ASDoc comments for the [DiscouragedForProfile] metadata tag

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ComboBox.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TitleWindow.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/BorderContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/FormHeading.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/ToolTip.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TabBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ButtonBarButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Form.as</path>

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

--- frameworks/projects/spark/src/spark/components/Form.as
+++ frameworks/projects/spark/src/spark/components/Form.as
@@ -29,7 +29,7 @@
  * Because this component does not define a skin for the mobile theme, Adobe
  * recommends that you not use it in a mobile application. Alternatively, you
  * can define your own mobile skin for the component. For more information,
- * see Spark Skinning.
+ * see Spark Skinning.
  */
 [DiscouragedForProfile("mobileDevice")]


Fixed HTML formating so class correctly compiles in asdocs

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -192,7 +192,7 @@
  *  overhead to a minimum, pooled and recycled.

  *
  *
The Grid control supports a doubleClick event, according the doubleClickMode
- *  property.
+ *  property.

  *
  *
The Grid control supports selection, according the selectionMode
  *  property.  The set of selected row or cell indices can be modified or
@@ -210,7 +210,7 @@
  *
The Grid control supports smooth scrolling.
  *  Their vertical and horizontal scroll positions define the pixel origin
  *  of the visible part of the grid and the grid's layout only displays
- *  as many cell item renderers as are needed to fill the available space.

+ *  as many cell item renderers as are needed to fill the available space.

  *
  *
The Grid control supports variable height rows that automatically compute
  *  their height based on the item renderers' contents.
@@ -2271,7 +2271,7 @@
      *
 This property is intended to be used to initialize or bind to the
      *  selection in MXML markup.  The setSelectedCell() method should be used
      *  for programatic selection updates, for example when writing a keyboard
-     *  or mouse event handler.
 >
+     *  or mouse event handler.

      *
      *
The default value is an empty Vector.<int>

      *


Transferred from the Adobe Open Source Subversion Repository

Revision: 3341
Author:   rfrishbe@adobe.com
Date:     2008-09-24T23:10:20.245436Z

Log Message:
-----------
Changing the definition of some methods in SkinnableComponent.  So instead of:

protected function partAdded(partName:String, instance:*):void

We now have:

protected function partAdded(partName:String, instance:Object):void

Technically this just means we can't support the value of "undefined" anymore.  This change was made to partAdded(), partRemoved(), createPartInstance(), removePartInstance(), and getDyanamicPartAt().

As I was making these changes in all the files that override these methods, I noticed Slider should have a partRemoved() method, so I added it.

I also made a minor change in Selector where there was a bug in the dataProvider collectionChange eventHandler.  Basically we were doing remove code on replace rather than remove.

QE: Yes - This will break (as in, it won't compile) some tests in SkinnableComponent.  Joann will change them soon after I checkin.
Doc: Yes
Bugs: SDK-16640, SDK-16709
Reviewer: Hans

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/DataComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Selector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ScrollBar.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/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Scroller.as</path>

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -234,7 +234,7 @@
 	 *  itemRendererFunction properties down to the contentGroup
 	 *  skin part.
 	 */
-	override protected function partAdded(partName:String, instance:*):void
+	override protected function partAdded(partName:String, instance:Object):void
 	{
 		super.partAdded(partName, instance);
 		if (instance == dataGroup)
@@ -249,7 +249,7 @@
 	/**
 	 *  Called when a skin part is removed.
 	 */
-	override protected function partRemoved(partName:String, instance:*):void
+	override protected function partRemoved(partName:String, instance:Object):void
 	{
 		if (instance == dataGroup)
 		{


added trace for significant GC activity

added trace for significant GC activity

Change-Id: I9a235efb0e69647ed90167f51d3c17fb0f6ae227

--- WeaveCore/src/weave/core/StageUtils.as
+++ WeaveCore/src/weave/core/StageUtils.as
@@ -323,7 +323,13 @@

 			// first run the functions that should be called before anything else.
 			if (pauseForGCIfCollectionImminent != null)
+			{
+				var t:Number = new Date().time;
 				pauseForGCIfCollectionImminent();
+				t = new Date().time - t;
+				if (t > maxComputationTimePerFrame)
+					trace('paused',t,'ms for GC');
+			}
 			var queue:Array = _priorityCallLaterQueues[WeaveAPI.TASK_PRIORITY_IMMEDIATE] as Array;
 			var countdown:int;
 			for (countdown = queue.length; countdown > 0; countdown--)


rewrote erroneous computation in ZoomUtils.getScaleFromZoomLevel().

--- WeaveData/src/weave/utils/ZoomUtils.as
+++ WeaveData/src/weave/utils/ZoomUtils.as
@@ -61,18 +61,18 @@
 		 */
 		public static function getScaleFromZoomLevel(fullDataBounds:IBounds2D, minScreenSize:Number, zoomLevel:Number):Number
 		{
-			var relativeScale:Number = Math.pow(2, zoomLevel);
+			var zoomedScreenSize:Number = Math.pow(2, zoomLevel) * minScreenSize;

 			// get screen size of fullDataBounds
-			var screenSize:Number;
+			var originalSize:Number;
 			//If this is true, X coordinates will be used to calculate zoom level.  If this is false, Y coordinates will be used.
 			var useXCoordinates:Boolean = (fullDataBounds.getXCoverage() > fullDataBounds.getYCoverage()); // fit full extent inside min screen size
 			if (useXCoordinates)
-				screenSize = tempBounds.getWidth() * relativeScale;
+				originalSize = fullDataBounds.getWidth();
 			else
-				screenSize = tempBounds.getHeight() * relativeScale;
-
-			return screenSize / minScreenSize;
+				originalSize = fullDataBounds.getHeight();
+
+			return zoomedScreenSize / originalSize;
 		}

 		/**


added explicit int() casts where missing from JS

--- WeaveJS/src/weavejs/util/ArrayUtils.as
+++ WeaveJS/src/weavejs/util/ArrayUtils.as
@@ -257,10 +257,10 @@
 			var right:int = (lastIndex >= 0) ? (lastIndex) : (list.length - 1);
 			if (left >= right)
 				return left;
-			var medianIndex:int = (left + right) / 2;
+			var medianIndex:int = int((left + right) / 2);
 			while (true)
 			{
-				var pivotIndex:int = partition(list, left, right, (left + right) / 2, compareFunction);
+				var pivotIndex:int = partition(list, left, right, int((left + right) / 2), compareFunction);
 				if (medianIndex == pivotIndex)
 					break;
 				if (medianIndex < pivotIndex)
@@ -383,7 +383,7 @@
 				imax:int = sortedUniqueValues.length - 1;
 			while (imin <= imax)
 			{
-				i = (imin + imax) / 2;
+				i = int((imin + imax) / 2);
 				var a:* = sortedUniqueValues[i];

 				var c:int = compare != null ? compare(item, a) : (item < a ? -1 : (item > a ? 1 : 0));


Transferred from the Adobe Open Source Subversion Repository

Revision: 11811
Author:   dsubrama@adobe.com
Date:     2009-11-14T20:14:54.284449Z

Log Message:
-----------
Fixes for FXG 2.0.

SDK-23790 - We now set the blendMode correctly when switching from an AIM blendMode to a native Flash one.

SDK-24039 - We hoisted the AIM blendMode support up to UIComponent as per Catalyst's request.

SDK-23715 - Positioning of radial gradient strokes is now correct.

As part of this change, the spark.primitives.supportClasses.shaders packaged move into the framework swc/project, specifically mx.graphics.shaderClasses.

QE notes: Regression and re-gening of so many bitmaps.
Doc notes: None
Bugs: SDK-23790, SDK-24039, SDK-23715
Reviewer: Jason/Evtim/Pete
Tests run: Checkintests - known failures with bitmaps
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="dir" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/shaders</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/LuminosityMaskFilter.pbk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodgeShader.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/HueShader.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLight.pbj</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FlexFXG2SWFTranscoder.java</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLight.pbk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorBurn.pbj</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorBurn.pbk</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/ExclusionShaderExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/frameworkSwcExceptionsList.txt</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/ColorShaderExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/HueShaderExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/FilledElement.as</path>
<path kind="dir" action="D">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/primitives/supportClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLightShader.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorBurnShader.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/SaturationShaderExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Saturation.pbj</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Saturation.pbk</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/LuminosityShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/SoftLightShaderExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/ks5792.jpg</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/ColorBurnShaderExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/LuminosityMaskShader.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/SaturationShader.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Exclusion.pbj</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Exclusion.pbk</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/LuminosityShaderExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Luminosity.pbj</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Luminosity.pbk</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Color.pbj</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Color.pbk</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/ColorDodgeShaderExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Hue.pbj</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodge.pbj</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/Hue.pbk</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodge.pbk</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/asdoc/en_US/mx/graphics/shaderClasses/examples/LuminosityMaskShaderExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ExclusionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/LuminosityMaskFilter.pbj</path>

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

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -28,15 +28,6 @@
 import mx.core.UIFTETextField; UIFTETextField;
 import spark.core.SpriteVisualElement; SpriteVisualElement;
 import spark.components.supportClasses.ListItemDragProxy; ListItemDragProxy;
-import spark.primitives.supportClasses.shaders.ColorBurnShader; ColorBurnShader;
-import spark.primitives.supportClasses.shaders.ColorDodgeShader; ColorDodgeShader;
-import spark.primitives.supportClasses.shaders.ColorShader; ColorShader;
-import spark.primitives.supportClasses.shaders.ExclusionShader; ExclusionShader;
-import spark.primitives.supportClasses.shaders.HueShader; HueShader;
-import spark.primitives.supportClasses.shaders.LuminosityShader; LuminosityShader;
-import spark.primitives.supportClasses.shaders.LuminosityMaskShader; LuminosityMaskShader;
-import spark.primitives.supportClasses.shaders.SaturationShader; SaturationShader;
-import spark.primitives.supportClasses.shaders.SoftLightShader; SoftLightShader;
 import spark.skins.spark.ApplicationSkin; ApplicationSkin;
 import spark.skins.spark.BorderSkin; BorderSkin;
 import spark.skins.spark.ButtonSkin; ButtonSkin;


fix post processing by disabling frustum culling on the screen quad

--- src/aerys/minko/scene/controller/scene/RenderingController.as
+++ src/aerys/minko/scene/controller/scene/RenderingController.as
@@ -24,6 +24,7 @@
 	import aerys.minko.type.binding.DataBindings;
 	import aerys.minko.type.binding.DataProvider;
 	import aerys.minko.type.enum.DataProviderUsage;
+	import aerys.minko.type.enum.FrustumCulling;
 	import aerys.minko.type.log.DebugLevel;

 	import flash.display.BitmapData;
@@ -155,9 +156,13 @@
 			{
 				if (!_postProcessingScene)
 				{
-					_postProcessingScene = new Scene(
-						new Mesh(new QuadGeometry(), new Material(_postProcessingEffect))
-					);
+                    var screenQuad : Mesh = new Mesh(
+                        new QuadGeometry(),
+                        new Material(_postProcessingEffect)
+                    );
+
+                    screenQuad.frustumCulling = FrustumCulling.DISABLED;
+					_postProcessingScene = new Scene(screenQuad);

 					_postProcessingScene.bindings.addProvider(
 						_postProcessingProperties
@@ -176,31 +181,30 @@
 		{
 			if (_postProcessingEffect)
 			{
-				var w 		: int 	= 1 << Math.ceil(Math.log(backBuffer.width) * Math.LOG2E);
-				var h 		: int 	= 1 << Math.ceil(Math.log(backBuffer.height) * Math.LOG2E);
+				var w 		: uint 	= 1 << Math.ceil(Math.log(backBuffer.width) * Math.LOG2E);
+				var h 		: uint 	= 1 << Math.ceil(Math.log(backBuffer.height) * Math.LOG2E);
 				var bgcolor : uint 	= backBuffer.backgroundColor;

-				if (!_postProcessingBackBuffer)
-				{
-					_postProcessingBackBuffer = new RenderTarget(
-						w,
-						h,
-						new TextureResource(w, h),
-						0,
-						bgcolor
-					);
-
-					_postProcessingProperties.setProperty(
-						'backBuffer',
-						_postProcessingBackBuffer.textureResource
-					);
-				}
-				else if (_postProcessingBackBuffer.width != w
-						 || _postProcessingBackBuffer.height != h
-						 || _postProcessingBackBuffer.backgroundColor != bgcolor)
-				{
-					_postProcessingBackBuffer.resize(w, h);
-					_postProcessingBackBuffer.backgroundColor = bgcolor;
+				if (!_postProcessingBackBuffer
+                    || _postProcessingBackBuffer.width != w
+                    || _postProcessingBackBuffer.height != h
+                    || _postProcessingBackBuffer.backgroundColor != bgcolor)
+				{
+                    if (_postProcessingBackBuffer)
+                        _postProcessingBackBuffer.textureResource.dispose();
+
+                    _postProcessingBackBuffer = new RenderTarget(
+                        w,
+                        h,
+                        new TextureResource(w, h),
+                        0,
+                        bgcolor
+                    );
+
+                    _postProcessingProperties.setProperty(
+                        'backBuffer',
+                        _postProcessingBackBuffer.textureResource
+                    );
 				}

 				return _postProcessingBackBuffer;


passed test for resolving types with only optional constructor parameters

--- src/asfac.tests/src/com/thedevstop/asfac/RegistrationTests.as
+++ src/asfac.tests/src/com/thedevstop/asfac/RegistrationTests.as
@@ -74,5 +74,26 @@
 			var result:Object = factory.resolve(Dictionary);
 			assertTrue(result is Dictionary);
 		}
+
+		public function test_should_resolve_types_with_only_optional_constructor_parameters():void
+		{
+			var factory:AsFactory = new AsFactory();
+
+			factory.registerType(Dictionary, Dictionary);
+
+			var result:Object = factory.resolve(Dictionary);
+			assertTrue(result is Dictionary);
+		}
+
+		public function test_should_allow_register_callback():void
+		{
+			var factory:AsFactory = new AsFactory();
+
+			var source:Array = [1, 2, 3];
+			factory.registerCallback(function() { return source; }, Array);
+
+			var result:Array = factory.resolve(Array);
+			assertSame(source, result);
+		}
 	}
 }


Added GeometryPlotter.symbolPlotters

Added GeometryPlotter.symbolPlotters

--- WeaveUI/src/weave/visualization/plotters/GeometryPlotter.as
+++ WeaveUI/src/weave/visualization/plotters/GeometryPlotter.as
@@ -30,6 +30,7 @@

 	import weave.Weave;
 	import weave.api.WeaveAPI;
+	import weave.api.core.ILinkableHashMap;
 	import weave.api.data.IAttributeColumn;
 	import weave.api.data.IColumnWrapper;
 	import weave.api.data.IQualifiedKey;
@@ -38,7 +39,9 @@
 	import weave.api.primitives.IBounds2D;
 	import weave.api.registerLinkableChild;
 	import weave.api.setSessionState;
+	import weave.api.ui.IPlotter;
 	import weave.api.ui.IPlotterWithGeometries;
+	import weave.core.LinkableHashMap;
 	import weave.core.LinkableNumber;
 	import weave.data.AttributeColumns.ColorColumn;
 	import weave.data.AttributeColumns.ImageColumn;
@@ -71,7 +74,9 @@
 			_filteredKeySet.removeCallback(spatialCallbacks.triggerCallbacks); // not every change to the geometries changes the bounding boxes
 			geometryColumn.boundingBoxCallbacks.addImmediateCallback(this, spatialCallbacks.triggerCallbacks); // bounding box should trigger spatial
 			registerSpatialProperty(_filteredKeySet.keyFilter); // subset should trigger spatial callbacks
-		}
+		}
+
+		public const symbolPlotters:ILinkableHashMap = registerLinkableChild(this, new LinkableHashMap(IPlotter));

 		/**
 		 * This is the reprojected geometry column to draw.
@@ -321,7 +326,10 @@
 				graphics.endFill();
 			}

-			destination.draw(tempShape);
+			destination.draw(tempShape);
+
+			for each (var plotter:IPlotter in symbolPlotters.getObjects())
+				plotter.drawPlot(recordKeys, dataBounds, screenBounds, destination);
 		}

 		private static const tempPoint:Point = new Point(); // reusable object


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

--- frameworks/projects/charts/src/mx/charts/CategoryAxis.as
+++ frameworks/projects/charts/src/mx/charts/CategoryAxis.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: 2790
Author:   gosmith@adobe.com
Date:     2008-08-08T22:08:51.675681Z

Log Message:
-----------
Infrastructure for CSS support in TextGraphicElement.

TextGraphicElement now has stubs that implement the same two CSS interfaces that UIComponent implements, namely ISimpleStyleClient and IStyleClient.

Reviewer: Deepa
Bugs: -
QA: No
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -920,18 +920,6 @@
      */
     public static const DEFAULT_MAX_HEIGHT:Number = 10000;

-    /**
-     *  @private
-     *  The inheritingStyles and nonInheritingStyles properties
-     *  are initialized to this empty Object.
-     *  This allows the getStyle() and getStyle()
-     *  methods to simply access inheritingStyles[] and nonInheritingStyles[]
-     *  without needing to first check whether those objects exist.
-     *  If they were simply initialized to {}, we couldn't determine
-     *  whether the style chain has already been built or not.
-     */
-    mx_internal static var STYLE_UNINITIALIZED:Object = {};
-
     //--------------------------------------------------------------------------
     //
     //  Class mixins
@@ -2901,7 +2889,7 @@
      *  @private
      *  Storage for the inheritingStyles property.
      */
-    private var _inheritingStyles:Object = UIComponent.STYLE_UNINITIALIZED;
+    private var _inheritingStyles:Object = StyleManager.STYLE_UNINITIALIZED;

     [Inspectable(environment="none")]

@@ -2934,7 +2922,7 @@
      *  @private
      *  Storage for the nonInheritingStyles property.
      */
-    private var _nonInheritingStyles:Object = UIComponent.STYLE_UNINITIALIZED;
+    private var _nonInheritingStyles:Object = StyleManager.STYLE_UNINITIALIZED;

     [Inspectable(environment="none")]

@@ -4523,7 +4511,7 @@
         // initialized and we haven't yet generated the proto chain.
         // To avoid redundant work, don't bother to create
         // the proto chain here.
-        if (inheritingStyles == UIComponent.STYLE_UNINITIALIZED)
+        if (inheritingStyles == StyleManager.STYLE_UNINITIALIZED)
             return;

         regenerateStyleCache(true);
@@ -7475,7 +7463,7 @@
         if (p)
         {
             var inheritChain:Object = p.inheritingStyles;
-            if (inheritChain == UIComponent.STYLE_UNINITIALIZED)
+            if (inheritChain == StyleManager.STYLE_UNINITIALIZED)
                 inheritChain = nonInheritChain;
         }
         else
@@ -7694,7 +7682,7 @@
                 // Does this object already have a proto chain?
                 // If not, there's no need to regenerate a new one.
                 if (IStyleClient(child).inheritingStyles !=
-                    UIComponent.STYLE_UNINITIALIZED)
+                    StyleManager.STYLE_UNINITIALIZED)
                 {
                     IStyleClient(child).regenerateStyleCache(recursive);
                 }
@@ -7788,7 +7776,7 @@
         var isInheritingStyle:Boolean =
             StyleManager.isInheritingStyle(styleProp);
         var isProtoChainInitialized:Boolean =
-            inheritingStyles != UIComponent.STYLE_UNINITIALIZED;
+            inheritingStyles != StyleManager.STYLE_UNINITIALIZED;
         var valueChanged:Boolean = getStyle(styleProp) != newValue;

         if (!_styleDeclaration)