Transferred from the Adobe Open Source Subversion Repository

Revision: 5201
Author:   egeorgie@adobe.com
Date:     2009-03-07T02:17:47.081375Z

Log Message:
-----------
Updates to the LayoutBase, mostly asdocs.

QE Notes: None
Doc Notes:
Bugs: None
Reviewer: Hans
tests: checkintests, mustella (group, layout)

Modified Paths:
--------------
<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/HorizontalLayout.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@1285435 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
@@ -20,25 +20,29 @@
 import mx.core.ILayoutElement;
 import mx.utils.OnDemandEventDispatcher;

-
+/**
+*  The base class for all layouts.
+ *
+ *  To create a custom layout that works with the Spark containers,
+ *  you must extend LayoutBase or one of its subclasses.
+ *
+ *
At minimum, subclasses must implement the updateDisplayList()
+ *  method, which positions and sizes the target GroupBase's elements, and
+ *  the measure() method, which calculates the target's default
+ *  size.
+ *
+ *  Subclasses may override methods like elementBoundsAboveScrollRect()
+ *  and elementBoundsBelowScrollRect() to customize the way
+ *  the target behaves when it's connected to scrollbars.
+ *
+ *
Subclasses that support virtualization must respect the
+ *  useVirtualLayout property and should only retrieve
+ *  layout elements within the scrollRect (the value of
+ *  getTargetScrollRect()) using getVirtualElementAt()
+ *  from within updateDisplayList().
+ */
 public class LayoutBase extends OnDemandEventDispatcher
 {
-    //--------------------------------------------------------------------------
-    //
-    //  Class methods
-    //
-    //--------------------------------------------------------------------------
-
-    internal static function hasPercentWidth(layoutElement:ILayoutElement):Boolean
-    {
-        return !isNaN(layoutElement.percentWidth);
-    }
-
-    internal static function hasPercentHeight(layoutElement:ILayoutElement):Boolean
-    {
-        return !isNaN(layoutElement.percentHeight);
-    }
-
     //--------------------------------------------------------------------------
     //
     //  Constructor
@@ -63,11 +67,13 @@
     private var _target:GroupBase;

     /**
-     *  The GroupBase whose layout we're responsible for.
-     *
-     *  The target is responsible for delegating the updateDisplayList()
-     *  and measure() methods to its layout.
-     *
+     *  The GroupBase whose elements are measured, sized and positioned
+     *  by this layout.
+     *
+     *
Subclasses may override the setter to perform target specific
+     *  actions. For example a 3D layout may set the target's
+     *  maintainProjectionCenter property here.

+     *
      *  @default null;
      *  @see #updateDisplayList
      *  @see #measure
@@ -99,12 +105,31 @@
     [Inspectable(defaultValue="false")]

     /**
-     *  If true, subclasses will be advised that when scrolling it's
+     *  If true, subclasses will be advised that it's
      *  preferable to lazily create layout elements as they come into view,
      *  and to discard or recycle layout elements that are no longer in view.
      *
+     *
You should implement virtualization support if the layout is going
+     *  to be used with data containers and you want to spend resources only
+     *  on the data items that are displayed on the screen.
+     *  To support virtualization, a layout must be implemented in such a way
+     *  that it does not iterate through all of the target's elements as anytime
+     *  you access a data container element, the container allocates an
+     *  ItemRenderer for the corresponding data item.
+     *  Instead, you should calculate and only access the elements that will be in view.
+     *  A typical implementation of a virtual layout will examine the target's
+     *  scrollRect and the size of the typicalLayoutElement to determine which
+     *  elements will be in view. Additionally some layouts, like the
+     *  VerticalLayout and the HorizontalLayout, keep a
+     *  cache of the sizes of all elements that have already been accessed
+     *  for more precise calculations for casese of bigger variations
+     *  in sizes between the typicalLayoutElement and the actual elements.

+     *
      *  @default false
-     *
+     *
+     *  @see #getTargetScrollRect
+     *  @see #typicalLayoutElement
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
@@ -294,6 +319,224 @@
     //--------------------------------------------------------------------------

     /**
+     *  Measures the target's default size based on its content, and optionally
+     *  measures the target's default minimum size.
+     *
+     *
This is one of the methods that you must override when creating a
+     *  subclass of LayoutBase. The other method is updateDisplayList().
+     *  You do not call these methods directly. Flex calls this method as part
+     *  of a layout pass. A layout pass consists of three phases.
+     *
+     *  First, if the target's properties are invalid, the LayoutManager calls
+     *  the target's commitProperties method.
+     *
+     *  Second, if the target's size is invalid, LayoutManager calls the target's
+     *  validateSize() method. The target's validateSize()
+     *  will in turn call the layout's measure() to calculate the
+     *  target's default size unless it was explicitly specified by both target's
+     *  explicitWidth and explicitHeight</codd> properties.
+     *  If the default size changes, Flex will invalidate the target's display list.
+     *
+     *  Last, if the target's display list is invalid, LayoutManager calls the target's
+     *  validateDisplayList. The target's validateDisplayList
+     *  will in turn call the layout's updateDisplayList method to
+     *  size and position the target's elements.

+     *
+     *
When implementing this method, you must set the target's
+     *  measuredWidth and measuredHeight properties
+     *  to define the target's default size. You may optionally set the
+     *  measuredMinWidth and measuredMinHeight
+     *  properties to define the default minimum size.
+     *  A typical implementation iterates through the target's elements
+     *  and uses the methods defined by the ILayoutElement to
+     *  accumulate the preferred and/or minimum sizes of the elements and then sets
+     *  the target's measuredWidth, measuredHeight,
+     *  measuredMinWidth and measuredMinHeight.

+     *
+     *  @see #updateDisplayList
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function measure():void
+    {
+    }
+
+    /**
+     *  Sizes and positions the target's elements.
+     *
+     *
This is one of the methods that you must override when creating a
+     *  subclass of LayoutBase. The other method is measure().
+     *  You do not call these methods directly. Flex calls this method as part
+     *  of a layout pass. A layout pass consists of three phases.
+     *
+     *  First, if the target's properties are invalid, the LayoutManager calls
+     *  the target's commitProperties method.
+     *
+     *  Second, if the target's size is invalid, LayoutManager calls the target's
+     *  validateSize() method. The target's validateSize()
+     *  will in turn call the layout's measure() to calculate the
+     *  target's default size unless it was explicitly specified by both target's
+     *  explicitWidth and explicitHeight</codd> properties.
+     *  If the default size changes, Flex will invalidate the target's display list.
+     *
+     *  Last, if the target's display list is invalid, LayoutManager calls the target's
+     *  validateDisplayList. The target's validateDisplayList
+     *  will in turn call the layout's updateDisplayList method to
+     *  size and position the target's elements.

+     *
+     *
A typical implementation iterates through the target's elements
+     *  and uses the methods defined by the ILayoutElement to
+     *  position and resize the elements. Then the layout must also calculate and set
+     *  the target's contentWidth and contentHeight
+     *  properties to define the target's scrolling region.

+     *
+     *  @param unscaledWidth Specifies the width of the target, in pixels,
+     *  in the targets's coordinates.
+     *
+     *  @param unscaledHeight Specifies the height of the component, in pixels,
+     *  in the target's coordinates.
+     *
+     *  @see #measure
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function updateDisplayList(width:Number, height:Number):void
+    {
+    }
+
+    /**
+     *  Convenience function for subclasses that invalidates the
+     *  target's size and displayList so that both layout's measure()
+     *  and updateDisplayList methods get called.
+     *
+     *
Typically a layout invalidates the target's size and display list so that
+     *  it gets a chance to recalculate the target's default size and also size and
+     *  position the target's elements. For example changing the gap
+     *  property on a VerticalLayout will internally call this method
+     *  to ensure that the elements are re-arranged with the new setting and the
+     *  target's default size is recomputed.

+     *
+     *  @see #invalidateTargetDisplayList
+     *  @see mx.core.UIComponent#invalidateSize
+     *  @see mx.core.UIComponent#invalidateDisplayList
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function invalidateTargetSizeAndDisplayList():void
+    {
+        var g:GroupBase = target;
+        if (!g)
+            return;
+
+        g.invalidateSize();
+        g.invalidateDisplayList();
+    }
+
+    /**
+     *  Convenience function for subclasses that invalidates the
+     *  target's displayList so that the layout's updateDisplayList()
+     *  gets called.
+     *
+     *
Typically a layout invalidates the target's display list so that
+     *  it gets a chance to size and position the target's elements, but doesn't need to
+     *  recompute the target's default size. For example changing the horizontalAlign
+     *  property on a VerticalLayout will internally call this method
+     *  to ensure that the elements are re-arranged with the new setting.
+     *  The horizontalAlign does not affect the target's default size.

+     *
+     *  @see #invalidateTargetSizeAndDisplayList
+     *  @see mx.core.UIComponent#invalidateDisplayList
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function invalidateTargetDisplayList():void
+    {
+        var g:GroupBase = target;
+        if (!g)
+            return;
+
+        g.invalidateDisplayList();
+    }
+
+    /**
+     *  Called when the verticalScrollPosition or horizontalScrollPosition
+     *  properties change.
+     *
+     *  The default implementation updates the target's scrollRect property by
+     *  calling updateScrollRect().
+     *
+     *  Subclasses can override this method to compute other values that are
+     *  based on the current scrollPosition or scrollRect.
+     *
+     *  @see updateScrollRect
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function scrollPositionChanged():void
+    {
+        var g:GroupBase = target;
+        if (!g)
+            return;
+
+        updateScrollRect(g.width, g.height);
+    }
+
+    /**
+     *  Called by the target at the end of its updateDisplayList
+     *  to have the layout update its scrollRect.
+     *
+     *  If clipAndEnableScrolling is true, the default implementation
+     *  sets the origin of the scrollRect to verticalScrollPosition,
+     *  horizontalScrollPosition and its size to the width, height
+     *  parameters (the target's unscaled width,height).
+     *
+     *  If clipAndEnableScrolling is false, the default implementation
+     *  sets the scrollRect to null.
+     *
+     *  @param width The target's width.
+     *  @param height The target's height.
+     *
+     *  @see target
+     *  @see flash.display.DisplayObject#scrollRect
+     *  @see updateDisplayList
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function updateScrollRect(w:Number, h:Number):void
+    {
+        var g:GroupBase = target;
+        if (!g)
+            return;
+
+        if (clipAndEnableScrolling)
+        {
+            var hsp:Number = horizontalScrollPosition;
+            var vsp:Number = verticalScrollPosition;
+            g.scrollRect = new Rectangle(hsp, vsp, w, h);
+        }
+        else
+            g.scrollRect = null;
+    }
+
+    /**
      *  Returns the bounds of the target's scrollRect in layout coordinates.
      *
      *  Layout methods should not get the target's scrollRect directly.
@@ -316,20 +559,20 @@
         return new Rectangle(hsp, vsp, g.width, g.height);
     }

-
     /**
      *  Returns the bounds of the first layout element that either spans or
      *  is to the left of the scrollRect's left edge.
      *
-     *  Used by the getHorizontalScrollPositionDelta() method.
+     *
This is a convenience method that is used by the default
+     *  implementation of the getHorizontalScrollPositionDelta() method.
+     *  Subclasses that rely on the default implementation of
+     *  getHorizontalScrollPositionDelta() should override this method to
+     *  provide an accurate bounding rectangle that has valid left and
+     *  right properties.

      *
      *  By default this method returns a Rectangle with width=1, height=0,
      *  whose left edge is one less than the scrollRect's left edge,
      *  and top=0.
-     *
-     *  Subclasses should override this method to provide an accurate
-     *  bounding rectangle that has valid left and
-     *  right properties.
      *
      *  @param scrollRect The target's scrollRect.
      *  @return Returns the bounds of the first element that spans or is to
@@ -357,15 +600,16 @@
      *  Returns the bounds of the first layout element that either spans or
      *  is to the right of the scrollRect's right edge.
      *
-     *  Used by the getHorizontalScrollPositionDelta() method.
+     *
This is a convenience method that is used by the default
+     *  implementation of the getHorizontalScrollPositionDelta() method.
+     *  Subclasses that rely on the default implementation of
+     *  getHorizontalScrollPositionDelta() should override this method to
+     *  provide an accurate bounding rectangle that has valid left and
+     *  right properties.

      *
      *  By default this method returns a Rectangle with width=1, height=0,
      *  whose right edge is one more than the scrollRect's right edge,
      *  and top=0.
-     *
-     *  Subclasses should override this method to provide an accurate
-     *  bounding rectangle that has valid left and
-     *  right properties.
      *
      *  @param scrollRect The target's scrollRect.
      *  @return Returns the bounds of the first element that spans or is to
@@ -393,7 +637,12 @@
      *  Returns the bounds of the first layout element that either spans or
      *  is above the scrollRect's top edge.
      *
-     *  Used by the getVerticalScrollPositionDelta() method.
+     *
This is a convenience method that is used by the default
+     *  implementation of the getVerticalScrollPositionDelta() method.
+     *  Subclasses that rely on the default implementation of
+     *  getVerticalScrollPositionDelta() should override this method to
+     *  provide an accurate bounding rectangle that has valid top and
+     *  bottom properties.

      *
      *  By default this method returns a Rectangle with width=0, height=1,
      *  whose top edge is one less than the scrollRect's top edge,
@@ -428,26 +677,27 @@
     /**
      *  Returns the bounds of the first layout element that either spans or
      *  is below the scrollRect's bottom edge.
-     *
-     *  Used by the getVerticalScrollPositionDelta() method.
-     *
+     *
+     *
This is a convenience method that is used by the default
+     *  implementation of the getVerticalScrollPositionDelta() method.
+     *  Subclasses that rely on the default implementation of
+     *  getVerticalScrollPositionDelta() should override this method to
+     *  provide an accurate bounding rectangle that has valid top and
+     *  bottom properties.

+     *
      *  By default this method returns a Rectangle with width=0, height=1,
      *  whose bottom edge is one more than the scrollRect's bottom edge,
      *  and left=0.
-     *
-     *  Subclasses should override this method to provide an accurate
-     *  bounding rectangle that has valid top and
-     *  bottom properties.
-     *
+     *
      *  @param scrollRect The target's scrollRect.
      *  @return Returns the bounds of the first element that spans or is
      *  below the scrollRect’s bottom edge.
-     *
+     *
      *  @see #elementBoundsLeftOfScrollRect
      *  @see #elementBoundsRightScrollRect
      *  @see #elementBoundsAboveScrollRect
      *  @see #getVerticalScrollPositionDelta
-     *
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
@@ -459,8 +709,8 @@
         bounds.top = scrollRect.bottom;
         bounds.bottom = scrollRect.bottom + 1;
         return bounds;
-    }
-
+    }
+
     /**
      *  Implements the default handling of
      *  LEFT, RIGHT, PAGE_LEFT, PAGE_RIGHT, HOME and END.
@@ -863,133 +1113,5 @@

          return new Point(dx, dy);
      }
-
-    /**
-     *  Called when the verticalScrollPosition or horizontalScrollPosition
-     *  properties change.
-     *
-     *  Resets the target's scrollRect property by calling
-     *  updateScrollRect().
-     *
-     *  Subclasses can override this method to compute other values that are
-     *  based on the current scrollPosition or scrollRect.
-     *
-     *  @see updateScrollRect
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    protected function scrollPositionChanged():void
-    {
-        var g:GroupBase = target;
-        if (!g)
-            return;
-
-        updateScrollRect(g.width, g.height);
-    }
-
-    /**
-     *  If clipAndEnableScrolling is true, sets the origin of the scrollRect to
-     *  verticalScrollPosition,horizontalScrollPosition and its width
-     *  width,height to w,h (the target's unscaled width,height).
-     *
-     *  If clipAndEnableScrolling is false, sets the scrollRect to null.
-     *
-     *  @param w The target's unscaled width.
-     *  @param h The target's unscaled height.
-     *
-     *  @see target
-     *  @see flash.display.DisplayObject#scrollRect
-     *  @see updateDisplayList
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function updateScrollRect(w:Number, h:Number):void
-    {
-        var g:GroupBase = target;
-        if (!g)
-            return;
-
-        if (clipAndEnableScrolling)
-        {
-            var hsp:Number = horizontalScrollPosition;
-            var vsp:Number = verticalScrollPosition;
-            g.scrollRect = new Rectangle(hsp, vsp, w, h);
-        }
-        else
-            g.scrollRect = null;
-    }
-
-    /**
-     *  Convenience function for subclasses that invalidates the
-     *  target's size and displayList if the target is non-null.
-     *
-     *  @see mx.core.UIComponent#invalidateSize
-     *  @see mx.core.UIComponent#invalidateDisplayList
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    protected function invalidateTargetSizeAndDisplayList():void
-    {
-        var g:GroupBase = target;
-        if (!g)
-            return;
-
-        g.invalidateSize();
-        g.invalidateDisplayList();
-    }
-
-    /**
-     *  Convenience function for subclasses that invalidates the
-     *  target's displayList if the target is non-null.
-     *
-     *  @see mx.core.UIComponent#invalidateDisplayList
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    protected function invalidateTargetDisplayList():void
-    {
-        var g:GroupBase = target;
-        if (!g)
-            return;
-
-        g.invalidateDisplayList();
-    }
-
-    /**
-     *  @copy mx.core.UIComponent#measure
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function measure():void
-    {
-    }
-
-    /**
-     *  @copy mx.core.UIComponent#updateDisplayList
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-    }
 }
-
 }


now properly removing callbacks in dispose()

Change-Id: I43063bffec8eaa0d28d67da8540576d80a901c38

--- WeaveCore/src/weave/core/CallbackJuggler.as
+++ WeaveCore/src/weave/core/CallbackJuggler.as
@@ -107,7 +107,8 @@
 		 */
 		public function dispose():void
 		{
-			_target = null;
+			_callbacks.delayCallbacks();
+			target = null; // removes callbacks
 			WeaveAPI.SessionManager.disposeObjects(_callbacks);
 			_callbacks = null;
 		}


OFC-558 In form item context menu, "Confirm error" item appears even if the error is SpecifiedError

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/component/input/FormItemContextMenu.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/component/input/FormItemContextMenu.as
@@ -11,9 +11,11 @@
 	import org.openforis.collect.metamodel.proxy.CodeAttributeDefinitionProxy;
 	import org.openforis.collect.metamodel.proxy.NodeDefinitionProxy;
 	import org.openforis.collect.model.CollectRecord$Step;
+	import org.openforis.collect.model.proxy.AttributeProxy;
 	import org.openforis.collect.model.proxy.EntityProxy;
 	import org.openforis.collect.ui.component.detail.AttributeFormItem;
 	import org.openforis.collect.ui.component.detail.CollectFormItem;
+	import org.openforis.collect.util.CollectionUtil;
 	import org.openforis.idm.metamodel.validation.ValidationResultFlag;

 	/**
@@ -64,27 +66,33 @@
 		}

 		private function createMenuItems(step:CollectRecord$Step):Array {
+			var nodeDefinition:NodeDefinitionProxy = _formItem.nodeDefinition;
+			var parentEntity:EntityProxy = _formItem.parentEntity;
 			var items:Array = new Array();
-			if(_formItem.parentEntity != null) {
-				var nodeName:String = _formItem.nodeDefinition.name;
-				var count:int = _formItem.parentEntity.getCount(nodeName);
-				var minCountValid:ValidationResultFlag = _formItem.parentEntity.childrenMinCountValidationMap.get(nodeName);
+			if(parentEntity != null) {
+				var nodeName:String = nodeDefinition.name;
+				var count:int = parentEntity.getCount(nodeName);
+				var minCountValid:ValidationResultFlag = parentEntity.childrenMinCountValidationMap.get(nodeName);
 				if(count == 0 || minCountValid == ValidationResultFlag.ERROR) {
 					switch(step) {
-						case CollectRecord$Step.ENTRY:
+						/*case CollectRecord$Step.ENTRY:
 							items.push(SET_BLANK_ON_FORM);
-							break;
+							break;*/
 						case CollectRecord$Step.CLEANSING:
 							items.push(APPROVE_MISSING);
 							break;
 					}
 				}
 				if(step == CollectRecord$Step.ENTRY) {
-					var hasErrors:Boolean = _formItem.parentEntity.childContainsErrors(_formItem.nodeDefinition.name);
-					if(hasErrors) {
-						var hasConfirmedError:Boolean = _formItem.parentEntity.hasConfirmedError(_formItem.nodeDefinition.name);
-						if(! hasConfirmedError) {
-							items.push(CONFIRM_ERROR);
+					if ( _formItem.nodeDefinition is AttributeDefinitionProxy && ! nodeDefinition.multiple ) {
+						var attribute:AttributeProxy = parentEntity.getSingleAttribute(nodeDefinition.name);
+						var hasErrors:Boolean = attribute != null && attribute.hasErrors() &&
+							! CollectionUtil.containsItemWith(attribute.validationResults.errors, "ruleName", "SpecifiedValidator");
+						if(hasErrors) {
+							var hasConfirmedError:Boolean = parentEntity.hasConfirmedError(nodeDefinition.name);
+							if(! hasConfirmedError) {
+								items.push(CONFIRM_ERROR);
+							}
 						}
 					}
 				}


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridGroupItemRenderer.as
+++ frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridGroupItemRenderer.as
@@ -0,0 +1,665 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.controls.advancedDataGridClasses
+{
+
+import flash.display.DisplayObject;
+import flash.display.InteractiveObject;
+import flash.events.Event;
+import flash.events.MouseEvent;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+import flash.utils.getDefinitionByName;
+
+import mx.controls.AdvancedDataGrid;
+import mx.controls.listClasses.BaseListData;
+import mx.controls.listClasses.IDropInListItemRenderer;
+import mx.controls.listClasses.IListItemRenderer;
+import mx.core.IDataRenderer;
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModuleFactory;
+import mx.core.IFontContextComponent;
+import mx.core.IToolTip;
+import mx.core.IUITextField;
+import mx.core.SpriteAsset;
+import mx.core.UIComponent;
+import mx.core.UITextField;
+import mx.core.mx_internal;
+import mx.events.AdvancedDataGridEvent;
+import mx.events.FlexEvent;
+import mx.events.ToolTipEvent;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the data property changes.
+ *
+ *
When you use a component as an item renderer,
+ *  the data property contains the data to display.
+ *  You can listen for this event and update the component
+ *  when the data property changes.

+ *
+ *  @eventType mx.events.FlexEvent.DATA_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="dataChange", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+/**
+ *  Text color of a component label.
+ *  The default value is 0x0B333C.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="color", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Color of the component if it is disabled.
+ *  The default value is 0xAAB3B3.
+ *
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Style(name="disabledColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  The AdvancedDataGridGroupItemRenderer class defines the default item renderer for
+ *  the nodes of the navigation tree.
+ *  By default, the item renderer draws the text associated with each node in the tree,
+ *  an optional icon, and an optional disclosure icon.
+ *
+ *
You can override the default item renderer by creating a custom item renderer.

+ *
+ *  @see mx.controls.AdvancedDataGrid
+ *  @see mx.core.IDataRenderer
+ *  @see mx.controls.listClasses.IDropInListItemRenderer
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class AdvancedDataGridGroupItemRenderer extends UIComponent
+       implements IDataRenderer, IDropInListItemRenderer, IListItemRenderer,
+                  IFontContextComponent
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function AdvancedDataGridGroupItemRenderer()
+    {
+        super();
+
+        // InteractiveObject variables.
+        mouseEnabled = false;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var listOwner:AdvancedDataGrid;
+
+    /**
+     *  The internal IFlexDisplayObject that displays the icon in this renderer.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected var icon:IFlexDisplayObject;
+
+    /**
+     *  The internal UITextField that displays the text in this renderer.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected var label:IUITextField;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  data
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the data property.
+     */
+    private var _data:Object;
+
+    [Bindable("dataChange")]
+
+    /**
+     *  The implementation of the data property as
+     *  defined by the IDataRenderer interface.
+     *
+     *  @see mx.core.IDataRenderer
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    /**
+     *  @private
+     */
+    public function set data(value:Object):void
+    {
+        _data = value;
+
+        invalidateProperties();
+
+        dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+    }
+
+    //----------------------------------
+    //  disclosureIcon
+    //----------------------------------
+
+    /**
+     *  The internal IFlexDisplayObject that displays the disclosure icon
+     *  in this renderer.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    protected var disclosureIcon:IFlexDisplayObject;
+
+    //----------------------------------
+    //  fontContext
+    //----------------------------------
+
+    /**
+    * @private
+    */
+    public function get fontContext():IFlexModuleFactory
+    {
+        return moduleFactory;
+    }
+
+    /**
+    * @private
+    */
+    public function set fontContext(moduleFactory:IFlexModuleFactory):void
+    {
+        this.moduleFactory = moduleFactory;
+    }
+
+    //----------------------------------
+    //  listData
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the listData property.
+     */
+    private var _listData:AdvancedDataGridListData;
+
+    [Bindable("dataChange")]
+
+    /**
+     *  The implementation of the listData property as
+     *  defined by the IDropInListItemRenderer interface.
+     *
+     *  @see mx.controls.listClasses.IDropInListItemRenderer
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get listData():BaseListData
+    {
+        return _listData;
+    }
+
+    /**
+     *  @private
+     */
+    public function set listData(value:BaseListData):void
+    {
+        _listData = AdvancedDataGridListData(value);
+
+        invalidateProperties();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        createLabel(-1);
+
+        addEventListener(ToolTipEvent.TOOL_TIP_SHOW, toolTipShowHandler);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        // if the font changed and we already created the label, we will need to
+        // destory it so it can be re-created, possibly in a different swf context.
+        if (hasFontContextChanged() && label != null)
+        {
+            var index:int = getChildIndex(DisplayObject(label));
+            removeLabel();
+            createLabel(index);
+        }
+
+        // we need to save the x values,
+        // when containers are used as item renderers then there
+        // might be a delay between the call to commitProperties() and
+        // updateDisplayList(). The icons will shift to the left during that time.
+        // positioning them again will avoid the shifting.
+        var oldIconX:Number;
+        var oldDisclosureIconX:Number;
+
+        if (icon)
+        {
+            // save the x position
+            oldIconX = icon.x;
+            removeChild(DisplayObject(icon));
+            icon = null;
+        }
+
+        if (disclosureIcon)
+        {
+            // save the x position
+            oldDisclosureIconX = disclosureIcon.x;
+            disclosureIcon.removeEventListener(MouseEvent.MOUSE_DOWN,
+                                               disclosureMouseDownHandler);
+            removeChild(DisplayObject(disclosureIcon));
+            disclosureIcon = null;
+        }
+
+        if (_data != null)
+        {
+            listOwner = AdvancedDataGrid(_listData.owner);
+
+            var column:AdvancedDataGridColumn =
+                listOwner.columns[_listData.columnIndex];
+
+            if (_listData.disclosureIcon)
+            {
+                var disclosureIconClass:Class = _listData.disclosureIcon;
+                var disclosureInstance:* = new disclosureIconClass();
+
+                // If not already an interactive object, then we'll wrap
+                // in one so we can dispatch mouse events.
+                if (!(disclosureInstance is InteractiveObject))
+                {
+                    var wrapper:SpriteAsset = new SpriteAsset();
+                    wrapper.addChild(disclosureInstance as DisplayObject);
+                    disclosureIcon = wrapper as IFlexDisplayObject;
+                }
+                else
+                {
+                    disclosureIcon = disclosureInstance;
+                }
+
+                addChild(disclosureIcon as DisplayObject);
+                // set the x position
+                if (oldDisclosureIconX)
+                    disclosureIcon.x = oldDisclosureIconX;
+
+                disclosureIcon.addEventListener(MouseEvent.MOUSE_DOWN,
+                                                disclosureMouseDownHandler);
+            }
+
+            if (_listData.icon)
+            {
+                var iconClass:Class = _listData.icon;
+                icon = new iconClass();
+
+                addChild(DisplayObject(icon));
+                // set the x position
+                if (oldIconX)
+                    icon.x = oldIconX;
+            }
+
+            label.text = _listData.label;
+            label.multiline = listOwner.variableRowHeight;
+            label.wordWrap = listOwner.columnWordWrap(column);
+
+             var dataTips:Boolean = listOwner.showDataTips;
+             if (column.showDataTips == true)
+             	dataTips = true;
+             if (column.showDataTips == false)
+                dataTips = false;
+            if (dataTips)
+            {
+                if (!(_data is AdvancedDataGridColumn) && (label.textWidth > label.width
+                	|| column.dataTipFunction || column.dataTipField
+                    || listOwner.dataTipFunction || listOwner.dataTipField))
+                {
+                    toolTip = column.itemToDataTip(_data);
+                }
+                else
+                {
+                    toolTip = null;
+                }
+            }
+            else
+            {
+                toolTip = null;
+            }
+        }
+        else
+        {
+            label.text = " ";
+            toolTip = null;
+        }
+
+        invalidateDisplayList();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        var w:Number = _data ? _listData.indent : 0;
+
+        if (disclosureIcon)
+            w += disclosureIcon.width;
+
+        if (icon)
+            w += icon.measuredWidth;
+
+        // guarantee that label width isn't zero because it messes up ability to measure
+        if (label.width < 4 || label.height < 4)
+        {
+            label.width = 4;
+            label.height = 16;
+        }
+
+        if (isNaN(explicitWidth))
+        {
+            w += label.getExplicitOrMeasuredWidth();
+            measuredWidth = w;
+        }
+        else
+        {
+            label.width = Math.max(explicitWidth - w, 4);
+        }
+
+        measuredHeight = label.getExplicitOrMeasuredHeight();
+        if (icon && icon.measuredHeight > measuredHeight)
+            measuredHeight = icon.measuredHeight;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        var startx:Number = _data ? _listData.indent : 0;
+
+        if (disclosureIcon)
+        {
+            disclosureIcon.x = startx;
+
+            startx = disclosureIcon.x + disclosureIcon.width;
+
+            disclosureIcon.setActualSize(disclosureIcon.width,
+                                         disclosureIcon.height);
+
+            disclosureIcon.visible = _data ?
+                                     _listData.hasChildren :
+                                     false;
+
+            // dont display disclosure icon if the column width is
+            // less than the start of the disclosure icon's x
+            if(disclosureIcon.visible)
+                disclosureIcon.visible = startx < unscaledWidth;
+        }
+
+        if (icon)
+        {
+            icon.x = startx;
+            startx = icon.x + icon.measuredWidth;
+            icon.setActualSize(icon.measuredWidth, icon.measuredHeight);
+
+            // dont display icon if the column width is less then the start of the icon's x
+            // else set the width of the item according to column's width
+            if (icon.x > unscaledWidth)
+            {
+                icon.visible = false;
+            }
+            else if (startx > unscaledWidth)
+            {
+                icon.setActualSize(unscaledWidth - icon.x, icon.measuredHeight);
+            }
+        }
+
+        label.x = startx;
+        label.setActualSize(unscaledWidth - startx, unscaledHeight);
+
+        var verticalAlign:String = getStyle("verticalAlign");
+        if (verticalAlign == "top")
+        {
+            label.y = 0;
+            if (icon)
+                icon.y = 0;
+            if (disclosureIcon)
+                disclosureIcon.y = 0;
+        }
+        else if (verticalAlign == "bottom")
+        {
+            label.y = unscaledHeight - label.height + 2; // 2 for gutter
+            if (icon)
+                icon.y = unscaledHeight - icon.height;
+            if (disclosureIcon)
+                disclosureIcon.y = unscaledHeight - disclosureIcon.height;
+        }
+        else
+        {
+            label.y = (unscaledHeight - label.height) / 2;
+            if (icon)
+                icon.y = (unscaledHeight - icon.height) / 2;
+            if (disclosureIcon)
+                disclosureIcon.y = (unscaledHeight - disclosureIcon.height) / 2;
+        }
+
+        var labelColor:Number;
+
+        if (data && parent)
+        {
+            if (!enabled)
+                labelColor = getStyle("disabledColor");
+            else if (listOwner.isItemHighlighted(listData.uid))
+                labelColor = getStyle("textRollOverColor");
+            else if (listOwner.isItemSelected(listData.uid))
+                labelColor = getStyle("textSelectedColor");
+            else
+                labelColor = getStyle("color");
+
+            label.setColor(labelColor);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+    * @private
+    *
+    * Create the label child and add it as a child of this component.
+    *
+    * @param childIndex index of where to add the child. If -1, the text field is
+    *                  appended to the end of the list.
+    */
+    protected function createLabel(childIndex:int):void
+    {
+        if (!label)
+        {
+            label = IUITextField(createInFontContext(UITextField));
+            label.styleName = this;
+
+            if (childIndex == -1)
+                addChild(DisplayObject(label));
+            else
+                addChildAt(DisplayObject(label), childIndex);
+        }
+    }
+
+    /**
+    * @private
+    *
+    * Remove the label from this component.
+    */
+    protected function removeLabel():void
+    {
+        if (label != null)
+        {
+            removeChild(DisplayObject(label));
+            label = null;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function toolTipShowHandler(event:ToolTipEvent):void
+    {
+        var toolTip:IToolTip = event.toolTip;
+		var xPos:int = DisplayObject(systemManager).mouseX + 11;
+        var yPos:int = DisplayObject(systemManager).mouseY + 22;
+        // Calculate global position of label.
+        var pt:Point = new Point(xPos, yPos);
+        pt = DisplayObject(systemManager).localToGlobal(pt);
+        pt = DisplayObject(systemManager.getSandboxRoot()).globalToLocal(pt);
+
+        toolTip.move(pt.x, pt.y + (height - toolTip.height) / 2);
+
+        var screen:Rectangle = toolTip.screen;
+        var screenRight:Number = screen.x + screen.width;
+        if (toolTip.x + toolTip.width > screenRight)
+            toolTip.move(screenRight - toolTip.width, toolTip.y);
+    }
+
+    /**
+     *  @private
+     */
+    private function disclosureMouseDownHandler(event:Event):void
+    {
+        event.stopPropagation();
+
+        if (listOwner.isOpening || !listOwner.enabled)
+            return;
+
+        var open:Boolean = _listData.open;
+        _listData.open = !open;
+
+        listOwner.dispatchAdvancedDataGridEvent(AdvancedDataGridEvent.ITEM_OPENING,
+                                _listData.item, //item
+                                this,   //renderer
+                                event,  //trigger
+                                !open,  //opening
+                                true,   //animate
+                                true)   //dispatch
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function getLabel():IUITextField
+    {
+        return label;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function getDisclosureIcon():IFlexDisplayObject
+    {
+        return disclosureIcon;
+    }
+}
+
+}


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

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


Fixed bug where grouped callback with null context would not get removed/skipped at the right time.

--- WeaveCore/src/weave/core/CallbackCollection.as
+++ WeaveCore/src/weave/core/CallbackCollection.as
@@ -40,6 +40,7 @@
 		public static var debug:Boolean = false;
 		internal var _linkableObject:ILinkableObject; // for debugging only... will be set when debug==true
 		private var _lastTriggerStackTrace:String; // for debugging only... will be set when debug==true
+		private var _oldEntries:Array;

 		/**
 		 * If specified, the preCallback function will be called immediately before running each callback.
@@ -199,7 +200,9 @@
 						entry.context = null;
 						entry.callback = null;
 						// remove the empty callback reference from the list
-						_callbackEntries.splice(i--, 1); // decrease i because remaining entries have shifted
+						var removed:Array = _callbackEntries.splice(i--, 1); // decrease i because remaining entries have shifted
+						if (debug)
+							_oldEntries = _oldEntries ? _oldEntries.concat(removed) : removed;
 						continue;
 					}
 					// if _preCallback is specified, we don't want to limit recursion because that would cause a loss of information.
@@ -325,6 +328,8 @@
 		public function dispose():void
 		{
 			// remove all callbacks
+			if (debug)
+				_oldEntries = _oldEntries ? _oldEntries.concat(_callbackEntries) : _callbackEntries.concat();
 			_callbackEntries.length = 0;
 			_wasDisposed = true;

@@ -414,15 +419,15 @@
 				_frameCallbackAdded = true;
 			}

+			if (relevantContext == null)
+				relevantContext = this;
+
 			var recursionLimit:uint = 0;
 			var triggerEntry:CallbackEntry = _groupedCallbackToTriggerEntryMap[groupedCallback] as CallbackEntry;
 			if (triggerEntry != null)
 			{
 				// add this context to the list of relevant contexts
-				if (relevantContext == null) // null means never remove the callback
-					triggerEntry.context = [null];
-				else if (triggerEntry.context[0] != null)
-					triggerEntry.context.push(relevantContext);
+				triggerEntry.context.push(relevantContext);
 				// use the minimum of the existing limit and the new limit.
 				triggerEntry.recursionLimit = Math.min(triggerEntry.recursionLimit, recursionLimit);
 			}
@@ -442,12 +447,8 @@
 						var allContexts:Array = triggerEntry.context as Array;
 						// remove the contexts that have been disposed of.
 						for (var i:int = 0; i < allContexts.length; i++)
-						{
-							var context:Object = allContexts[i];
-							// if there is a null context, it means the callback should never be removed.
-							if (context != null && WeaveAPI.SessionManager.objectWasDisposed(context))
+							if (WeaveAPI.SessionManager.objectWasDisposed(allContexts[i]))
 								allContexts.splice(i--, 1);
-						}
 						// if there are no more relevant contexts for this callback, don't run it.
 						if (allContexts.length == 0)
 						{


Flash: Avoid hanging on JPEGs having faulty Exif headers.

--- src/flash/plupload/src/com/mxi/image/ExifParser.as
+++ src/flash/plupload/src/com/mxi/image/ExifParser.as
@@ -371,7 +371,7 @@

 		// At the moment only setting of simple (LONG) values, that do not require offset recalculation, is supported
 		private function setTag(ifd:String, tag:*, value:*) : Boolean {
-			var offset:uint, length:uint, tagOffset:uint, valueOffset:uint = 0, hex:*;
+			var offset:*, length:uint, tagOffset:uint, valueOffset:uint = 0, hex:*;

 			// If tag name passed translate into hex key
 			if (tag is String) {
@@ -384,6 +384,10 @@
 				}
 			}
 			offset = offsets[ifd.toLowerCase() + 'IFD'];
+			if (offset === null) {
+				return false;
+			}
+
 			length = data.SHORT(offset);

 			for (var i:uint = 0; i < length; i++) {


Transferred from the Adobe Open Source Subversion Repository

Revision: 2387
Author:   jimurphy@adobe.com
Date:     2008-07-08T13:46:39.703947Z

Log Message:
-----------
Merged 3.0.x rev [2381] -> trunk

Modified Paths:
--------------
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>

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

--- frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
+++ frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
@@ -18,9 +18,11 @@
 import flash.display.InteractiveObject;
 import flash.display.MovieClip;
 import flash.display.Sprite;
+import flash.display.Stage;
 import flash.display.StageAlign;
 import flash.display.StageScaleMode;
 import flash.events.Event;
+import flash.events.IEventDispatcher;
 import flash.events.MouseEvent;
 import flash.geom.Point;
 import flash.geom.Rectangle;
@@ -38,6 +40,11 @@
 import mx.core.Window;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
+import mx.events.MarshalEvent;
+import mx.sandbox.ISandboxBridgeGroup;
+import mx.sandbox.SandboxBridgeGroup;
+import mx.events.SandboxBridgeRequest;
+import mx.events.SandboxBridgeEvent;
 import mx.styles.ISimpleStyleClient;
 import mx.styles.IStyleClient;

@@ -60,7 +67,7 @@
  *
  *  @playerversion AIR 1.1
  */
-public class WindowedSystemManager extends MovieClip implements ISystemManager
+public class WindowedSystemManager extends MovieClip implements ISystemManager, ISystemManager2
 {

 	public function WindowedSystemManager(rootObj:IUIComponent)
@@ -117,7 +124,25 @@
 	 */
 	private var _topLevelSystemManager:ISystemManager;

-		/**
+	/**
+	 *  @private
+	 *  Whether we are the stage root or not.
+	 *  We are only the stage root if we were the root
+	 *  of the first SWF that got loaded by the player.
+	 *  Otherwise we could be top level but not stage root
+	 *  if we are loaded by some other non-Flex shell
+	 *  or are sandboxed.
+	 */
+	private var isStageRoot:Boolean = true;
+
+	/**
+	 *  @private
+	 *  Whether we are the first SWF loaded into a bootstrap
+	 *  and therefore, the topLevelRoot
+	 */
+	private var isBootstrapRoot:Boolean = false;
+
+	/**
 	 *  Depth of this object in the containment hierarchy.
 	 *  This number is used by the measurement and layout code.
 	 */
@@ -471,6 +496,38 @@
 			_rawChildren = new WindowedSystemRawChildrenList(this);

 		return _rawChildren;
+	}
+
+	//--------------------------------------------------------------------------
+	//  sandbox bridge group
+	//--------------------------------------------------------------------------
+
+	/**
+	 * @private
+	 *
+	 * Represents the related parent and child sandboxs this SystemManager may
+	 * communicate with.
+	 */
+	private var _sandboxBridgeGroup:ISandboxBridgeGroup;
+
+
+	public function get sandboxBridgeGroup():ISandboxBridgeGroup
+	{
+		if (topLevel)
+			return _sandboxBridgeGroup;
+		else if (topLevelSystemManager)
+			return ISystemManager2(topLevelSystemManager).sandboxBridgeGroup;
+
+		return null;
+	}
+
+	public function set sandboxBridgeGroup(bridgeGroup:ISandboxBridgeGroup):void
+	{
+		if (topLevel)
+			_sandboxBridgeGroup = bridgeGroup;
+		else if (topLevelSystemManager)
+			SystemManager(topLevelSystemManager).sandboxBridgeGroup = bridgeGroup;
+
 	}

 	//--------------------------------------------------------------------------
@@ -1171,7 +1228,286 @@
         defaultMenu.builtInItems.print = true;
         contextMenu = defaultMenu;
     }
-		/**
+
+	/**
+	 * @inheritdoc
+	 */
+	public function isTopLevelRoot():Boolean
+	{
+		return isStageRoot || isBootstrapRoot;
+	}
+
+	/**
+	 * @private
+	 *
+	 * Listen to messages this System Manager needs to service from its children.
+	 */
+	mx_internal function addChildBridgeListeners(bridge:IEventDispatcher):void
+	{
+		if (!topLevel && topLevelSystemManager)
+		{
+			SystemManager(topLevelSystemManager).addChildBridgeListeners(bridge);
+			return;
+		}
+
+		/* Uncomment when needed
+		bridge.addEventListener(PopUpRequest.ADD, addPopupRequestHandler);
+		bridge.addEventListener(PopUpRequest.REMOVE, removePopupRequestHandler);
+		bridge.addEventListener(PopUpRequest.ADD_PLACEHOLDER, addPlaceholderPopupRequestHandler);
+		bridge.addEventListener(PopUpRequest.REMOVE_PLACEHOLDER, removePlaceholderPopupRequestHandler);
+		bridge.addEventListener(SandboxBridgeEvent.ACTIVATE_WINDOW, activateFormSandboxEventHandler);
+		bridge.addEventListener(SandboxBridgeEvent.DEACTIVATE_WINDOW, deactivateFormSandboxEventHandler);
+		bridge.addEventListener(SandboxBridgeEvent.ACTIVATE_APPLICATION, activateApplicationSandboxEventHandler);
+		bridge.addEventListener(EventListenerRequest.ADD, eventListenerRequestHandler, false, 0, true);
+		bridge.addEventListener(EventListenerRequest.REMOVE, eventListenerRequestHandler, false, 0, true);
+		*/
+
+	}
+
+	/**
+	 * @private
+	 *
+	 * Remove all child listeners.
+	 */
+	mx_internal function removeChildBridgeListeners(bridge:IEventDispatcher):void
+	{
+		if (!topLevel && topLevelSystemManager)
+		{
+			SystemManager(topLevelSystemManager).removeChildBridgeListeners(bridge);
+			return;
+		}
+
+		/* Uncomment when needed
+		bridge.removeEventListener(PopUpRequest.ADD, addPopupRequestHandler);
+		bridge.removeEventListener(PopUpRequest.REMOVE, removePopupRequestHandler);
+		bridge.removeEventListener(PopUpRequest.ADD_PLACEHOLDER, addPlaceholderPopupRequestHandler);
+		bridge.removeEventListener(PopUpRequest.REMOVE_PLACEHOLDER, removePlaceholderPopupRequestHandler);
+		bridge.removeEventListener(SandboxBridgeEvent.ACTIVATE_WINDOW, activateFormSandboxEventHandler);
+		bridge.removeEventListener(SandboxBridgeEvent.DEACTIVATE_WINDOW, deactivateFormSandboxEventHandler);
+		bridge.removeEventListener(SandboxBridgeEvent.ACTIVATE_APPLICATION, activateApplicationSandboxEventHandler);
+		bridge.removeEventListener(EventListenerRequest.ADD, eventListenerRequestHandler);
+		bridge.removeEventListener(EventListenerRequest.REMOVE, eventListenerRequestHandler);
+		*/
+	}
+
+	/**
+	 * Create the requested manager
+	 */
+	public function addChildToSandboxRoot(layer:String, child:DisplayObject):void
+	{
+		if (getSandboxRoot() == this)
+		{
+			this[layer].addChild(child);
+		}
+		else
+		{
+			addingChild(child);
+			var me:MarshalEvent = new MarshalEvent(MarshalEvent.SYSTEM_MANAGER);
+			me.name = layer + ".addChild";
+			me.value = child;
+			getSandboxRoot().dispatchEvent(me);
+			childAdded(child);
+		}
+	}
+
+	/**
+	 * Create the requested manager
+	 */
+	public function removeChildFromSandboxRoot(layer:String, child:DisplayObject):void
+	{
+		if (getSandboxRoot() == this)
+		{
+			this[layer].removeChild(child);
+		}
+		else
+		{
+			removingChild(child);
+			var me:MarshalEvent = new MarshalEvent(MarshalEvent.SYSTEM_MANAGER);
+			me.name = layer + ".removeChild";
+			me.value = child;
+			getSandboxRoot().dispatchEvent(me);
+			childRemoved(child);
+		}
+	}
+
+	/**
+	 * @private
+	 *
+	 * Test if a display object is in an applcation we want to communicate with over a bridge.
+	 *
+	 */
+	public function isDisplayObjectInABridgedApplication(displayObject:DisplayObject):Boolean
+	{
+		if (sandboxBridgeGroup)
+		{
+			var request:SandboxBridgeRequest = new SandboxBridgeRequest(SandboxBridgeRequest.IS_BRIDGE_CHILD,
+																		false, true, null, displayObject);
+			var children:Array = sandboxBridgeGroup.getChildBridges();
+			var n:int = children.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				var childBridge:IEventDispatcher = IEventDispatcher(children[i]);
+
+				// No need to test a child if it does not trust us, we will never see
+				// their display objects.
+				// Also, if the we don't trust the child don't send them a display object.
+				if (sandboxBridgeGroup.canAccessChildBridge(childBridge) &&
+					sandboxBridgeGroup.accessibleFromChildBridge(childBridge) &&
+					!childBridge.dispatchEvent(request))
+					return true;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Add a bridge to talk to the child owned by owner.
+	 *
+	 * @param owner the display object that owns the bridge.
+	 * @param bridge the bridge used to talk to the parent.
+	 */
+	public function addChildSandboxBridge(owner:DisplayObject, bridge:IEventDispatcher):void
+	{
+		if (!sandboxBridgeGroup)
+			sandboxBridgeGroup = new SandboxBridgeGroup(this);
+
+   		sandboxBridgeGroup.addChildBridge(owner, bridge);
+        addChildBridgeListeners(bridge);
+		IFocusManagerContainer(document).focusManager.addFocusManagerBridge(bridge);
+	}
+
+	/**
+	 * Remove a child bridge.
+	 */
+	public function removeChildSandboxBridge(bridge:IEventDispatcher):void
+	{
+		IFocusManagerContainer(document).focusManager.removeFocusManagerBridge(bridge);
+   		sandboxBridgeGroup.removeChildBridge(bridge);
+        removeChildBridgeListeners(bridge);
+	}
+
+	/**
+	 * @inheritdoc
+	 */
+	public function useBridge():Boolean
+	{
+		if (isStageRoot)
+			return false;
+
+		if (!topLevel && topLevelSystemManager)
+			return ISystemManager2(topLevelSystemManager).useBridge();
+
+		// if we're toplevel and we aren't the sandbox root, we need a bridge
+		if (topLevel && getSandboxRoot() != this)
+			return true;
+
+		// we also need a bridge even if we're the sandbox root
+		// but not a stage root, but our parent loader is a bootstrap
+		// that is not the stage root
+		if (getSandboxRoot() == this)
+		{
+			try
+			{
+				if (root.loaderInfo.parentAllowsChild)
+				{
+					try
+					{
+						if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isStageRoot", false, true)))
+							return true;
+					}
+					catch (e:Error)
+					{
+					}
+				}
+				else
+					return true;
+			}
+			catch (e1:Error)
+			{
+				// we seem to get here when a SWF is being unloaded, has been unparented, but still
+				// has a stage and root property, but loaderInfo is invalid.
+				return false;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Go up our parent chain to get the top level system manager.
+	 *
+	 * returns null if we are not on the display list or we don't have
+	 * access to the top level system manager.
+	 */
+	public function getTopLevelRoot():DisplayObject
+	{
+		// work our say up the parent chain to the root. This way we
+		// don't have to rely on this object being added to the stage.
+		try
+		{
+			var sm:ISystemManager2 = this;
+			if (sm.topLevelSystemManager)
+				sm = ISystemManager2(sm.topLevelSystemManager);
+			var parent:DisplayObject = DisplayObject(sm).parent;
+			var lastParent:DisplayObject = parent;
+			while (parent)
+			{
+				if (parent is Stage)
+					return lastParent;
+				lastParent = parent;
+				parent = parent.parent;
+			}
+		}
+		catch (error:SecurityError)
+		{
+		}
+
+		return null;
+	}
+
+	/**
+	 * Go up our parent chain to get the top level system manager in this
+	 * SecurityDomain
+	 *
+	 */
+	public function getSandboxRoot():DisplayObject
+	{
+		// work our say up the parent chain to the root. This way we
+		// don't have to rely on this object being added to the stage.
+		var sm:ISystemManager2 = this;
+
+		try
+		{
+			if (sm.topLevelSystemManager)
+				sm = ISystemManager2(sm.topLevelSystemManager);
+			var parent:DisplayObject = DisplayObject(sm).parent;
+			if (parent is Stage)
+				return DisplayObject(sm);
+			// test to see if parent is a Bootstrap
+			if (parent && !parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)))
+				return this;
+			var lastParent:DisplayObject = parent;
+			while (parent)
+			{
+				if (parent is Stage)
+					return lastParent;
+				// test to see if parent is a Bootstrap
+				if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)))
+					return lastParent;
+				lastParent = parent;
+				parent = parent.parent;
+			}
+		}
+		catch (error:SecurityError)
+		{
+			// don't have access to parent
+		}
+
+		return lastParent != null ? lastParent : DisplayObject(sm);
+	}
+
+	/**
 	 *  Returns true if the given DisplayObject is the
 	 *  top-level window.
 	 *
@@ -1747,6 +2083,28 @@
 	}

 	/**
+	 * Return the object the player sees as having focus.
+	 *
+	 * @return An object of type InteractiveObject that the
+	 * 		   player sees as having focus. If focus is currently
+	 * 		   in a sandbox the caller does not have access to
+	 * 		   null will be returned.
+	 */
+	public function getFocus():InteractiveObject
+	{
+		try
+		{
+			return stage.focus;
+		}
+		catch (e:SecurityError)
+		{
+			// trace("SM getFocus(): ignoring security error " + e);
+		}
+
+		return null;
+	}
+
+	/**
 	 *  @private
 	 *  Cleans up references to Window. Also removes self from topLevelSystemManagers list.
 	 */


Transferred from the Adobe Open Source Subversion Repository

Revision: 21232
Author:   chiedozi@adobe.com
Date:     2011-05-10T20:50:13.396251Z

Log Message:
-----------
Removed the auto alignment logic from SplashScreen to fix various issues on various devices.
The mx_internal method getImage now accepts an aspectRatio parameter instead of a portraitOrientation boolean

QE notes:
Doc notes:
Bugs: SDK-30390
Reviewer: Evtim
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreen.as

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

--- frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreen.as
+++ frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreen.as
@@ -14,6 +14,7 @@

 import flash.display.DisplayObject;
 import flash.display.Sprite;
+import flash.display.StageAspectRatio;
 import flash.display.StageOrientation;
 import flash.events.Event;
 import flash.events.StageOrientationEvent;
@@ -209,16 +210,6 @@
     //--------------------------------------------------------------------------

     //----------------------------------
-    //  autoAlign
-    //----------------------------------
-    /**
-     *  @private
-     *  Flag determines whether the SplashScreen attempts to auto orient the
-     *  splash screen image that is displayed.
-     */
-    mx_internal var autoAlign:Boolean = true;
-
-    //----------------------------------
     //  preloader
     //----------------------------------

@@ -305,11 +296,6 @@
      */
     public function initialize():void
     {
-        // autoAlign is disabled on iOS devices since the stage's width and height
-        // are properly provided at start up.  See SDK-30261.
-        if (Capabilities.version.indexOf("IOS") == 0)
-            autoAlign = false;
-
         // The preloader parameters are in the SystemManager's info() object
         var sysManager:SystemManager = this.parent.loaderInfo.content as SystemManager;
         if (!sysManager)
@@ -334,7 +320,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    mx_internal function getImageClass(dpi:Number, portraitOrientation:Boolean):Class
+    mx_internal function getImageClass(dpi:Number, aspectRatio:String):Class
     {
         if ("splashScreenImage" in info)
             return info["splashScreenImage"];
@@ -351,9 +337,8 @@

         // Capture device dpi and orientation
         var dpi:Number = dpiProvider.runtimeDPI;
-        var portraitOrientation:Boolean = stage.stageWidth < stage.stageHeight;
-
-        var imageClass:Class = getImageClass(dpi, portraitOrientation);
+        var aspectRatio:String = (stage.stageWidth < stage.stageHeight) ? StageAspectRatio.PORTRAIT : StageAspectRatio.LANDSCAPE;
+        var imageClass:Class = getImageClass(dpi, aspectRatio);

         // The SplashImageClass will only be set if a splash screen image has
         // already be generated.  If the desired imageClass differs from the
@@ -431,20 +416,8 @@
         var dpiScale:Number = this.root.scaleX;

         // Get stage dimensions at default orientation
-        var stageWidth:Number;
-        var stageHeight:Number;
-
-        if (autoAlign && (orientation == StageOrientation.ROTATED_LEFT ||
-            orientation == StageOrientation.ROTATED_RIGHT))
-        {
-            stageWidth = stage.stageHeight / dpiScale;
-            stageHeight = stage.stageWidth / dpiScale;
-        }
-        else
-        {
-            stageWidth = stage.stageWidth / dpiScale;
-            stageHeight = stage.stageHeight / dpiScale;
-        }
+        var stageWidth:Number = stage.stageWidth / dpiScale;
+        var stageHeight:Number = stage.stageHeight / dpiScale;

         // The image dimensions
         var width:Number = splashImageWidth;
@@ -482,43 +455,11 @@
             m.scale(scaleX, scaleY);
         }

-        // Rotate to keep aligned with StageOrientation.DEFAULT
-        var rotation:Number = 0;
-
-        if (autoAlign)
-        {
-            switch (stage.orientation)
-            {
-                case StageOrientation.UNKNOWN:
-                case StageOrientation.DEFAULT:
-                    rotation = 0;
-                break;
-
-                case StageOrientation.ROTATED_RIGHT:
-                    rotation = Math.PI * 1.5; // 270
-                break;
-
-                case StageOrientation.ROTATED_LEFT:
-                    rotation = Math.PI * 0.5; // 90
-                break;
-
-                case StageOrientation.UPSIDE_DOWN:
-                    rotation = Math.PI; // 180
-                break;
-            }
-        }
-
         // Move center to (0,0):
         m.translate(-width / 2, -height / 2);

-        // Rotate around center (0,0)
-        if (rotation != 0)
-            m.rotate(rotation);
-
         // Align center of image (0,0) to center of stage:
-        var stageWidthAfterOrientationAndDPI:Number = stage.stageWidth / dpiScale;
-        var stageHeightAfterOrientationAndDPI:Number = stage.stageHeight / dpiScale;
-        m.translate(stageWidthAfterOrientationAndDPI / 2, stageHeightAfterOrientationAndDPI / 2);
+        m.translate(stageWidth / 2, stageHeight / 2);

         // Apply matrix
         splashImage.transform.matrix = m;


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

--- frameworks/projects/mx/src/mx/controls/listClasses/ListBaseFindPending.as
+++ frameworks/projects/mx/src/mx/controls/listClasses/ListBaseFindPending.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2006 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.controls.listClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 21536
Author:   jasonsj@adobe.com
Date:     2011-07-11T23:14:34.905781Z

Log Message:
-----------
Initial checkin for Callout/CalloutButton and mobile check-in tests.

* Refactored pop up transformations from PopUpAnchor.applyPopUpTransform() to mx.utils.PopUpUtil.applyPopUpTransform()
* CalloutPosition.AUTO not yet implemented
* Visuals are not the final XD design.

QE notes:
Doc notes:
Bugs:
Reviewer: chiedozi
Tests run: checkintests, checkintests-mobile
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/.flexLibProperties</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutPosition.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/ArrowDirection.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/tests/airMobileBasicTests/src/mobile/views/TestCalloutButton.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/.actionScriptProperties</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalloutButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/.flexLibProperties</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/SkinnablePopUpContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/utils/PopUpUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/.actionScriptProperties</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/Callout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/tests/airMobileBasicTests/src/airMobileBasicTests-config.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutButtonSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/tests/airMobileBasicTests/src/mobile/scripts/CalloutButtonTestScript.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/.actionScriptProperties</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/CalloutSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/.flexLibProperties</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/tests/airMobileBasicTests/src/airMobileBasicTests-app.xml</path>

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

--- frameworks/projects/spark/src/spark/components/SkinnablePopUpContainer.as
+++ frameworks/projects/spark/src/spark/components/SkinnablePopUpContainer.as
@@ -273,6 +273,8 @@

             // This will create the skin and attach it
             PopUpManager.addPopUp(this, owner, modal);
+
+            positionPopUp();
         }

         // Change state *after* we pop up, as the skin needs to go be in the initial "closed"
@@ -283,6 +285,20 @@
             skin.addEventListener(FlexEvent.STATE_CHANGE_COMPLETE, stateChangeComplete_handler);
         else
             stateChangeComplete_handler(null); // Call directly
+    }
+
+    /**
+     *  Positions the popUp after the popUp is added to PopUpManager but before any
+     *  state transitions occur.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    protected function positionPopUp():void
+    {
+        // subclasses will implement custom positioning
+        // e.g. PopUpManager.centerPopUp()
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 4192
Author:   rfrishbe@adobe.com
Date:     2008-11-26T19:39:48.250759Z

Log Message:
-----------
This change will allow us to handle having the same items multiple times in the list, for example “Ryan Frishberg” can now be in the list twice.

In order to do it, rather than using the item to find the itemRenderer or to tell the list that an item’s been selected, we need to use the index instead.  Methods like getItemRenderer and getRendererItem were changed to accept an index rather than an item.  Other methods were added, like isItemIndexSelected() because I felt isItemSelected() is still a useful method to have, even though it’s ambiguous when multiple items come in to play.

For now, I just tried to change the parameters where needed.  Some of the names of the methods were updated to reflect the change, but others weren’t because PARB is going to review a lot of this on Thursday, so it’s easier to make a name change only once (and after PARB approves it).

I also added properties to ItemExistanceChangeEvent.as.  In a later checkin, I’ll create a separate RendererExistanceChangeEvent.as for DataGroups and use ItemExistanceChangeEvents only for IVisualElementContainers (Halo containers  will also dispatch these events).  However, this needs to be PARB reviewed, so I figured it’s best to hold off on this change until later.

Also included in this checkin are some small ASDoc updates to no longer use any of the “addItem(), numItems”, and instead use addElement() or numElements where appropriate.

QE Notes: Steve's excluded any failing tests.  As noted in the checkin, there will probably be some renaming related to these methods.  Also, add some tests for duplicate items now.
Doc Notes: None
Bugs: SDK-17912
Reviewer: Glenn
tests: checkintests, mustella DataGroup, FxDataContainer, FxList

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/ItemExistenceChangedEvent.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/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
@@ -144,7 +144,7 @@
      *  Setting the selectedIndex property deselects the currently selected
      *  item and selects the item at the specified index.
      *
-     *
The value is always between -1 and (numItems - 1).
+     *
The value is always between -1 and (dataProvider.length - 1).
      *  If items at a lower index than selectedIndex are
      *  removed from the component, the selected index is adjusted downward
      *  accordingly.

@@ -250,7 +250,7 @@
     /**
      *  Specifies whether an item must always be selected.
      *  If the value is true, the selectedIndex property
-     *  is always set to a value between 0 and (numItems - 1),
+     *  is always set to a value between 0 and (dataProvider.length - 1),
      *  or -1 if there are no items.
      *
      *  @default false
@@ -302,7 +302,7 @@
             // TODO: should resetting the dataProvider clear out all of its state?
             // or should we preserve selectedIndex
             if (selectedIndex >= 0 && dataProvider && selectedIndex < dataProvider.length)
-               itemSelected(dataProvider.getItemAt(selectedIndex), true);
+               itemSelected(selectedIndex, true);
             else
                selectedIndex = -1;
         }
@@ -358,14 +358,46 @@
      *  Called when an item is selected or deselected.
      *  Subclasses must override this method to display the selection.
      *
-     *  @param item The item.
+     *  @param index The item index that was selected.
      *
      *  @param selected true if the item is selected,
      *  and false if it is deselected.
      */
-    protected function itemSelected(item:Object, selected:Boolean):void
+    protected function itemSelected(index:int, selected:Boolean):void
     {
         // Subclasses must override this method to display the selection.
+    }
+
+    /**
+     *  Returns true if the item is selected by calling
+     *  isItemIndexSelected().
+     *
+     *
If multiple instances of the item are in the list,
+     *  this will only check to see whether the item at
+     *  dataProvider.getItemIndex() (usually the first
+     *  instance of that item) is selected.

+     *
+     *  @param item The item whose selection status is being checked
+     *
+     *  @return true if the item is selected, false otherwise.
+     */
+    public function isItemSelected(item:Object):Boolean
+    {
+        var index:int = dataProvider.getItemIndex(item);
+
+        return isItemIndexSelected(index);
+    }
+
+    /**
+     *  Returns true if the item at the index is selected.
+     *
+     *  @param index The index of the item whose selection status is being checked
+     *
+     *  @return true if the item at that index is selected, false otherwise.
+     */
+    public function isItemIndexSelected(index:int):Boolean
+    {
+        return index == selectedIndex;
     }

     //--------------------------------------------------------------------------
@@ -412,9 +444,9 @@

         // Step 3: commit the selection change
         if (_selectedIndex != NO_SELECTION)
-            itemSelected(dataProvider.getItemAt(_selectedIndex), false);
+            itemSelected(_selectedIndex, false);
         if (_proposedSelectedIndex != NO_SELECTION)
-            itemSelected(dataProvider.getItemAt(_proposedSelectedIndex), true);
+            itemSelected(_proposedSelectedIndex, true);
         _selectedIndex = _proposedSelectedIndex;
         _proposedSelectedIndex = NO_PROPOSED_SELECTION;


Transferred from the Adobe Open Source Subversion Repository

Revision: 10598
Author:   rfrishbe@adobe.com
Date:     2009-09-25T20:02:36.112749Z

Log Message:
-----------
Enabling doubleClick for Label and RichText.  The way we do this is just set mouseChildren=false for these components, so the underlying TextLines don't get in the way.

QE notes: -
Doc notes: -
Bugs: SDK-23363
Reviewer: Gordon
Tests run: checkintests, mustella Label, GraphicTags, RichText
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -120,6 +120,10 @@
     public function TextBase()
     {
         super();
+
+        // set mouseChildren to false so that the TextLines that get
+        // added don't trap the mouse events.
+        mouseChildren = false;

 		var resourceManager:IResourceManager = ResourceManager.getInstance();


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

--- frameworks/projects/framework/src/mx/managers/marshalClasses/PopUpManagerMarshalMixin.as
+++ frameworks/projects/framework/src/mx/managers/marshalClasses/PopUpManagerMarshalMixin.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2006 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.managers.marshalClasses
 {


fix sum bugs

fix sum bugs

git-svn-id: 864080e30cc358c5edb906449bbf014f90258007@50 96db6a20-122f-0410-8d9f-89437bbe4005

--- src/com/rails2u/debug/ExportJS.as
+++ src/com/rails2u/debug/ExportJS.as
@@ -18,27 +18,39 @@
             inited = true;
         }

-        public static function updateProperty(jsName:String, chainProperties:Array, value:Object):void {
+        public static function updateProperty(jsName:String, chainProperties:Array, value:Object):Boolean {
             var obj:Object = objects[jsName];
             while (chainProperties.length > 1) {
                 var prop:String = chainProperties.shift();
                 obj = obj[prop];
             }
-            obj[chainProperties.shift()] = value;
+            try {
+                obj[chainProperties.shift()] = value;
+            } catch(e:Error) {
+                ExternalInterface.call('console.error', e.message);
+                return false;
+            }
+            return true;
         }

-        public static function callMethod(jsName:String, chainProperties:Array, args:Object):void {
+        public static function callMethod(jsName:String, chainProperties:Array, args:Object):* {
             var obj:Object = objects[jsName];
             while (chainProperties.length > 1) {
                 var prop:String = chainProperties.shift();
                 obj = obj[prop];
             }
             var func:Function = obj[chainProperties.shift()] as Function;
-            if (func is Function) func.apply(obj, args);
+
+            try {
+                if (func is Function) return func.apply(obj, args);
+            } catch(e:Error) {
+                ExternalInterface.call('console.error', e.message);
+            }
         }

         public static function reloadObject(jsName:String) {
             export(objects[jsName], jsName);
+            ExternalInterface.call('console.info', 'reloaded: ' + jsName);
         }

         private static var cNum:uint = 0;
@@ -85,8 +97,11 @@
                             obj.__defineSetter__(i,
                                 (function(attrName) {
                                     return function(val) {
-                                        swfObject.updateProperty(jsName, [].concat(parentProperties).concat(attrName), val);
-                                        return this.__tmpProperties__[attrName] = val;
+                                        if (swfObject.updateProperty(jsName, [].concat(parentProperties).concat(attrName), val)) {
+                                            return this.__tmpProperties__[attrName] = val;
+                                        } else {
+                                            return this.__tmpProperties__[attrName];
+                                        }
                                     }
                                 })(i)
                             );
@@ -99,6 +114,8 @@
                     defineAttr(target, []);

                     target.__reload = function() { return swfObject.reloadObject(jsName) };
+                    if (!target.hasOwnProperty('reload')) target.reload = target.__reload;
+
                     target.toString = function() { return klassName };
                     window[jsName] = target;
                 ;})


fix indents and spaces

fix indents and spaces

--- src/org/mangui/osmf/plugins/traits/HLSPlayTrait.as
+++ src/org/mangui/osmf/plugins/traits/HLSPlayTrait.as
@@ -12,14 +12,12 @@
     import org.mangui.hls.utils.Log;
     }

-    public class HLSPlayTrait extends PlayTrait
-    {
+    public class HLSPlayTrait extends PlayTrait {
         private var _hls : HLS;

         private var streamStarted : Boolean = false;

-        public function HLSPlayTrait(hls : HLS)
-        {
+        public function HLSPlayTrait(hls : HLS) {
             CONFIG::LOGGING {
             Log.debug("HLSPlayTrait()");
             }
@@ -29,8 +27,7 @@
             _hls.addEventListener(HLSEvent.PLAYBACK_COMPLETE, _playbackComplete);
         }

-        override public function dispose() : void
-        {
+        override public function dispose() : void {
             CONFIG::LOGGING {
             Log.debug("HLSPlayTrait:dispose");
             }
@@ -40,22 +37,17 @@
         }

-        override protected function playStateChangeStart(newPlayState:String):void
-        {
-            CONFIG::LOGGING
-            {
+        override protected function playStateChangeStart(newPlayState:String):void {
+            CONFIG::LOGGING {
                 Log.info("HLSPlayTrait:playStateChangeStart:" + newPlayState);
             }
-            switch (newPlayState)
-            {
+            switch (newPlayState) {
                 case PlayState.PLAYING:
-                    if (!streamStarted)
-                    {
+                    if (!streamStarted) {
                         _hls.stream.play();
                         streamStarted = true;
                     }
-                    else
-                    {
+                    else {
                         _hls.stream.resume();

                     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17526
Author:   klin@adobe.com
Date:     2010-08-30T23:30:33.580290Z

Log Message:
-----------
Also add ExcludeClass metadata for ColumnHeaderBarLayout.

QE notes: No
Doc notes: No
Bugs: SDK-27668
Reviewer: Hans
Tests run: checkintests, DataGrid
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
@@ -11,17 +11,16 @@

 package spark.components.supportClasses
 {
-import flash.geom.Rectangle;
-
 import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
 import mx.core.mx_internal;

 import spark.components.DataGroup;
-import spark.components.supportClasses.GridColumn;
 import spark.layouts.supportClasses.LayoutBase;

 use namespace mx_internal;
+
+[ExcludeClass]

 public class ColumnHeaderBarLayout extends LayoutBase
 {


Fixed wrong event name

Fixed wrong event name

--- src/com/axis/audioclient/AxisTransmit.as
+++ src/com/axis/audioclient/AxisTransmit.as
@@ -161,7 +161,7 @@

       if ("stopped" === this.currentState) {
         this.currentState = "playing";
-        this.callAPI(EVENT_TRANSMIT_AUDIO_STARTED);
+        this.callAPI(EVENT_AUDIO_TRANSMIT_STARTED);
       }

       while (event.data.bytesAvailable) {


- bugfix: made opacity work for borders again

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

--- src/reprise/ui/renderers/DefaultBorderRenderer.as
+++ src/reprise/ui/renderers/DefaultBorderRenderer.as
@@ -174,7 +174,7 @@
 			side : int) : void
 		{
 			var colorValue : int = 0;
-			var opacityValue : int = 1;
+			var opacityValue : Number = 1;
 			if (color)
 			{
 				colorValue = color.rgb();


changed addRadioButton() to internal

changed addRadioButton() to internal

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

--- src/reprise/controls/RadioButtonGroup.as
+++ src/reprise/controls/RadioButtonGroup.as
@@ -50,11 +50,6 @@
 				g_radioGroups[name] = new RadioButtonGroup(name);
 			}
 			return g_radioGroups[name];
-		}
-
-		public function addRadioButton(btn:RadioButton):void
-		{
-			m_radioButtons.push(btn);
 		}

 		public function removeRadioButton(btn:RadioButton):void
@@ -125,5 +120,15 @@
 					DocumentView.FOCUS_METHOD_KEYBOARD);
 			}
 		}
+
+
+
+		//*****************************************************************************************
+		//*                                    Internal Methods                                   *
+		//*****************************************************************************************
+		internal public function addRadioButton(btn:RadioButton):void
+		{
+			m_radioButtons.push(btn);
+		}
 	}
 }