Changes to support MDIEffectEvent

Changes to support MDIEffectEvent

--- src/flexlib/mdi/managers/MDIManager.as
+++ src/flexlib/mdi/managers/MDIManager.as
@@ -37,6 +37,7 @@
 	import flexlib.mdi.effects.IMDIEffectsDescriptor;
 	import flexlib.mdi.effects.MDIEffectsDescriptorBase;
 	import flexlib.mdi.effects.effectClasses.MDIGroupEffectItem;
+	import flexlib.mdi.events.MDIEffectEvent;
 	import flexlib.mdi.events.MDIManagerEvent;
 	import flexlib.mdi.events.MDIWindowEvent;

@@ -166,11 +167,31 @@
 	[Event(name="tile", type="flexlib.mdi.events.MDIManagerEvent")]

 	/**
+	 *  Dispatched when an effect begins.
+	 *
+	 *  @eventType mx.events.EffectEvent.EFFECT_START
+	 */
+	[Event(name="effectStart", type="mx.events.EffectEvent")]
+
+	/**
+	 *  Dispatched when an effect ends.
+	 *
+	 *  @eventType mx.events.EffectEvent.EFFECT_END
+	 */
+	[Event(name="effectEnd", type="mx.events.EffectEvent")]
+
+	/**
 	 * Class responsible for applying effects and default behaviors to MDIWindow instances such as
 	 * tiling, cascading, minimizing, maximizing, etc.
 	 */
 	public class MDIManager extends EventDispatcher
 	{
+		/**
+		 * Temporary storage location for use in dispatching MDIEffectEvents.
+		 *
+		 * @private
+		 */
+		private var mgrEventCollection:ArrayCollection = new ArrayCollection();

 		private static var globalMDIManager:MDIManager;
 		public static function get global():MDIManager
@@ -202,7 +223,7 @@
 		public static const CONTEXT_MENU_LABEL_SHOW_ALL:String = "Show All Windows";

 		/**
-     	*   Contstructor()
+     	*   Constructor()
      	*/
 		public function MDIManager(container:UIComponent, effects:IMDIEffectsDescriptor = null):void
 		{
@@ -457,80 +478,106 @@
 					case MDIManagerEvent.WINDOW_ADD:
 						// get the effect here because this doesn't pass thru windowEventProxy()
 						mgrEvent.effect = this.effects.getWindowAddEffect(mgrEvent.window, this);
-						mgrEvent.effect.play();
 					break;

 					case MDIManagerEvent.WINDOW_MINIMIZE:
 						mgrEvent.effect.addEventListener(EffectEvent.EFFECT_END, onMinimizeEffectEnd);
-						mgrEvent.effect.play();
 					break;

 					case MDIManagerEvent.WINDOW_RESTORE:
 						removeTileInstance(mgrEvent.window);
-						mgrEvent.effect.play();
 					break;

 					case MDIManagerEvent.WINDOW_MAXIMIZE:
 						removeTileInstance(mgrEvent.window);
-						maximizeWindow(mgrEvent.window);
+						mgrEvent.effect = getMaximizeWindowEffect(mgrEvent.window);
 					break;

 					case MDIManagerEvent.WINDOW_CLOSE:
 						removeTileInstance(mgrEvent.window);
 						mgrEvent.effect.addEventListener(EffectEvent.EFFECT_END, onCloseEffectEnd);
-						mgrEvent.effect.play();
 					break;

 					case MDIManagerEvent.WINDOW_FOCUS_START:
 						mgrEvent.window.hasFocus = true;
 						mgrEvent.window.validateNow();
 						container.setChildIndex(mgrEvent.window, container.numChildren - 1);
-						mgrEvent.effect.play();
 					break;

 					case MDIManagerEvent.WINDOW_FOCUS_END:
 						mgrEvent.window.hasFocus = false;
 						mgrEvent.window.validateNow();
-						mgrEvent.effect.play();
-					break;
-
+					break;
+
+					// no, nothing happens in these cases. but it might someday.
 					case MDIManagerEvent.WINDOW_DRAG_START:
-						mgrEvent.effect.play();
-					break;
-
 					case MDIManagerEvent.WINDOW_DRAG:
-						mgrEvent.effect.play();
-					break;
-
 					case MDIManagerEvent.WINDOW_DRAG_END:
-						mgrEvent.effect.play();
-					break;
-
 					case MDIManagerEvent.WINDOW_RESIZE_START:
-						mgrEvent.effect.play();
-					break;
-
 					case MDIManagerEvent.WINDOW_RESIZE:
-						mgrEvent.effect.play();
-					break;
-
 					case MDIManagerEvent.WINDOW_RESIZE_END:
-						mgrEvent.effect.play();
 					break;

 					case MDIManagerEvent.CASCADE:
 						// get the effect here because this doesn't pass thru windowEventProxy()
 						mgrEvent.effect = this.effects.getCascadeEffect(mgrEvent.effectItems, this);
-						mgrEvent.effect.play();
 					break;

 					case MDIManagerEvent.TILE:
 						// get the effect here because this doesn't pass thru windowEventProxy()
 						mgrEvent.effect = this.effects.getTileEffect(mgrEvent.effectItems, this);
-						mgrEvent.effect.play();
-					break;
-				}
-			}
+					break;
+				}
+
+				// add this event to collection for lookup in the effect handler
+				mgrEventCollection.addItem(mgrEvent);
+
+				// listen for start and end of effect
+				mgrEvent.effect.addEventListener(EffectEvent.EFFECT_START, onMgrEffectEvent)
+				mgrEvent.effect.addEventListener(EffectEvent.EFFECT_END, onMgrEffectEvent);
+
+				mgrEvent.effect.play();
+			}
+		}
+
+		/**
+		 * Handler for start and end events of all effects initiated by MDIManager.
+		 *
+		 * @param event
+		 */
+		private function onMgrEffectEvent(event:EffectEvent):void
+		{
+			// iterate over stored events
+			for each(var mgrEvent:MDIManagerEvent in mgrEventCollection)
+			{
+				// is this the manager event that corresponds to this effect?
+				if(mgrEvent.effect == event.effectInstance.effect)
+				{
+					// for group events (tile and cascade) event.window is null
+					// and we have to dig in a bit to get the window list
+					var windows:Array = new Array();
+					if(mgrEvent.window)
+					{
+						windows.push(mgrEvent.window);
+					}
+					else
+					{
+						for each(var group:MDIGroupEffectItem in mgrEvent.effectItems)
+						{
+							windows.push(group.window);
+						}
+					}
+					// create and dispatch event
+					dispatchEvent(new MDIEffectEvent(event.type, mgrEvent.type, windows));
+
+					// if the effect is over remove the manager event from collection
+					if(event.type == EffectEvent.EFFECT_END)
+					{
+						mgrEventCollection.removeItemAt(mgrEventCollection.getItemIndex(mgrEvent));
+					}
+					return;
+				}
+			}
 		}

 		private function onMinimizeEffectEnd(event:EffectEvent):void
@@ -646,7 +693,7 @@
 				for(var winIndex:int = 0; winIndex < openWins.length; winIndex++)
 				{
 					if(MDIWindow(openWins[winIndex]).maximized)
-						maximizeWindow(MDIWindow(openWins[winIndex]));
+						getMaximizeWindowEffect(MDIWindow(openWins[winIndex])).play();
 				}
 			}

@@ -668,16 +715,16 @@
 		 * @param window MDIWindowinstance to maximize
 		 *
 		 **/
-		private function maximizeWindow(window:MDIWindow):void
+		private function getMaximizeWindowEffect(window:MDIWindow):Effect
 		{
 			var maxTiles:int = this.container.width / this.tileMinimizeWidth;
 			if(showMinimizedTiles)
 			{
-				this.effects.getWindowMaximizeEffect(window, this, getBottomOffsetHeight(maxTiles, window.minimizeHeight, this.minTilePadding)).play();
+				return this.effects.getWindowMaximizeEffect(window, this, getBottomOffsetHeight(maxTiles, window.minimizeHeight, this.minTilePadding));
 			}
 			else
 			{
-				this.effects.getWindowMaximizeEffect(window, this).play();
+				return this.effects.getWindowMaximizeEffect(window, this);
 			}
 		}

@@ -859,14 +906,16 @@
 		}

 		/**
-		 * Pushes a window onto the managed window stack
+		 * Pushes an existing window onto the managed window stack.
 		 *
 		 *  @param win Window:MDIWindow to push onto managed windows stack
 		 * */
 		public function manage(window:MDIWindow):void
 		{
-			if(window != null)
+			if(window != null && windowList.indexOf(window) < 0)
+			{
 				windowList.push(window);
+			}
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 3624
Author:   clucier@adobe.com
Date:     2008-10-14T15:35:30.554711Z

Log Message:
-----------
Enabling initial support for colorTransform in GraphicElement.
Bugs: MXMLG-241
Check-in Tests: Pass
Reviewer: Chet, Ryan, Jason
QA: Yes

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

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -1385,6 +1385,9 @@
      */
     public function get transform():flash.geom.Transform
     {
+        if (!_transform)
+            setTransform(new mx.geom.Transform());
+
         return _transform;
     }

@@ -1393,36 +1396,47 @@
      */
     public function set transform(value:flash.geom.Transform):void
     {
+        setTransform(value);
+
+        if (_transform)
+        {
+            if(_transform.matrix != null)
+            {
+                layoutFeatures.layoutMatrix = _transform.matrix.clone();
+            }
+            else if (_transform.matrix3D != null)
+            {
+                layoutFeatures.layoutMatrix3D = _transform.matrix3D.clone();
+            }
+        }
+
+        _colorTransform = _transform ? _transform.colorTransform : null;
+
+        invalidateTransform();
+    }
+
+    /**
+     * @private
+     */
+    private function setTransform(value:flash.geom.Transform):void
+    {
         // Clean up the old event listeners
-        var oldTransform:mx.geom.Transform =
-            _transform as mx.geom.Transform;
+        var oldTransform:mx.geom.Transform = _transform as mx.geom.Transform;
         if (oldTransform)
         {
-            oldTransform.removeEventListener(
-                PropertyChangeEvent.PROPERTY_CHANGE,
-                transformPropertyChangeHandler);
+            oldTransform.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
         }

         var newTransform:mx.geom.Transform = value as mx.geom.Transform;

         if (newTransform)
         {
-            newTransform.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
-                                          transformPropertyChangeHandler);
-			if(value.matrix != null)
-			{
-				layoutFeatures.layoutMatrix = value.matrix;
-			}
-			else if (value.matrix3D != null)
-			{
-				layoutFeatures.layoutMatrix3D = value.matrix3D;
-			}
-            _colorTransform = value.colorTransform;
-        }
+            newTransform.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, transformPropertyChangeHandler);
+        }
+
         _transform = value;
-        invalidateTransform();
-    }
-
+    }
+
 	/**
 	 * Documentation is not currently available.  the matrix of a component is the transform matrix used to calculate its layout
 	 * relative to its siblings. This matrix is modified by the values of the offset property to determine its final, computed matrix.
@@ -2034,8 +2048,8 @@
     {
         if (displayObject)
             return displayObject;
-        else
-            return new Sprite();
+
+        return new Sprite();
     }

@@ -2824,17 +2838,21 @@
         layoutFeatures.updatePending = false;

         if(displayObject == null)
-        	return;
-
-		if(layoutFeatures.is3D)
-		{
-			displayObject.transform.matrix3D = layoutFeatures.computedMatrix3D;
-		}
-		else
-		{
-			displayObject.transform.matrix = layoutFeatures.computedMatrix;
-			//race("updating transform");
-		}
+            return;
+
+        if(layoutFeatures.is3D)
+        {
+            displayObject.transform.matrix3D = layoutFeatures.computedMatrix3D;
+        }
+        else
+        {
+            displayObject.transform.matrix = layoutFeatures.computedMatrix;
+        }
+
+        if (_colorTransform)
+        {
+            displayObject.transform.colorTransform = _colorTransform;
+        }
     }

     /**
@@ -2948,8 +2966,16 @@
                 if (_transform)
                 {
                     _colorTransform = _transform.colorTransform;
-                    invalidateDisplayList();
-                    notifyElementLayerChanged();
+
+                    if (displayObject)
+                    {
+                        displayObject.transform.colorTransform = _colorTransform;
+                    }
+                    else
+                    {
+                        invalidateDisplayList();
+                        notifyElementLayerChanged();
+                    }
                 }
             }
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3705
Author:   mhorn@adobe.com
Date:     2008-10-17T15:24:32.617729Z

Log Message:
-----------
asdoc updates

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/MaskType.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedParagraphFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -1522,7 +1522,7 @@
     }

     /**
-     *
+     *  Documentation not available.
      */
     public function transformAround(rx:Number,ry:Number,rz:Number,sx:Number,sy:Number,sz:Number,tx:Number,ty:Number,tz:Number):void
     {
@@ -2156,6 +2156,9 @@
         return result;
     }

+    /**
+     *
+     */
     public function get nextSiblingNeedsDisplayObject():Boolean
     {
         // TODO: The displayObject && visible test is a quick fix for MXMLG-228.
@@ -2165,11 +2168,17 @@

     private var _sharedDisplayObject:DisplayObject;

+    /**
+     *
+     */
     public function set sharedDisplayObject(value:DisplayObject):void
     {
         _sharedDisplayObject = value;
     }

+    /**
+     *  @private
+     */
     public function get sharedDisplayObject():DisplayObject
     {
         return _sharedDisplayObject;
@@ -2184,6 +2193,17 @@
      *  Returns a bitmap snapshot of the GraphicElement.
      *  The bitmap contains all transformations and is reduced
      *  to fit the visual bounds of the object.
+     *
+     *  @param transparent Whether or not the bitmap image supports per-pixel transparency.
+     *  The default value is true (transparent). To create a fully transparent bitmap, set the value of the
+     *  transparent parameter to true and the value of the fillColor parameter to 0x00000000 (or to 0).
+     *  Setting the transparent property to false can result in minor improvements in rendering performance.
+     *
+     *  @param fillColor A 32-bit ARGB color value that you use to fill the bitmap image area.
+     *  The default value is 0xFFFFFFFF (solid white).
+     *
+     *  @return A bitmap snapshot of the GraphicElement.
+     *
      */
     public function getBitmapData(transparent:Boolean = true, fillColor:uint = 0xFFFFFFFF):BitmapData
     {
@@ -2193,10 +2213,10 @@

         if (displayObject && nextSiblingNeedsDisplayObject)
         {
-        	var m:Matrix = displayObject.transform.matrix;
-
-			if (m)
-        		m.translate(-actualPosition.x, -actualPosition.y);
+            var m:Matrix = displayObject.transform.matrix;
+
+            if (m)
+                m.translate(-actualPosition.x, -actualPosition.y);
             bitmapData.draw(displayObject, m);
         }
         else
@@ -2261,7 +2281,7 @@
      *
      *  @param oldValue The previous value of the property.
      *
-     *  @param value the new value of the property.
+     *  @param value The new value of the property.
      */
     protected function dispatchPropertyChangeEvent(prop:String, oldValue:*,
                                                    value:*):void
@@ -2275,8 +2295,8 @@
     // notifyElementLayerChanged()?

     /**
-     *  Utility method that notifies our host that we have changed and need
-     *  our layer to be updated.
+     *  Utility method that notifies the host that this element has changed and needs
+     *  its layer to be updated.
      */
     protected function notifyElementLayerChanged():void
     {
@@ -2386,7 +2406,7 @@
     /**
      *  Used by layout logic to validate the properties of a component
      *  by calling the commitProperties() method.
-     *  In general, subclassers should
+     *  In general, subclasses should
      *  override the commitProperties() method and not this method.
      */
     public function validateProperties():void
@@ -2450,8 +2470,8 @@
                 {
                     if (previousMask)
                     {
-                    	moveToParentSpace(previousMask);
-
+                        moveToParentSpace(previousMask);
+
                         elementHost.removeMaskElement(previousMask, this);
                         if (displayObject)
                             displayObject.mask = null;
@@ -2518,9 +2538,11 @@
     }

     /**
-     *  @return Returns true when the measureSizes() code can skip the call to
-     *  measure(). For example this is usually true when both explicitWidth and
-     *  explicitHeight are set. For path, this is true when the bounds of the path
+     *  Determines if the call to the measure() method can be skipped.
+     *
+     *  @return Returns true when the measureSizes() method can skip the call to
+     *  the measure() method. For example this is usually true when both explicitWidth and
+     *  explicitHeight are set. For paths, this is true when the bounds of the path
      *  have not changed.
      */
     protected function skipMeasure():Boolean
@@ -2677,8 +2699,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  @return Returns a reference to the object in the layout tree
-     *  represented by this interface.
+     *  A reference to the object in the layout tree represented by this interface.
      */
     public function get target():Object
     {
@@ -2686,8 +2707,12 @@
     }

     /**
+     *  Gets the transformation matrix.
+     *
+     *  @param actualMatrix
+     *
      *  @return Returns the transformation matrix for this element, or null
-     *  if it is detla identity.
+     *  if it is delta identity.
      */
     protected function computeMatrix(actualMatrix:Boolean):Matrix
     {
@@ -2699,6 +2724,14 @@
     }

     /**
+     *  Transform the element's size.
+     *
+     *  @param width The target width.
+     *
+     *  @param height The target height.
+     *
+     *  @param actualMatrix
+     *
      *  @return Returns the transformed size. Transformation is this element's
      *  transformation matrix.
      */
@@ -2721,6 +2754,17 @@
      *  Override for graphic elements that need specific calculation of
      *  coordinates of top-left corner of bounding box when resized to
      *  width and height.
+     *
+     *  @param topLeft The origin of the bounds rectangle to be transformed.
+     *
+     *  @param width The target width.
+     *
+     *  @param height The target height.
+     *
+     *  @param m The transformation matrix.
+     *
+     *  @return The top left point of the rectangle after transformation.
+     *
      */
     protected function computeTopLeft(topLeft:Point, width:Number, height:Number, m:Matrix):Point
     {
@@ -2745,9 +2789,13 @@
     }

     /**
-     *  setActualPosition moves the item
+     *  Moves the item
      *  such that the left-top corner of the item's TBounds
      *  has the specified coordinates.
+     *
+     *  @param x The new x position of the GraphicElement.
+     *
+     *  @param y The new y position of the GraphicElement.
      */
     public function setActualPosition(x:Number, y:Number):void
     {
@@ -2791,27 +2839,30 @@
     }

     /**
-     *  setActualSize modifies the item size/transform
+     *  Modifies the item size/transform
      *  so that its TBounds have the specified width
      *  and height.
      *
-     *  If one of the desired TBounds dimensions is left unspecified, it's size
-     *  will be picked such that item can be optimally sized to fit the other
-     *  TBounds dimension. This is useful when the layout doesn't want to
+     *
If one of the desired TBounds dimensions is left unspecified, its size
+     *  is set such that item can be optimally sized to fit the other
+     *  TBounds dimension. This is useful when the layout does not
      *  overconstrain the item in cases where the item TBounds width and height
-     *  are dependent (text, components with complex transforms, etc.)
+     *  are dependent (such as with text or with components that have complex transforms).

      *
-     *  If both TBounds dimensions are left unspecified, the item will have its
-     *  preferred size set.
+     *
If both TBounds dimensions are left unspecified, the item's preferred size is set.

      *
-     *  setActualSize does not clip against minSize and
-     *  maxSize properties.
+     *
The setActualSize() method does not clip against the minSize and
+     *  maxSize properties.

      *
-     *  setActualSize must preserve the item's TBounds position,
+     *
The setActualSize method must preserve the item's TBounds position,
      *  which means that in some cases it will move the item in addition to
-     *  changing its size.
+     *  changing its size.

      *
-     *  @return Returns the TBounds of the new item size.
+     *  @param width The target width.
+     *
+     *  @param height The target height.
+     *
+     *  @return The TBounds of the new item size.
      */
     public function setActualSize(width:Number = Number.NaN,
                                   height:Number = Number.NaN):Point
@@ -2914,13 +2965,13 @@

         if(displayObject == null)
             return;
-
-		if (_mask && isMaskInElementSpace)
-        {
-        	moveToParentSpace(_mask);
-        	isMaskInElementSpace = false;
-        }
-
+
+        if (_mask && isMaskInElementSpace)
+        {
+            moveToParentSpace(_mask);
+            isMaskInElementSpace = false;
+        }
+
         if(layoutFeatures.is3D)
         {
             displayObject.transform.matrix3D = layoutFeatures.computedMatrix3D;
@@ -2937,8 +2988,8 @@

         if (_mask && !isMaskInElementSpace)
         {
-        	moveToLocalSpace(_mask);
-        	isMaskInElementSpace = true;
+            moveToLocalSpace(_mask);
+            isMaskInElementSpace = true;
         }
     }


Revert "Fix potential loss of best effort request causing long 30 second plus stalls."

--- HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
+++ HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
@@ -913,18 +913,8 @@
 						}
 					}
 				}
-				else
-				{
-
-					// Fire any pending best effort requests.
-					if(_pendingBestEffortRequest)
-					{
-						trace("Firing pending best effort request (2): " + _pendingBestEffortRequest);
-						var pber:HTTPStreamRequest = _pendingBestEffortRequest;
-						_pendingBestEffortRequest = null;
-						return pber;
-					}
-
+				else
+				{
 					trace("getFileForTime - Waiting on knowledge!");
 					return new HTTPStreamRequest (HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 				}


fixed bug that was causing global columns to be cached and an error message to be shown when reloading a file with cached data.

--- WeaveData/src/weave/data/AttributeColumnCache.as
+++ WeaveData/src/weave/data/AttributeColumnCache.as
@@ -113,11 +113,12 @@
 			var dataSource:*;
 			for (dataSource in cache)
 			{
-				// skip global columns (EquationColumn, CSVColumn)
-				if (!dataSource || objectWasDisposed(dataSource))
+				var dataSourceName:String = WeaveAPI.globalHashMap.getName(dataSource);
+
+				// skip disposed data sources and global columns (EquationColumn, CSVColumn)
+				if (!dataSourceName)
 					continue;

-				var dataSourceName:String = WeaveAPI.globalHashMap.getName(dataSource);
 				for (var metadataHash:String in cache[dataSource])
 				{
 					var column:IAttributeColumn = (cache[dataSource][metadataHash] as WeakReference).value as IAttributeColumn;
@@ -184,7 +185,8 @@
 			var dataSource:IDataSource = WeaveAPI.globalHashMap.getObject(dataSourceName) as IDataSource;
 			if (!dataSource)
 			{
-				reportError("Data source not found: " + dataSourceName);
+				if (dataSourceName)
+					reportError("Data source not found: " + dataSourceName);
 				return;
 			}
 			var column:IAttributeColumn;


Fixed null pointer error

Fixed null pointer error

Change-Id: I721524e82d5c58ee4bb1837fb8bf21bb22de68af

--- WeaveData/src/weave/data/DataSources/CSVDataSource.as
+++ WeaveData/src/weave/data/DataSources/CSVDataSource.as
@@ -121,7 +121,7 @@
 		{
 			// save parsedRows only if csvData has non-null session state
 			var rows:Array = csvData.getSessionState() as Array;
-			if (rows != null)
+			if (rows != null && rows.length)
 			{
 				// clear url value when we specify csvData session state
 				if (url.value)
@@ -139,7 +139,7 @@
 		private function handleParsedRows(rows:Array):void
 		{
 			parsedRows = rows;
-			columnIds = rows[0] ? (rows[0] as Array).concat() : [];
+			columnIds = rows && rows[0] is Array ? (rows[0] as Array).concat() : [];
 			// make sure column names are unique - if not, use index values for columns with duplicate names
 			var nameLookup:Object = {};
 			for (var i:int = 0; i < columnIds.length; i++)


small change

small change

--- WeaveAPI/src/lang.as
+++ WeaveAPI/src/lang.as
@@ -48,10 +48,7 @@
 		}

 		if (parameters.length)
-		{
-			parameters.unshift(newText);
-			return StringUtil.substitute.apply(null, parameters);
-		}
+			return StringUtil.substitute(newText, parameters);

 		return newText;
 	}


Enable glorious unloadAndStop().
I did some tests with it, and it sure does put the kibosh on things.

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

--- src/as/com/threerings/flash/LoaderUtil.as
+++ src/as/com/threerings/flash/LoaderUtil.as
@@ -20,16 +20,16 @@
         } catch (e1 :Error) {
             // ignore
         }
-//        try {
-//            loader.unloadAndStop();
-//        } catch (e2 :Error) {
+        try {
+            loader.unloadAndStop();
+        } catch (e2 :Error) {
             // hmm, maybe they are using FP9 still
             try {
                 loader.unload();
             } catch (e3 :Error) {
                 // ignore
             }
-//        }
+        }
     }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10276
Author:   smgilson@adobe.com
Date:     2009-09-15T19:36:00.969262Z

Log Message:
-----------
ASDoc edits on the Spark ButtonBar support for ViewStack feature

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ISelectableList.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/framework/src/mx/containers/ViewStack.as</path>

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

--- frameworks/projects/mx/src/mx/containers/ViewStack.as
+++ frameworks/projects/mx/src/mx/containers/ViewStack.as
@@ -140,8 +140,9 @@
  *  for selecting which child container is currently visible.
  *  Typically, you set its selectedIndex or
  *  selectedChild property in ActionScript in response to
- *  some user action. Alternately, you can associate a LinkBar, TabBar or ToggleButtonBar
- *  container with a ViewStack container to provide a navigation interface.
+ *  some user action.
+ *  Alternately, you can associate an MX LinkBar, TabBar, ButtonBar, or ToggleButtonBar
+ *  control or a Spark ButtonBar control with a ViewStack container to provide a navigation interface.
  *  To do so, specify the ViewStack container as the value of the
  *  dataProvider property of the LinkBar, TabBar or
  *  ToggleButtonBar container.

@@ -223,6 +224,10 @@
  *  @includeExample examples/ViewStackExample.mxml
  *
  *  @see mx.controls.LinkBar
+ *  @see mx.controls.ButtonBar
+ *  @see mx.controls.TabBar
+ *  @see mx.controls.ToggleButtonBar
+ *  @see spark.components.ButtonBar
  *  @see mx.managers.HistoryManager
  *  @see mx.managers.LayoutManager
  *
@@ -1505,7 +1510,7 @@
      */
     public function get length():int
     {
-    	return numChildren;
+        return numChildren;
     }

     /**
@@ -1514,7 +1519,7 @@
      */
     public function addItem(item:Object):void
     {
-    	addChild(item as DisplayObject);
+        addChild(item as DisplayObject);
     }

     /**
@@ -1523,7 +1528,7 @@
      */
     public function addItemAt(item:Object, index:int):void
     {
-    	addChildAt(item as DisplayObject, index);
+        addChildAt(item as DisplayObject, index);
     }

     /**
@@ -1532,7 +1537,7 @@
      */
     public function getItemAt(index:int, prefetch:int = 0):Object
     {
-    	return getChildAt(index);
+        return getChildAt(index);
     }

     /**
@@ -1541,7 +1546,7 @@
      */
     public function getItemIndex(item:Object):int
     {
-    	return getChildIndex(item as DisplayObject);
+        return getChildIndex(item as DisplayObject);
     }

     /**
@@ -1552,7 +1557,7 @@
                          oldValue:Object = null,
                          newValue:Object = null):void
     {
-
+
     }

     /**
@@ -1561,7 +1566,7 @@
      */
     public function removeAll():void
     {
-    	removeAllChildren();
+        removeAllChildren();
     }

     /**
@@ -1580,9 +1585,9 @@
      */
     public function setItemAt(item:Object, index:int):Object
     {
-    	var result:Object = removeChildAt(index);
-    	addChildAt(item as DisplayObject,index);
-    	return result;
+        var result:Object = removeChildAt(index);
+        addChildAt(item as DisplayObject,index);
+        return result;
     }

     /**
@@ -1594,7 +1599,7 @@
         var result:Array = [];
         for(var i:int =0;i<numChildren;i++)
         {
-        	result.push(getChildAt(i));
+            result.push(getChildAt(i));
         }
         return result;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

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

--- frameworks/projects/mx/src/mx/skins/halo/PanelSkin.as
+++ frameworks/projects/mx/src/mx/skins/halo/PanelSkin.as
@@ -0,0 +1,262 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 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.skins.halo
+{
+
+import flash.display.GradientType;
+import flash.display.Graphics;
+import flash.utils.getQualifiedClassName;
+import flash.utils.describeType;
+import mx.core.IContainer;
+import mx.core.EdgeMetrics;
+import mx.core.FlexVersion;
+import mx.core.IUIComponent;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ *  The PanelSkin class defines the skin for the Panel, TitleWindow, and Alert components.
+ */
+public class PanelSkin extends HaloBorder
+{
+    include "../../core/Version.as";
+
+    /**
+     *  Constructor
+     */
+    public function PanelSkin()
+    {
+        super();
+    }
+
+    /**
+     *  @private
+     */
+    private var oldHeaderHeight:Number;
+
+    /**
+     *  @private
+     */
+    private var oldControlBarHeight:Number;
+
+    /**
+     *  @private
+     *  Return the thickness of the border edges.
+     *
+     *  @return Object  top, bottom, left, right thickness in pixels
+     */
+    override public function get borderMetrics():EdgeMetrics
+    {
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 || getStyle("borderStyle") != "default")
+            return super.borderMetrics;
+
+        var hasPanelParent:Boolean = isPanel(parent);
+        var controlBar:IUIComponent = hasPanelParent ? Object(parent).mx_internal::_controlBar : null;
+        var hHeight:Number = hasPanelParent ? Object(parent).mx_internal::getHeaderHeightProxy() : NaN;
+
+        var newControlBarHeight:Number;
+
+        if (controlBar && controlBar.includeInLayout)
+            newControlBarHeight = controlBar.getExplicitOrMeasuredHeight();
+
+        if (newControlBarHeight != oldControlBarHeight)
+            _borderMetrics = null;
+
+        if (hHeight != oldHeaderHeight)
+            _borderMetrics = null;
+
+        if (_borderMetrics)
+            return _borderMetrics;
+
+        var o:EdgeMetrics = super.borderMetrics;
+        var vm:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
+
+        var bt:Number = getStyle("borderThickness");
+        var btl:Number = getStyle("borderThicknessLeft");
+        var btt:Number = getStyle("borderThicknessTop");
+        var btr:Number = getStyle("borderThicknessRight");
+        var btb:Number = getStyle("borderThicknessBottom");
+
+        // Add extra space to edges (was margins).
+        vm.left = o.left + (isNaN(btl) ? bt : btl);
+        vm.top = o.top + (isNaN(btt) ? bt : btt);
+        vm.right = o.bottom + (isNaN(btr) ? bt : btr);
+
+        // Bottom is a special case. If borderThicknessBottom is NaN,
+        // use btl if we don't have a control bar or btt if we do.
+        vm.bottom = o.bottom + (isNaN(btb) ?
+            (controlBar && !isNaN(btt) ? btt : isNaN(btl) ? bt : btl) :
+            btb);
+
+        // Since the header covers the solid portion of the border,
+        // we need to use the larger of borderThickness or headerHeight
+
+        oldHeaderHeight = hHeight;
+        if (!isNaN(hHeight))
+            vm.top += hHeight;
+
+        oldControlBarHeight = newControlBarHeight
+        if (!isNaN(newControlBarHeight))
+            vm.bottom += newControlBarHeight;
+
+        _borderMetrics = vm;
+
+        return _borderMetrics;
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function drawBorder(w:Number, h:Number):void
+    {
+        super.drawBorder(w,h);
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+            return;
+
+        var borderStyle:String = getStyle("borderStyle");
+
+        if (borderStyle == "default")
+        {
+            // For Panel/Alert, "borderAlpha" is the alpha for the
+            // title/control/gutter area and "backgroundAlpha"
+            // is the alpha for the content area.
+            // We flip-flop the variables here so the "borderAlpha"
+            // is applied by the background drawing code at the bottom.
+            var contentAlpha:Number = getStyle("backgroundAlpha");
+            var backgroundAlpha:Number = getStyle("borderAlpha");
+            backgroundAlphaName = "borderAlpha";
+
+            radiusObj = null;
+            radius = getStyle("cornerRadius");
+            bRoundedCorners =
+                getStyle("roundedBottomCorners").toString().toLowerCase() == "true";
+            var br:Number = bRoundedCorners ? radius : 0;
+
+            var g:Graphics = graphics;
+
+            drawDropShadow(0, 0, w, h, radius, radius, br, br);
+
+            // If we don't have rounded corners we need to initialize
+            // the complex radius object so the background fill code
+            // below works correctly.
+            if (!bRoundedCorners)
+                radiusObj = {};
+
+            var parentContainer:IContainer = parent as IContainer;
+
+            if (parentContainer)
+            {
+                var vm:EdgeMetrics = parentContainer.viewMetrics;
+
+                // The backgroundHole is the content area
+                backgroundHole = {x:vm.left, y:vm.top,
+                                  w: Math.max(0, w - vm.left - vm.right),
+                                  h: Math.max(0, h - vm.top - vm.bottom),
+                                  r:0};
+
+                if (backgroundHole.w > 0 && backgroundHole.h > 0)
+                {
+                    // Draw a shadow around the content
+                    // if the content and panel alpha are different.
+                    // This could be a style property if needed
+                    if (contentAlpha != backgroundAlpha)
+                    {
+                        drawDropShadow(backgroundHole.x, backgroundHole.y,
+                                backgroundHole.w, backgroundHole.h,
+                                0, 0, 0, 0);
+                    }
+
+                    // Fill in the content area
+                    g.beginFill(Number(backgroundColor), contentAlpha);
+                    g.drawRect(backgroundHole.x, backgroundHole.y,
+                            backgroundHole.w, backgroundHole.h);
+                    g.endFill();
+                }
+            }
+
+            // When the content and panel alpha are different, the border
+            // of the panel is drawn using borderColor. We've already
+            // drawn the content background so we set backgroundColor to
+            // borderColor here so the drawing code below is done with the
+            // border color.
+            backgroundColor = getStyle("borderColor");
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function drawBackground(w:Number, h:Number):void
+    {
+        super.drawBackground(w,h);
+
+        if (getStyle("headerColors") == null && getStyle("borderStyle") == "default")
+        {
+            var highlightAlphas:Array = getStyle("highlightAlphas");
+            var highlightAlpha:Number = highlightAlphas ? highlightAlphas[0] : 0.3;
+            // edge
+            drawRoundRect(
+                0, 0, w, h,
+                { tl: radius, tr: radius, bl: 0, br: 0 },
+                0xFFFFFF, highlightAlpha, null,
+                GradientType.LINEAR, null,
+                { x: 0, y: 1, w: w, h: h - 1,
+                  r: { tl: radius, tr: radius, bl: 0, br: 0 } });
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function getBackgroundColorMetrics():EdgeMetrics
+    {
+    	if (getStyle("borderStyle") == "default")
+        	return EdgeMetrics.EMPTY;
+        else
+        	return super.getBackgroundColorMetrics();
+    }
+
+   	/**
+	 *  We don't use 'is' to prevent dependency issues
+	 */
+	static private var panels:Object = {};
+
+	static private function isPanel(parent:Object):Boolean
+	{
+		var s:String = getQualifiedClassName(parent);
+		if (panels[s] == 1)
+			return true;
+
+		if (panels[s] == 0)
+			return false;
+
+		if (s == "mx.containers::Panel")
+		{
+			panels[s] == 1;
+			return true;
+		}
+
+		var x:XML = describeType(parent);
+		var xmllist:XMLList = x.extendsClass.(@type == "mx.containers::Panel");
+		if (xmllist.length() == 0)
+		{
+			panels[s] = 0;
+			return false;
+		}
+
+		panels[s] = 1;
+		return true;
+	}
+
+}
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/spark/src/spark/core/IViewport.as
+++ frameworks/projects/spark/src/spark/core/IViewport.as
@@ -206,7 +206,29 @@
      *  @productversion Flex 4
      */
     function get clipAndEnableScrolling():Boolean;
-    function set clipAndEnableScrolling(value:Boolean):void;
+    function set clipAndEnableScrolling(value:Boolean):void;
+
+    /**
+     *  If clipAndEnabledScrolling is true and
+     *  inputMode is touch,
+     *  scrollAxis specifies which direction this scroller
+     *  can scroll.
+     *
+     *  Possible values for this property are vertical,
+     *  horizontal, and diagonal.
+     *
+     *  @default vertical
+     *
+     *  @see mx.core.UIComponent#inputMode
+     *  @see #clipAndEnableScrolling
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4.5
+     */
+    function get scrollAxis():String;
+    function set scrollAxis(value:String):void;
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20503
Author:   chiedozi@adobe.com
Date:     2011-03-01T01:35:23.376092Z

Log Message:
-----------
Altering focus changes made in revision 20384.  View and ViewNavigatorBase can no longer gain focus.

QE notes:
Doc notes:
Bugs: SDK-29667
Reviewer: Ryan, Alex
Tests run:
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigatorApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as
@@ -719,14 +719,7 @@
                 // If there is no focus or the item that had focus isn't
                 // on the display list anymore, update the focus to be
                 // the active view or the view navigator
-                var focusedObject:Object = focusManager.getFocus();
-                if (!focusedObject || !focusedObject.stage || focusedObject == this)
-                {
-                    if (activeView)
-                        focusManager.setFocus(activeView);
-                    else
-                        focusManager.setFocus(this);
-                }
+                updateFocus();
             }

             selectedIndexAdjusted = false;


Transferred from the Adobe Open Source Subversion Repository

Revision: 20537
Author:   chiedozi@adobe.com
Date:     2011-03-02T04:23:09.889338Z

Log Message:
-----------
Fixed a bug in FlipViewTransition and ZoomViewTransition where the transitions were incorrectly re-parenting the animated navigator

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/ViewTransitionBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/ZoomViewTransition.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as
@@ -688,11 +688,16 @@
         // our transition goes haywire because our bounds are wrong.
         UIComponent(targetNavigator.parent).validateNow();

+        // Save the child index of the target navigator
+        navigatorProps.childIndex = getComponentChildIndex(targetNavigator, targetNavigator.parent as UIComponent);
+
         // Add a temporary group to contain our snapshot view of the navigator
         // while we animate.
         transitionGroup = new Group();
         transitionGroup.includeInLayout = false;
-        addComponentToContainer(transitionGroup, DisplayObject(targetNavigator).parent as UIComponent);
+
+        // Add the transition group at the same index of the target navigator
+        addComponentToContainerAt(transitionGroup, DisplayObject(targetNavigator).parent as UIComponent, navigatorProps.childIndex);

         transitionGroup.addElement(targetNavigator);
         cachedNavigator.includeInLayout = false;
@@ -833,7 +838,7 @@

             // Restore our views to their natural location.
             removeComponentFromContainer(targetNavigator as UIComponent, transitionGroup as UIComponent);
-            addComponentToContainer(targetNavigator as UIComponent, transitionGroup.parent as UIComponent);
+            addComponentToContainerAt(targetNavigator as UIComponent, transitionGroup.parent as UIComponent, navigatorProps.childIndex);
             removeComponentFromContainer(transitionGroup as UIComponent, transitionGroup.parent as UIComponent);

             // Restore targetNavigator properties.


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LinearLayoutVector.as
@@ -0,0 +1,540 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+package mx.layout
+{
+import __AS3__.vec.Vector;
+import flash.geom.Rectangle;
+import mx.graphics.Rect;
+import mx.layout.ILayoutElement;
+
+
+/**
+ *  A sparse array of "major dimension" sizes that represent
+ *  VerticalLayout item heights or HorizontalLayout item widths,
+ *  and the current "minor dimension" maximum size.
+ *
+ *  Provides efficient support for finding the cumulative distance to
+ *  the start/end of an item along the major axis, and similarly for
+ *  finding the index of the item at a particular distance.
+ *
+ *  Default major/minor sizes is used for items whose size hasn't
+ *  been specified.
+ */
+public final class LinearLayoutVector
+{
+    /**
+     *  Specifies that the majorAxis is vertical.
+     *
+     *  @see majorAxis
+     */
+    public static const VERTICAL:uint = 0;
+
+
+    /**
+     *  Specifies that the majorAxis is horizontal.
+     *
+     *  @see majorAxis
+     */
+    public static const HORIZONTAL:uint = 1;
+
+    /* Assumption: vector elements (sizes) will typically be set in
+     * small ranges that reflect localized scrolling.  Allocate vector
+     * elements in blocks of BLOCK_SIZE, which must be a power of 2.
+     * BLOCK_SHIFT is the power of 2 and BLOCK_MASK masks off as many
+     * low order bits.  The blockTable contains all of the allocated
+     * blocks and has length/BLOCK_SIZE elements which are allocated lazily.
+     */
+    internal static const BLOCK_SIZE:uint = 128;
+    internal static const BLOCK_SHIFT:uint = 7;
+    internal static const BLOCK_MASK:uint = 0x7F;
+    private var blockTable:Vector.<Block> = new Vector.<Block>(0, false);
+
+
+    public function LinearLayoutVector()
+    {
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  length
+    //----------------------------------
+
+    private var _length:uint = 0;
+
+    /**
+     *  The number of item size valued elements.
+     *
+     *  @default 0
+     */
+    public function get length():uint
+    {
+        return _length;
+    }
+
+    /**
+     * @private
+     */
+    public function set length(value:uint):void
+    {
+        if (_length == value)
+            return;
+
+        _length = value;
+        var partialBlock:uint = ((_length & BLOCK_MASK) == 0) ? 0 : 1;
+        blockTable.length = (_length >> BLOCK_SHIFT) + partialBlock;
+    }
+
+    //----------------------------------
+    //  defaultMajorSize
+    //----------------------------------
+
+    private var _defaultMajorSize:Number = 20;
+
+    /**
+     *  The size of items whose majorSize was not specified with setMajorSize.
+     *
+     *  @default 20
+     *  @see #cacheDimensions
+     */
+    public function get defaultMajorSize():Number
+    {
+        return _defaultMajorSize;
+    }
+
+    /**
+     * @private
+     */
+    public function set defaultMajorSize(value:Number):void
+    {
+        _defaultMajorSize = value;
+    }
+
+    //----------------------------------
+    //  minorSize
+    //----------------------------------
+
+    private var _minorSize:Number = 0;
+
+    /**
+     *  The maximum size of items along the axis opposite the majorAxis.
+     *
+     *  This property is updated by the cacheDimensions() method.
+     *
+     *  @default 0
+     *  @see #cacheDimensions
+     *  @see majorAxis
+     */
+    public function get minorSize():Number
+    {
+        return _minorSize;
+    }
+
+    /**
+     * @private
+     */
+    public function set minorSize(value:Number):void
+    {
+        _minorSize = value;
+    }
+
+    //----------------------------------
+    //  minMinorSize
+    //----------------------------------
+
+    private var _minMinorSize:Number = 0;
+
+    /**
+     *  The maximum of the minimum size of items relative to the minor axis.
+     *
+     *  If majorAxis is VERTICAL then this is the maximum of items' minWidths,
+     *  and if majorAxis is HORIZONTAL, then this is the maximum of the
+     *  items' minHeights.
+     *
+     *  This property is updated by the cacheDimensions() method.
+     *
+     *  @default 0
+     *  @see #cacheDimensions
+     *  @see majorAxis
+     */
+    public function get minMinorSize():Number
+    {
+        return _minMinorSize;
+    }
+
+    /**
+     * @private
+     */
+    public function set minMinorSize(value:Number):void
+    {
+        _minMinorSize = value;
+    }
+
+    //----------------------------------
+    //  majorAxis
+    //----------------------------------
+
+    private var _majorAxis:Number = VERTICAL;
+
+    /**
+     *  Defines how the getBounds() method maps from
+     *  majorSize, minorSize to width and height.
+     *
+     *  @default VERTICAL
+     *  @see #cacheDimensions
+     */
+    public function get majorAxis():Number
+    {
+        return _majorAxis;
+    }
+
+    /**
+     * @private
+     */
+    public function set majorAxis(value:Number):void
+    {
+        _majorAxis = value;
+    }
+
+    //----------------------------------
+    //  gap
+    //----------------------------------
+
+    private var _gap:Number = 6;
+
+    /**
+     *  The distance between items.
+     *
+     *  @default 6
+     */
+    public function get gap():Number
+    {
+        return _gap;
+    }
+
+    /**
+     * @private
+     */
+    public function set gap(value:Number):void
+    {
+        _gap = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Return the size of the item at index.  If no size was ever
+     *  specified then then the defaultMajorSize is returned.
+     *
+     *  @param index The item's index.
+     *  @see defaultMajorSize
+     */
+    public function getMajorSize(index:uint):Number
+    {
+        var block:Block = blockTable[index >> BLOCK_SHIFT];
+        if (block)
+        {
+            var value:Number = block.sizes[index & BLOCK_MASK];
+            return (isNaN(value)) ? _defaultMajorSize : value;
+        }
+        else
+            return _defaultMajorSize;
+    }
+
+    /**
+     *  Set the size of the item at index.   If an index is
+     *  set to NaN then subsequent calls to get
+     *  will return the defaultMajorSize.
+     *
+     *  @param index The item's index.
+     *  @param value The item's size.
+     *  @see defaultMajorSize
+     */
+    public function setMajorSize(index:uint, value:Number):void
+    {
+        if (index >= length)
+            throw new Error("invalid index");
+
+        var blockIndex:uint = index >> BLOCK_SHIFT;
+        var block:Block = blockTable[blockIndex];
+        if (!block)
+            block = blockTable[blockIndex] = new Block();
+        var sizesIndex:uint = index & BLOCK_MASK;
+        var sizes:Vector.<Number> = block.sizes;
+        var oldValue:Number = sizes[sizesIndex];
+        if (oldValue == value)
+            return;
+        if (isNaN(oldValue))
+        {
+            block.defaultCount -= 1;
+            block.sizesSum += value;
+        }
+        else if (isNaN(value))
+        {
+            block.defaultCount += 1;
+            block.sizesSum -= oldValue;
+        }
+        else
+            block.sizesSum += value - oldValue;
+        block.sizes[sizesIndex] = value;
+    }
+
+    /**
+     *  The cumulative distance to the start of the item at index, including
+     *  the gaps between items.
+     *
+     *  The value of start(0) is 0.
+     *
+     *  Equivalent to:
+     *

+     *  var distance:Number = 0;
+     *  for (var i:int = 0; i < index; i++)
+     *      distance += get(i);
+     *  return distance + (gap * index);
+     *

+     *
+     *  The actual implementation is relatively efficient.
+     *
+     *  @param index The item's index.
+     *  @see #end
+     */
+    public function start(index:uint):Number
+    {
+        if (index == 0)
+            return 0;
+
+        if (index >= _length)
+            throw new Error("invalid index");
+
+        var distance:Number = 0;
+        var blockIndex:uint = index >> BLOCK_SHIFT;
+        for (var i:int = 0; i < blockIndex; i++)
+        {
+            var block:Block = blockTable[i];
+            if (block)
+                distance += block.sizesSum + (block.defaultCount * _defaultMajorSize);
+            else
+                distance += BLOCK_SIZE * _defaultMajorSize;
+        }
+        var lastBlock:Block = blockTable[blockIndex];
+        var lastBlockOffset:uint = index & ~BLOCK_MASK;
+        var lastBlockLength:uint = index - lastBlockOffset;
+        if (lastBlock)
+        {
+            var sizes:Vector.<Number> = lastBlock.sizes;
+            for(i = 0; i < lastBlockLength; i++)
+            {
+                var size:Number = sizes[i];
+                distance += (isNaN(size)) ? _defaultMajorSize : size;
+            }
+        }
+        else
+            distance += _defaultMajorSize * lastBlockLength;
+        distance += index * gap;
+        return distance;
+    }
+
+    /**
+     *  The cumulative distance to the end of the item at index, including
+     *  the gaps between items.
+     *
+     *  If index <(length-1) then the value of this
+     *  function is defined as:
+     *  start(index) + get(index) + gap.
+     *
+     *  The gap isn't added for the last item.
+     *
+     *  @param index The item's index.
+     *  @see #start
+     */
+    public function end(index:uint):Number
+    {
+        var distance:Number = start(index) + getMajorSize(index);
+        if (index < (_length - 1))
+            distance += gap;
+       return distance;
+    }
+
+    /**
+     *  Returns the index of the item that overlaps the specified distance.
+     *
+     *  The item at index i overlaps a distance value
+     *  if start(i) <= distance < end(i).
+     *
+     *  If no such item exists, -1 is returned.
+     */
+    public function indexOf(distance:Number):int
+    {
+        if ((_length == 0) || (distance < 0))
+            return -1;
+
+        var curDistance:Number = 0;
+        var index:int = -1;
+        var block:Block = null;
+        var blockGap:Number = _gap * BLOCK_SIZE;
+
+        // Find the block that contains distance and the index of its
+        // first element
+        for (var blockIndex:uint = 0; blockIndex < blockTable.length; blockIndex++)
+        {
+            block = blockTable[blockIndex];
+            var blockDistance:Number = blockGap;
+            if (block)
+                blockDistance += block.sizesSum + (block.defaultCount * _defaultMajorSize);
+            else
+                blockDistance += BLOCK_SIZE * _defaultMajorSize;
+            if ((distance == curDistance) ||
+                ((distance >= curDistance) && (distance < (curDistance + blockDistance))))
+            {
+                index = blockIndex << BLOCK_SHIFT;
+                break;
+            }
+            curDistance += blockDistance;
+        }
+
+        if ((index == -1) || (distance == curDistance))
+            return index;
+
+        if (block)
+        {
+            // Find the item that contains distance and return its index
+            var sizes:Vector.<Number> = block.sizes;
+            for (var i:int = 0; i < BLOCK_SIZE - 1; i++)
+            {
+                var size:Number = sizes[i];
+                curDistance += _gap + (isNaN(size) ? _defaultMajorSize : size);
+                if (curDistance > distance)
+                    return index + i;
+            }
+            // TBD special-case for the very last index
+            return index + BLOCK_SIZE - 1;
+        }
+        else
+        {
+            return index + Math.ceil(Number(distance - curDistance) / Number(_defaultMajorSize + _gap));
+        }
+    }
+
+    /**
+     *  Stores the majorSize for the specified ILayoutElement at index,
+     *  and  updates the minorSize and minMinorSize properties.
+     *
+     *  If majorAxis is VERTICAL then majorSize corresponds to the
+     *  height of this ILayoutElement, and the minor sizes to the
+     *  with and minWidth.
+     *
+     *  If majorAxis is HORIZONTAL, then the roles of the dimensions
+     *  are reversed.
+     *
+     *  The minMinorSize is intended to be used LinearLayout::measure() time.
+     *
+     *  It accumulates the maximum of the minWidth,Height for items for which
+     *  percentWidth,Height is specified, and preferredWidth,Height when
+     *  a percent size is not specified.
+     *
+     *  This is because LinearLayouts give items their preferred size along
+     *  the minor axis, unless percent size was specified.
+     *
+     *  @param index The item's index.
+     *  @param elt The layout element at index.
+     *
+     *  @see #getMajorSize
+     *  @see minorSize
+     *  @see minMinorSize
+     *  @see majorAxis
+     */
+    public function cacheDimensions(index:uint, elt:ILayoutElement):void
+    {
+        if (!elt || (index >= _length))
+            return;
+
+        if (majorAxis == VERTICAL)
+        {
+            setMajorSize(index, elt.getLayoutHeight());
+            minorSize = Math.max(minorSize, elt.getLayoutWidth());
+            var mw:Number =  isNaN(elt.percentWidth) ? elt.getPreferredWidth() : elt.getMinWidth();
+            minMinorSize = Math.max(minMinorSize, mw);
+        }
+        else
+        {
+            setMajorSize(index, elt.getLayoutWidth());
+            minorSize = Math.max(minorSize, elt.getLayoutHeight());
+            var mh:Number =  isNaN(elt.percentHeight) ? elt.getPreferredHeight() : elt.getMinHeight();
+            minMinorSize = Math.max(minMinorSize, mh);
+        }
+    }
+
+    /**
+     *  Returns the implict bounds of the item at index.
+     *
+     *  The bounds do not include the gap that follows the item.
+     *
+     *  If majorAxis is VERTICAL then the returned value is equivalent to:
+     *

+     *    new Rectangle(0, start(index), major, minor)
+     *

+     *
+     *  If majorAxis is HORIZONTAL then the returned value is equivalent to:
+     *

+     *    new Rectangle(start(index), 0, minor, major)
+     *

+     *
+     *  @param index The item's index.
+     *  @param bounds The Rectangle to return or null for a new Rectangle
+     */
+    public function getBounds(index:uint, bounds:Rectangle = null):Rectangle
+    {
+        if (!bounds)
+            bounds = new Rectangle();
+
+        var major:Number = getMajorSize(index);
+        var minor:Number = minorSize;
+        if (majorAxis == VERTICAL)
+        {
+            bounds.x = 0;
+            bounds.y = start(index);
+            bounds.height = major;
+            bounds.width = minor;
+        }
+        else  // HORIZONTAL
+        {
+            bounds.x = start(index);
+            bounds.y = 0;
+            bounds.height = minor;
+            bounds.width = major;
+        }
+        return bounds;
+    }
+
+    public function toString():String
+    {
+        return "LinearLayoutVector{" +
+            "length=" + _length +
+            " [blocks=" + blockTable.length + "]" +
+            " " + ((majorAxis == VERTICAL) ? "VERTICAL" : "HORIZONTAL") +
+            " gap=" + _gap +
+            " defaultMajorSize=" + _defaultMajorSize +
+            "}";
+    }
+}
+
+}


FIX Flex 38862 (modal popup not working)

--- frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as
+++ frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as
@@ -433,7 +433,7 @@
 	{
 		var n:int = forms.length;
 		var rc:IChildList = systemManager.rawChildren;
-		for (var i:int = n - 1; n >= 0; i--)
+		for (var i:int = n - 1; i >= 0; i--)
 		{
 			var f:Object = forms[i];
 			if (f is DisplayObject)


Transferred from the Adobe Open Source Subversion Repository

Revision: 12433
Author:   cframpto@adobe.com
Date:     2009-12-03T15:01:54.719958Z

Log Message:
-----------
Finish reverting the part of rev 12322 which added custom menu support since it only works on the player and not on AIR.  SDK-23926 has been reopened.

QE notes:
Doc notes:
Bugs: SDK-23926
Reviewer:
Tests run: checkintests, TextArea
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -15,7 +15,6 @@
 import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.events.FocusEvent;
-import flash.ui.ContextMenu;

 import flashx.textLayout.elements.TextFlow;
 import flashx.textLayout.events.SelectionEvent;
@@ -202,67 +201,62 @@
     /**
      *  @private
      */
-    private static const CONTEXT_MENU_PROPERTY_FLAG:uint = 1 << 1;
-
-    /**
-     *  @private
-     */
-    private static const DISPLAY_AS_PASSWORD_PROPERTY_FLAG:uint = 1 << 2;
-
-    /**
-     *  @private
-     */
-    private static const EDITABLE_PROPERTY_FLAG:uint = 1 << 3;
+    private static const DISPLAY_AS_PASSWORD_PROPERTY_FLAG:uint = 1 << 1;
+
+    /**
+     *  @private
+     */
+    private static const EDITABLE_PROPERTY_FLAG:uint = 1 << 2;

     /**
      *  @private
      */
-    private static const HEIGHT_IN_LINES_PROPERTY_FLAG:uint = 1 << 4;
-
-    /**
-     *  @private
-     */
-    private static const IME_MODE_PROPERTY_FLAG:uint = 1 << 5;
-
-    /**
-     *  @private
-     */
-    private static const MAX_CHARS_PROPERTY_FLAG:uint = 1 << 6;
+    private static const HEIGHT_IN_LINES_PROPERTY_FLAG:uint = 1 << 3;
+
+    /**
+     *  @private
+     */
+    private static const IME_MODE_PROPERTY_FLAG:uint = 1 << 4;
+
+    /**
+     *  @private
+     */
+    private static const MAX_CHARS_PROPERTY_FLAG:uint = 1 << 5;

     /**
      *  @private
      */
-    private static const MAX_WIDTH_PROPERTY_FLAG:uint = 1 << 7;
-
-    /**
-     *  @private
-     */
-    private static const RESTRICT_PROPERTY_FLAG:uint = 1 << 8;
-
-    /**
-     *  @private
-     */
-    private static const SELECTABLE_PROPERTY_FLAG:uint = 1 << 9;
-
-    /**
-     *  @private
-     */
-    private static const SELECTION_HIGHLIGHTING_FLAG:uint = 1 << 10;
-
-    /**
-     *  @private
-     */
-    private static const TEXT_PROPERTY_FLAG:uint = 1 << 11;
-
-    /**
-     *  @private
-     */
-    private static const TEXT_FLOW_PROPERTY_FLAG:uint = 1 << 12;
-
-    /**
-     *  @private
-     */
-    private static const WIDTH_IN_CHARS_PROPERTY_FLAG:uint = 1 << 13;
+    private static const MAX_WIDTH_PROPERTY_FLAG:uint = 1 << 6;
+
+    /**
+     *  @private
+     */
+    private static const RESTRICT_PROPERTY_FLAG:uint = 1 << 7;
+
+    /**
+     *  @private
+     */
+    private static const SELECTABLE_PROPERTY_FLAG:uint = 1 << 8;
+
+    /**
+     *  @private
+     */
+    private static const SELECTION_HIGHLIGHTING_FLAG:uint = 1 << 9;
+
+    /**
+     *  @private
+     */
+    private static const TEXT_PROPERTY_FLAG:uint = 1 << 10;
+
+    /**
+     *  @private
+     */
+    private static const TEXT_FLOW_PROPERTY_FLAG:uint = 1 << 11;
+
+    /**
+     *  @private
+     */
+    private static const WIDTH_IN_CHARS_PROPERTY_FLAG:uint = 1 << 12;

     //--------------------------------------------------------------------------
     //
@@ -387,44 +381,6 @@
     //--------------------------------------------------------------------------

     //----------------------------------
-    //  contextMenu
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-//    override public function get contextMenu():ContextMenu
-//    {
-//        if (textDisplay)
-//            return textDisplay.contextMenu;
-//
-//        // want the default to be null
-//        var v:* = textDisplayProperties.contextMenu
-//        return (v === undefined) ? null : v;
-//    }
-
-    /**
-     *  @private
-     */
-//    override public function set contextMenu(value:ContextMenu):void
-//    {
-//        if (textDisplay)
-//        {
-//            textDisplay.contextMenu = value;
-//            textDisplayProperties = BitFlagUtil.update(
-//                uint(textDisplayProperties),
-//                CONTEXT_MENU_PROPERTY_FLAG, true);
-//        }
-//        else
-//        {
-//            textDisplayProperties.contextMenu = value;
-//        }
-//
-//        // Generate an UPDATE_COMPLETE event.
-//        invalidateProperties();
-//    }
-
-    //----------------------------------
     //  displayAsPassword
     //----------------------------------

@@ -1188,14 +1144,6 @@
                 uint(newTextDisplayProperties), CONTENT_PROPERTY_FLAG, true);
         }

-        if (textDisplayProperties.contextMenu !== undefined)
-        {
-            textDisplay.contextMenu = textDisplayProperties.contextMenu;
-            newTextDisplayProperties = BitFlagUtil.update(
-                uint(newTextDisplayProperties),
-                CONTEXT_MENU_PROPERTY_FLAG, true);
-        }
-
         if (textDisplayProperties.displayAsPassword !== undefined)
         {
             textDisplay.displayAsPassword =
@@ -1299,12 +1247,6 @@
     {
         var newTextDisplayProperties:Object = {};

-        if (BitFlagUtil.isSet(uint(textDisplayProperties),
-            CONTEXT_MENU_PROPERTY_FLAG))
-        {
-            newTextDisplayProperties.contextMenu = textDisplay.contextMenu;
-        }
-
         if (BitFlagUtil.isSet(uint(textDisplayProperties),
                               DISPLAY_AS_PASSWORD_PROPERTY_FLAG))
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20846
Author:   smgilson@adobe.com
Date:     2011-03-14T15:46:32.470057Z

Log Message:
-----------
Merge 20813 - ASDoc edits

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/StringUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/MultiDPIBitmapSource.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectProxy.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/BitmapUtil.as</path>
<path kind="dir" action="M">/private/flex/sdk/trunk</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/OnDemandEventDispatcher.as</path>

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

--- frameworks/projects/framework/src/mx/utils/ObjectProxy.as
+++ frameworks/projects/framework/src/mx/utils/ObjectProxy.as
@@ -620,6 +620,26 @@
      *  addEventListener() in the
      *  flash.events.EventDispatcher class.
      *
+     *  @param type The type of event.
+     *
+     *  @param listener The listener function that processes the event. This function must accept
+     *  an Event object as its only parameter and must return nothing.
+     *
+     *  @param useCapture Determines whether the listener works in the capture phase or the
+     *  target and bubbling phases. If useCapture is set to true,
+     *  the listener processes the event only during the capture phase and not in the
+     *  target or bubbling phase. If useCapture is false, the
+     *  listener processes the event only during the target or bubbling phase. To listen for
+     *  the event in all three phases, call addEventListener twice, once with
+     *  useCapture set to true, then again with
+     *  useCapture set to false.
+     *
+     *  @param priority The priority level of the event listener.
+     *
+     *  @param useWeakReference Determines whether the reference to the listener is strong or
+     *  weak. A strong reference (the default) prevents your listener from being garbage-collected.
+     *  A weak reference does not.
+     *
      *  @see flash.events.EventDispatcher#addEventListener()
      *
      *  @langversion 3.0


Transferred from the Adobe Open Source Subversion Repository

Revision: 17663
Author:   rfrishbe@adobe.com
Date:     2010-09-10T19:15:10.873300Z

Log Message:
-----------
Some Mobile item renderer fixes:

- Making some of the member variables protected for easier subclassing
- Fixing up some issues when using textAlign
- Adding new icon scale properties

QE notes: None
Doc notes: None
Bugs: SDK-27675, SDK-27672, SDK-27582
Reviewer: Glenn
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -730,20 +730,19 @@
         if (labelDisplay)
         {
             // measure the label component
-            var textWidth:Number = 0;
             var textHeight:Number = 0;
             var labelLineMetrics:TextLineMetrics;

             if (label != "")
             {
                 labelLineMetrics = measureText(label);
-                textWidth = labelLineMetrics.width + UITextField.TEXT_WIDTH_PADDING;
                 textHeight = labelLineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
             }

-            // text should take up the rest of the space
+            // text should take up the rest of the space width-wise, but only let it take up
+            // its measured textHeight so we can position it later based on verticalAlign
             var viewWidth:Number = unscaledWidth - getStyle("paddingLeft") + getStyle("paddingRight");
-            var labelWidth:Number = Math.max(Math.min(viewWidth, textWidth), 0);
+            var labelWidth:Number = Math.max(viewWidth, 0);

             var viewHeight:Number =  unscaledHeight - getStyle("paddingTop") - getStyle("paddingBottom");
             var labelHeight:Number = Math.max(Math.min(viewHeight, textHeight), 0);


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

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

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

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

 package spark.components.supportClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12823
Author:   hhillen@paciellogroup.com
Date:     2009-12-11T02:01:40.548617Z

Log Message:
-----------
Added TabBarAccImpl, Moved ButtonBarAccImpl to ButtonBarBaseAccImpl
QE notes: none
Doc notes: none
Bugs: n/a
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TabBar.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/ButtonBarBase.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ButtonBarBaseAccImpl.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/TabBarAccImpl.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as
@@ -35,7 +35,7 @@

 use namespace mx_internal;  // use of ListBase/setCurrentCaretIndex(index);

-
+[AccessibilityClass(implementation="spark.accessibility.ButtonBarBaseAccImpl")]
 /**
  *  The ButtonBarBase class defines the common behavior for the ButtonBar, TabBar and similar subclasses.
  *  This class does not add any new API however it refines selection, keyboard focus and keyboard navigation
@@ -79,6 +79,18 @@
 {
     include "../../core/Version.as";

+    //--------------------------------------------------------------------------
+    //
+    //  Class mixins
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Placeholder for mixin by ButtonBarBaseAccImpl.
+     */
+    mx_internal static var createAccessibilityImplementation:Function;
+
     /**
      *  Constructor.
      *
@@ -198,6 +210,17 @@
     //  Overridden Methods
     //
     //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Called by the initialize() method of UIComponent
+     *  to hook in the accessibility code.
+     */
+    override protected function initializeAccessibility():void
+    {
+        if (ButtonBarBase.createAccessibilityImplementation != null)
+            ButtonBarBase.createAccessibilityImplementation(this);
+    }

     /**
      *  @private


Signal optimization: no unnecessary callbacks copyings

--- src/ru/whitered/kote/Signal.as
+++ src/ru/whitered/kote/Signal.as
@@ -8,6 +8,8 @@
 	{
 		private var callbacks:Vector.<Function>;

+		private var callbacksInUse:Boolean = false;
+

 		/**
@@ -16,7 +18,17 @@
 		public function dispatch(... args):void
 		{
 			if(!callbacks) return;
-			const snapshot:Vector.<Function> = callbacks.concat();
+
+			if(callbacksInUse)
+			{
+				callbacks = callbacks.slice();
+			}
+			else
+			{
+				callbacksInUse = true;
+			}
+
+			const snapshot:Vector.<Function> = callbacks;
 			const numCallbacks:int = snapshot.length;

 			var i:int;
@@ -34,6 +46,8 @@
 					snapshot[i].apply(null, args);
 				}
 			}
+
+			callbacksInUse = false;
 		}

@@ -45,8 +59,15 @@
 		 */
 		public function addCallback(callback:Function):Boolean
 		{
+
 			if(callbacks)
 			{
+				if(callbacksInUse)
+				{
+					callbacks = callbacks.slice();
+					callbacksInUse = false;
+				}
+
 				if(callbacks.indexOf(callback) >= 0) return false;
 				callbacks[callbacks.length] = callback;
 			}
@@ -69,6 +90,13 @@
 			if(!callbacks) return false;
 			const index:int = callbacks.indexOf(callback);
 			if(index < 0) return false;
+
+			if(callbacksInUse)
+			{
+				callbacks = callbacks.slice();
+				callbacksInUse = false;
+			}
+
 			callbacks.splice(index, 1);
 			return true;
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10766
Author:   gruehle@adobe.com
Date:     2009-09-30T22:55:55.205927Z

Log Message:
-----------
Re-commit compiler errors for other theme's styles feature. If Style metadata has a "themes" attribute, the style is only valid if that theme is applied.

The Spark theme is applied by default. The halo theme can be specified as a compiler argument or by selecting the "MX Only" component set in Builder.

All other themes need to be applied using theme+= instead of theme=. If you use theme= you will get warnings about styles used in CSS selectors, and errors if you use any theme-specific style as an attribute on an MXML tag.

By default, styles that aren't valid for the current theme are errors. These can be changed to warnings with the report-invalid-styles-as-warnings compiler option.

QE notes: Expect test breakage
Doc notes: The new policy for themes needs to be documented.
Bugs: none yet, but I'm sure there will be some...
Reviewer: Ryan
Tests run: checkintests, cyclone
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToolTip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/DefaultsConfigurator.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/sparkskins/src/mx/skins/spark/ApplicationBackground.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/halo/defaults.css</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/themes/Spark/spark.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CalendarLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SkinStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ApplicationControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests.css</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/DeclarationHandler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ToolTipBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Type.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MxmlConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/TypeTable.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/sparkskins/src/SparkSkinsClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/MxmlConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler_en.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/AttributeHandler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ScrollControlBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FXGCompiler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/SkinnableDataContainerSkin.mxml</path>

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

--- frameworks/projects/mx/src/mx/controls/Button.as
+++ frameworks/projects/mx/src/mx/controls/Button.as
@@ -260,6 +260,17 @@
  *  @productversion Flex 3
  */
 [Style(name="skin", type="Class", inherit="no", states="up, over, down, disabled, selectedUp, selectedOver, selectedDown, selectedDisabled")]
+
+/**
+ *  Name of the class to use as the emphasized skin for the background and border.
+ *  @default "mx.skins.halo.ButtonSkin"
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="emphasizedSkin", type="Class", inherit="no", states="up, over, down, disabled, selectedUp, selectedOver, selectedDown, selectedDisabled")]

 /**
  *  Name of the class to use as the skin for the background and border