Transferred from the Adobe Open Source Subversion Repository

Revision: 11873
Author:   klin@adobe.com
Date:     2009-11-17T00:17:50.385514Z

Log Message:
-----------
Fix for http://bugs.adobe.com/jira/browse/SDK-22800.

ButtonBase.as - Subclasses of ButtonBase were updating properties like selected and selection in the clickHandler. This caused the buttons to be in an intermediary state between the mouse up event and the mouse click event. I've added a new protected method called buttonReleased() that is called during the mouse up handler when the mouse is captured and when the mouse is hovering over the button. This allows the button to smoothly transition between states like down and overAndSelected without passing through the over state. I also separated out some of the systemManager mouse up handlers into a separate handler.

ToggleButtonBase.as, RadioButton.as - Moved the update code from clickHandler to buttonReleased.

QE notes: No
Doc notes: No
Bugs: SDK-22800
Reviewer: Evtim
Tests run: checkintests, Button, ToggleButton, RadioButton
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.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>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
@@ -816,7 +816,7 @@

     /**
      *  @private
-     *  This method adds the mouseEventHandler as an event listener to
+     *  This method adds the systemManager_mouseUpHandler as an event listener to
      *  the stage and the systemManager so that it gets called even if mouse events
      *  are dispatched outside of the button. This is needed for example when the
      *  user presses the button, drags out and releases the button.
@@ -824,24 +824,24 @@
     private function addSystemMouseHandlers():void
     {
         systemManager.getSandboxRoot().addEventListener(
-            MouseEvent.MOUSE_UP, mouseEventHandler, true /* useCapture */);
+            MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true /* useCapture */);

         systemManager.getSandboxRoot().addEventListener(
-            SandboxMouseEvent.MOUSE_UP_SOMEWHERE, mouseEventHandler);
-    }
-
-    /**
-     *  @private
-     *  This method removes the mouseEventHandler as an event listener from
-     *  the stage and the systemManager.
+            SandboxMouseEvent.MOUSE_UP_SOMEWHERE, systemManager_mouseUpHandler);
+    }
+
+    /**
+     *  @private
+     *  This method removes the systemManager_mouseUpHandler as an event
+     *  listener from the stage and the systemManager.
      */
     private function removeSystemMouseHandlers():void
     {
         systemManager.getSandboxRoot().removeEventListener(
-            MouseEvent.MOUSE_UP, mouseEventHandler, true /* useCapture */);
+            MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true /* useCapture */);

         systemManager.getSandboxRoot().removeEventListener(
-            SandboxMouseEvent.MOUSE_UP_SOMEWHERE, mouseEventHandler);
+            SandboxMouseEvent.MOUSE_UP_SOMEWHERE, systemManager_mouseUpHandler);
     }

     /**
@@ -916,6 +916,23 @@
     {
         autoRepeatTimer.stop();
         autoRepeatTimer = null;
+    }
+
+    /**
+     *  This method is called when handling a MouseEvent.MOUSE_UP event
+     *  when the user clicks on the button. It is only called when the button
+     *  is the target and when mouseCaptured is true. It allows subclasses
+     *  to update the properties of the button right as it is clicked to
+     *  avoid the button being in transitional states between the mouse up
+     *  and click events.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function buttonReleased():void
+    {
     }

     //--------------------------------------------------------------------------
@@ -974,12 +991,7 @@
      *  where appropriate and updates the hovered and
      *  mouseCaptured properties.
      *
This method gets called to handle MouseEvent.ROLL_OVER, MouseEvent.ROLL_OUT,
-     *  MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_UP, MouseEvent.CLICK and
-     *  SandboxMouseEvent.MOUSE_UP_SOMEWHERE.

-     *
For MouseEvent.MOUSE_UP and SandboxMouseEvent.MOUSE_UP_SOMEWHERE, the event
-     *  target can be other than the ButtonBase - for example when the user presses the
-     *  ButtonBase, we listen for MOUSE_UP and MOUSE_UP_SOMEWHERE to handle cases where the user drags
-     *  outside the ButtonBase and releases the mouse.

+     *  MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_UP, and MouseEvent.CLICK.

      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -1008,7 +1020,7 @@

             case MouseEvent.MOUSE_DOWN:
             {
-                // When the button is down we need to listen for mouse events outsied the button so that
+                // When the button is down we need to listen for mouse events outside the button so that
                 // we update the state appropriately on mouse up.  Whenever mouseCaptured changes to false,
                 // it will take care to remove those handlers.
                 addSystemMouseHandlers();
@@ -1018,12 +1030,18 @@

             case MouseEvent.MOUSE_UP:
             {
-                if (event.currentTarget == this)
+                // Call buttonReleased() if we mouse up on the button and if the mouse
+                // was captured before.
+                if (event.target == this)
+                {
                     hovered = true;
-            } //fallthrough:
-            case SandboxMouseEvent.MOUSE_UP_SOMEWHERE:
-            {
-                mouseCaptured = false;
+
+                    if (mouseCaptured)
+                    {
+                        buttonReleased();
+                        mouseCaptured = false;
+                    }
+                }
                 break;
             }

@@ -1061,6 +1079,19 @@
     /**
      *  @private
      */
+    private function systemManager_mouseUpHandler(event:Event):void
+    {
+        // If the target is the button, do nothing because the
+        // mouseEventHandler will be handle it.
+        if (event.target == this)
+            return;
+
+        mouseCaptured = false;
+    }
+
+    /**
+     *  @private
+     */
     private function autoRepeat_timerDelayHandler(event:TimerEvent):void
     {
         autoRepeatTimer.reset();


add lOgger.

add lOgger.

--- actionscript-cafe/src/main/flex/org/servebox/cafe/core/signal/SignalAggregator.as
+++ actionscript-cafe/src/main/flex/org/servebox/cafe/core/signal/SignalAggregator.as
@@ -8,6 +8,9 @@
 */
 package org.servebox.cafe.core.signal
 {
+	import mx.logging.ILogger;
+	import mx.logging.Log;
+
 	import org.servebox.cafe.core.observer.AbstractObservable;
 	import org.servebox.cafe.core.observer.IObservable;
 	import org.servebox.cafe.core.observer.IObserver;
@@ -16,9 +19,7 @@
 	public class SignalAggregator extends AbstractObservable
 	{

-		public function SignalAggregator()
-		{
-		}
+		public var log : ILogger = Log.getLogger("SignalAggregator");

 		override public function registerObserver(o:IObserver, notificationFilters:Array=null):void
 		{
@@ -40,7 +41,7 @@

 		public function signal( type : String, ... cargo) : void
 		{
-
+			log.info("SignalAggregator runs " + type );

 			if( cargo.length > 0 )
 			{


bug fix - no longer clearing metadata in ProxyColumn.dataUnavailable()

Change-Id: Icdaefe3a8d159b336c08e7536f33173c6c5078d7

--- WeaveData/src/weave/data/AttributeColumns/ProxyColumn.as
+++ WeaveData/src/weave/data/AttributeColumns/ProxyColumn.as
@@ -76,7 +76,10 @@
 		 * @return The metadata value of the ProxyColumn or the internal column, ProxyColumn metadata takes precendence.
 		 */
 		override public function getMetadata(propertyName:String):String
-		{
+		{
+			if (propertyName === ColumnMetadata.TITLE && _overrideTitle)
+				return _overrideTitle;
+
 			var overrideValue:String = super.getMetadata(propertyName);
 			if (overrideValue == null && _internalColumn != null)
 				return _internalColumn.getMetadata(propertyName);
@@ -120,7 +123,9 @@
 			return _internalColumn;
 		}
 		public function setInternalColumn(newColumn:IAttributeColumn):void
-		{
+		{
+			_overrideTitle = null;
+
 			if (newColumn == this)
 			{
 				trace("WARNING! Attempted to set ProxyColumn.internalAttributeColumn to self: " + this);
@@ -164,6 +169,8 @@
 			setInternalColumn(null); // this will remove the callback that was added to the internal column
 		}

+		private var _overrideTitle:String;
+
 		/**
 		 * Call this function when the ProxyColumn should indicate that the requested data is unavailable.
 		 * @param message The message to display in the title of the ProxyColumn. Default is "Data unavailable."
@@ -171,10 +178,9 @@
 		public function dataUnavailable(message:String = null):void
 		{
 			delayCallbacks();
-			var meta:Object = {};
-			meta[ColumnMetadata.TITLE] = message || lang("Data unavailable");
-			setMetadata(meta);
 			setInternalColumn(null);
+			_overrideTitle = message || lang("Data unavailable");
+			triggerCallbacks();
 			resumeCallbacks();
 		}


* fix for length -> size() change

* fix for length -> size() change

--- scripts/engine/collections/Arrays.as
+++ scripts/engine/collections/Arrays.as
@@ -5,8 +5,8 @@
 {
 	static public <Type> void copy(Type[] from, Type[] to)
 	{
-		assert from.length <= to.length;
-		for ( int index = 0; index < from.length; index++ )
+		assert from.size() <= to.size();
+		for ( int index = 0; index < from.size(); index++ )
 		{
 			to[index] = from[index];
 		}
@@ -14,7 +14,7 @@

 	static public <Type> boolean equals(Type[] left, Type[] right)
 	{
-		return equals(left, right, left.length);
+		return equals(left, right, left.size());
 	}

 	static public <Type> boolean equals(Type[] left, Type[] right, int length)


drop colorTime from Flash version as well

merge yuv & drawing time into one to match current JS

--- src/ogv.as
+++ src/ogv.as
@@ -73,7 +73,6 @@
         private var videoDecodingTime:Number = 0;
         private var audioDecodingTime:Number = 0;
         private var bufferTime:Number = 0;
-        private var colorTime:Number = 0;
         private var drawingTime:Number = 0;
         private var totalJitter:Number = 0;
         private var lastFrameDecodeTime:Number = 0;
@@ -232,7 +231,6 @@
                     videoDecodingTime: videoDecodingTime,
                     audioDecodingTime: audioDecodingTime,
                     bufferTime: bufferTime,
-                    colorTime: colorTime,
                     drawingTime: drawingTime,
                     droppedAudio: droppedAudio,
                     jitter: totalJitter / framesProcessed
@@ -245,7 +243,6 @@
                 videoDecodingTime = 0;
                 audioDecodingTime = 0;
                 bufferTime = 0;
-                colorTime = 0;
                 drawingTime = 0;
                 totalJitter = 0;
             });
@@ -663,21 +660,17 @@
             frameEndTimestamp = yCbCrBuffer.timestamp;

             var start:Number, delta:Number;
+            start = getTimestamp();

             // colorspace conversion
-            start = getTimestamp();
             var bytesARGB:ByteArray = codec.convertYCbCr(yCbCrBuffer);
-            delta = getTimestamp() - start;
-            colorTime += delta;
-            lastFrameDecodeTime += delta;

             // drawing
-            start = getTimestamp();
             var rect:Rectangle = new Rectangle(0, 0, videoInfo.frameWidth, videoInfo.frameHeight);
             bytesARGB.position = 0;
             bitmapData.setPixels(rect, bytesARGB);
+
             delta = getTimestamp() - start;
-
             lastFrameDecodeTime += delta;
             drawingTime += delta;
             framesProcessed++;


def: 6252 don't show related when player is set to loop

git-svn-id: 3f608e5a9a704dd448217c0a64c508e7f145cfa1@92214 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

--- plugins/relatedViewPlugin/src/com/kaltura/kdpfl/plugin/component/RelatedViewMediator.as
+++ plugins/relatedViewPlugin/src/com/kaltura/kdpfl/plugin/component/RelatedViewMediator.as
@@ -4,6 +4,7 @@

 	import org.puremvc.as3.interfaces.INotification;
 	import org.puremvc.as3.patterns.mediator.Mediator;
+	import com.kaltura.kdpfl.view.media.KMediaPlayerMediator;

 	public class RelatedViewMediator extends Mediator
 	{
@@ -39,7 +40,10 @@
 			switch (note.getName())
 			{
 				case NotificationType.PLAYER_PLAY_END:
-					if (showAfterPlayEnd && (viewComponent as relatedViewPluginCode).dataProvider && (viewComponent as relatedViewPluginCode).dataProvider.length)
+					if (showAfterPlayEnd &&
+						!((facade.retrieveMediator(KMediaPlayerMediator.NAME) as KMediaPlayerMediator).player.loop) &&
+						(viewComponent as relatedViewPluginCode).dataProvider &&
+						(viewComponent as relatedViewPluginCode).dataProvider.length)
 					{
 						viewComponent.visible = true;
 						(viewComponent as relatedViewPluginCode).showReplayBtn = true;


fixed warning

fixed warning

Change-Id: Iaf3b8a0040d581c751997fd59d4a6c8171f9baf4

--- WeaveData/src/weave/data/BinningDefinitions/NaturalJenksBinningDefinition.as
+++ WeaveData/src/weave/data/BinningDefinitions/NaturalJenksBinningDefinition.as
@@ -19,23 +19,17 @@

 package weave.data.BinningDefinitions
 {
-	import com.hurlant.util.ArrayUtil;
-
-	import mx.collections.errors.SortError;
-	import mx.utils.ArrayUtil;
 	import mx.utils.ObjectUtil;

-	import weave.api.WeaveAPI;
+	import weave.api.registerLinkableChild;
+	import weave.api.reportError;
 	import weave.api.core.ILinkableHashMap;
 	import weave.api.data.IAttributeColumn;
 	import weave.api.data.IPrimitiveColumn;
 	import weave.api.data.IQualifiedKey;
-	import weave.api.registerLinkableChild;
 	import weave.core.LinkableNumber;
 	import weave.data.BinClassifiers.NumberClassifier;
 	import weave.utils.AsyncSort;
-	import weave.utils.ColumnUtils;
-	import weave.utils.NumberUtils;
 	import weave.utils.VectorUtils;

 	/**
@@ -169,15 +163,8 @@

 		private function getJenksBreak(column:IAttributeColumn):Array
 		{
-			if(_previousBreaks != null)
-			{
-				_previousBreaks = [];
-			}
-
-			if(_previousSortedValues != null)
-			{
-				_previousSortedValues = [];
-			}
+			_previousBreaks.length = 0;
+			_previousSortedValues.length = 0;

 			var sortedValues:Array = getSortedNumbersFromColumn(column);

@@ -289,16 +276,17 @@
 		private function getSumOfNumbers(list:Array):Number
 		{
 			var result:Number = 0;
-			try{
+			try
+			{
 				for each (var num:Number in list)
 				{
 					result += num;
 				}
-
-			}catch(e:Error)
-			{
-				WeaveAPI.ErrorManager.reportError(e.message, "Error adding numbers in array");
-				return null;
+			}
+			catch(e:Error)
+			{
+				reportError(e, "Error adding numbers in array");
+				return 0;
 			}

 			return result;


Transferred from the Adobe Open Source Subversion Repository

Revision: 19746
Author:   dloverin@adobe.com
Date:     2011-01-13T20:13:17.960593Z

Log Message:
-----------
BusyIndicator fixes.

* Draw the BusyIndicator using rounded lines with no children.
* Fix a bug where the (x,y) of the component was modified by the rotation of the component. Fixed by calling transformAround() with the rotation vector as the postLayoutRotation instead of the rotation parameter.
* Fix layout problem by clearing the postLayoutTransformOffsets when the BusyIndicator is invalidated (code in invalidateDisplayList).
* New default alpha values for the spokes and component.
* New default sizes.

QE notes: None.
Doc notes: None.
Bugs: SDK-29060
Reviewer: Glenn
Tests run: checkintests
Is noteworthy for integration: No.

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/BusyIndicator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/BusyIndicator.as
@@ -12,13 +12,16 @@
 package spark.components
 {

+import flash.display.CapsStyle;
 import flash.display.Graphics;
+import flash.display.LineScaleMode;
 import flash.display.Shape;
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.TimerEvent;
 import flash.geom.Matrix;
 import flash.geom.Matrix3D;
+import flash.geom.Point;
 import flash.geom.Transform;
 import flash.geom.Vector3D;
 import flash.utils.Timer;
@@ -66,7 +69,7 @@
 [Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark,mobile")]

 /**
- *  The BusyIndicator defines a component to display a when a long-running
+ *  The BusyIndicator defines a component to display when a long-running
  *  operation is in progress. This component is a spinner with twelve spokes.
  *  The color of the spokes is controled by the value of the symbolColor style.
  *  The transparency of this component can be modified using the alpha property
@@ -82,9 +85,9 @@
  *
The BusyIndicator has the following default characteristics:

  *

  *
Characteristic	Description

- *
Default size	160 DPI: 22x22 pixels

- *                                  240 DPI: 34x34 pixels

- *                                  320 DPI: 44x44 pixels

+ *
Default size	160 DPI: 28x28 pixels

+ *                                  240 DPI: 40x40 pixels

+ *                                  320 DPI: 56x56 pixels

  *
Minimum size	20x20 pixels

  *
Maximum size	No limit

  *

@@ -95,7 +98,7 @@
  *
  *  @mxml
  *
-*
The <s:BusyCursor> tag inherits the symbolColor style
+ *
The <s:BusyCursor> tag inherits the symbolColor style
  *  and adds the rotationInterval style.

  *
  *

@@ -135,6 +138,11 @@
      */
     static private const DEFAULT_MINIMUM_SIZE:Number = 20;

+    /**
+     *  @private
+     */
+    static private const RADIANS_PER_DEGREE:Number = Math.PI / 180;
+
     //--------------------------------------------------------------------------
     //
     //  Constructor
@@ -153,7 +161,7 @@
     {
         super();

-        alpha = 0.65;       // default alpha
+        alpha = 0.60;       // default alpha

         // Listen to added to stage and removed from stage.
         // Start rotating when we are on the stage and stop
@@ -206,12 +214,35 @@
      *  Diameter of the spinner for this component.
      */
     private var spinnerDiameter:int;
-
-    //--------------------------------------------------------------------------
-    //
-    //  Public Properties
-    //
-    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Cache the last value of applicationDPI.
+     */
+    private var _applicationDPI:int;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Properties
+    //
+    //--------------------------------------------------------------------------
+    /**
+     *  @private
+     *
+     *  Get the applicationDPI in use.
+     */
+    private function get applicationDPI():int
+    {
+        if (_applicationDPI)
+            return _applicationDPI;
+
+        var application:Object = FlexGlobals.topLevelApplication;
+
+        if ("applicationDPI" in application)
+            _applicationDPI = application["applicationDPI"];
+
+        return _applicationDPI;
+    }

     //--------------------------------------------------------------------------
     //
@@ -243,32 +274,40 @@
     /**
      *  @private
      */
+    override public function invalidateDisplayList():void
+    {
+        super.invalidateDisplayList();
+
+        if (currentRotation > 0)
+            postLayoutTransformOffsets = new TransformOffsets();
+    }
+
+    /**
+     *  @private
+     */
     override protected function measure():void
     {
         super.measure();

         // Set the default measured size depending on the
         // applicationDPI
-        var applicationDPI:int = 0;
-        var application:Object = FlexGlobals.topLevelApplication;
-
-        if ("applicationDPI" in application)
-            applicationDPI = application["applicationDPI"];
+
+        //trace("applicationDPI = " + applicationDPI);

         if (applicationDPI == 320)
         {
-            measuredWidth = 44;
-            measuredHeight = 44;
+            measuredWidth = 56;
+            measuredHeight = 56;
         }
         else if (applicationDPI == 240)
         {
-            measuredWidth = 34;
-            measuredHeight = 34;
+            measuredWidth = 40;
+            measuredHeight = 40;
         }
         else if (applicationDPI == 160)
         {
-            measuredWidth = 22;
-            measuredHeight = 22;
+            measuredWidth = 28;
+            measuredHeight = 28;
         }
         else
         {
@@ -353,8 +392,34 @@
         var diameter:Number = Math.min(width, height);
         diameter = Math.max(DEFAULT_MINIMUM_SIZE, diameter);
         if (diameter % 2 != 0)
-        {
             diameter--;
+
+        diameter = spinnerDiameterFixup(diameter);
+
+        return diameter;
+    }
+
+    /**
+     *  @private
+     *
+     *  Modify the spinnerDiameter to avoid diameters that end up causing the
+     *  spinner to jitter. This will cause us to reuse the spokeWidth and
+     *  spokeHeight of the previous diameter size.
+     */
+    private function spinnerDiameterFixup(diameter:Number):Number
+    {
+        if (applicationDPI == 240)
+        {
+            // For diameter 30, use the settings for diameter 28 (29 is the same)
+            if (diameter >= 30 && diameter <= 33)
+                diameter = 28;
+        }
+        else if (applicationDPI == 160)
+        {
+            if (diameter == 24)
+                diameter = 22;
+            else if (diameter == 28)
+                diameter = 26;
         }

         return diameter;
@@ -363,8 +428,7 @@
    /**
     *   @private
     *
-    *   Removes the old spinner children, if any, and adds
-    *   new ones.
+    *   Draw the spinner.
     */
     private function updateSpinnerChildren(diameter:Number):void
     {
@@ -373,150 +437,192 @@
         if (isRotating)
             stopRotation();

-        var n:int = numChildren;
-        for (var i:int = 0; i < n; i++)
-        {
-            removeChildAt(0);
-        }
-
-        // FIXME (dloverin): need to reset the accumulated
-        // transform matrix information. Current attempts
-        // have not worked.
-
-        //setLayoutMatrix3D(new Matrix3D(), false);
-        //postLayoutTransformOffsets = new TransformOffsets();
-
-        // Add the spinner children that when combined create the
-        // spinner.
         spinnerDiameter = diameter;
-
-        var spinnerChildren:Array = createSpinnerChildren();
-        n = spinnerChildren.length;
-
-        for (i = 0; i < n; i++)
-            addChild(spinnerChildren[i]);
+
+        drawSpinnerChildren();

         if (isRotating)
             startRotation();
     }

-
-    /**
-     *   @private
+    /**
+     *  @private
      *
-     *   Create the three spinner chilren and returns them in
-     *   an array.
+     *  Draw the twelve spokes of the children.
+     */
+    mx_internal function drawSpinnerChildren():void
+    {
+
+        var spokeColor:uint = getStyle("symbolColor");
+        var g:Graphics = graphics;
+        var spinnerRadius:int = spinnerDiameter / 2;
+        var spinnerWidth:int = spinnerDiameter;
+        var spokeHeight:Number = spinnerDiameter / 3.7;
+        var insideDiameter:Number = spinnerDiameter - (spokeHeight * 2);
+        var spokeWidth:Number = insideDiameter / 5;
+        var eHeight:Number = spokeWidth / 2;
+        var center:Number = spinnerRadius - 1;
+        var spinnerPadding:Number = 0;
+
+
+        // Modify the spoke width and height for various DPI and spinnerDiameter
+        // combinations. These combinations cause the spinner to jitter when
+        // it is rotated. Override the calculated spokeHeight and spokeWidth
+        // with hard-coded values.
+        if (applicationDPI == 240)
+        {
+            if (spinnerDiameter >= 28 && spinnerDiameter <= 29)
+            {
+                spokeHeight = 8;
+                spokeWidth = 2.5;
+            }
+            else if (spinnerDiameter >= 34 && spinnerDiameter <= 35)
+            {
+                spokeHeight = 9;
+                spokeWidth = 4;
+            }
+            else if (spinnerDiameter >= 36 && spinnerDiameter <= 39)
+            {
+                spokeWidth += 0.5;
+            }
+
+        }
+        else if (applicationDPI == 160)
+        {
+            if (spinnerDiameter == 20)
+            {
+                spokeHeight = 6;
+                spokeWidth = 1.4;
+                spinnerPadding = 0.5;
+            }
+        }
+        else if (applicationDPI == 320)
+        {
+            if (spinnerDiameter == 28)
+            {
+                spokeWidth = 2;
+            }
+            else if (spinnerDiameter == 36)
+            {
+                spokeWidth = 2;
+                spinnerPadding = 1;
+            }
+            else if (spinnerDiameter == 40)
+            {
+                spokeWidth = 3;
+                spinnerPadding = 1;
+            }
+            else if (spinnerDiameter == 48)
+            {
+                spokeWidth = 5;
+            }
+        }
+
+//        // Undocumented styles to modified the spokeWidth
+//        // and spokeHeight.
+//        if (getStyle("spokeWidth") !== undefined)
+//        {
+//            spokeWidth = getStyle("spokeWidth");
+//            eHeight = spokeWidth / 2;
+//        }
+//
+//        if (getStyle("spokeHeight") !== undefined)
+//            spokeHeight = getStyle("spokeHeight");
+//
+//        // spinnerPadding is the padding between the outside
+//        // edge of the circle and the edge of a spoke.
+//        if (getStyle("spinnerPadding") !== undefined)
+//            spinnerPadding = getStyle("spinnerPadding");
+//
+//        trace("spoke height = " + spokeHeight);
+//        trace("spoke width = " + spokeWidth);
+//        trace("center = " + center);
+
+        g.clear();
+
+        // 1
+        drawSpoke(0.20, 300, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 2
+        drawSpoke(0.25, 330, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 3
+        drawSpoke(0.30, 0, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 4
+        drawSpoke(0.35, 30, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 5
+        drawSpoke(0.40, 60, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 6
+        drawSpoke(0.45, 90, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 7
+        drawSpoke(0.50, 120, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 8
+        drawSpoke(0.60, 150, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 9
+        drawSpoke(0.70, 180, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 10
+        drawSpoke(0.80, 210, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 11
+        drawSpoke(0.90, 240, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+
+        // 12
+        drawSpoke(1.0, 270, spokeWidth, spokeHeight, spokeColor, spinnerRadius, eHeight, spinnerPadding);
+    }
+
+
+    /**
+     *  @private
      *
-     *   The spinner children are created based on the current
-     *   value of the symbolColor style and the spinnerDiameter.
-     *
-     *   The spinner has twelve spokes in the position of a clock
-     *   face. Each spoke has a differnt alpha. Three children
-     *   are used for different parts of the clockface. Each
-     *   child contains four spokes. The first child contains
-     *   the spokes for 12, 3, 6, and 9 o'clock.
-     *
-     *   The second child
-     *   is drawn the same as the first child (but with different
-     *   alphas) but is roatated 30 degrees. The second child
-     *   represents 1, 4, 7, and 10 o'clock.
-     *
-     *   The third child is drawn the same with differnt alpha
-     *   but it is rotated 60 degrees. The third child represents
-     *   2, 5, 8, and 11 o'clock.
-     *
-     */
-    private function createSpinnerChildren():Array
-    {
-
-        var spokeColor:uint = getStyle("symbolColor");
-        var g:Graphics;
-        var spinner12:Shape = new Shape();
-        var spinner1:Shape = new Shape();
-        var spinner2:Shape = new Shape();
-        var localSpinnerDiameter:int = spinnerDiameter;
-        var halfSpinnerDiameter:int = spinnerDiameter / 2;
-        var spinnerWidth:int = spinnerDiameter;
-        var halfSpinnerWidth:int = spinnerWidth / 2;
-        var halfSpinnerHeight:int = spinnerDiameter / 2;
-        var spokeWidth:int = spinnerDiameter / 10;
-        var spokeHeight:int = spinnerDiameter / 4;
-        var halfSpokeWidth:int = spokeWidth / 2;
-        var halfSpokeHeight:int = spokeHeight / 2;
-        var eWidth:int = spokeWidth;
-        var eHeight:int = spokeWidth / 2;
-        var m:Matrix;
-
-        // First child
-        g = spinner12.graphics;
-
-        // 12
-        g.beginFill(spokeColor, 1);
-        g.drawRoundRect(halfSpinnerDiameter - halfSpokeWidth, 1, spokeWidth, spokeHeight, eWidth, eHeight);
-
-        // 9
-        g.beginFill(spokeColor, 0.89);
-        g.drawRoundRect(1, halfSpinnerDiameter - halfSpokeWidth, spokeHeight, spokeWidth,  eWidth, eHeight);
-
-        // 6
-        g.beginFill(spokeColor, 0.73);
-        g.drawRoundRect(halfSpinnerDiameter - halfSpokeWidth, localSpinnerDiameter - spokeHeight - 1, spokeWidth, spokeHeight,  eWidth, eHeight);
-
-        // 3
-        g.beginFill(spokeColor, 0.53);
-        g.drawRoundRect(localSpinnerDiameter - spokeHeight - 1, halfSpinnerDiameter - halfSpokeWidth, spokeHeight, spokeWidth, eWidth, eHeight);
-
-        // Second child
-        g = spinner1.graphics;
-
-        // 1
-        g.beginFill(spokeColor, 0.45);
-        g.drawRoundRect(halfSpinnerDiameter - halfSpokeWidth, 1, spokeWidth, spokeHeight, eWidth, eHeight);
-
-        // 10
-        g.beginFill(spokeColor, 0.93);
-        g.drawRoundRect(1, halfSpinnerDiameter - halfSpokeWidth, spokeHeight, spokeWidth,  eWidth, eHeight);
-
-        // 7
-        g.beginFill(spokeColor, 0.80);
-        g.drawRoundRect(halfSpinnerDiameter - halfSpokeWidth, localSpinnerDiameter - spokeHeight - 1, spokeWidth, spokeHeight,  eWidth, eHeight);
-
-        // 4
-        g.beginFill(spokeColor, 0.55);
-        g.drawRoundRect(localSpinnerDiameter - spokeHeight - 1, halfSpinnerDiameter - halfSpokeWidth, spokeHeight, spokeWidth, eWidth, eHeight);
-
-        m = new Matrix();
-        m.translate(-halfSpinnerDiameter,-halfSpinnerDiameter);
-        m.rotate( (30 * Math.PI) / 180);
-        m.translate(halfSpinnerDiameter, halfSpinnerDiameter);
-        spinner1.transform.matrix = m;
-
-        // Third child
-        g = spinner2.graphics;
-
-        // 2
-        g.beginFill(spokeColor, 0.49);
-        g.drawRoundRect(halfSpinnerDiameter - halfSpokeWidth, 1, spokeWidth, spokeHeight, eWidth, eHeight);
-
-        // 11
-        g.beginFill(spokeColor, 0.95);
-        g.drawRoundRect(1, halfSpinnerDiameter - halfSpokeWidth, spokeHeight, spokeWidth,  eWidth, eHeight);
-
-        // 8
-        g.beginFill(spokeColor, 0.82);
-        g.drawRoundRect(halfSpinnerDiameter - halfSpokeWidth, localSpinnerDiameter - spokeHeight - 1, spokeWidth, spokeHeight,  eWidth, eHeight);
-
-        // 5
-        g.beginFill(spokeColor, 0.65);
-        g.drawRoundRect(localSpinnerDiameter - spokeHeight - 1, halfSpinnerDiameter - halfSpokeWidth, spokeHeight, spokeWidth, eWidth, eHeight);
-
-        m = new Matrix();
-        m.translate(-halfSpinnerDiameter,-halfSpinnerDiameter);
-        m.rotate( (60 * Math.PI) / 180);
-        m.translate(halfSpinnerDiameter, halfSpinnerDiameter);
-        spinner2.transform.matrix = m;
-
-        return [spinner12, spinner1, spinner2];
+     *  @param spokeAlpha: alpha value of the spoke.
+     *  @param spokeWidth: width of the spoke in points.
+     *  @param spokeHeight: the lenght of the spoke in pixels.
+     *  @param spokeColor: the color of the spoke.
+     *  @param spinnerRadius: radius of the spinner.
+     *  @param eHeight: estimated height of the rounded end of the spinner.
+     *  @param spinnerPadding: number of pixels between the outside
+     *  radius of the spinner and the spokes. This is used to make
+     *  spinners with skinny spokes look better by moving them
+     *  closer to the center of the spinner.
+     */
+    private function drawSpoke(spokeAlpha:Number, degrees:int,
+                               spokeWidth:Number,
+                               spokeHeight:Number,
+                               spokeColor:uint,
+                               spinnerRadius:Number,
+                               eHeight:Number,
+                               spinnerPadding:Number):void
+    {
+        var g:Graphics = graphics;
+        var outsidePoint:Point = new Point();
+        var insidePoint:Point = new Point();
+
+        g.lineStyle(spokeWidth, spokeColor, spokeAlpha, false, LineScaleMode.NORMAL, CapsStyle.ROUND);
+        outsidePoint = calculatePointOnCircle(spinnerRadius - 1, spinnerRadius - eHeight - spinnerPadding, degrees);
+        insidePoint = calculatePointOnCircle(spinnerRadius - 1, spinnerRadius - spokeHeight + eHeight - spinnerPadding, degrees);
+        g.moveTo(outsidePoint.x, outsidePoint.y);
+        g.lineTo(insidePoint.x,  insidePoint.y);
+
+    }
+
+    /**
+     *  @private
+     */
+    private function calculatePointOnCircle(center:Number, radius:Number, degrees:Number):Point
+    {
+        var point:Point = new Point();
+        var radians:Number = degrees * RADIANS_PER_DEGREE;
+        point.x = center + radius * Math.cos(radians);
+        point.y = center + radius * Math.sin(radians);
+
+        return point;
     }

     /**
@@ -712,12 +818,15 @@
      */
     private function timerHandler(event:TimerEvent):void
     {
-
         var spinnerRadius:int = (spinnerDiameter / 2);
-        var transformCenter:Vector3D = new Vector3D(spinnerRadius, spinnerRadius);
+        var transformCenter:Vector3D = new Vector3D(spinnerRadius - 1, spinnerRadius - 1);
+
         currentRotation += 30;
         var rotation3D:Vector3D = new Vector3D(0, 0, currentRotation);
-        transformAround(transformCenter, null, rotation3D, null, null, null, null, false);
+        if (currentRotation >= 360)
+            currentRotation = 0;
+
+        transformAround(transformCenter, null, null, null, null, rotation3D, null, false);

         event.updateAfterEvent();
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 8481
Author:   smgilson@adobe.com
Date:     2009-07-09T17:28:31.741329Z

Log Message:
-----------
First of several checkins to update the namespace in ASDoc MXML syntax descriptions for Spark components

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<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/Group.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/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>
<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/HSlider.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/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.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/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.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/SkinnableContainer.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/List.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/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Range.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
@@ -140,7 +140,7 @@
  *  attributes of its superclass and adds the following tag attributes:

  *
  *

- *  <GroupBase
+ *  <s:GroupBase
  *    Properties
  *    autoLayout="true"
  *    clipAndEnableScrolling="false"
@@ -1350,11 +1350,11 @@
     {
         if (_mask !== value)
         {
-			if (_mask && _mask.parent === this)
-			{
-				super.removeChild(_mask);
-			}
-
+            if (_mask && _mask.parent === this)
+            {
+                super.removeChild(_mask);
+            }
+
             _mask = value;
             maskChanged = true;
             invalidateDisplayList();


Transferred from the Adobe Open Source Subversion Repository

Revision: 4736
Author:   chaase@adobe.com
Date:     2009-01-29T19:31:04.898445Z

Log Message:
-----------
API improvements in some of the effects classes, such as:

- PropertyValuesHolder renamed to AnimationProperty
	- Also, values[] array changed to valueFrom and valueTo Objects
	- Also, 'delta' property changed to valueBy Object property
- FxAnimate.propertyValuesList renamed to FxAnimate.animationProperties
- Constant interpolator renamed Linear (old Linear interpolator went away)
- ColorInterpolator renamed RGBInterpolator
- HSBInterpolator now exists (not used by default: FxAnimateColor uses RGBInterpolator)
- HSBColor: new data structure in mx.utils for holding HSB colors and converting from/to RGB
- various changes to *Instance classes in effects (but these are not generally used externally)

QE Notes: Mustella tests will break due to class and property renames. QE is fixing these issues and a follow-up putback to Mustella is expected
Doc Notes: None
Bugs: -
Reviewer: Gordon
tests: checkintests, Mustella: tests/Effects tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxFadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxResizeInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Constant.as" copyfrom-rev="4610" action="R">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/ColorInterpolator.as" copyfrom-rev="4610" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/RGBInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/HSBInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/HSBColor.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/ColorInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/ArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateShaderTransitionInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/Constant.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/IInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/NumberInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/interpolation/EaseInOut.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AnimationProperty.as</path>

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

--- frameworks/projects/spark/src/spark/effects/supportClasses/MoveInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/MoveInstance.as
@@ -16,7 +16,7 @@
 import mx.core.Container;
 import mx.core.IUIComponent;
 import mx.effects.Animation;
-import mx.effects.PropertyValuesHolder;
+import mx.effects.AnimationProperty;
 import mx.events.AnimationEvent;
 import mx.events.EffectEvent;
 import mx.events.TweenEvent;
@@ -159,9 +159,9 @@
 			}
 		}

-        propertyValuesList =
-            [new PropertyValuesHolder("x", [xFrom, xTo], xBy),
-             new PropertyValuesHolder("y", [yFrom, yTo], yBy)];
+        animationProperties =
+            [new AnimationProperty("x", xFrom, xTo, xBy),
+             new AnimationProperty("y", yFrom, yTo, yBy)];

         // TODO (chaase): The Flex3 version of Move had logic for forcing clipping
         // off during the effect. We probably need something like this


TextInputBead responds to size changes

TextInputBead responds to size changes

git-svn-id: 00225d326fbeb9978ee2ea3564602c0fe18eb5d2@1444948 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputBead.as
+++ frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputBead.as
@@ -17,9 +17,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.staticControls.beads
 {
+	import flash.display.DisplayObject;
 	import flash.display.DisplayObjectContainer;
 	import flash.events.Event;
+	import flash.events.IEventDispatcher;
 	import flash.text.TextField;
+	import flash.text.TextFieldAutoSize;
 	import flash.text.TextFieldType;

 	import org.apache.flex.core.IBead;
@@ -35,14 +38,21 @@
 			_textField.selectable = true;
 			_textField.type = TextFieldType.INPUT;
 			_textField.mouseEnabled = true;
+			_textField.multiline = false;
+			_textField.wordWrap = false;

 			// for debug only
 			_textField.border = true;
-			_textField.borderColor = 0xFF0000;
+			_textField.borderColor = 0x333333;
+			_textField.width = 100;
+			_textField.height = 18;
 		}
+
 		private var textModel:ITextModel;

 		private var _strand:IStrand;
+
+		private var _textField:TextField;

 		public function set strand(value:IStrand):void
 		{
@@ -59,6 +69,15 @@
 			// for input, listen for changes to the _textField and update
 			// the model
 			_textField.addEventListener(Event.CHANGE, inputChangeHandler);
+
+			// set initial size, if present, and listen for changes in dimension
+			var ww:Number = DisplayObject(value).width;
+			var hh:Number = DisplayObject(value).height;
+
+			if( !isNaN(ww) && ww > 0 ) _textField.width = ww;
+			if( !isNaN(hh) && hh > 0 ) _textField.height = hh;
+			IEventDispatcher(_strand).addEventListener("widthChanged", widthChangedHandler);
+			IEventDispatcher(_strand).addEventListener("heightChanged", heightChangedHandler);
 		}

 		private function textChangeHandler(event:Event):void
@@ -76,7 +95,17 @@
 			textModel.text = _textField.text;
 		}

-		private var _textField:TextField;
+		private function widthChangedHandler(event:Event):void
+		{
+			var ww:Number = DisplayObject(_strand).width;
+			_textField.width = ww;
+		}
+
+		private function heightChangedHandler(event:Event):void
+		{
+			var hh:Number = DisplayObject(_strand).height;
+			_textField.height = hh;
+		}

 		public function get text():String
 		{


Transferred from the Adobe Open Source Subversion Repository

Revision: 17753
Author:   klin@adobe.com
Date:     2010-09-17T22:01:57.619431Z

Log Message:
-----------
Fix for handling columns (IList) changes in GridDimensions. I implemented the columnsCollectionChanged handler in GridDimensions to handle all the collection events.

GridDimensions.as - When someone sets the columnCount, we should clear everything. Implemented columnsCollectionChanged(). Changed typicalCellWidths and typicalCellHeights to Vectors to make them easier to handle. Added a few helper functions to insert multiple values into vectors and to clear a vector. Also, fixed a small bug in getColumnIndexAt for the case where the column width is 0. Fixed up the rowCount setter to remove the excess rows.

Grid.as - Move setting columnCount from clearGridLayoutCache to commitProperties because it should only be set when the columns actually change. Add call to columnsCollectionChanged.

GridRowList.as, GridRowNode.as - Add support for column changes.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridDimensions.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridRowNode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridRowList.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
@@ -35,6 +35,73 @@
 {
     include "../../core/Version.as";

+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Inserts specified elements starting from startIndex.
+     *
+     *  Our implementation of:
+     *      var argArray:Array = new Array();
+     *      for each (var x:Number in values)
+     *      {
+     *          argArray.push(x);
+     *      }
+     *      argArray.splice(0, 0, startIndex, 0);
+     *      vec.splice.apply(vec, argArray);
+     *
+     */
+    public static function insertValuesToVector(vec:Vector.<Number>, startIndex:int, values:Vector.<Number>):void
+    {
+        // FIXME (klin): change method name.
+        const oldLength:int = vec.length;
+        const count:int = values.length;
+        vec.length += count;
+        const vecLength:int = vec.length;
+        var i:int;
+
+        // Shift elements down by count.
+        for (i = oldLength - 1; i >= startIndex; i--)
+            vec[i + count] = vec[i];
+
+        const endIndex:int = startIndex + values.length;
+        for (i = startIndex; i < endIndex; i++)
+            vec[i] = values[i];
+    }
+
+    /**
+     *  Insert count elements of the specified value starting from
+     *  startIndex.
+     */
+    public static function insertValueToVector(vec:Vector.<Number>, startIndex:int, count:int, value:Number):void
+    {
+        // FIXME (klin): change method name.
+        const oldLength:int = vec.length;
+        vec.length += count;
+        const vecLength:int = vec.length;
+
+        // Shift elements down by count.
+        for (var i:int = oldLength - 1; i >= startIndex; i--)
+            vec[i + count] = vec[i];
+
+        clearVector(vec, value, startIndex, count);
+    }
+
+    /**
+     *  Sets all of the numbers in a vector to be value unless otherwise
+     *  specified.
+     */
+    public static function clearVector(vec:Vector.<Number>, value:Number, startIndex:int = 0, count:int = -1):void
+    {
+        const endIndex:int = (count == -1) ? vec.length : startIndex + count;
+
+        for (var i:int = startIndex; i < endIndex; i++)
+            vec[i] = value;
+    }
+
     /**
      *  @private
      *  Restrict a number to a particular min and max.
@@ -48,15 +115,15 @@

         return a;
     }
-
+
     //--------------------------------------------------------------------------
     //
     //  Variables
     //
     //--------------------------------------------------------------------------

-    private var rowList:GridRowList = new GridRowList();
-    private var _columnWidths:Vector.<Number>;
+    public var rowList:GridRowList = new GridRowList();
+    private var _columnWidths:Vector.<Number> = new Vector.<Number>();

     //cache for cumulative y values.
     private var startY:Number = 0;
@@ -64,8 +131,8 @@
     private var startY2:Number = 0;
     private var recentNode2:GridRowNode = null;

-    private const typicalCellWidths:Array = new Array();
-    private const typicalCellHeights:Array = new Array();
+    private const typicalCellWidths:Vector.<Number> = new Vector.<Number>();
+    private const typicalCellHeights:Vector.<Number> = new Vector.<Number>();
     private var isFirstTypicalCellHeight:Boolean = true;

     //--------------------------------------------------------------------------
@@ -111,14 +178,12 @@
         if (value == _rowCount)
             return;

+        // remove rows greater than value.
+        // This also clears the cached nodes.
+        if (value < _rowCount)
+            removeRowsAt(value, value - _rowCount)
+
         _rowCount = value;
-
-        if (recentNode && recentNode.rowIndex >= _rowCount)
-            recentNode = null;
-        if (recentNode2 && recentNode2.rowIndex >= _rowCount)
-            recentNode2 = null;
-
-        // FIXME (klin): remove a range of indices...
     }

     //----------------------------------
@@ -144,51 +209,9 @@
         if (value == _columnCount)
             return;

-        _columnCount = value;
-        if (_columnCount == 0)
-        {
-            rowList.removeAll();
-            recentNode = null;
-            recentNode2 = null;
-            return;
-        }
-
-        rowList.numColumns = value;
-
-        var i:int;
-
-        if (!_columnWidths)
-        {
-            _columnWidths = new Vector.<Number>(_columnCount);
-
-            for (i = 0; i < _columnCount; i++)
-                _columnWidths[i] = NaN;
-        }
-        else
-        {
-            var temp:int = _columnWidths.length;
-            _columnWidths.length = _columnCount;
-
-            if (temp < _columnCount)
-            {
-                for (i = temp; i < _columnCount; i++)
-                    _columnWidths[i] = NaN;
-
-                if (_columnCount == 0)
-                {
-                    clearTypicalCellWidthsAndHeights();
-                }
-                else
-                {
-                    typicalCellWidths.length = _columnCount;
-                    typicalCellHeights.length = _columnCount;
-                }
-            }
-        }
-
-        // clear cache
-        recentNode = null;
-        recentNode2 = null;
+        // if we change the columnCount, clear everything
+        // because we don't know which columns are valid anymore.
+        resetColumns(value);
     }

     //----------------------------------
@@ -470,10 +493,7 @@
     }

     /**
-     *  Sets the height of a given row. This height takes precedence over
-     *  the natural height of the row (determined by the maximum of its
-     *  cell heights) and the defaultRowHeight. However, fixedRowHeight
-     *  takes precedence over this height.
+     *  Sets the width of a given column.
      */
     public function setColumnWidth(col:int, width:Number):void
     {
@@ -998,7 +1018,7 @@
             else
                 cur -= temp + columnGap;

-            if (cur < 0)
+            if (cur <= 0)
                 return i;
         }

@@ -1074,13 +1094,13 @@
      */
     public function getTypicalContentWidth(columnCountOverride:int = -1):Number
     {
-        const nCols:int = (columnCountOverride == -1) ? columnCount : columnCountOverride;
+        const nCols:int = (columnCountOverride == -1) ? _columnCount : columnCountOverride;
         var contentWidth:Number = 0;

         for (var columnIndex:int = 0; columnIndex < nCols; columnIndex++)
         {
-            var width:Number = typicalCellWidths[columnIndex];
-            contentWidth += isNaN(width) ? defaultColumnWidth : width;
+            var width:Number = columnIndex < _columnCount ? typicalCellWidths[columnIndex] : NaN;
+            contentWidth += isNaN(width) ? 0 : width;
         }

         if (nCols > 1)
@@ -1155,8 +1175,12 @@
         {
             // otherwise, find the max of the typical cell heights.
             var max:Number = 0;
-            for (var i:int = 0; i < typicalCellHeights.length; i++)
-                max = Math.max(max, typicalCellHeights[i]);
+            const typicalCellHeightsLength:int = typicalCellHeights.length;
+            for (var i:int = 0; i < typicalCellHeightsLength; i++)
+            {
+                if (!isNaN(typicalCellHeights[i]))
+                    max = Math.max(max, typicalCellHeights[i]);
+            }
             this.defaultRowHeight = max;
         }
     }
@@ -1166,8 +1190,8 @@
      */
     public function clearTypicalCellWidthsAndHeights():void
     {
-        typicalCellWidths.length = 0;
-        typicalCellHeights.length = 0;
+        clearVector(typicalCellWidths, NaN);
+        clearVector(typicalCellHeights, NaN);
         defaultRowHeight = 26;
         isFirstTypicalCellHeight = true;
     }
@@ -1189,6 +1213,22 @@
      */
     public function insertColumns(startColumn:int, count:int):void
     {
+        const oldColumnCount:int = _columnCount;
+        const newColumnCount:int = _columnCount + count;
+
+        if (startColumn < 0 || startColumn > oldColumnCount)
+            return;
+
+        // change column count of all nodes in GridRowList.
+        rowList.insertColumns(startColumn, count);
+
+        // add to columnCount
+        _columnCount = newColumnCount;
+
+        // insert new values into the arrays.
+        insertValueToVector(_columnWidths, startColumn, count, NaN);
+        insertValueToVector(typicalCellWidths, startColumn, count, NaN);
+        insertValueToVector(typicalCellHeights, startColumn, count, NaN);
     }

     /**
@@ -1208,6 +1248,75 @@
      */
     public function removeColumns(startColumn:int, count:int):void
     {
+        const oldColumnCount:int = _columnCount;
+        const newColumnCount:int = _columnCount - count;
+
+        if (startColumn < 0 || startColumn >= oldColumnCount)
+            return;
+
+        // if we remove all the columns, clear everything.
+        if (newColumnCount <= 0)
+        {
+            columnCount = 0;
+            return;
+        }
+
+        // Otherwise, lets remove the specified columns.
+        // change column count of all nodes in GridRowList.
+        rowList.removeColumns(startColumn, count)
+
+        // lower columnCount without clearing anything else.
+        _columnCount = newColumnCount;
+
+        // remove values from the needed vectors
+        _columnWidths.splice(startColumn, count);
+        typicalCellWidths.splice(startColumn, count);
+        typicalCellHeights.splice(startColumn, count);
+
+        // cache is invalid because node values might have changed
+        recentNode = null;
+        recentNode2 = null;
+    }
+
+    /**
+     *  Clears any columns that occupy the indices between startColumn
+     *  and startColumn + count.
+     */
+    public function clearColumns(startColumn:int, count:int):void
+    {
+        if (startColumn < 0 || startColumn >= _columnCount)
+            return;
+
+        rowList.clearColumns(startColumn, count);
+
+        clearVector(_columnWidths, NaN, startColumn, count);
+        clearVector(typicalCellWidths, NaN, startColumn, count);
+        clearVector(typicalCellHeights, NaN, startColumn, count);
+
+        // cache is invalid because node values might have changed
+        recentNode = null;
+        recentNode2 = null;
+    }
+
+    /**
+     *  Clears the cache and resets GridDimensions such that the
+     *  number of columns is newLength.
+     */
+    public function resetColumns(columnsLength:int):void
+    {
+        // clear cached information
+        clear();
+
+        // fix up the number of columns
+        _columnCount = columnsLength;
+        _columnWidths.length = columnsLength;
+        typicalCellHeights.length = columnsLength;
+        typicalCellWidths.length = columnsLength;
+        rowList.numColumns = columnsLength
+
+        // clear the rest of the vectors
+        clearTypicalCellWidthsAndHeights();
+        clearVector(_columnWidths, NaN, 0, _columnCount);
     }

     /**
@@ -1234,6 +1343,14 @@
      */
     public function moveColumns(fromCol:int, toCol:int, count:int):void
     {
+        if (fromCol < 0 || fromCol >= _columnCount || toCol < 0 || toCol > _columnCount)
+            return;
+
+        rowList.moveColumns(fromCol, toCol, count);
+
+        insertValuesToVector(_columnWidths, toCol, _columnWidths.splice(fromCol, count));
+        insertValuesToVector(typicalCellWidths, toCol, typicalCellWidths.splice(fromCol, count));
+        insertValuesToVector(typicalCellHeights, toCol, typicalCellHeights.splice(fromCol, count));
     }

     /**
@@ -1241,12 +1358,12 @@
      */
     public function clear():void
     {
-        rowCount = 0;
+        _rowCount = 0;
         rowList.removeAll();
-        this.recentNode = null;
-        this.recentNode2 = null;
-        this.startY = 0;
-        this.startY2 = 0;
+        recentNode = null;
+        recentNode2 = null;
+        startY = 0;
+        startY2 = 0;
     }

     /**
@@ -1256,6 +1373,8 @@
      */
     private function insertRowsAt(startRow:int, count:int, nodes:Vector.<GridRowNode> = null):void
     {
+        // TODO: Push this to GridRowList.
+
         if (startRow < 0 || count <= 0)
             return;

@@ -1321,7 +1440,7 @@
             node = node.next;
         }

-        this.rowCount -= count;
+        _rowCount -= count;

         // cache is invalid now.
         recentNode = null;
@@ -1433,5 +1552,105 @@
         this.rowCount = IList(event.target).length;
         return true;
     }
+
+    /**
+     *  Handles changes in columns.
+     */
+    public function columnsCollectionChanged(event:CollectionEvent):void
+    {
+        switch (event.kind)
+        {
+            case CollectionEventKind.ADD:
+            {
+                columnsCollectionAdd(event);
+                break;
+            }
+
+            case CollectionEventKind.MOVE:
+            {
+                columnsCollectionMove(event);
+                break;
+            }
+
+            case CollectionEventKind.REFRESH:
+            {
+                columnsCollectionRefresh(event);
+                break;
+            }
+
+            case CollectionEventKind.REMOVE:
+            {
+                columnsCollectionRemove(event);
+                break;
+            }
+
+            case CollectionEventKind.REPLACE:
+            {
+                columnsCollectionReplace(event);
+                break;
+            }
+
+            case CollectionEventKind.RESET:
+            {
+                columnsCollectionReset(event);
+                break;
+            }
+
+            case CollectionEventKind.UPDATE:
+            {
+                // handled by GridLayout
+                break;
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function columnsCollectionAdd(event:CollectionEvent):void
+    {
+        insertColumns(event.location, event.items.length);
+    }
+
+    /**
+     *  @private
+     */
+    private function columnsCollectionRemove(event:CollectionEvent):void
+    {
+        removeColumns(event.location, event.items.length);
+    }
+
+    /**
+     *  @private
+     */
+    private function columnsCollectionReplace(event:CollectionEvent):void
+    {
+        clearColumns(event.location, event.items.length);
+    }
+
+    /**
+     *  @private
+     */
+    private function columnsCollectionMove(event:CollectionEvent):void
+    {
+        moveColumns(event.oldLocation, event.location, event.items.length);
+    }
+
+    /**
+     *  @private
+     */
+    private function columnsCollectionReset(event:CollectionEvent):void
+    {
+        resetColumns(IList(event.target).length);
+    }
+
+    /**
+     *  @private
+     */
+    private function columnsCollectionRefresh(event:CollectionEvent):void
+    {
+        resetColumns(IList(event.target).length);
+    }
+
 }
 }


FLEX-35260 GridHeaderViewLayout.getHeaderIndexAt() (which calls GridDimensions.getColumnIndexAt()) used to return a valid headerIndex (when it was expected to return -1) for an x < 0. Fixed.

--- frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
@@ -1183,9 +1183,12 @@
      */
     public function getColumnIndexAt(x:Number, y:Number):int
     {
-        var cur:Number = x;
+        var current:Number = x;
         var i:int;
-
+
+        if(current < 0)
+            return -1;
+
         for (i = 0; i < _columnCount; i++)
         {
             var temp:Number = _columnWidths[i];
@@ -1202,9 +1205,9 @@
             if (isNaN(temp))
                 temp = defaultColumnWidth;

-            cur -= temp + columnGap;
-
-            if (cur < 0)
+            current -= temp + columnGap;
+
+            if (current < 0)
                 return i;
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17973
Author:   dloverin@adobe.com
Date:     2010-09-30T22:28:57.338114Z

Log Message:
-----------
First delivery of DataGrid editor code.

Still a ways to go to get it ready for testing and get the APIs correct.

QE notes: Not ready for testing.
Doc notes: None.
Bugs:
Reviewer: Hans, Alex (FocusManager)
Tests run: cyclone server
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/IGridItemEditor.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/DataGridEditEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/TextGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DataGridSkin.mxml</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses</path>
<path kind="file" action="A">/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/framework/src/mx/managers/FocusManager.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
@@ -0,0 +1,309 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.components.gridClasses
+{
+import flash.utils.describeType;
+
+import mx.core.mx_internal;
+
+import spark.components.supportClasses.GridColumn;
+import spark.components.DataGrid;
+import spark.components.Group;
+import spark.components.IGridItemEditor;
+import spark.components.IGridItemRenderer;
+import mx.validators.IValidatorListener;
+
+use namespace mx_internal;
+
+public class GridItemEditor extends Group implements IGridItemEditor
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function GridItemEditor()
+    {
+    }
+
+   //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  column
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _column:GridColumn;
+
+    /**
+     *  @inheritDoc
+     */
+    public function get column():GridColumn
+    {
+        return _column;
+    }
+
+    /**
+     *  @private
+     */
+    public function set column(value:GridColumn):void
+    {
+        _column = value;
+    }
+
+    //----------------------------------
+    //  columnIndex
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _columnIndex:int;
+
+    /**
+     *  @inheritDoc
+     */
+    public function get columnIndex():int
+    {
+        return _columnIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set columnIndex(value:int):void
+    {
+        _columnIndex = value;
+    }
+
+    //----------------------------------
+    //  data
+    //----------------------------------
+
+    private var _data:Object = null;
+
+    /**
+     *  @inheritDoc
+     */
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    /**
+     *  @private
+     */
+    public function set data(value:Object):void
+    {
+        _data = value;
+    }
+
+    //----------------------------------
+    //  dataGrid
+    //----------------------------------
+
+    /**
+     *  @inheritdoc
+     */
+    public function get dataGrid():DataGrid
+    {
+        return DataGrid(owner);
+    }
+
+    //----------------------------------
+    //  itemRenderer
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _itemRenderer:IGridItemRenderer;
+
+    /**
+     *  @inheritDoc
+     */
+    public function get itemRenderer():IGridItemRenderer
+    {
+        return _itemRenderer;
+    }
+
+    /**
+     *  @private
+     */
+    public function set itemRenderer(value:IGridItemRenderer):void
+    {
+        _itemRenderer = value;
+    }
+
+    //----------------------------------
+    //  rowIndex
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _rowIndex:int;
+
+    /**
+     *  @inheritDoc
+     */
+    public function get rowIndex():int
+    {
+        return _rowIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set rowIndex(value:int):void
+    {
+        _rowIndex = value;
+    }
+
+    //----------------------------------
+    //  value
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     */
+    public function get value():Object
+    {
+        return null;
+    }
+
+    /**
+     *  @private
+     */
+    public function set value(newValue:Object):void
+    {
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+   //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+    /**
+     *  @inheritDoc
+     */
+    public function cancel():void
+    {
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public function discard():void
+    {
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public function prepare():void
+    {
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public function save():Boolean
+    {
+        if (!validate())
+            return false;
+
+        var newData:Object = value;
+        var property:String = column.dataField;
+        var data:Object = data;
+        var typeInfo:String = "";
+        for each(var variable:XML in describeType(data).variable)
+        {
+            if (property == variable.@name.toString())
+            {
+                typeInfo = variable.@type.toString();
+                break;
+            }
+        }
+
+        if (typeInfo == "String")
+        {
+            if (!(newData is String))
+                newData = newData.toString();
+        }
+        else if (typeInfo == "uint")
+        {
+            if (!(newData is uint))
+                newData = uint(newData);
+        }
+        else if (typeInfo == "int")
+        {
+            if (!(newData is int))
+                newData = int(newData);
+        }
+        else if (typeInfo == "Number")
+        {
+            if (!(newData is int))
+                newData = Number(newData);
+        }
+
+        data[property] = newData;
+        dataGrid.dataProvider.itemUpdated(data, property, data[property], newData);
+        dataGrid.validateNow();
+
+        return true;
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    public function validate():Boolean
+    {
+        // loop thru the children, looking for errors.
+        var n:int = numElements;
+        for (var i:int = 0; i < n; i++)
+        {
+            var child:IValidatorListener = getElementAt(i) as IValidatorListener;
+            if (child && child.errorString)
+            {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+}
+}


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

--- frameworks/projects/spark/src/spark/effects/interpolation/RGBInterpolator.as
+++ frameworks/projects/spark/src/spark/effects/interpolation/RGBInterpolator.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 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.
 //
 ////////////////////////////////////////////////////////////////////////////////
 package spark.effects.interpolation


Allow alternate extension .material for material files in the editor.

--- Bin/Data/Scripts/Editor/AttributeEditor.as
+++ Bin/Data/Scripts/Editor/AttributeEditor.as
@@ -699,10 +699,11 @@
     Array<String> imageFilters = {"*.png", "*.jpg"};
     Array<String> textureFilters = {"*.dds", "*.png", "*.jpg", "*.bmp", "*.ktx", "*.pvr"};
     Array<String> soundFilters = {"*.wav","*.ogg"};
+    Array<String> materialFilters = {"*.xml", "*.material"};
     resourcePickers.Push(ResourcePicker("Animation", "*.ani"));
     resourcePickers.Push(ResourcePicker("Image", imageFilters));
     resourcePickers.Push(ResourcePicker("Model", "*.mdl"));
-    resourcePickers.Push(ResourcePicker("Material", "*.xml"));
+    resourcePickers.Push(ResourcePicker("Material", materialFilters));
     resourcePickers.Push(ResourcePicker("Texture2D", textureFilters));
     resourcePickers.Push(ResourcePicker("TextureCube", "*.xml"));
     resourcePickers.Push(ResourcePicker("ScriptFile", "*.as"));


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

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

 package mx.automation.delegates.controls


getClassHierarchy

getClassHierarchy

--- as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
@@ -422,6 +422,14 @@
             return result;
         }

+        public static function getClassHeirarchy(object:*):Array
+        {
+            var result:Array = getSuperclasses(object);
+
+            result.splice(0,0, classOf(object));
+            return result;
+        }
+
         public static function getSuperclasses(object:*):Array
         {
             var result:Array = [];


FLEX-34458
CAUSE:
Because HierarchicalCollectionViewCursor uses both relative and absolute bookmarks in the various collections of the hierarchy, there needs to be special treatment for these two cases. Namely, while it works great with absolute bookmarks to call .movePrevious on the bookmark when something is deleted in the same collection before the selected item, it doesn't work well for the relative CursorBookmark.LAST currentChildBookmark value. Because HierarchicalCollectionViewCursor.collectionChangeHandler() did not make any difference between absolute and relative bookmarks, it used to call .movePrevious() on the bookmark even if it was the absolute value CursorBookmark.LAST.

SOLUTION:
In this situation we don't need to .movePrevious() when items above are deleted, because CursorBookmark.LAST will always point to the last item in the collection, no matter what changes happened to that collection.

--- frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
+++ frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
@@ -1261,6 +1261,9 @@

                     if (parentOfChangingNode == parentOfCurrentNode)
                     {
+                        if(currentChildBookmark == CursorBookmark.LAST)
+                            break;
+
                         if (changingNodeAndSiblings != null)
                         {
                             changingCollectionCursor = changingNodeAndSiblings.createCursor();
@@ -1285,6 +1288,10 @@
                                 changingNodeCollectionBookmarkIndex = parentOfChangingNodeIndex + 1;
                                 changingCollectionCursor = changingNodeAndSiblings.createCursor();
                                 bookmarkInChangingCollection = parentBookmarkStack[changingNodeCollectionBookmarkIndex];
+
+                                if(bookmarkInChangingCollection == CursorBookmark.LAST)
+                                    break;
+
                                 try
                                 {
                                     changingCollectionCursor.seek(bookmarkInChangingCollection);


Transferred from the Adobe Open Source Subversion Repository

Revision: 19665
Author:   eday@adobe.com
Date:     2011-01-09T19:46:39.597874Z

Log Message:
-----------
Bounce/pull bug fixes

QE notes:
Doc notes:
Bugs: SDK-29046, SDK-28972
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HScrollBar.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/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as
@@ -17,7 +17,8 @@
 import spark.components.Button;
 import spark.components.HScrollBar;
 import spark.skins.mobile.supportClasses.MobileSkin;
-
+import mx.core.mx_internal;
+use namespace mx_internal;

 /**
  *  ActionScript-based skin for HScrollBar components in mobile applications.
@@ -27,7 +28,7 @@
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
-public class HScrollBarSkin extends MobileSkin
+ public class HScrollBarSkin extends MobileSkin
 {
     //--------------------------------------------------------------------------
     //
@@ -47,30 +48,42 @@
         super();

         useChromeColor = true;
-
-        layoutMeasuredWidth = 20;
+
+		layoutMeasuredWidth = 20;
         thumbSkinClass = HScrollBarThumbSkin;
-
-        // Depending on density set our measured height
+        var paddingBottom:int;
+        var paddingHorizontal:int;
+
+		// Depending on density set our measured height
         switch (applicationDPI)
         {
-            case DPIClassification.DPI_320:
-            {
-                layoutMeasuredHeight = 12;
-                break;
-            }
+			case DPIClassification.DPI_320:
+			{
+				layoutMeasuredHeight = 12;
+                paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_320DPI;
+                paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_320DPI;
+				break;
+			}
             case DPIClassification.DPI_240:
             {
                 layoutMeasuredHeight = 9;
+                paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_240DPI;
+                paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_240DPI;
                 break;
             }
             default:
             {
                 // default PPI160
                 layoutMeasuredHeight = 6;
+                paddingBottom = HScrollBarThumbSkin.PADDING_BOTTOM_DEFAULTDPI;
+                paddingHorizontal = HScrollBarThumbSkin.PADDING_HORIZONTAL_DEFAULTDPI;
                 break;
             }
         }
+
+        // The minimum width is set such that, at it's smallest size, the thumb appears
+        // as wide as it is high.
+        minThumbWidth = (layoutMeasuredHeight - paddingBottom) + (paddingHorizontal * 2);
     }

     //--------------------------------------------------------------------------
@@ -83,6 +96,11 @@
      */
     public var hostComponent:HScrollBar;

+    /**
+     *  @private
+     */
+    private var minThumbWidth:Number;
+
     /**
      *  Skin to use for the thumb Button skin part
      */
@@ -138,6 +156,7 @@
         if (!thumb)
         {
             thumb = new Button();
+            thumb.minWidth = minThumbWidth;
             thumb.setStyle("skinClass", thumbSkinClass);
             thumb.width = layoutMeasuredHeight;
             thumb.height = layoutMeasuredHeight;


Transferred from the Adobe Open Source Subversion Repository

Revision: 6439
Author:   dsubrama@adobe.com
Date:     2009-04-30T21:19:14.460041Z

Log Message:
-----------
Bugfixes: SDK-20853, SDK-20506, SDK-20855

We now use the bottleneck method, updateRenderer() to let the DataGroup have first crack at setting a renderer's data, owner and labelText properties. Then the "true" owners like a List or ButtonBar which father a renderer, get a chance to come in and clean out stale properties and set new properties on the renderer (which was either created anew or recycled).

I also cleaned up some comments in LayoutBase.

Reviewer: Ryan
Checkintests: Pass
Mustella: Steve and Ella ok'ed a cyclone I gave them against List, ButtonBar, DataGroup and SkinnableDataContainer.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/IItemRendererOwner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
@@ -536,9 +536,12 @@
      *  values that are based on the current index and key
      *  stroke encountered.
      *
-     *  @param index The current index of the item with focus.
-     *  @param key The key stroke that determines which item
+     *  @param keyCode The key stroke that determines which item
      *  to navigate to next.
+     *
+     *  @param currentIndex The current index of the item with focus.
+     *
+     *  @param maxIndex The maximum value the index can jump to
      *
      *  @return The index of the next item to jump to.
      *


F fix TextureLoader

F fix TextureLoader

--- src/aerys/minko/type/loader/TextureLoader.as
+++ src/aerys/minko/type/loader/TextureLoader.as
@@ -100,7 +100,7 @@
 					bitmapData = Bitmap(assetObject).bitmapData;

 				_textureResource = new TextureResource();
-				_textureResource.setContentFromBitmapData(BitmapData(assetObject), _mipmap);
+				_textureResource.setContentFromBitmapData(bitmapData, _mipmap);
 				_complete.execute(this, _textureResource);
 			}
 			else if (assetObject is ByteArray)


Added automatic texture reloading with TextureLoader.loadClass and TextureLoader.load on context loss

--- src/aerys/minko/type/loader/TextureLoader.as
+++ src/aerys/minko/type/loader/TextureLoader.as
@@ -12,6 +12,7 @@
 	import flash.net.URLLoaderDataFormat;
 	import flash.net.URLRequest;
 	import flash.utils.ByteArray;
+	import flash.utils.Dictionary;
 	import flash.utils.getQualifiedClassName;

 	import aerys.minko.render.resource.texture.TextureResource;
@@ -29,6 +30,9 @@

 		protected var _textureResource	: TextureResource;

+		private static var _textureResourceToClass		: Dictionary = new Dictionary();
+		private static var _textureResourceToRequest	: Dictionary = new Dictionary();
+
 		public function get progress() : Signal
 		{
 			return _progress;
@@ -186,34 +190,58 @@
 			}
 		}

-		public static function loadClass(classObject 		: Class,
-										 enableMipMapping 	: Boolean = true) : TextureResource
-		{
-			var textureLoader : TextureLoader = new TextureLoader(enableMipMapping);
+		public static function loadClass(classObject 			: Class,
+										 enableMipMapping 		: Boolean = true,
+										 textureResource		: TextureResource = null) : TextureResource
+		{
+			var textureLoader : TextureLoader = new TextureLoader(enableMipMapping, textureResource);

 			textureLoader.loadClass(classObject);

+			if (!textureLoader.textureResource.contextLost.hasCallback(classTexturecontextLostHandler))
+			{
+				_textureResourceToClass[textureLoader.textureResource] = classObject;
+				textureLoader.textureResource.contextLost.add(classTexturecontextLostHandler);
+			}
+
 			return textureLoader.textureResource;
 		}

 		public static function load(request				: URLRequest,
-									enableMipMapping 	: Boolean = true) : TextureResource
-		{
-			var textureLoader : TextureLoader = new TextureLoader(enableMipMapping);
+									enableMipMapping 	: Boolean = true,
+									textureResource		: TextureResource = null) : TextureResource
+		{
+			var textureLoader : TextureLoader = new TextureLoader(enableMipMapping, textureResource);

 			textureLoader.load(request);

+			if (!textureLoader.textureResource.contextLost.hasCallback(urlRequestTexturecontextLostHandler))
+			{
+				_textureResourceToRequest[textureLoader.textureResource] = request;
+				textureLoader.textureResource.contextLost.add(urlRequestTexturecontextLostHandler)
+			}
+
 			return textureLoader.textureResource;
 		}

 		public static function loadBytes(bytes				: ByteArray,
-										 enableMipMapping 	: Boolean = true) : TextureResource
-		{
-			var textureLoader : TextureLoader = new TextureLoader(enableMipMapping);
+										 enableMipMapping 	: Boolean = true,
+										 textureResource	: TextureResource = null) : TextureResource
+		{
+			var textureLoader : TextureLoader = new TextureLoader(enableMipMapping, textureResource);

 			textureLoader.loadBytes(bytes);

 			return textureLoader.textureResource;
+		}
+
+		private static function classTexturecontextLostHandler(textureResource : TextureResource) : void
+		{
+			TextureLoader.loadClass(_textureResourceToClass[textureResource], textureResource.mipMapping, textureResource);
+		}
+		private static function urlRequestTexturecontextLostHandler(textureResource : TextureResource) : void
+		{
+			TextureLoader.load(_textureResourceToRequest[textureResource], textureResource.mipMapping, textureResource);
 		}
 	}
 }


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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/TextInputOperation.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/TextInputOperation.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
 package spark.components.supportClasses
 {
 import flashx.textLayout.operations.FlowOperation;