Transferred from the Adobe Open Source Subversion Repository

Revision: 18987
Author:   rfrishbe@adobe.com
Date:     2010-12-03T01:08:34.503999Z

Log Message:
-----------
PARB changes for sizeElement/positionElement.  MobileSkin and MobileItemRenderer's methods have been renamed: resizeElement() -> setElementSize(), positionElement() -> setElementPosition().

Also, cleaning up text reflow for TextAreaSkin

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TextSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/SelectableButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -835,10 +835,10 @@
         // its measured textHeight so we can position it later based on verticalAlign
         var labelWidth:Number = Math.max(viewWidth, 0);
         var labelHeight:Number = Math.max(Math.min(viewHeight, textHeight), 0);
-        resizeElement(labelDisplay, labelWidth, labelHeight);
+        setElementSize(labelDisplay, labelWidth, labelHeight);

         var labelY:Number = Math.round(vAlign * (viewHeight - labelHeight)) + paddingTop;
-        positionElement(labelDisplay, paddingLeft, labelY);
+        setElementPosition(labelDisplay, paddingLeft, labelY);

         // attempt to truncate the text now that we have its official width
         labelDisplay.truncateToFit();
@@ -851,25 +851,16 @@
     //--------------------------------------------------------------------------

     /**
-     *  A helper method to position the children of this item renderer.
-     *
-     *
You can use this method instead of checking for and using
-     *  various interfaces such as ILayoutElement or IFlexDisplayObject.

-     *
-     *  @param element The child to position.
-     *
-     *  @param x The x-coordinate of the child.
-     *
-     *  @param y The y-coordinate of the child.
-     *
-     *  @see #resizeElement
+     *  @copy spark.skins.mobile.MobileSkin#setElementPosition
+     *
+     *  @see #setElementSize
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.1
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function positionElement(element:Object, x:Number, y:Number):void
+    protected function setElementPosition(element:Object, x:Number, y:Number):void
     {
         if (element is ILayoutElement)
         {
@@ -887,25 +878,16 @@
     }

     /**
-     *  A helper method to size the children of this item renderer.
-     *
-     *
You can use this method instead of checking for and using
-     *  various interfaces such as ILayoutElement or IFlexDisplayObject.

-     *
-     *  @param element The child to position.
-     *
-     *  @param x The width of the child.
-     *
-     *  @param y The height of the child.
-     *
-     *  @see #positionElement
+     *  @copy spark.skins.mobile.MobileSkin#setElementSize
+     *
+     *  @see #setElementPosition
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.1
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function resizeElement(element:Object, width:Number, height:Number):void
+    protected function setElementSize(element:Object, width:Number, height:Number):void
     {
         if (element is ILayoutElement)
         {
@@ -923,14 +905,11 @@
     }

     /**
-     *  A helper method to retrieve the preferred width of an element
-     *
-     *
You can use this method instead of checking for and using
-     *  various interfaces such as ILayoutElement or IFlexDisplayObject.

-     *
-     *  @param element The child to retrieve the width for
-     *
-     *  @see #sizeElement
+     *  @copy spark.skins.mobile.MobileSkin#getElementPreferredWidth
+     *
+     *  @see #setElementPosition
+     *
+     *  @see #setElementSize
      *  @see #getElementPreferredHeight
      *
      *  @langversion 3.0
@@ -950,9 +929,6 @@
         }
         else if (element is StyleableTextField)
         {
-            // commit styles to get an accurate measurement
-            StyleableTextField(element).commitStyles();
-
             return StyleableTextField(element).measuredTextSize.x;
         }
         else
@@ -962,15 +938,12 @@
     }

     /**
-     *  A helper method to retrieve the preferred height of an element
-     *
-     *
You can use this method instead of checking for and using
-     *  various interfaces such as ILayoutElement or IFlexDisplayObject.

-     *
-     *  @param element The child to retrieve the height for
-     *
-     *  @see #sizeElement
-     *  @see #getElementPreferredWidth
+     *  @copy spark.skins.mobile.MobileSkin#getElementPreferredHeight
+     *
+     *  @see #setElementPosition
+     *
+     *  @see #setElementSize
+     *  @see #getElementPreferredWidth
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.1
@@ -989,9 +962,6 @@
         }
         else if (element is StyleableTextField)
         {
-            // commit styles to get an accurate measurement
-            StyleableTextField(element).commitStyles();
-
             return StyleableTextField(element).measuredTextSize.y;
         }
         else


Transferred from the Adobe Open Source Subversion Repository

Revision: 3057
Author:   jimurphy@adobe.com
Date:     2008-09-02T15:18:38.819662Z

Log Message:
-----------
Merged 3.0.x revisions [2966,2969,2995,3004,3018-3019,3023,3029-3030,3046,3049,3052] -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/ModalWindowRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/InterDragManagerEvent.as" copyfrom-rev="3052" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterDragManagerEvent.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/PopUpRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerGlobals.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SWFBridgeEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/EventProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/SliderThumb.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManagerImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SizeRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/InterManagerRequest.as" copyfrom-rev="3052" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/InterManagerRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FocusRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/wsdl/WSDL.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/dividedBoxClasses/BoxDivider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxRootDragEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SandboxMouseEvent.as" copyfrom-rev="3052" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxMouseEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxRootRequest.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/EventUtil.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SandboxRootMouseEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ScrollControlBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.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/managers/CursorManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SWFBridgeRequest.as</path>

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

--- frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridItemRenderer.as
+++ frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridItemRenderer.as
@@ -638,7 +638,7 @@
 		// Calculate global position of label.
 		var pt:Point = new Point(0, 0);
 		pt = localToGlobal(pt);
-		pt = stage.globalToLocal(pt);
+		pt = toolTip.parent.globalToLocal(pt);

 		toolTip.move(pt.x, pt.y + (height - toolTip.height) / 2);


FLEX-34032 Fix ActiveWindowManager injection.  Top-Level Windows can switch between the top-most modal and non-modal windows floating above it, not just among the non-modal windows

--- frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as
+++ frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as
@@ -464,9 +464,9 @@
 		var startIndex:int = 0;
 		if (numModalWindows > 0)
 		{
-			// if there is a modal window, only non-modal
+			// if there is a modal window, only the top modal and non-modal
 			// windows above it are in play
-			startIndex = findHighestModalForm() + 1;
+			startIndex = findHighestModalForm();
 		}

 		if (!systemManager.isTopLevelRoot() || forms.length > 1)
@@ -520,7 +520,10 @@

 						index = childList.getChildIndex(p);
 						newIndex = index;
-
+                        // activating top-most modal so don't switch it to the top
+						if (p == forms[startIndex])
+                            return;
+
 						//we need to reset n because activating p's
 						//FocusManager could have caused
 						//forms.length to have changed.


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

--- frameworks/projects/mx/src/mx/controls/NavBar.as
+++ frameworks/projects/mx/src/mx/controls/NavBar.as
@@ -37,7 +37,7 @@
 import mx.events.ItemClickEvent;
 import mx.managers.ISystemManager;
 import mx.managers.SystemManager;
-import mx.logging.AbstractTarget;
+import mx.styles.StyleManager;

 use namespace mx_internal;

@@ -426,7 +426,7 @@

         // Styles might not have been set yet, so short circuit and let
         // createChildren() handle the rest.
-        if (inheritingStyles == UIComponent.STYLE_UNINITIALIZED)
+        if (inheritingStyles == StyleManager.STYLE_UNINITIALIZED)
             return;

         dispatchEvent(new Event("collectionChange"));


Transferred from the Adobe Open Source Subversion Repository

Revision: 7803
Author:   dsubrama@adobe.com
Date:     2009-06-12T22:33:24.106666Z

Log Message:
-----------
Metadata needed by Bangalore team for event-handler generation.

Bug: http://bugs.adobe.com/jira/browse/SDK-21632
Checkintests: Pass
Reviewer: Ryan

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TabBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToggleButtonBar.as</path>

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

--- frameworks/projects/mx/src/mx/controls/TabBar.as
+++ frameworks/projects/mx/src/mx/controls/TabBar.as
@@ -228,6 +228,8 @@

 [DefaultProperty("dataProvider")]

+[DefaultTriggerEvent("itemClick")]
+
 [IconFile("TabBar.png")]

 [MaxChildren(0)]


Removed unnecessary deprecated class specification.

Change-Id: I1da403478ff148bab24ccb9c8dd29bbecc2eec77

--- WeaveUI/src/_InitializeWeaveUI.as
+++ WeaveUI/src/_InitializeWeaveUI.as
@@ -19,8 +19,6 @@

 package
 {
-	import weave.api.ui.IObjectWithSelectableAttributes;
-	import weave.core.ClassUtils;
 	import weave.core.SessionStateLog;
 	import weave.core.WeaveXMLDecoder;
 	import weave.data.AttributeColumns.DynamicColumn;
@@ -193,8 +191,6 @@
 				KeyMappingTool
 			]);

-			ClassUtils.registerDeprecatedClass('weave.api.ui::IVisToolWithSelectableAttributes', IObjectWithSelectableAttributes);
-
 			/**
 			 * Include these packages in WeaveXMLDecoder so they will not need to be specified in the XML session state.
 			 */


Added material diffuse color & UV tiling to Tundra importer.

--- Bin/Data/Scripts/Editor/EditorImport.as
+++ Bin/Data/Scripts/Editor/EditorImport.as
@@ -432,7 +432,10 @@

     bool mask = false;
     bool twoSided = false;
+    bool uvScaleSet = false;
     String textureName;
+    Vector2 uvScale(1, 1);
+    Color diffuse(1, 1, 1, 1);

     File file(fileName, FILE_READ);
     while (!file.eof)
@@ -443,17 +446,24 @@
         if (line.StartsWith("cull_hardware none"))
             twoSided = true;
         // Todo: handle multiple textures per material
-        if (line.StartsWith("texture ") && textureName.empty)
+        if (textureName.empty && line.StartsWith("texture "))
         {
             textureName = line.Substring(8);
             ProcessRef(textureName);
         }
+        if (!uvScaleSet && line.StartsWith("scale "))
+        {
+            uvScale = line.Substring(6).ToVector2();
+            uvScaleSet = true;
+        }
+        if (line.StartsWith("diffuse "))
+            diffuse = line.Substring(8).ToColor();
     }

     XMLFile outMat;
     XMLElement rootElem = outMat.CreateRoot("material");
     XMLElement techniqueElem = rootElem.CreateChild("technique");
-    techniqueElem.SetAttribute("name", mask ? "Techniques/DiffAlphaMask.xml" : "Techniques/Diff.xml");
+
     if (twoSided)
     {
         XMLElement cullElem = rootElem.CreateChild("cull");
@@ -464,18 +474,39 @@

     if (!textureName.empty)
     {
+        techniqueElem.SetAttribute("name", mask ? "Techniques/DiffAlphaMask.xml" : "Techniques/Diff.xml");
+
         String outTextureName = GetOutTextureName(textureName);
         XMLElement textureElem = rootElem.CreateChild("texture");
         textureElem.SetAttribute("unit", "diffuse");
         textureElem.SetAttribute("name", outTextureName);

-        // Todo: handle also materials without texture
-        File outFile(outFileName, FILE_WRITE);
-        outMat.Save(outFile);
-        outFile.Close();
-
         fileSystem.Copy(filePath + GetFullAssetName(textureName), sceneResourcePath + outTextureName);
     }
+    else
+        techniqueElem.SetAttribute("name", "NoTexture.xml");
+
+    if (uvScale != Vector2(1, 1))
+    {
+        XMLElement uScaleElem = rootElem.CreateChild("parameter");
+        uScaleElem.SetAttribute("name", "UOffset");
+        uScaleElem.SetVector3("value", Vector3(1 / uvScale.x, 0, 0));
+
+        XMLElement vScaleElem = rootElem.CreateChild("parameter");
+        vScaleElem.SetAttribute("name", "VOffset");
+        vScaleElem.SetVector3("value", Vector3(0, 1 / uvScale.y, 0));
+    }
+
+    if (diffuse != Color(1, 1, 1, 1))
+    {
+        XMLElement diffuseElem = rootElem.CreateChild("parameter");
+        diffuseElem.SetAttribute("name", "MatDiffColor");
+        diffuseElem.SetColor("value", diffuse);
+    }
+
+    File outFile(outFileName, FILE_WRITE);
+    outMat.Save(outFile);
+    outFile.Close();

     convertedMaterials.Push(materialName);
 }


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

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

 package mx.automation.tabularData
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 22774
Author:   tkraikit@adobe.com
Date:     2011-09-28T18:38:58.135371Z

Log Message:
-----------
SDK-31412: CalloutButton failure due to underlying bug in ButtonBase (BB) and DropDownController (DDC) interaction where BUTTON_DOWN was being dispatched too late and DDC was not ready to capture the MOUSE_UP event. Moving BUTTON_DOWN dispatch earlier for this specific scenario (mobile, scroller, delayed mouse events due to waiting for possible touch interaction)

QE notes: -
Doc notes: -
Bugs: SDK-31412
Reviewer: glenn, jszeto
Tests run: checkintests, cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
@@ -97,6 +97,8 @@

         _openButton = value;

+        _openButton.disableMinimumDownStateTime = true;
+
         addOpenTriggers();

     }
@@ -296,8 +298,6 @@
      */
     private function addOpenTriggers():void
     {
-        // TODO (jszeto): Change this to be mouseDown. Figure out how to not
-        // trigger systemManager_mouseDown.
         if (openButton)
         {
             if (isNaN(rollOverOpenDelay))


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

--- frameworks/projects/spark/src/spark/components/supportClasses/InvalidatingSprite.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/InvalidatingSprite.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.supportClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8393
Author:   jszeto@adobe.com
Date:     2009-07-06T20:46:27.558863Z

Log Message:
-----------
Updated FIXME comments

Changed some to TODOs, removed some and filed bugs for the remainder

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/Transform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.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/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -895,7 +895,7 @@
         if (offstageHandler == null)
             offstageHandler = onstageHandler;

-        // FIXME (jszeto): Make marshall plan compliant
+        // FIXME (jszeto): Make marshall plan compliant  SDK-22044
         if (systemManager)
         {
         	// For on-stage events
@@ -928,7 +928,7 @@
         if (offstageHandler == null)
             offstageHandler = onstageHandler;

-        // FIXME (jszeto): Make marshall plan compliant
+        // FIXME (jszeto): Make marshall plan compliant SDK-22044
         if (systemManager)
         {
         	// For on-stage events


Fix error to strip 0x in front of static IV

--- HLSPlugin/src/org/denivip/osmf/net/httpstreaming/hls/HTTPStreamingHLSIndexHandler.as
+++ HLSPlugin/src/org/denivip/osmf/net/httpstreaming/hls/HTTPStreamingHLSIndexHandler.as
@@ -250,7 +250,7 @@
 								var strip:RegExp = /"/g;
 								keyUrl = keyValue.replace(strip,"");
 							}else if(keyComponent == "IV") {
-								keyIv = keyValue;
+								keyIv = keyValue.substr(2);
 							}
 						}


Convenience.

Convenience.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@619 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flex/FlexUtil.as
+++ src/as/com/threerings/flex/FlexUtil.as
@@ -59,11 +59,13 @@
      * In flex the 'visible' property controls visibility separate from whether
      * the component takes up space in the layout, which is controlled by 'includeInLayout'.
      * We usually want to set them together, so this does that for us.
+     * @return the new visible setting.
      */
-    public static function setVisible (component :UIComponent, visible :Boolean) :void
+    public static function setVisible (component :UIComponent, visible :Boolean) :Boolean
     {
         component.visible = visible;
         component.includeInLayout = visible;
+        return visible;
     }
 }
 }


trim trailing spaces

trim trailing spaces

--- src/com/mangui/HLS/streaming/Buffer.as
+++ src/com/mangui/HLS/streaming/Buffer.as
@@ -6,7 +6,7 @@
     import com.mangui.HLS.streaming.*;
     import com.mangui.HLS.parsing.*;
     import com.mangui.HLS.utils.*;
-
+
     import flash.media.*;
     import flash.net.*;
     import flash.utils.*;
@@ -93,7 +93,7 @@
                   _hls.dispatchEvent(new HLSEvent(HLSEvent.MEDIA_TIME,{ position:_playback_current_position, buffer:buffer, duration:_loader.getPlayListDuration()}));
                }
             }
-
+
             // Load new tags from fragment.
             if(buffer < _loader.getBufferLength() && !_loading) {
                var loadstatus:Number = _loader.loadfragment(_buffer_next_time,_buffer_last_pts,buffer,_loaderCallback,(_buffer.length == 0));
@@ -101,14 +101,14 @@
                   // good, new fragment being loaded
                   _loading = true;
                } else  if (loadstatus < 0) {
-                  /* it means sequence number requested is smaller than any seqnum available.
+                  /* it means sequence number requested is smaller than any seqnum available.
                      it could happen on live playlist in 2 scenarios :
                      if bandwidth available is lower than lowest quality needed bandwidth
                      after long pause
-                     => seek(offset) to force a restart of the playback session
+                     => seek(offset) to force a restart of the playback session
                      we target second segment
                      */
-                  Log.txt("long pause on live stream or bad network quality");
+                  Log.txt("long pause on live stream or bad network quality");
                   seek(_loader.getSegmentMaxDuration());
                   return;
                } else if(loadstatus > 0) {
@@ -120,7 +120,7 @@
                }
             }
             // Append tags to buffer.
-            if((_state == HLSStates.PLAYING && _stream.bufferLength < 10) ||
+            if((_state == HLSStates.PLAYING && _stream.bufferLength < 10) ||
                (_state == HLSStates.BUFFERING && buffer > 10))
              {
                 //Log.txt("appending data");
@@ -163,7 +163,7 @@

         /** Dispatch an error to the controller. **/
-        private function _errorHandler(error:Error):void {
+        private function _errorHandler(error:Error):void {
             _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR,error.toString()));
         };

@@ -215,7 +215,7 @@
         /** Toggle playback. **/
         public function pause():void {
             clearInterval(_interval);
-            if(_state == HLSStates.PAUSED) {
+            if(_state == HLSStates.PAUSED) {
                 _setState(HLSStates.BUFFERING);
                 _stream.resume();
                 _interval = setInterval(_checkBuffer,100);


fix playlist reloading too often ...

fix playlist reloading too often ...

--- src/com/mangui/HLS/streaming/Getter.as
+++ src/com/mangui/HLS/streaming/Getter.as
@@ -104,7 +104,7 @@
                _levels[index].start_seqnum = frags[0].seqnum;
                _levels[index].end_seqnum = frags[frags.length-1].seqnum;
                _levels[index].duration = frags[frags.length-1].start + frags[frags.length-1].duration;
-               _fragmentDuration = _levels[index].targetduration;
+               _fragmentDuration = 1000*_levels[index].targetduration;
             }
             if(--_toLoad == 0) {
             // Check whether the stream is live or not finished yet


akamaiHD: don't notify plugin ready twice

--- plugins/akamaiHDPlugin/src/akamaiHDPlugin.as
+++ plugins/akamaiHDPlugin/src/akamaiHDPlugin.as
@@ -55,6 +55,7 @@
 		 */
 		protected function onOSMFPluginLoaded (e : MediaFactoryEvent) : void
 		{
+			e.target.removeEventListener(MediaFactoryEvent.PLUGIN_LOAD, onOSMFPluginLoaded);
 			dispatchEvent( new KPluginEvent (KPluginEvent.KPLUGIN_INIT_COMPLETE) );
 		}
 		/**
@@ -64,6 +65,7 @@
 		 */
 		protected function onOSMFPluginLoadError (e : MediaFactoryEvent) : void
 		{
+			e.target.removeEventListener(MediaFactoryEvent.PLUGIN_LOAD_ERROR, onOSMFPluginLoadError);
 			dispatchEvent( new KPluginEvent (KPluginEvent.KPLUGIN_INIT_FAILED) );
 		}


Stack trace filtering: remove local file paths to focus on the class names preceding them.

--- as3/src/asunit/runner/BaseTestRunner.as
+++ as3/src/asunit/runner/BaseTestRunner.as
@@ -1,15 +1,18 @@
 package asunit.runner {
     import flash.display.Sprite;
-
+
     /**
      * Base class for all test runners.
      * This class was born live on stage in Sardinia during XP2000.
      */
     public class BaseTestRunner extends Sprite {

-        // Filters stack frames from internal JUnit classes
+        // Filters stack trace to improve readability.
         public static function getFilteredTrace(stack:String):String {
-            return stack;
+			// Remove local file paths to focus on the class names preceding them.
+			var localPathExp:RegExp = /([A-Z]:\\[^\/:\*\?<>\|]+\.\w{2,6})|(\\{2}[^\/:\*\?<>\|]+\.\w{2,6})/g;
+			stack = stack.replace(localPathExp, '');
+            return stack
         }
     }
  }


gpu render text

gpu render text

--- src/flash/__native/GLCanvasRenderingContext2D.as
+++ src/flash/__native/GLCanvasRenderingContext2D.as
@@ -47,6 +47,7 @@
 		public var context3D:Context3D;

 		private var bmd2texture:ObjectMap = new ObjectMap;
+		private var text2img:Object = { };
 		private var bitmapPosBuf:VertexBuffer3D;
 		private var bitmapUVBuf:VertexBuffer3D;
 		private var bitmapIBuf:IndexBuffer3D;
@@ -55,8 +56,10 @@
 		private var matr:Matrix = new Matrix;
 		private var bitmapUVScale:Vector.<Number> = Vector.<Number>([1,1,0,0]);
 		private var stage:Stage;
-		public function GLCanvasRenderingContext2D(stage:Stage)
+		private var isBatch:Boolean;
+		public function GLCanvasRenderingContext2D(stage:Stage,isBatch:Boolean=false)
 		{
+			this.isBatch = isBatch;
 			this.stage = stage;
 			this.canvas = stage.canvas;
 			context3D = new Context3D;
@@ -195,7 +198,17 @@
 		}

 		public function fillText (text:String, x:Number, y:Number, opt_maxWidth:Number = 0) : Object {
-			return null;
+			var image:HTMLCanvasElement = text2img[text];
+			if (image==null) {
+				image = text2img[text]=document.createElement("canvas") as HTMLCanvasElement;
+				var ctx:CanvasRenderingContext2D = image.getContext("2d") as CanvasRenderingContext2D;
+				var measure:TextMetrics = ctx.measureText(text);
+				image.width = measure.width;
+				image.height = 20;
+				ctx.fillStyle = "#ff0000";
+				ctx.fillText(text, 0, 20);
+			}
+			return drawImage(image,0,0);
 		}

 		public function getImageData (sx:Number, sy:Number, sw:Number, sh:Number) : ImageData {


stdio for compiler is inherited

stdio for compiler is inherited

--- source/ASConfigC.as
+++ source/ASConfigC.as
@@ -438,9 +438,9 @@
 			{
 				var result:Object = child_process.execFileSync(this._javaExecutable, this._args,
 				{
+					stdio: "inherit",
 					encoding: "utf8"
 				});
-				console.info(result);
 			}
 			catch(error:Error)
 			{


TextFieldUtil.setMaximumTextWidth()
So that Robert stops breaking the UI with his ridiculously long names...

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@558 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flash/TextFieldUtil.as
+++ src/as/com/threerings/flash/TextFieldUtil.as
@@ -21,21 +21,17 @@

 package com.threerings.flash {

+import com.threerings.util.StringUtil;
+import com.threerings.util.Util;
+
 import flash.events.Event;
 import flash.events.MouseEvent;
-
 import flash.filters.GlowFilter;
-
 import flash.system.Capabilities;
 import flash.system.System;
-
 import flash.text.TextField;
 import flash.text.TextFieldAutoSize;
-import flash.text.TextFieldType;
 import flash.text.TextFormat;
-import flash.text.TextFormatAlign;
-
-import com.threerings.util.Util;

 public class TextFieldUtil
 {
@@ -44,6 +40,56 @@

     /** A fudge factor that must be added to a TextField's textHeight when setting the height. */
     public static const HEIGHT_PAD :int = 4;
+
+    /**
+     * Ensures that a single-line TextField is not wider than the specified width, and
+     * truncates it with the truncation string if is. If the TextField is truncated,
+     * it will be resized to its new textWidth.
+     *
+     * @param width the maximum pixel width of the TextField. If tf.width > width,
+     * the text inside the TextField will be truncated, and will have the truncation string
+     * appended.
+     * @param truncationString the string to append to the end of the TextField if it exceeds
+     * the specified width.
+     * @return true if truncation took place
+     */
+    public static function setMaximumTextWidth (tf :TextField, width :Number, truncationString :String = "...") :Boolean
+    {
+        if (tf.numLines > 1) {
+            // We only operate on single-line TextFields
+            return false;
+        }
+
+        // TextField.textWidth doesn't account for scale, so account for it here
+        width /= tf.scaleX;
+
+        var truncated :Boolean;
+        if (tf.textWidth > width && tf.text.length > 0) {
+            // subtract the width of our truncationString from our target width
+            var tmp :String = tf.text;
+            tf.text = truncationString;
+            width -= tf.textWidth;
+            tf.text = tmp;
+
+            // Drop characters from our string until we hit our target width.
+            // Flash doesn't appear to provide a nicer way to get text metrics than
+            // sticking stuff in a TextField and calling textWidth.
+            do {
+                tf.text = tf.text.substr(0, tf.text.length - 1);
+            } while (tf.textWidth > width && tf.text.length > 0);
+
+            // strip whitespace characters from the end of the truncated string
+            tf.text = StringUtil.trimEnd(tf.text);
+
+            tf.appendText(truncationString);
+            truncated = true;
+
+            tf.width = tf.textWidth + WIDTH_PAD;
+            tf.height = tf.textHeight + HEIGHT_PAD;
+        }
+
+        return truncated;
+    }

     /**
      * Create a TextField.


- bugfix: several small fixes to CSS transitions of intrinsic dimensions

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

--- src/reprise/ui/UIComponent.as
+++ src/reprise/ui/UIComponent.as
@@ -163,6 +163,8 @@
 		private var m_oldInFlowStatus : int = -1;
 		private var m_oldOuterBoxDimension : Point;
 		protected var m_invalidateStylesAfterValidation : Boolean;
+		private var m_oldContentBoxWidth : int;
+		private var m_oldContentBoxHeight : int;

 		/***************************************************************************
@@ -1433,8 +1435,8 @@
 				m_borderBoxHeight + m_currentStyles.marginTop + m_currentStyles.marginBottom);
 			m_oldInFlowStatus = m_positionInFlow;

-			var oldWidth : int = m_currentStyles.width;
-			var oldHeight : int = m_currentStyles.height;
+			m_oldContentBoxWidth = m_contentBoxWidth;
+			m_oldContentBoxHeight = m_contentBoxHeight;

 			if (m_stylesInvalidated)
 			{
@@ -1483,8 +1485,8 @@
 						}
 					}
 					applyStyles();
-					if (m_currentStyles.width != oldWidth ||
-						m_currentStyles.height != oldHeight)
+					if (m_currentStyles.width != m_oldContentBoxWidth ||
+						m_currentStyles.height != m_oldContentBoxHeight)
 					{
 						m_specifiedDimensionsChanged = true;
 					}
@@ -1501,9 +1503,8 @@
 				return;
 			}

-			var oldContentBoxHeight : int = m_contentBoxHeight;
-			var oldContentBoxWidth : int = m_contentBoxWidth;
-
+			var oldIntrinsicWidth : int = m_intrinsicWidth;
+			var oldIntrinsicHeight : int = m_intrinsicHeight;
 			applyInFlowChildPositions();

 			measure();
@@ -1520,7 +1521,11 @@
 					}
 					else
 					{
+						//TODO: deal with inline elements adapting to the intermittend sizes,
+						//changing the intrinsic width
 						m_weakStyles.setStyle('width', m_intrinsicWidth + 'px', true);
+						m_specifiedStyles.setStyle('width', m_oldContentBoxWidth + 'px');
+						m_contentBoxWidth = m_oldContentBoxWidth;
 						m_invalidateStylesAfterValidation = true;
 						m_stylesInvalidated = true;
 						invalidate();
@@ -1543,6 +1548,8 @@
 					else
 					{
 						m_weakStyles.setStyle('height', m_intrinsicHeight + 'px', true);
+						m_specifiedStyles.setStyle('height', m_oldContentBoxHeight + 'px');
+						m_contentBoxHeight = m_oldContentBoxHeight;
 						m_invalidateStylesAfterValidation = true;
 						m_stylesInvalidated = true;
 						invalidate();
@@ -1585,8 +1592,10 @@
 	//				log("f reason for parentReflow: dims of in-flow changed");
 				}
 			}
-			else if (m_intrinsicHeight != oldContentBoxHeight ||
-				m_intrinsicWidth != oldContentBoxWidth)
+			else if (m_contentBoxHeight != m_oldContentBoxHeight ||
+				m_contentBoxWidth != m_oldContentBoxWidth ||
+				m_intrinsicHeight != oldIntrinsicHeight ||
+				m_intrinsicWidth != oldIntrinsicWidth)
 			{
 				applyOverflowProperty();
 			}


Add tests for invalid published file ID.

--- test/src/FRESteamWorksTest.as
+++ test/src/FRESteamWorksTest.as
@@ -289,7 +289,7 @@
 		private function deletePublishedFile(e:Event = null):void {
 			if(!Steamworks.isReady) return;

-			if(!publishedFile) {
+			if(!publishedFile || publishedFile == WorkshopConstants.PUBLISHEDFILEID_Invalid) {
 				log("No file handle set, publish or enumerate first");
 				return;
 			}
@@ -410,7 +410,7 @@
 		}

 		private function updateFile(e:Event = null):void {
-			if(!publishedFile) {
+			if(!publishedFile || publishedFile == WorkshopConstants.PUBLISHEDFILEID_Invalid) {
 				log("No file handle set, publish or enumerate first");
 				return;
 			}
@@ -654,6 +654,11 @@

 					publishedFile = Steamworks.publishWorkshopFileResult();
 					log("File published as " + publishedFile);
+					if (publishedFile == WorkshopConstants.PUBLISHEDFILEID_Invalid) {
+						log("FAILED!");
+						break;
+					}
+
 					log("subscribePublishedFile(...) == " + Steamworks.subscribePublishedFile(publishedFile));
 					break;
 				case SteamConstants.RESPONSE_OnEnumerateUserSubscribedFiles:


Stylistic changes.

Stylistic changes.

	* build-aux/instrument.as: Prefer () for cases.
	(normalize_boolean): Simplify the code.


handle text-align

handle text-align

--- frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -482,7 +482,8 @@
             "color" : 1,
             "fontFamily" : 1,
             "fontSize" : 1,
-            "fontStyle" : 1
+            "fontStyle" : 1,
+            "textAlign" : 1
         }

 	}


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

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

 package mx.automation.codec
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 22172
Author:   jszeto@adobe.com
Date:     2011-08-23T23:58:28.507994Z

Log Message:
-----------
SpinnerList Bug Fixes (fontColor / disabled items)

DateSpinner now supports fontSize. SpinnerList and DateSpinner now use the global fontSize instead of specify a larger default size.

SDK-31014 - Inconsistent behavior when all items in a SpinnerList are disabled

When useVirtualLayout is true, the element might not exist. We check the data directly instead asking the element if it is enabled.

SDK-30990 - SpinnerList does not respect text color

Both DateSpinner and SpinnerList should now support the color style. Changed the accentColor and disabled logic for setting the color. Now we set the colorName property so StyleableTextField knows which style to use. Disabled items are set to an alpha of .5.

QE notes: baselines will need updating
Doc notes: none
Bugs: SDK-30990, SDK-31014
Reviewer: Tom K
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/StyleableTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/YearProvider.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
+++ frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as
@@ -18,6 +18,7 @@
 import mx.core.IVisualElement;
 import mx.core.mx_internal;

+import spark.components.DataGroup;
 import spark.components.SpinnerList;
 import spark.components.supportClasses.GroupBase;
 import spark.core.NavigationUnit;
@@ -363,44 +364,50 @@
 	{
 		var index:int = Math.floor(position.y / rowHeight); // may be larger than numElements to indicate wrapping

-		var element:ILayoutElement;
+        var item:Object;
 		var startIndex:int = index % target.numElements;
         var distance:int = 0;
         var direction:int = autoScrollAscending ? 1 : -1;
+        var dataGroup:DataGroup = target as DataGroup;
+
 		if (startIndex < 0)
             startIndex += target.numElements;

 		// If the element at index % numElements) is not selectable, find the nearest one that is
         var iter:LayoutIterator = new LayoutIterator(target, startIndex);

-        while (Math.abs(distance) <= (target.numElements / 2) + 1)
-        {
-            // Try searching in one direction
-            iter.currentIndex = startIndex + distance * direction;
-            element = iter.getCurrentElement();
-
-            if (isElementEnabled(element))
-                break;
-
-            if (distance != 0)
+        if (dataGroup)
+        {
+            while (Math.abs(distance) <= (target.numElements / 2) + 1)
             {
-                // Flip the direction
-                direction *= -1;
+                // Try searching in one direction
+                iter.currentIndex = startIndex + distance * direction;
+
+                item = dataGroup.dataProvider.getItemAt(normalizeItemIndex(iter.currentIndex));

-                // Try searching in the other direction
-                iter.currentIndex = startIndex + distance * direction;
-                element = iter.getCurrentElement();
-
-                if (isElementEnabled(element))
+                if (isElementEnabled(item))
                     break;

-                // Flip the direction back
-                direction *= -1;
+                if (distance != 0)
+                {
+                    // Flip the direction
+                    direction *= -1;
+
+                    // Try searching in the other direction
+                    iter.currentIndex = startIndex + distance * direction;
+                    item = dataGroup.dataProvider.getItemAt(normalizeItemIndex(iter.currentIndex));
+
+                    if (isElementEnabled(item))
+                        break;
+
+                    // Flip the direction back
+                    direction *= -1;
+                }
+
+                distance++;
             }
-
-            distance++;
-        }
-
+        }
+
 		// If we don't allow wrapping, then cap the max index
 		if(!wrapElements)
 			index = Math.max(0, Math.min(index, target.numElements - 1));
@@ -480,7 +487,7 @@
         // casting as an object
         try
         {
-            if (!element || element["enabled"] == undefined || element["enabled"] == true)
+            if (!element || element["_enabled_"] == undefined || element["_enabled_"] == true)
                 return true;
         }
         catch (e:Error)


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 16981
Author:   cframpto@adobe.com
Date:     2010-07-20T18:33:36.137375Z

Log Message:
-----------
Prepend "single" to SINGLE_ROW and SINGLE_CELL constants.

QE notes: if you are using strings for selectionMode rather than constants they need to be updated or, better, changed to the constants
Doc notes:
Bugs: 26951
Reviewer: Hans
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridSelectionMode.as

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridSelectionMode.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridSelectionMode.as
@@ -46,7 +46,7 @@
      *  @playerversion AIR 2.0
      *  @productversion Flex 4.5
      */
-    public static const SINGLE_ROW:String = "row";
+    public static const SINGLE_ROW:String = "singleRow";

     /**
      *  Specifies that one or more rows can be selected.
@@ -66,7 +66,7 @@
      *  @playerversion AIR 2.0
      *  @productversion Flex 4.5
      */
-    public static const SINGLE_CELL:String = "cell";
+    public static const SINGLE_CELL:String = "singleCell";

     /**
      *  Specifies that one or more cells can be selected.


Transferred from the Adobe Open Source Subversion Repository

Revision: 16665
Author:   rfrishbe@adobe.com
Date:     2010-06-24T22:40:15.397962Z

Log Message:
-----------
Initial checkin for touch-enabled Lists.  This has not been code reviewed or spec-approved.  There will be lots of changes that will occur with this, but this will allow people to easily create touch-enabled Lists

QE notes: None
Doc notes: None
Bugs: -
Reviewer: None - this will get reviewed later
Tests run: checkintests, full mustella run (some tests failed and were off by a few pixels)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollingEasing.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/TouchScrollEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/IViewport.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/ScrollPolicy.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as
@@ -415,7 +415,8 @@
         var oldShowHSB:Boolean = hsbVisible;
         var oldShowVSB:Boolean = vsbVisible;

-        var hAuto:Boolean = false;
+        var hAuto:Boolean = false;
+        var hsbTakeUpSpace:Boolean = true; // if visible
         switch(scroller.getStyle("horizontalScrollPolicy"))
         {
             case ScrollPolicy.ON:
@@ -430,11 +431,17 @@
                 }
                 break;

+            case ScrollPolicy.OVERLAY:
+                hsbVisible = scroller.horizontalScrollInProgress;
+                hsbTakeUpSpace = false;
+                break;
+
             default:
                 hsbVisible = false;
         }

         var vAuto:Boolean = false;
+        var vsbTakeUpSpace:Boolean = true; // if visible
         switch(scroller.getStyle("verticalScrollPolicy"))
         {
            case ScrollPolicy.ON:
@@ -448,7 +455,12 @@
                     vsbVisible = (contentH >= (viewportH + SDT));
                 }
                 break;
-
+
+            case ScrollPolicy.OVERLAY:
+                vsbVisible = scroller.verticalScrollInProgress;
+                vsbTakeUpSpace = false;
+                break;
+
             default:
                 vsbVisible = false;
         }
@@ -457,12 +469,12 @@
         // the viewport's size was explicitly set, then we just use that.

         if (isNaN(explicitViewportW))
-            viewportW = w - ((vsbVisible) ? (minViewportInset + vsbRequiredWidth()) : (minViewportInset * 2));
+            viewportW = w - ((vsbVisible && vsbTakeUpSpace) ? (minViewportInset + vsbRequiredWidth()) : (minViewportInset * 2));
         else
             viewportW = explicitViewportW;

         if (isNaN(explicitViewportH))
-            viewportH = h - ((hsbVisible) ? (minViewportInset + hsbRequiredHeight()) : (minViewportInset * 2));
+            viewportH = h - ((hsbVisible && hsbTakeUpSpace) ? (minViewportInset + hsbRequiredHeight()) : (minViewportInset * 2));
         else
             viewportH = explicitViewportH;

@@ -482,7 +494,7 @@
         // then prefer to show the "non-dependent" auto scrollbar if we added the second
         // "dependent" auto scrollbar because of the space consumed by the first.

-        if (hsbVisible && vsbVisible)
+        if ((hsbVisible && hsbTakeUpSpace) && (vsbVisible && vsbTakeUpSpace))
         {
             if (hsbFits(w, h) && vsbFits(w, h))
             {
@@ -521,21 +533,21 @@
                     vsbVisible = false;
             }
         }
-        else if (hsbVisible && !hsbFits(w, h))  // just trying to show HSB, but it doesn't fit
+        else if (hsbVisible && hsbTakeUpSpace && !hsbFits(w, h))  // just trying to show HSB, but it doesn't fit
             hsbVisible = false;
-        else if (vsbVisible && !vsbFits(w, h))  // just trying to show VSB, but it doesn't fit
+        else if (vsbVisible && vsbTakeUpSpace && !vsbFits(w, h))  // just trying to show VSB, but it doesn't fit
             vsbVisible = false;

         // Reset the viewport's width,height to account for the visible scrollbars, unless
         // the viewport's size was explicitly set, then we just use that.

         if (isNaN(explicitViewportW))
-            viewportW = w - ((vsbVisible) ? (minViewportInset + vsbRequiredWidth()) : (minViewportInset * 2));
+            viewportW = w - ((vsbVisible && vsbTakeUpSpace) ? (minViewportInset + vsbRequiredWidth()) : (minViewportInset * 2));
         else
             viewportW = explicitViewportW;

         if (isNaN(explicitViewportH))
-            viewportH = h - ((hsbVisible) ? (minViewportInset + hsbRequiredHeight()) : (minViewportInset * 2));
+            viewportH = h - ((hsbVisible && hsbTakeUpSpace) ? (minViewportInset + hsbRequiredHeight()) : (minViewportInset * 2));
         else
             viewportH = explicitViewportH;

@@ -549,18 +561,29 @@

         if (hsbVisible)
         {
-            var hsbW:Number = (vsbVisible) ? w - vsb.getPreferredBoundsWidth() : w;
+            var hsbW:Number = (vsbVisible && vsbTakeUpSpace) ? w - vsb.getPreferredBoundsWidth() : w;
             var hsbH:Number = hsb.getPreferredBoundsHeight();
             hsb.setLayoutBoundsSize(Math.max(hsb.getMinBoundsWidth(), hsbW), hsbH);
-            hsb.setLayoutBoundsPosition(0, h - hsbH);
+
+            // if in overlay mode, let's inset it by a bit
+            if (scroller.getStyle("horizontalScrollPolicy") == ScrollPolicy.OVERLAY)
+                hsb.setLayoutBoundsPosition(0, h - hsbH - 5);
+            else
+                hsb.setLayoutBoundsPosition(0, h - hsbH);
         }

         if (vsbVisible)
         {
             var vsbW:Number = vsb.getPreferredBoundsWidth();
-            var vsbH:Number = (hsbVisible) ? h - hsb.getPreferredBoundsHeight() : h;
+            var vsbH:Number = (hsbVisible && hsbTakeUpSpace) ? h - hsb.getPreferredBoundsHeight() : h;
             vsb.setLayoutBoundsSize(vsbW, Math.max(vsb.getMinBoundsHeight(), vsbH));
-            vsb.setLayoutBoundsPosition(w - vsbW, 0);
+
+            // if in overlay mode, let's inset it by a bit
+            // FIXME (rfrishbe): shouldn't hardcode the 5 here
+            if (scroller.getStyle("verticalScrollPolicy") == ScrollPolicy.OVERLAY)
+                vsb.setLayoutBoundsPosition(w - vsbW - 5, 0);
+            else
+                vsb.setLayoutBoundsPosition(w - vsbW, 0);
         }

         // If we've added an auto scrollbar, then the measured size is likely to have been wrong.


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

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

 package mx.collections
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20032
Author:   smgilson@adobe.com
Date:     2011-02-01T15:47:30.269415Z

Log Message:
-----------
Minor ASDoc edits

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/gridClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/IGridVisualElement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/ComboBoxGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridSelectionMode.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/IGridVisualElement.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/IGridVisualElement.as
@@ -43,8 +43,8 @@
  *

  *
  *
The rowIndex and columnIndex parameters specify the
- *  the cell the visual element will occupy.  If columnIndex=-1 then the visual element
- *  will occupy a Grid row; similarly if rowIndex=-1 then the visual element will occupy
+ *  the cell the visual element will occupy.  If columnIndex = -1 then the visual element
+ *  occupies a Grid row. If rowIndex = -1 then the visual element occupies
  *  a Grid column.

  *
  *
There are many more examples like this in DataGridSkin.mxml.  Note that custom


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

--- frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as
+++ frameworks/projects/spark/src/mx/controls/listClasses/MXItemRenderer.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  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.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/airframework/src/mx/managers/WindowedSystemRawChildrenList.as
+++ frameworks/projects/airframework/src/mx/managers/WindowedSystemRawChildrenList.as
@@ -16,6 +16,8 @@
 import flash.geom.Point;
 import mx.core.IChildList;
 import mx.core.mx_internal;
+
+use namespace mx_internal;

 [ExcludeClass]

@@ -83,7 +85,7 @@
 	 */
 	public function get numChildren():int
 	{
-		return owner.mx_internal::$numChildren;
+		return owner.$numChildren;
 	}

 	/**
@@ -95,7 +97,7 @@
 	 */
   	public function getChildAt(index:int):DisplayObject
   	{
-		return owner.mx_internal::rawChildren_getChildAt(index);
+		return owner.rawChildren_getChildAt(index);
   	}

 	/**
@@ -107,7 +109,7 @@
 	 */
 	public function addChild(child:DisplayObject):DisplayObject
   	{
-		return owner.mx_internal::rawChildren_addChild(child);
+		return owner.rawChildren_addChild(child);
   	}

 	/**
@@ -119,7 +121,7 @@
 	 */
 	public function addChildAt(child:DisplayObject, index:int):DisplayObject
   	{
-		return owner.mx_internal::rawChildren_addChildAt(child,index);
+		return owner.rawChildren_addChildAt(child,index);
   	}

 	/**
@@ -131,7 +133,7 @@
 	 */
 	public function removeChild(child:DisplayObject):DisplayObject
   	{
-		return owner.mx_internal::rawChildren_removeChild(child);
+		return owner.rawChildren_removeChild(child);
   	}

 	/**
@@ -143,7 +145,7 @@
 	 */
 	public function removeChildAt(index:int):DisplayObject
   	{
-		return owner.mx_internal::rawChildren_removeChildAt(index);
+		return owner.rawChildren_removeChildAt(index);
   	}

 	/**
@@ -155,7 +157,7 @@
 	 */
   	public function getChildByName(name:String):DisplayObject
   	{
-		return owner.mx_internal::rawChildren_getChildByName(name);
+		return owner.rawChildren_getChildByName(name);
 	}

 	/**
@@ -167,7 +169,7 @@
 	 */
   	public function getChildIndex(child:DisplayObject):int
   	{
-		return owner.mx_internal::rawChildren_getChildIndex(child);
+		return owner.rawChildren_getChildIndex(child);
   	}

 	/**
@@ -179,7 +181,7 @@
 	 */
 	public function setChildIndex(child:DisplayObject, newIndex:int):void
   	{
-		owner.mx_internal::rawChildren_setChildIndex(child, newIndex);
+		owner.rawChildren_setChildIndex(child, newIndex);
   	}

 	/**
@@ -191,7 +193,7 @@
 	 */
 	public function getObjectsUnderPoint(point:Point):Array
 	{
-		return owner.mx_internal::rawChildren_getObjectsUnderPoint(point);
+		return owner.rawChildren_getObjectsUnderPoint(point);
 	}

 	/**
@@ -203,7 +205,7 @@
 	 */
 	public function contains(child:DisplayObject):Boolean
 	{
-		return owner.mx_internal::rawChildren_contains(child);
+		return owner.rawChildren_contains(child);
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19793
Author:   clucier@adobe.com
Date:     2011-01-18T15:17:55.402132Z

Log Message:
-----------
Just making SlideViewTransition's default consistent with ViewNavigator's default transition configuration.

QE notes: None
Doc notes: None
Bugs: None
Reviewer: NJ
Tests run: Checkin
Is noteworthy for integration: No

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

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

--- frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as
@@ -66,6 +66,9 @@
     public function SlideViewTransition()
     {
         super();
+
+        // Defaut duration of 300 yields a smooth result.
+        duration = 300;
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 12380
Author:   smgilson@adobe.com
Date:     2009-12-02T18:37:15.838623Z

Log Message:
-----------
ASDoc edits in preparation for localization

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/DisplayLayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ToggleButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarHorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.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/spark/src/spark/components/supportClasses/ListItemDragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Range.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as
@@ -39,6 +39,8 @@

 /**
  *  The radius of the corners for this component.
+ *
+ *  @default 4
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -49,6 +51,8 @@

 /**
  *  Controls the visibility of the drop shadow for this component.
+ *
+ *  @default true
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -154,7 +158,9 @@
  *
  *

  *  <s:DropDownListBase
- *    Properties
+ *    Styles
+ *    cornerRadius="4"
+ *    dropShadowVisible="true"
  *
  *    Events
  *    closed="No default"
@@ -670,6 +676,9 @@
         }
     }

+    /**
+     *  @private
+     */
     override protected function findKey(eventCode:int):Boolean
     {
         if (!dataProvider || dataProvider.length == 0)


Transferred from the Adobe Open Source Subversion Repository

Revision: 11951
Author:   hhillen@paciellogroup.com
Date:     2009-11-18T20:35:52.215971Z

Log Message:
-----------
Accessibility implementation support for the spark ToggleButton, DropDownListBase and ComboBox components.
QE notes: none
Doc notes: none
Bugs: n/a
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ToggleButtonAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/DropDownListBaseAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ToggleButtonBase.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/DropDownListAccImpl.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ComboBoxAccImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ButtonAccImpl.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ToggleButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ToggleButtonBase.as
@@ -18,6 +18,8 @@
 import mx.core.mx_internal;
 import mx.events.FlexEvent;

+use namespace mx_internal;
+
 /**
  *  Dispatched when the selected property
  *  changes for the ToggleButtonBase control.
@@ -76,6 +78,12 @@

 // FIXME (egeorgie): figure out whether we need this?
 [DefaultBindingProperty(source="selected", destination="label")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[AccessibilityClass(implementation="spark.accessibility.ToggleButtonAccImpl")]

 /**
  *  The ToggleButtonBase component is the base class for the Spark button components
@@ -95,6 +103,18 @@
 {
     include "../../core/Version.as";

+    //--------------------------------------------------------------------------
+    //
+    //  Class mixins
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Placeholder for mixin by ToggleButtonAccImpl.
+     */
+    mx_internal static var createAccessibilityImplementation:Function;
+
     //--------------------------------------------------------------------------
     //
     //  Constructor
@@ -187,6 +207,21 @@

         dispatchEvent(new Event(Event.CHANGE));
     }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function initializeAccessibility():void
+    {
+        if (ToggleButtonBase.createAccessibilityImplementation != null)
+            ToggleButtonBase.createAccessibilityImplementation(this);
+    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 12295
Author:   smgilson@adobe.com
Date:     2009-11-30T21:41:29.675871Z

Log Message:
-----------
fix for FLEXDOCS-889, and add doc on the WindowedApplication.useNativeDragManager property

QE notes: -
Doc notes: -
Bugs: - FLEXDOCS-889
Reviewer: -
Tests run: - checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/AnchorStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>

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

--- frameworks/projects/airspark/src/spark/components/WindowedApplication.as
+++ frameworks/projects/airspark/src/spark/components/WindowedApplication.as
@@ -388,6 +388,7 @@
  *    systemTrayIconMenu="null"
  *    title=""
  *    titleIcon="null"
+ *    useNativeDragManager="true"
  *
  *    Effects
  *    closeEffect="No default"
@@ -1610,10 +1611,31 @@
     [Inspectable(defaultValue="true")]

     /**
-     *  Specifies if the DragManager should use the NativeDragManagerImpl implementation class.
-     *  If false, then the DragManagerImpl class will be used.
+     *  If true, the DragManager should use the NativeDragManagerImpl implementation class.
+     *  If false, then the DragManagerImpl class will be used.
      *
-     *
Note: This property cannot be set by ActionScript code; it must be set in MXML code.

+     *
Note: This property cannot be set by ActionScript code; it must be set in MXML code.
+     *  That means you cannot change its value at run time.

+     *
+     *
By default, the DragManager  for AIR applications built in Flex uses the
+     *  NativeDragManagerImpl class as the implementation class.
+     *  Flash Player applications build in Flex use the DragManagerImpl class.

+     *
+     *
The NativeDragManagerImpl class is a bridge between the AIR NativeDragManager API
+     *  and the Flex DragManager API.
+     *  The AIR NativeDragManager class uses the operating system's drag and drop APIs.
+     *  It supports dragging between AIR windows and between the operating system and AIR.
+     *  Because the operating system controls the drag-and-drop operation,
+     *  it is not possible to customize the cursors during a drag.
+     *  Also, you have no control over the drop animation.
+     *  The behavior is dependent upon the operating system and has some inconsistencies across different platforms.

+     *
+     *
The DragManagerImpl class does not use the operating system for drag-and-drop.
+     *  Instead, it controls the entire drag-and-drop process.
+     *  It supports customizing the cursors and provides a drop animation.
+     *  However, it does not allow dragging between AIR windows and between the operating system or AIR window.

+     *
+     *  @default true
      *
      *  @langversion 3.0
      *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 21947
Author:   ksimm@adobe.com
Date:     2011-08-12T01:28:00.148877Z

Log Message:
-----------
Refactor findLongestDateItem and findLongestYaerItem functions.

QE notes: no
Doc notes: no
Bugs: no
Reviewer: tkraikit
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/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/YearProvider.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
+++ frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
@@ -241,10 +241,13 @@
     // the NumberFormatter to identify the longest yearList item in DATE mode
     private var numberFormatter:NumberFormatter;

+    // caching the longest digit (the array value) between index and 9, inclusive, and refresh when locale changes
+    private var longestDigitArray:Array = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
     private var dateObj:Date = new Date();
     private var use24HourTime:Boolean;

-    // stores the longest dateList item and updates only when locale changes
+    // store the longest dateList item and updates only when locale changes
     private var longestDateItem:Object;
     private var longestYearItem:Object;

@@ -1068,7 +1071,7 @@
     private function getLongestLabel(list:IList):Object
     {
         var idx:int = -1;
-        var maxWidth:int = 0;
+        var maxWidth:Number = 0;
         var labelWidth:Number;
         for (var i:int = 0; i < list.length; i++)
         {
@@ -1289,24 +1292,27 @@
         return false;
     }

-    // identify the dateList item that has the longest width in DATE_AND_TIME mode
+    // identify the dateList item that has the longest width in DATE_AND_TIME mode
     private function findLongestDateItem():Object
     {
         updateDayMonthDateFormatter();

-        dateTimeFormatter.dateTimePattern =  dayMonthDateFormatter.getMonthPattern();
-
-        var longestDateItemObj:Object = dateList.dataProvider.getItemAt(0);
+        var labelWidth:Number = -1;
+        var maxWidth:Number = 0;
+        dateObj.date = 1;
+        dateObj.hours = 11;
+        dateObj.minutes = 0;
+        dateObj.seconds = 0;
+        dateObj.milliseconds = 0;
+
+        // 1) find the longest month
         var longestMonth:int = 0;
-        var labelWidth:Number = -1;
-        var maxWidth:int = 0;
-        var dateStr:String;
-        dateObj.date = 1;
-
-        // find the longest month
+        dateTimeFormatter.dateTimePattern = dayMonthDateFormatter.getMonthPattern();
+
         for (var month:int = 0; month < 12; month++)
         {
             dateObj.month = month;
+
             labelWidth = measureText(dateTimeFormatter.format(dateObj)).width;
             if (labelWidth > maxWidth)
             {
@@ -1316,95 +1322,134 @@
         }

         dateObj.month = longestMonth;
+
+        // 2) find the longest date
+        var longestDate:int = 0;
+        var longestDateWidth:Number;
         maxWidth = 0;
-
-        // find the longest dateList item
-        for (var date:int = 1; date <= 31; date++)
-        {
-            dateObj.date = date;
-            dateStr = dayMonthDateFormatter.format(dateObj);
-            labelWidth = measureText(dateStr).width;
+        updateNumberFormatter();
+
+        for (var date:int = 1; date <= 28; date++)
+        {
+            labelWidth = measureText(numberFormatter.format(date)).width;
             if (labelWidth > maxWidth)
             {
                 maxWidth = labelWidth;
-                // TODO: dateObj.time for second argument?
-                longestDateItemObj = generateDateItemObject(dateStr, dateObj.time);
-            }
+                longestDate = date;
+            }
+        }
+
+        longestDateWidth = maxWidth;
+        dateObj.date = longestDate;
+
+        // 3) find the longest date item
+        var longestDateItemObj:Object = dateList.dataProvider.getItemAt(0);
+        var formattedDateStr:String;
+        maxWidth = 0;
+
+        for (var year:int = 2000; year <= 2010; year++)
+        {
+            dateObj.fullYear = year;
+            formattedDateStr = dayMonthDateFormatter.format(dateObj);
+            labelWidth = measureText(formattedDateStr).width;
+            if (labelWidth > maxWidth)
+            {
+                maxWidth = labelWidth;
+                longestDateItemObj = generateDateItemObject(formattedDateStr, dateObj.time);
+            }
+        }
+
+        // 4) compare to date 29, 30, 31
+        var trueLongestDate:int = longestDate;
+        maxWidth = longestDateWidth;
+
+        for (date = 29; date <= 31; date++)
+        {
+            labelWidth = measureText(numberFormatter.format(date)).width;
+            if (labelWidth > maxWidth)
+            {
+                maxWidth = labelWidth;
+                trueLongestDate = date;
+            }
+        }
+
+        if (trueLongestDate != longestDate)
+        {
+            formattedDateStr = String(longestDateItemObj.label);
+
+            // replace all the occurrence of the previous longest date to the true longest date
+            longestDateItemObj.label = String(longestDateItemObj.label).replace(new RegExp(numberFormatter.format(longestDate), "g"),
+                numberFormatter.format(trueLongestDate));
+
+            // since the result can be wrong date such as "Wed, Feb 31," assign null to data
+            longestDateItemObj.data = null;
         }

         return longestDateItemObj;
     }

-    // TODO: rename variable names and relocate the function.
     // identify the yearList item that has the longest width in DATE mode
     // the range of year should be from 1601 to 9999
     private function findLongestYearItem():Object
     {
-        // TODO: create functions e.g. getLongestDigit(6) returns the longest digit among 6, 7, 8, 9
-        var longestDigitIncludingZero:int;
-        var longestDigitExcludingZero:int;
-        var longestDigitOf6789:int;
-        var longestDigitOf789:int;
-
-        var maxWidthForlongestDigitIncludingZero:Number = 0;
-        var maxWidthForlongestDigitExcludingZero:Number = 0;
-        var maxWidthForlongestDigitOf6789:Number = 0;
-        var maxWidthForlongestDigitOf789:Number = 0;
-
-        var labelWidth:Number;
-
-        // instantiate the number formatter and update its locale
+        // instantiate the number formatter and set its locale to the DateSpinner's locale
+        // and refresh longestDigitArray to pick the longest digit in a current locale format.
         updateNumberFormatter();

-        // find the four types of the longest digit
-        for (var i:int = 0; i < 10; i++)
-        {
-            labelWidth = measureText(numberFormatter.format(i)).width;
-
-            if (labelWidth > maxWidthForlongestDigitIncludingZero)
-            {
-                maxWidthForlongestDigitIncludingZero = labelWidth;
-                longestDigitIncludingZero = i;
-            }
-
-            if (i >= 1 && labelWidth > maxWidthForlongestDigitExcludingZero)
-            {
-                maxWidthForlongestDigitExcludingZero = labelWidth;
-                longestDigitExcludingZero = i;
-            }
-
-            if (i >= 6 && labelWidth > maxWidthForlongestDigitOf6789)
-            {
-                maxWidthForlongestDigitOf6789 = labelWidth;
-                longestDigitOf6789 = i;
-            }
-
-            if (i >= 7 && labelWidth > maxWidthForlongestDigitOf789)
-            {
-                maxWidthForlongestDigitOf789 = labelWidth;
-                longestDigitOf789 = i;
-            }
-        }
-
         // generate the longest width year
-        var longestYear:int = longestDigitExcludingZero * 1000;
-
-        if (longestDigitExcludingZero > 1)
-            longestYear += longestDigitIncludingZero * 111;
-        else // longestDigitExcludingZero == 1
-            longestYear += ((longestDigitIncludingZero == 0)? longestDigitOf789 : longestDigitOf6789) * 100 +
-                longestDigitIncludingZero * 10 + longestDigitIncludingZero;
-
+        var longestYear:int = getLongestDigit(1) * 1000;
+
+        // if the first (left-most) digit is greater than 1, then the rest digit is just the longest digit of 0~9.
+        if (getLongestDigit(1) > 1)
+            longestYear += getLongestDigit() * 111;
+
+        // if the first digit is 1, then the second digit should be greater than or equal to
+        // (1) 7 if none of last two digits is 0.
+        // (2) 6 if both last two digits are 0.
+        else
+            longestYear += ((getLongestDigit() == 0)? getLongestDigit(7) : getLongestDigit(6)) * 100 +
+                getLongestDigit() * 10 + getLongestDigit();
+
         dateObj.fullYear = longestYear;
         dateTimeFormatter.dateTimePattern = dateTimeFormatterEx.getYearPattern();
         return generateDateItemObject(dateTimeFormatter.format(dateObj), longestYear);
     }

+    // return the longest digit between min and 9, inclusive
+    // call updateNumberFormatter() before calling this function to refresh longestDigitArray
+    private function getLongestDigit(min:int = 0):int
+    {
+        var longestDigit:int = longestDigitArray[min];
+        var labelWidth:Number = -1;
+        var maxWidth:Number = 0;
+
+        if (longestDigit == -1)
+        {
+            for (var i:int = min; i < 10; i++)
+            {
+                labelWidth = measureText(numberFormatter.format(i)).width;
+                if (labelWidth > maxWidth)
+                {
+                    maxWidth = labelWidth;
+                    longestDigit = i;
+                }
+            }
+
+            longestDigitArray[min] = longestDigit;
+        }
+
+        return longestDigit;
+    }
+
     // instantiate the number formatter and update its locale property
     private function updateNumberFormatter():void
     {
         if(!numberFormatter)
             numberFormatter = new NumberFormatter();
+
+        // reset to -1
+        for (var i:int = 0; i < longestDigitArray.length; i++)
+            longestDigitArray[i] = -1;

         var localeStr:String = getStyle("locale");
         if (localeStr)