Transferred from the Adobe Open Source Subversion Repository

Revision: 4724
Author:   rfrishbe@adobe.com
Date:     2009-01-29T02:13:02.210369Z

Log Message:
-----------
Bunch of small changes:

build scripts..just minor fixes and making it player 10

FxComponent - required parts must be present--not just defined

FxContainer - removing some dead code around IUIComponent since everything should be an IVisualElement now

Group - move around logic for removing a previously parented object.  This helps deal with graphic elements with shared display objects

GraphicElement - need to handle display object getting changed as well

ArrayList/ListCollectionView - add addAll() and addAllAt()

AdvancedLayoutFeatures - remove Vector import (now that build scripts are fixed, it works fine)

QE Notes: Write tests for addAll() and allAllAt(), check that required parts are required in the first state
Doc Notes: None
Bugs: SDK-18536, SDK-18745, SDK-18709, SDK-18189, SDK-18537
Reviewer: Evtim
tests: checkintests, mustella DataGroup, List, Group, FxContainer, FxDataContainer

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/utilities/build.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ListCollectionView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/build.xml</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/build.xml</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/framework/src/mx/collections/ArrayList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -499,6 +499,35 @@
                 listIndex = list.getItemIndex(localIndex[index]);
         }
         list.addItemAt(item, listIndex);
+    }
+
+    /**
+     *  Adds a list of items to the current list, placing them at the end of
+     *  the list in the order they are passed.
+     *
+     *  @param IList The list of items to add to the current list
+     */
+    public function addAll(addList:IList):void
+    {
+        addAllAt(addList, length);
+    }
+
+    /**
+     *  Adds a list of items to the current list, placing them at the position
+     *  index passed in to the function.  The items are placed at the index location
+     *  and placed in the order they are recieved.
+     *
+     *  @param IList The list of items to add to the current list
+     *  @param index The location of the current list to place the new items.
+     *  @throws RangeError if index is less than 0 or greater than the length of the list.
+     */
+    public function addAllAt(addList:IList, index:int):void
+    {
+        var length:int = addList.length;
+        for(var i:int=0; i < length; i++)
+        {
+            this.addItemAt(addList.getItemAt(i), i+index);
+        }
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

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

 package mx.managers
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19452
Author:   mhorn@adobe.com
Date:     2010-12-17T15:03:22.438091Z

Log Message:
-----------
minor ASDoc updates

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/ActionBar.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ActionBar.as
@@ -374,7 +374,8 @@
     //--------------------------------------------------------------------------

     /**
-     *  Constructor
+     *  Constructor.
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 2.5
@@ -453,7 +454,16 @@
     /**
      *  The skin part that defines the appearance of the
      *  title text in the component.
-     *
+     *
+     *  You can use CSS to declare styles on the ActionBar's titleDisplay skin part, as the following example shows:
+     *
+     *  <pre>
+     *  @namespace s "library://ns.adobe.com/flex/spark";
+     *  s|ActionBar #titleDisplay {
+     *     color:red;
+     *  }
+     * </pre>
+     *
      *  @see spark.skins.mobile.ActionBarSkin
      *
      *  @langversion 3.0


Transferred from the Adobe Open Source Subversion Repository

Revision: 22867
Author:   tkraikit@adobe.com
Date:     2011-10-05T17:35:12.739638Z

Log Message:
-----------
SDK-31720: on CalloutButton in Scroller, with Callout expanded clicking on the CalloutButton fails to close the Callout

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

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

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
@@ -908,7 +908,7 @@
         if (!enabled)
             return "disabled";

-        if (isDown())
+        if (isDown() || _keepDown)
             return "down";

         // if interactionMode == InteractionMode.TOUCH, then we have no over state
@@ -1000,9 +1000,6 @@
     {
         if (!enabled)
             return false;
-
-        if (_keepDown)
-            return true;

         if (keyboardPressed)
             return true;
@@ -1147,7 +1144,7 @@
         // Only if down state has changed, do we need to do something
         if (_downEventFired != isCurrentlyDown)
         {
-            if (isCurrentlyDown)
+            if (isCurrentlyDown && hasEventListener(FlexEvent.BUTTON_DOWN))
                 dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));

             _downEventFired = isCurrentlyDown;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8581
Author:   mhorn@adobe.com
Date:     2009-07-15T15:47:47.191332Z

Log Message:
-----------
asdoc edits: bug fix FLEXDOCS-1000

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
@@ -608,7 +608,7 @@
         if (value != prevValue)
             dispatchEvent(new Event(Event.CHANGE));

-        // Gumbo redispatches scrolling keyboard events with cancelable=true
+        // Flex 4 redispatches scrolling keyboard events with cancelable=true
         // so typically we will preventDefault (read "cancel") here, rather
         // than stopping dispatching.
         if (stopPropagation)


fixed as3 warnings

fixed as3 warnings

--- actionscript/src/com/freshplanet/ane/AirFacebook/share/FBGameRequestContent.as
+++ actionscript/src/com/freshplanet/ane/AirFacebook/share/FBGameRequestContent.as
@@ -51,7 +51,7 @@
          *
          * @param val
          */
-        public function setActionType(val:FBGameRequestActionType) {
+        public function setActionType(val:FBGameRequestActionType):void {
             _actionType = val.value;
         }

@@ -59,7 +59,7 @@
          *
          * @param val
          */
-        public function setFilter(val:FBGameRequestFilter) {
+        public function setFilter(val:FBGameRequestFilter):void {
             _filters = val.value;
         }


Updated TileLayout to conform to new layout protocol.

--- frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/TileLayout.as
+++ frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/TileLayout.as
@@ -22,6 +22,8 @@
 	import org.apache.flex.core.ILayoutParent;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.IViewport;
+	import org.apache.flex.core.IViewportModel;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
@@ -66,6 +68,25 @@
 			_strand = value;
 		}

+		private var _viewportModel:IViewportModel;
+
+		/**
+		 *  The data that describes the viewport used by this layout.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get viewportModel():IViewportModel
+		{
+			return _viewportModel;
+		}
+		public function set viewportModel(value:IViewportModel):void
+		{
+			_viewportModel = value;
+		}
+
 		private var _numColumns:Number = 4;
 		private var _columnWidth:Number = Number.NaN;
 		private var _rowHeight:Number = Number.NaN;
@@ -131,8 +152,13 @@
 		public function layout():Boolean
 		{
 			// this is where the layout is calculated
+			var host:UIBase = _strand as UIBase;
 			var p:ILayoutParent = _strand.getBeadByType(ILayoutParent) as ILayoutParent;
 			var area:UIBase = p.contentView as UIBase;
+
+			// this layout will use and modify the IViewportMode
+			var viewport:IViewport = _strand.getBeadByType(IViewport) as IViewport;
+			if (viewport) viewportModel = viewport.model;

 			var xpos:Number = 0;
 			var ypos:Number = 0;
@@ -148,12 +174,15 @@
 				if (testChild && !testChild.visible) realN--;
 			}

-			if (isNaN(useWidth)) useWidth = Math.floor(area.width / numColumns); // + gap
+			if (isNaN(useWidth)) useWidth = Math.floor(host.width / numColumns); // + gap
 			if (isNaN(useHeight)) {
 				// given the width and total number of items, how many rows?
 				var numRows:Number = Math.floor(realN/numColumns);
-				useHeight = Math.floor(area.height / numRows);
-			}
+				useHeight = Math.floor(host.height / numRows);
+			}
+
+			var maxWidth:Number = useWidth;
+			var maxHeight:Number = useHeight;

 			for(var i:int=0; i < n; i++)
 			{
@@ -165,15 +194,37 @@
 				child.y = ypos;

 				xpos += useWidth;
+				maxWidth = Math.max(maxWidth,xpos);

 				var test:Number = (i+1)%numColumns;

 				if (test == 0) {
 					xpos = 0;
 					ypos += useHeight;
+					maxHeight = Math.max(maxHeight,ypos);
 				}
 			}
-            return true;
+
+			maxWidth = Math.max(maxWidth, numColumns*useWidth);
+			maxHeight = Math.max(maxHeight, numRows*useHeight);
+
+			// Only return true if the contentView needs to be larger; that new
+			// size is stored in the model.
+			var sizeChanged:Boolean = false;
+			if (viewportModel != null) {
+				if (viewportModel.contentHeight != maxHeight) {
+					viewportModel.contentHeight = maxHeight;
+					sizeChanged = true;
+				}
+				if (viewportModel.contentWidth != maxWidth) {
+					viewportModel.contentWidth = maxWidth;
+					sizeChanged = true;
+				}
+			}
+
+			IEventDispatcher(_strand).dispatchEvent( new Event("layoutComplete") );
+
+			return sizeChanged;
 		}
 	}
 }


Docs are now compiling with asdoc from Flex SDK 4.6.0.23201B.

--- src/org/igniterealtime/xiff/conference/Room.as
+++ src/org/igniterealtime/xiff/conference/Room.as
@@ -601,7 +601,7 @@
 		 * true to this method to begin the configuration process.	When
 		 * The configuration is complete, the room will be unlocked for others to join.
 		 * Listen for the RoomEvent.CONFIGURE_ROOM event to handle and
-		 * either return or cancel the configuration of the room.
+		 * either return or cancel the configuration of the room.

 		 *
 		 * @param	createReserved Set to true if you wish to create and configure a reserved room
 		 * @param	joinPresenceExtensions An array of additional extensions to send with the initial presence to the room.


Transferred from the Adobe Open Source Subversion Repository

Revision: 1968
Author:   jimurphy@adobe.com
Date:     2008-06-05T15:31:56.961691Z

Log Message:
-----------
Merge 3.0.x revisions [1940,1954] -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/FlexHTMLLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemEnumerationMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemHistoryButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemTree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/HTML.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/air/mac/AIR Integration Kit.tbz2</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/utils/DirectoryEnumeration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/utils/DirectoryEnumerationMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/AIREvent.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FileEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/windowClasses/StatusBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/air/win/AIR Integration Kit.zip</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemDataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/ApplicationTitleBarBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FlexNativeMenuEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowMinimizeButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowMaximizeButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowRestoreButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/StatusBarBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/IWindow.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemSizeDisplayMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FlexNativeWindowBoundsEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowBackground.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/windowClasses/TitleBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowCloseButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FlexNativeMenu.as</path>

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

--- frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
+++ frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
@@ -58,7 +58,7 @@
  *
  *  @see mx.managers.SystemManager
  *
- *  @productversion Apollo 1.0
+ *  @playerversion AIR 1.1
  */
 public class WindowedSystemManager extends MovieClip implements ISystemManager
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20007
Author:   cframpto@adobe.com
Date:     2011-01-28T20:19:13.564049Z

Log Message:
-----------
Add [Inspectable] metadata to all spark text components

QE notes:
Doc notes:
Bugs: part of SDK-28942
Reviewer: Corey
Tests run: cyclone, FlashBuilder w/ DesignView
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -373,7 +373,7 @@
      */
 	private var _maxDisplayedLines:int = 0;

-    [Inspectable(minValue="-1")]
+    [Inspectable(category="General", minValue="-1", defaultValue="0")]

     /**
      *  An integer which determines whether, and where,
@@ -439,6 +439,8 @@
      */
     private var _showTruncationTip:Boolean = false;

+    [Inspectable(category="General", defaultValue="false")]
+
     /**
 	 *  A property that controls whether the component
      *  should show a toolTip when the text has been truncated.
@@ -474,13 +476,13 @@
     //  text
     //----------------------------------

-    [Inspectable(category="General")]
-
     /**
      *  @private
      */
     mx_internal var _text:String = "";

+    [Inspectable(category="General", defaultValue="")]
+
     /**
      *  The text displayed by this text component.
 	 *


Transferred from the Adobe Open Source Subversion Repository

Revision: 5831
Author:   egeorgie@adobe.com
Date:     2009-03-31T23:50:47.797738Z

Log Message:
-----------
Fix bug Fix SDK-19800 FxButton doesnt resize itself to display all text when lineBreak == toFit

Fix: implement text reflow support for TextGraphicelement.

QE Notes: None
Doc Notes:
Bugs: SDK-19800
Reviewer: Carol, Gordon
tests: checkintests, mustella

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -12,17 +12,17 @@
 package spark.primitives.supportClasses
 {

+import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
-import flash.display.Graphics;
-import flash.display.DisplayObject;
-import flash.display.Sprite;
 import flash.events.Event;
+import flash.geom.Matrix;
 import flash.geom.Rectangle;
 import flash.text.engine.TextLine;

 import flashx.textLayout.formats.LineBreak;

 import mx.core.mx_internal;
+import mx.events.FlexEvent;
 import mx.resources.IResourceManager;
 import mx.resources.ResourceManager;
 import mx.styles.CSSStyleDeclaration;
@@ -30,6 +30,8 @@
 import mx.styles.StyleManager;
 import mx.styles.StyleProtoChain;
 import mx.utils.NameUtil;
+
+import spark.components.Group;

 /**
  *  The base class for GraphicElements such as TextBox and TextGraphic
@@ -141,6 +143,20 @@
      */
     mx_internal var lineBreakToFit:Boolean = true;

+    /**
+     *  @private
+     *  Cache the width constraint as set by the layout in setLayoutBoundsSize()
+     *  so that text reflow can be calculated during a subsequent measure pass.
+     */
+    private var _widthConstraint:Number = NaN;
+
+    /**
+     *  @private
+     *  Cache the number of text lines during measure. We can optimize for
+     *  a single line text reflow, which is a lot of cases.
+     */
+    private var _measuredTextLineCount:int;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties: GraphicElement
@@ -482,35 +498,135 @@
     /**
      *  @private
      */
+    override public function parentChanged(value:Group):void
+    {
+        // TODO EGeorgie: we add event listener to the parent, as adding event
+        // listener to the TextGraphicElement itself doesn't work, as we perform
+        // double invalidation, but our updateDisplayList gets called only once
+        // and  the code in the base GraphicElement class assumes that
+        // updateDisplayList will get called twice.
+        if (parent)
+            parent.removeEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
+
+        super.parentChanged(value);
+
+        if (parent)
+            parent.addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
+    }
+
+    /**
+     *  @private
+     */
     override protected function measure():void
     {
-        super.measure();
-
         // The measure() method of a GraphicElement can get called
         // when its style chain hasn't been initialized.
         // In that case, composeTextLines() must not be called.
         if (!mx_internal::styleChainInitialized)
             return;

-        composeTextLines(explicitWidth, explicitHeight);
-
+        // _widthConstraint trumps even explicitWidth as some layouts may choose
+        // to specify width different from the explicit.
+        var constrainedWidth:Number =
+            !isNaN(_widthConstraint) ? _widthConstraint : explicitWidth;
+        composeTextLines(constrainedWidth, explicitHeight);
+
+        // Anytime we are composing we need to invalidate the display list
+        // as we may have messed up the text lines.
+        invalidateDisplayList();
+
         // If width/height not explicitly set, put on next pixel boundary for
         // crisp edges.  This should not impact isOverset which was calculated
         // with the pre-adjusted bounds values.  If explcitly set, use it so
         // that a recomposition can possibily be avoided in updateDisplayList().
         if (mx_internal::bounds.width != explicitWidth)
-            mx_internal::bounds.width = Math.ceil(mx_internal::bounds.width);
-
-        measuredWidth = mx_internal::bounds.width;
-
+            mx_internal::bounds.width = Math.ceil(mx_internal::bounds.width);
         if (mx_internal::bounds.height != explicitHeight)
             mx_internal::bounds.height = Math.ceil(mx_internal::bounds.height);

-        measuredHeight = mx_internal::bounds.height;
+        // If the measured height is not affected, then constrained
+        // width measurement is not neccessary.
+        if (!isNaN(_widthConstraint) && measuredHeight == mx_internal::bounds.height)
+            return;
+
+        // Call super.measure() here insted of in the beginning of the method,
+        // as it zeroes the measuredWidth, measuredHeight and these values will
+        // still be valid if we decided to do an early return above.
+        super.measure();
+
+        measuredWidth = mx_internal::bounds.width;
+        measuredHeight = mx_internal::bounds.height;

+        // Remember the number of text lines during measure. We can use this to
+        // optimize the double measure scheme for text reflow.
+        _measuredTextLineCount = mx_internal::textLines.length;
+
         //trace("measure", measuredWidth, measuredHeight);
     }
+
+    /**
+     *  @private
+     *  We override the setLayoutBoundsSize to determine whether to perform
+     *  text reflow. This is a convenient place, as the layout passes NaN
+     *  for a dimension not constrained to the parent.
+     */
+    override public function setLayoutBoundsSize(width:Number=NaN,
+                                                 height:Number=NaN,
+                                                 postTransform:Boolean=true):void
+    {
+        super.setLayoutBoundsSize(width, height, postTransform);
+
+        // TODO EGeorgie: possible optimization - if we reflow the text
+        // immediately, we'll be able to detect whether the constrained
+        // width causes the measured height to change.
+        // Also certain layouts like vertical/horizontal will
+        // be able to get the better performance as subsequent elements
+        // will not go through updateDisplayList twice. This also has the
+        // potential of avoiding text compositing during measure.
+
+        // Did we already constrain the width?
+        if (_widthConstraint == width)
+            return;
+
+        // No reflow for explicit lineBreak
+        if (!mx_internal::lineBreakToFit)
+            return;
+
+        // If we don't measure
+        if (skipMeasure())
+            return;
+
+        if (!isNaN(explicitHeight))
+            return;
+
+        // We support reflow only in the case of constrained width and
+        // unconstrained height. Note that we compare with measuredWidth,
+        // as for example the TextGraphicElement can be
+        // constrained by the layout with "left" and "right", but the
+        // container width itself may not be constrained and it would depend
+        // on the element's measuredWidth.
+        var constrainedWidth:Boolean = !isNaN(width) && (width != measuredWidth);
+        if (!constrainedWidth)
+            return;

+        // Special case - if we have a single line, then having a constraint larger
+        // than the measuredWidth will not result in measuredHeight change, as we
+        // will still have only a single line
+        if (_measuredTextLineCount == 1 && width > measuredWidth)
+            return;
+
+        // We support reflow only when we don't have a transform.
+        // We could add support for scale, but not skew or rotation.
+        var matrix:Matrix;
+        if (postTransform)
+            matrix = computeMatrix();
+        if (null != matrix)
+            return;
+
+        _widthConstraint = width;
+        invalidateSize();
+    }
+
     /**
      *  @private
      */
@@ -969,6 +1085,18 @@
         invalidateSize();
         invalidateDisplayList();
     }
+
+    /**
+     *  @private
+     *  We clear the width constraint that's used for the text reflow
+     *  after the layout pass is complete.
+     */
+    private function updateCompleteHandler(event:FlexEvent):void
+    {
+        // Make sure that if we did a double pass, next time around we'll
+        // measure normally
+        _widthConstraint = NaN;
+    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18476
Author:   rfrishbe@adobe.com
Date:     2010-11-05T19:24:22.345498Z

Log Message:
-----------
Adding a "down" state for item renderers when in touch interaction mode.  This means item renderers don't go in to the "selected" state when someone presses down on them.  They first go in to the "down" state.  If the user later starts scrolling or moving around, the item renderer returns to the "normal" state.  If they press down and release up on the same item, the item renderer will go from the "down" state to the "selected" state.  This distinction is necessary on touch devices to distinguish between "down" and "selected".  There's also a new "selectedAndDown" state.

Adding ItemRendererInterationStateDetector as a helper class for item renderer to help detect when they are indeed hovered or pressed down.

QE notes:
Doc notes:
Bugs: SDK-27674, SDK-28110
Reviewer: Eric Day
Tests run: checkintests, full mustella run, QA cyclone
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ItemRendererInteractionStateDetector.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/wireframe/src/spark/skins/wireframe/DefaultItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/wireframe/defaults.css</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as
+++ frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as
@@ -13,6 +13,7 @@
 {

 import flash.display.DisplayObject;
+import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.geom.Point;

@@ -25,6 +26,7 @@

 import spark.components.IItemRenderer;
 import spark.components.Label;
+import spark.components.supportClasses.ItemRendererInteractionStateDetector;
 import spark.components.supportClasses.TextBase;

 use namespace mx_internal;
@@ -73,6 +75,20 @@
 [Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes", theme="spark, mobile")]

 /**
+ *  Color of the background of an item renderer when it is pressed down
+ *
+ *
This style is only applicable in touch interactionMode.

+ *
+ *  @default 0xA8C6EE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="downColor", type="uint", format="Color", inherit="yes", theme="mobile")]
+
+/**
  *  Color of focus ring when the component is in focus
  *
  *  @default 0x70B2EE
@@ -86,6 +102,8 @@

 /**
  *  Color of the highlights when the mouse is over the component
+ *
+ *
This style is only applicable in mouse interactionMode.

  *
  *  @default 0xCEDBEF
  *
@@ -156,7 +174,9 @@
     public function DefaultItemRenderer()
     {
         super();
-        addHandlers();
+
+        itemRendererInteractionStateDetector = new ItemRendererInteractionStateDetector(this);
+        itemRendererInteractionStateDetector.addEventListener(Event.CHANGE, itemRendererInteractionStateDetector_changeHandler);
     }

     //--------------------------------------------------------------------------
@@ -173,9 +193,9 @@

     /**
      *  @private
-     *  Flag that is set when the mouse is hovered over the item renderer.
-     */
-    private var hovered:Boolean = false;
+     *  Helper class to help determine when we are in the hovered or down state
+     */
+    private var itemRendererInteractionStateDetector:ItemRendererInteractionStateDetector;

     //--------------------------------------------------------------------------
     //
@@ -471,9 +491,11 @@

         var backgroundColor:uint;
         var drawBackground:Boolean = true;
-        if (selected)
+        if (itemRendererInteractionStateDetector.down)
+            backgroundColor = getStyle("downColor");
+        else if (selected)
             backgroundColor = getStyle("selectionColor");
-        else if (hovered)
+        else if (itemRendererInteractionStateDetector.hovered)
             backgroundColor = getStyle("rollOverColor");
         else
         {
@@ -521,21 +543,6 @@
         labelDisplay.setLayoutBoundsPosition(3, 5);
     }

-    /**
-     *  @private
-     */
-    override public function styleChanged(styleName:String):void
-    {
-        var allStyles:Boolean = !styleName || styleName == "styleName";
-
-        super.styleChanged(styleName);
-
-        if (allStyles || styleName == "interactionMode")
-        {
-            addHandlers();
-        }
-    }
-
     //--------------------------------------------------------------------------
     //
     //  Event handling
@@ -544,69 +551,9 @@

     /**
      *  @private
-     *  Keeps track of whether rollover/rollout events were added
-     *
-     *  We need to be careful about calling add/remove event listener because
-     *  of the reference counting going on in
-     *  super.addEventListener/removeEventListener.
-     */
-    private var rolloverEventsAdded:Boolean = false;
-
-    /**
-     *  @private
-     *  Attach the mouse events.
-     */
-    private function addHandlers():void
-    {
-        if (getStyle("interactionMode") == InteractionMode.MOUSE)
-        {
-            if (!rolloverEventsAdded)
-            {
-                rolloverEventsAdded = true;
-                addEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
-                addEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
-            }
-        }
-        else
-        {
-            if (rolloverEventsAdded)
-            {
-                rolloverEventsAdded = false;
-                removeEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
-                removeEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
-            }
-        }
-    }
-
-    /**
-     *  @private
-     */
-    private function anyButtonDown(event:MouseEvent):Boolean
-    {
-        var type:String = event.type;
-        return event.buttonDown || (type == "middleMouseDown") || (type == "rightMouseDown");
-    }
-
-    /**
-     *  @private
-     *  Mouse rollOver event handler.
-     */
-    protected function itemRenderer_rollOverHandler(event:MouseEvent):void
-    {
-        if (!anyButtonDown(event))
-        {
-            hovered = true;
-            invalidateDisplayList();
-        }
-    }
-
-    /**
-     *  @private
-     *  Mouse rollOut event handler.
-     */
-    protected function itemRenderer_rollOutHandler(event:MouseEvent):void
-    {
-        hovered = false;
+     */
+    private function itemRendererInteractionStateDetector_changeHandler(event:Event):void
+    {
         invalidateDisplayList();
     }


deprecation of link_to, button_to and their ilk

--- vendor/ras3r/ras3r/ReactionView.as
+++ vendor/ras3r/ras3r/ReactionView.as
@@ -141,53 +141,14 @@
 			return sprite(klass, attr, styles);
 		}

-		// label: String. Text label to display on button.
-		// options: Hash. Valid options:
-		//	- action: 	String method name of controller to call when visual element dipatches event.
-		// attr: Hash. Optional. Properties to be applied to button upon creation (w, h, x, y, etc).
-		protected function button_to (label:String, options:Object, attr:Object = null) :*
-		{
-			var button:* = button(label, attr);
-			link_to(button, options);
-			return button;
-		}
-
-		// label: String. Text label to display on button.
-		// handler: Function. Function to call when visual element dipatches event.
-		// attr: Hash. Optional. Properties to be applied to button upon creation (w, h, x, y, etc).
-		// event: String. Optional. Event dispatched by visual element to listen for. Default = 'click'
-		//protected function button_to_function (label:String, ...args) :*
-		protected function button_to_function (label:String, handler:Function, attr:Object = null, event:String = 'click') :*
-		{
-			//			attr:Object = null, event:String = 'click') :void
-//			var attr:Object = args.splice(1, 1).shift();
-			var button:* = button(label, attr);
-			link_to_function(button, handler, event);
-			return button;
-		}
-
 		protected function combo_box_for (object_name:String, property:String, choices:*, attributes:Object = null, styles:Object = null) :ComboBox
 		{
 			var dataProvider:DataProvider = (choices is DataProvider) ? choices : (new DataProvider(choices));
 			attributes = new Hash(attributes).update({ dataProvider: dataProvider });

 			return (addChild(sprite_for(ComboBoxHelper.create(attributes), 'selectedItem', object_name, property)) as ComboBox);
-/*			return (sprite_for(ComboBox, 'selectedItem', object_name, property, attributes, styles) as ComboBox);*/
-		}
-
-/*		protected function combo_box_for (object_name:String, property:String, choices:*, attributes:Object = null, styles:Object = null) :ComboBox
-		{
-			var dataProvider:DataProvider = (choices is DataProvider) ? choices : (new DataProvider(choices));
-			attributes = new Hash(attributes).update({ dataProvider: dataProvider });
-			return (sprite_for(ComboBox, 'selectedItem', object_name, property, attributes, styles) as ComboBox);
-		}
-*/
-/*		protected function combo_box_for (object_name:String, property:String, attributes:Object = null, styles:Object = null) :ComboBox
-		{
-			this[object_name][property] ||= new DataProvider();
-			return (sprite_for(ComboBox, 'dataProvider', object_name, property, attributes, styles) as ComboBox);
-		}
-*/
+		}
+
 		protected function hbox (options:Object, ...args) :DisplayObjectContainer
 		{
 			return (addChild(BoxHelper.hbox(options, args)) as DisplayObjectContainer);
@@ -216,58 +177,6 @@
 			var sprite:DisplayObject = TextFieldHelper.create(options);
 			assign_id_for_sprite({ id: (object_name + '_' + property + '_label') }, sprite);
 			return (addChild(sprite) as TextField);
-
-			// infer default instance id, but allow for manual override
-/*			attributes = new Hash({
-				id: 		,
-				htmlText:	html
-			}).update(attributes);
-			return (sprite(Text, attributes, styles) as Text);
-*//*
-
-
-			options = options_for('htmlText', object_name, property).update(options);
-			var id:String = options.remove('id');
-			if (debug) options = new Hash({ opaqueBackground: 0xddffdd }).update(options);
-
-			var sprite:DisplayObject = TextFieldHelper.create(options);
-			assign_id_for_sprite({ id: id }, sprite);
-			return (addChild(sprite) as TextField);
-*/		}
-
-		// elem: Object. Visual element for whom the handler is being wired
-		// options: Hash. Valid options:
-		//	- action: 	String method name of controller to call when visual element dipatches event.
-		//	- on:		String. Optional. Event dispatched by visual element to listen for. Default = 'click'
-		public function link_to (elem:Object, options:Object) :void
-		{
-			// default controller name
-			if (! options.controller) options.controller = controller.controller_name();
-
-			var args:Array = [ ];
-
-			// custom event override
-			if (options.on) args.push(options.on);
-			delete options.on;
-
-			// filter chain delegate
-			args.unshift(Delegate.create(controller.redirect_to, options));
-
-			args.unshift(elem);
-			link_to_function.apply(null, args);
-		}
-
-		protected function link_to_url (elem:Object, url:String) :void
-		{
-			link_to(elem, { action: 'get_url', url: url });
-		}
-
-		// elem: Object. Visual element for whom the handler is being wired
-		// handler: Function. Function to call when visual element dipatches event.
-		// event: String. Optional. Event dispatched by visual element to listen for. Default = 'click'
-		protected function link_to_function (elem:Object, handler:Function, event:String = 'click') :void
-		{
-			elem.addEventListener(event, handler);
 		}

 		protected function options_for (assign_property:String, object_name:String, object_property:String) :Hash
@@ -361,13 +270,11 @@
 			var sprite:DisplayObject = TextFieldHelper.create(options);
 			assign_id_for_sprite({ id: id }, sprite);
 			return (addChild(sprite) as TextField);
-/*			return (sprite_for(Text, 'htmlText', object_name, property, options) as TextField);*/
 		}

 		protected function text_input_for (object_name:String, property:String, options:Object = null) :TextInput
 		{
 			return (addChild(sprite_for(TextInputHelper.create(options), 'text', object_name, property)) as TextInput);
-/*			return (sprite_for(TextInput, 'text', object_name, property, attributes, styles) as TextInput);*/
 		}

 		protected function truncate (tf:TextField, suffix:String = '...') :void
@@ -481,5 +388,71 @@
 				}
 			}
 		}
+
+
+		/*****************************************************
+		*
+		*	D E P R E C A T E D    M E T H O D S
+		*
+		*****************************************************/
+/*
+		// label: String. Text label to display on button.
+		// options: Hash. Valid options:
+		//	- action: 	String method name of controller to call when visual element dipatches event.
+		// attr: Hash. Optional. Properties to be applied to button upon creation (w, h, x, y, etc).
+		private function button_to (label:String, options:Object, attr:Object = null) :*
+		{
+			var button:* = button(label, attr);
+			link_to(button, options);
+			return button;
+		}
+
+		// label: String. Text label to display on button.
+		// handler: Function. Function to call when visual element dipatches event.
+		// attr: Hash. Optional. Properties to be applied to button upon creation (w, h, x, y, etc).
+		// event: String. Optional. Event dispatched by visual element to listen for. Default = 'click'
+		//protected function button_to_function (label:String, ...args) :*
+		private function button_to_function (label:String, handler:Function, attr:Object = null, event:String = 'click') :*
+		{
+			var button:* = button(label, attr);
+			link_to_function(button, handler, event);
+			return button;
+		}
+
+		// elem: Object. Visual element for whom the handler is being wired
+		// options: Hash. Valid options:
+		//	- action: 	String method name of controller to call when visual element dipatches event.
+		//	- on:		String. Optional. Event dispatched by visual element to listen for. Default = 'click'
+		private function link_to (elem:Object, options:Object) :void
+		{
+			// default controller name
+			if (! options.controller) options.controller = controller.controller_name();
+
+			var args:Array = [ ];
+
+			// custom event override
+			if (options.on) args.push(options.on);
+			delete options.on;
+
+			// filter chain delegate
+			args.unshift(Delegate.create(controller.redirect_to, options));
+
+			args.unshift(elem);
+			link_to_function.apply(null, args);
+		}
+
+		private function link_to_url (elem:Object, url:String) :void
+		{
+			link_to(elem, { action: 'get_url', url: url });
+		}
+
+		// elem: Object. Visual element for whom the handler is being wired
+		// handler: Function. Function to call when visual element dipatches event.
+		// event: String. Optional. Event dispatched by visual element to listen for. Default = 'click'
+		private function link_to_function (elem:Object, handler:Function, event:String = 'click') :void
+		{
+			elem.addEventListener(event, handler);
+		}
+*/
 	}
 }


Signal.removeAll(): now uses fast clearing of listeners when not dispatching.

--- src/org/osflash/signals/Signal.as
+++ src/org/osflash/signals/Signal.as
@@ -82,7 +82,10 @@
 		/** @inheritDoc */
 		public function removeAll():void
 		{
-			listeners = [];
+			if (dispatching)
+				listeners = [];
+			else
+				listeners.length = 0;
 			onceListeners = new Dictionary();
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

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

 package mx.charts.chartClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 2529
Author:   gosmith@adobe.com
Date:     2008-07-18T22:37:56.754773Z

Log Message:
-----------
Replaced some string literals in TextGraphic and TextView with the appropriate consts.

Reviewer: None; no functional change
Bug: -
QA: No
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextGraphic.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -1637,7 +1637,7 @@
 			    '<content>' + markup + '</content>' +
 			'</TextGraphic>';

-		return TextFilter.importFromString(markup, "fxg");
+		return TextFilter.importFromString(markup, TextFilter.FXG_FORMAT);
 	}

 	/**
@@ -1678,7 +1678,7 @@
 		{
 			if (text != null && text != "")
 			{
-				textFlow = TextFilter.importFromString(text, "text");
+				textFlow = TextFilter.importFromString(text, TextFilter.PLAIN_TEXT_FORMAT);
 			}
 			else
 			{


Transferred from the Adobe Open Source Subversion Repository

Revision: 4367
Author:   cframpto@adobe.com
Date:     2008-12-19T23:54:05.801558Z

Log Message:
-----------
Handle selection styles in TextView.

QE Notes:
Doc Notes: None
Bugs: SDK-18099
Reviewer: not yet but I don't want to lose this over the shutdown

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -221,7 +221,7 @@

     /**
      *  @private
-     *  This object is determined by the CSS styles of the TextGraphic
+     *  This object is determined by the CSS styles of the TextView
      *  and is updated by createTextFlow() when the hostFormatsInvalid flag
      *  is true.
      */
@@ -229,7 +229,7 @@

     /**
      *  @private
-     *  This object is determined by the CSS styles of the TextGraphic
+     *  This object is determined by the CSS styles of the TextView
      *  and is updated by createTextFlow() when the hostFormatsInvalid flag
      *  is true.
      */
@@ -237,7 +237,7 @@

     /**
      *  @private
-     *  This object is determined by the CSS styles of the TextGraphic
+     *  This object is determined by the CSS styles of the TextView
      *  and is updated by createTextFlow() when the hostFormatsInvalid flag
      *  is true.
      */
@@ -247,7 +247,7 @@
      *  @private
      *  This flag indicates whether hostCharacterFormat, hostParagraphFormat,
      *  and hostContainerFormat need to be recalculated from the CSS styles
-     *  of the TextGraphic. It is set true by stylesInitialized() and also
+     *  of the TextView. It is set true by stylesInitialized() and also
      *  when styleChanged() is called with a null argument, indicating that
      *  multiple styles have changed.
      */
@@ -883,8 +883,10 @@

     /**
      *  @private
-     */
-    private var selectionVisibilityChanged:Boolean = false;
+     *  To indicate either selection visibility or selection styles have
+     *  changed.
+     */
+    private var selectionFormatsChanged:Boolean = false;

     /**
      *  Documentation is not currently available.
@@ -903,11 +905,11 @@
     {
         if (value == _selectionVisibility)
             return;
-
+
         _selectionVisibility = value;
-        selectionVisibilityChanged = true;
-
-        invalidateProperties();
+        selectionFormatsChanged = true;
+
+        invalidateDisplayList();
     }

     //----------------------------------
@@ -1201,13 +1203,14 @@
             editableChanged = false;
             selectableChanged = false;
         }
-        else if (enabledChanged || editableChanged || selectableChanged)
+        else if (enabledChanged || editableChanged || selectableChanged ||
+                    selectionFormatsChanged)
         {
             setInteractionManager(textFlow);

             enabledChanged = false;
             editableChanged = false;
-            selectableChanged = false;
+            selectableChanged = false;
         }

         // Tell the TextFlow to generate TextLines within the
@@ -1253,6 +1256,8 @@
         // or hostCharacterFormat immediately.
         if (styleProp == null || styleProp == "styleName")
             hostFormatsInvalid = true;
+        else if (isSelectionFormat(styleProp))
+            selectionFormatsChanged = true;
         else
             setHostFormat(styleProp);

@@ -1326,7 +1331,10 @@
             hostParagraphFormat[styleProp] = value;

         else if (kind == TextUtil.CHARACTER)
-            hostCharacterFormat[styleProp] = value;
+            hostCharacterFormat[styleProp] = value;
+
+        else
+            trace("TextView.setFormat: unrecognized style", styleProp);
     }

     /**
@@ -1470,11 +1478,24 @@
         return textFlow;
     }

-    /**
-     *  @private
-     *  Initialize the ISelectionManager with the default values.
-     */
-    private function initInteractionManager(instanceManager:ISelectionManager):void
+     /**
+     *  @private
+     *  Is this a style associated with the SelectionFormat?
+     */
+    private function isSelectionFormat(styleProp:String):Boolean
+    {
+        return styleProp &&
+                (styleProp == "selectionColor" ||
+                    styleProp == "unfocusedSelectionColor" ||
+                        styleProp == "inactiveSelectionColor");
+    }
+
+    /**
+     *  @private
+     *  Initialize the ISelectionManager with the selection style vlaues.
+     *  This should be kept in sync with isSelectionFormat().
+     */
+    private function setSelectionFormats(instanceManager:ISelectionManager):void
     {
         var selectionColor:* = getStyle("selectionColor");
         var unfocusedAlpha:Number =
@@ -1495,8 +1516,7 @@

     /**
      *  @private
-     *  Persist the edit manager so that any formatting that was set is
-     *  maintained.
+     *  Persist the edit manager.
      */
     private var _editManager:TextViewEditManager = null;

@@ -1505,11 +1525,20 @@
      */
     private function get editManager():TextViewEditManager
     {
+        // Since this is cached, have to be careful to update the
+        // selection formats if they change.
         if (_editManager == null)
         {
-            _editManager = new TextViewEditManager(mx_internal::undoManager);
-            initInteractionManager(_editManager);
-        }
+            _editManager = new TextViewEditManager(mx_internal::undoManager);
+            selectionFormatsChanged = true;
+        }
+
+        if (selectionFormatsChanged)
+        {
+            setSelectionFormats(_editManager);
+            selectionFormatsChanged = false;
+        }
+
         return _editManager;
     }

@@ -1520,7 +1549,7 @@
     private function get selectionManager():ISelectionManager
     {
         var selectionManager:ISelectionManager = new SelectionManager();
-        initInteractionManager(selectionManager);
+        setSelectionFormats(selectionManager);
         return selectionManager;
     }

@@ -1849,12 +1878,10 @@
         var priorManager:ISelectionManager = textFlow.interactionManager;
         switchInteractionManager(textFlow, editManager);

-        var applyFormatOperation:ApplyFormatOperation =
-            new ApplyFormatOperation(editManager.selectionState,
-            characterFormat, paragraphFormat, containerFormat);
-
-        editManager.execute(applyFormatOperation);
-
+        // Apply the format to the current selection.
+        EditManager(textFlow.interactionManager).applyFormat(
+                        characterFormat, paragraphFormat, containerFormat);
+
         // Restore the prior manager if it wasn't an EditManager.
         switchInteractionManager(textFlow, priorManager);
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 12085
Author:   klin@adobe.com
Date:     2009-11-21T20:42:53.350711Z

Log Message:
-----------
Reverting 12078 until I can fix the errors.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/ScrollBarTestScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
@@ -293,12 +293,7 @@
      */
     private var steppingDown:Boolean;
     private var steppingUp:Boolean;
-
-    /**
-     * @private
-     * This variable tracks whether we are currently stepping the ScrollBar
-     */
-    private var isStepping:Boolean;
+	private var isStepping:Boolean;

     /**
      * @private
@@ -306,7 +301,7 @@
      * do a single changeValueByPage() operation. This is used to end that operation properly
      * if another operation interrupts it.
      */
-    private var animatingOnce:Boolean;
+    private var animatingSinglePage:Boolean;

     /**
      * @private
@@ -670,14 +665,9 @@
         else
             val = Math.max(value - pageSize, minimum);
         if (getStyle("smoothScrolling"))
-        {
             startAnimation(getStyle("repeatInterval"), val, linearEaser);
-        }
         else
-        {
             setValue(val);
-            dispatchEvent(new Event(Event.CHANGE));
-        }
     }

     //--------------------------------------------------------------------------
@@ -752,22 +742,26 @@
     mx_internal function viewportVerticalScrollPositionChangeHandler(event:PropertyChangeEvent):void
     {
     }
-
-    //---------------------------------
-    // Thumb dragging handlers
-    //---------------------------------
-
-    /**
-     *  @private
-     */
-    override protected function thumb_mouseDownHandler(event:MouseEvent) : void
-    {
-        // Stop animation before thumb dragging
-        stopAnimation();
-
-        super.thumb_mouseDownHandler(event);
-    }
-
+
+	//---------------------------------
+	// Thumb dragging handlers
+	//---------------------------------
+
+	/**
+	 *  @private
+	 */
+	override protected function thumb_mouseDownHandler(event:MouseEvent) : void
+	{
+		// Stop animation before thumb dragging
+		if (animatingSinglePage)
+		{
+			animationEndHandler(animator);
+			animator.stop();
+		}
+
+		super.thumb_mouseDownHandler(event);
+	}
+
     //---------------------------------
     // Mouse up/down handlers
     //---------------------------------
@@ -788,35 +782,38 @@
      */
     protected function button_buttonDownHandler(event:Event):void
     {
-        // Make sure we finish any running page animation before starting
-        // to step.
-        if (!isStepping)
-            stopAnimation();
-
-        var increment:Boolean = (event.target == incrementButton);
-
-        // Dispatch changeStart for the first step if we can make a step.
-        if (!isStepping &&
-            ((increment && value < maximum) ||
-                (!increment && value > minimum)))
-        {
-            dispatchEvent(new FlexEvent(FlexEvent.CHANGE_START));
-            isStepping = true;
-            systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP,
-                button_buttonUpHandler, true);
-            systemManager.getSandboxRoot().addEventListener(
-                SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
-        }
-
+		// Make sure we finish any running page animation before starting
+		// to step.
+		if (animatingSinglePage)
+		{
+			animationEndHandler(animator);
+			animator.stop();
+		}
+
         // Noop if we're currently running a stepping animation. We get
         // called repeatedly here due to the button's autoRepeat
         if (!steppingDown && !steppingUp)
         {
+            var increment:Boolean = (event.target == incrementButton);
+
+			if (!isStepping &&
+				((increment && value < maximum) ||
+				 (!increment && value > minimum)))
+			{
+				dispatchEvent(new FlexEvent(FlexEvent.CHANGING));
+				isStepping = true;
+			}
+
             // FIXME (chaase): first step is non-animated, just to simplify the delayed
             // start of the animated stepping. Seems okay, but worth thinking
             // about whether we should animate the first step too
             changeValueByStep(increment);

+			systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP,
+				button_buttonUpHandler, true);
+			systemManager.getSandboxRoot().addEventListener(
+				SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
+
             // Only animate if smoothScrolling enabled and we're not at the end already
             if (getStyle("smoothScrolling") &&
                 ((increment && value < maximum) ||
@@ -850,25 +847,30 @@
     {
         if (steppingDown || steppingUp)
         {
-        	// stopAnimation will not dispatch a changeEnd.
-            stopAnimation();
-
-            dispatchEvent(new FlexEvent(FlexEvent.CHANGE_END));
-
-            steppingUp = steppingDown = false;
-            isStepping = false;
-        }
-        else if (isStepping)
-        {
-            // Dispatch changeEnd event for no animation case
-            dispatchEvent(new FlexEvent(FlexEvent.CHANGE_END));
-            isStepping = false;
-        }
-
-        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP,
-            button_buttonUpHandler, true);
-        systemManager.getSandboxRoot().removeEventListener(
-            SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
+            if (animator.isPlaying)
+            {
+                animationEndHandler(animator);
+            }
+            // stop even if !isPlaying - it might just be startDelayed
+            animator.stop();
+
+			// Dispatch change event after animation is finished or stopped
+			dispatchEvent(new Event(Event.CHANGE));
+
+			steppingUp = steppingDown = false;
+			isStepping = false;
+        }
+		else if (isStepping)
+		{
+			// Dispatch change event for no animation case
+			dispatchEvent(new Event(Event.CHANGE));
+			isStepping = false;
+		}
+
+		systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP,
+			button_buttonUpHandler, true);
+		systemManager.getSandboxRoot().removeEventListener(
+			SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
     }

     //---------------------------------
@@ -892,11 +894,16 @@

         // Make sure we finish any running page animation before starting
         // a new one.
-        stopAnimation();
-
+        if (animatingSinglePage)
+		{
+			animationEndHandler(animator);
+            animator.stop();
+		}
         // Cache original event location for use on later repeating events
         trackPosition = track.globalToLocal(new Point(event.stageX, event.stageY));
-
+
+		dispatchEvent(new FlexEvent(FlexEvent.CHANGING));
+
         // If the user shift-clicks on the track, then offset the event coordinates so
         // that the thumb ends up centered under the mouse.
         if (event.shiftKey)
@@ -920,12 +927,11 @@
                 slideDuration != 0 &&
                 (maximum - minimum) != 0)
             {
-                dispatchEvent(new FlexEvent(FlexEvent.CHANGE_START));
                 // Animate the shift-click operation
                 startAnimation(slideDuration *
                     (Math.abs(value - newScrollValue) / (maximum - minimum)),
                     adjustedValue, deceleratingSineEaser);
-                animatingOnce = true;
+				animatingSinglePage = true;
             }
             else
             {
@@ -934,10 +940,6 @@
             }
             return;
         }
-
-        dispatchEvent(new FlexEvent(FlexEvent.CHANGE_START));
-        // Assume we're repeating unless user releases
-        animatingOnce = false;

         changeValueByPage(trackScrollDown);

@@ -996,7 +998,7 @@
      */
     protected function animatePaging(newValue:Number, pageSize:Number):void
     {
-        animatingOnce = false;
+        animatingSinglePage = false;
         // FIXME (chaase): hard-coding easing behavior, how to style it?
         startAnimation(
             getStyle("repeatInterval") * (Math.abs(newValue - value) / pageSize),
@@ -1045,7 +1047,6 @@
      */
     private function animationUpdateHandler(animation:Animation):void
     {
-        // TODO (klin): Add support to send change events at the right intervals.
         setValue(animation.currentValue["value"]);
     }

@@ -1061,44 +1062,20 @@
         if (trackScrolling)
             trackScrolling = false;

-        // End stepping animation
         if (steppingDown || steppingUp)
         {
             // If we're animating stepping, end on a final real step call in the
             // appropriate direction, ensuring that we stop on a content
             // item boundary
             changeValueByStep(steppingDown);
-
             animator.startDelay = 0;
-            return;
-        }
-
-        // End paging or shift-click animation.
-        setValue(nearestValidValue(this.value, snapInterval));
-        dispatchEvent(new Event(Event.CHANGE));
-
-        // We only dispatch the changeEnd event in the endHandler
-        // for paging when we are not repeating.
-        if (animatingOnce)
-        {
-            dispatchEvent(new FlexEvent(FlexEvent.CHANGE_END));
-            animatingOnce = false;
-        }
-    }
-
-    /**
-     *  @private
-     *  Stops a running animation prematurely and calls the
-     *  animationEndHandler.
-     */
-    private function stopAnimation():void
-    {
-        if (animator.isPlaying)
-            animationEndHandler(animator);
-
-        // Stop it regardless, in case the animation is startDelayed and
-        // thus not 'playing', but still active
-        animator.stop();
+			return;
+        }
+
+		if (animatingSinglePage)
+			dispatchEvent(new Event(Event.CHANGE));
+
+        animatingSinglePage = false;
     }

     /**
@@ -1217,41 +1194,49 @@
         systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE,
             track_mouseUpHandler);

-        // First, we check for smoothScrolling and also if we are
-        // in the non-repeating case.
+		// First, we check for smoothScrolling and also if we are
+		// not in a shift-click case.
         if (getStyle("smoothScrolling"))
         {
-            if (!animatingOnce)
-            {
-                // We check the timer to see if the user released the mouse
-                // before the repeat delay has expired.
-                if (trackScrollTimer && trackScrollTimer.running)
-                {
-                    // If the animation has not yet finished before the repeat delay
-                    // we set animatingOnce to true. Otherwise, the animation
-                    // is done but repeating has not begun so we dispatch a changeEnd
-                    // event.
-                    if (animator.isPlaying)
-                        animatingOnce = true;
-                    else
-                        dispatchEvent(new FlexEvent(FlexEvent.CHANGE_END));
-                }
-                else
-                {
-                    // repeating case
-                    stopAnimation();
-                    dispatchEvent(new FlexEvent(FlexEvent.CHANGE_END));
-                }
-            }
-        }
-        else
-        {
-            // Dispatch changeEnd if there's no animation.
-            dispatchEvent(new FlexEvent(FlexEvent.CHANGE_END));
-        }
-
-        if (trackScrollTimer)
-            trackScrollTimer.reset();
+			if (!animatingSinglePage)
+			{
+				// We check the timer to see if the user released the mouse
+				// before or after the repeat delay has expired. If not,
+				// we are currently repeating and we should end the animation
+				// as well as dispatch a change event.
+				if (trackScrollTimer && trackScrollTimer.running)
+				{
+					// If the animation has not yet finished before the repeat delay
+					// we set animatingSinglePage to true. Otherwise, the animation
+					// is done but repeating has not begun so we dispatch a change
+					// event.
+					if (animator.isPlaying)
+						animatingSinglePage = true;
+					else
+						dispatchEvent(new Event(Event.CHANGE));
+				}
+				else
+				{
+					if (animator.isPlaying)
+					{
+						animationEndHandler(animator);
+					}
+					// Stop it regardless, in case the animation is startDelayed and
+					// thus not 'playing', but still active
+					animator.stop();
+
+					dispatchEvent(new Event(Event.CHANGE));
+				}
+			}
+        }
+		else
+		{
+			// Dispatch change if there's no animation.
+			dispatchEvent(new Event(Event.CHANGE));
+		}
+
+		if (trackScrollTimer)
+			trackScrollTimer.reset();
     }

     /**
@@ -1261,8 +1246,6 @@
      */
     private function track_rollOverHandler(event:MouseEvent):void
     {
-        // TODO (klin): Fix up roll over/roll out handling so that
-        // it works with animation.
         if (trackScrolling && trackScrollTimer)
             trackScrollTimer.start();
     }


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 19447
Author:   mcho@adobe.com
Date:     2010-12-17T02:19:45.123455Z

Log Message:
-----------
Update LabelItemRenderer skin

QE notes:
Doc notes:
Bugs:
Reviewer: Ryan & Jason SJ
Tests run:
Is noteworthy for integration:

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -11,16 +11,18 @@

 package spark.components
 {
+import flash.display.GradientType;
 import flash.events.Event;
+import flash.geom.Matrix;
 import flash.text.TextLineMetrics;

 import mx.controls.listClasses.*;
+import mx.core.DPIClassification;
+import mx.core.FlexGlobals;
 import mx.core.IDataRenderer;
 import mx.core.IFlexDisplayObject;
 import mx.core.ILayoutElement;
-import mx.core.IUIComponent;
 import mx.core.UIComponent;
-import mx.core.UITextField;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;

@@ -285,6 +287,26 @@
     {
         super();

+		switch (applicationDPI)
+		{
+			case DPIClassification.DPI_320:
+			{
+				itemMiniumumHeight = 88;
+				break;
+			}
+			case DPIClassification.DPI_240:
+			{
+				itemMiniumumHeight = 66;
+				break;
+			}
+			default:
+			{
+				// default PPI160
+				itemMiniumumHeight = 44;
+				break;
+			}
+		}
+
         interactionStateDetector = new InteractionStateDetector(this);
         interactionStateDetector.addEventListener(Event.CHANGE, interactionStateDetector_changeHandler);
     }
@@ -316,7 +338,7 @@
      */
     override public function get baselinePosition():Number
     {
-        // Copied from UITextField.baselinePosition
+		// Copied from UITextField.baselinePosition
         var tlm:TextLineMetrics;

         // The text styles aren't known until there is a parent.
@@ -334,9 +356,9 @@
         if (isEmpty)
             labelDisplay.text = "";

-        // TextFields have 2 pixels of padding all around.
+		// TextFields have 2 pixels of padding all around.
         return 2 + tlm.ascent;
-    }
+	}

     //--------------------------------------------------------------------------
     //
@@ -643,6 +665,33 @@
         _dragging = value;
     }

+
+	//----------------------------------
+	//  authorDensity
+	//----------------------------------
+	/**
+	 *  Returns the DPI of the application.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 2.5
+	 *  @productversion Flex 4.5
+	 */
+	public function get applicationDPI():int
+	{
+		return FlexGlobals.topLevelApplication.applicationDPI;
+	}
+
+
+	//--------------------------------------------------------------------------
+	//
+	//  Protected Properties
+	//
+	//--------------------------------------------------------------------------
+	// Enforced minimum height of the item renderer
+	protected var itemMiniumumHeight:uint = 0;
+
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods: UIComponent
@@ -687,15 +736,20 @@
             var verticalPadding:Number = getStyle("paddingTop") + getStyle("paddingBottom");

             // Text respects padding right, left, top, and bottom
-            measuredWidth = getElementPreferredWidth(labelDisplay) + horizontalPadding;
-            measuredHeight = getElementPreferredHeight(labelDisplay) + verticalPadding;
-        }
-
-        // minimum height of 80 pixels
-        measuredHeight = Math.max(measuredHeight, 80);
+			labelDisplay.commitStyles();
+			var metrics:TextLineMetrics = labelDisplay.getLineMetrics(0);
+            measuredWidth = labelDisplay.measuredTextSize.x + horizontalPadding;
+
+			// We need the ascent that doesn't include the "slop"
+			var realAscent:Number = metrics.ascent - 2;
+            measuredHeight = realAscent + verticalPadding;
+		}
+
+        // enforce minimum height
+        measuredHeight = Math.max(measuredHeight, itemMiniumumHeight);

         measuredMinWidth = 0;
-        measuredMinHeight = 80;
+        measuredMinHeight = itemMiniumumHeight;
     }

     /**
@@ -798,21 +852,76 @@
         // the reason why we draw it in the case of drawBackground == 0 is for
         // mouse hit testing purposes
         graphics.beginFill(backgroundColor, drawBackground ? 1 : 0);
-        graphics.lineStyle();
-        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
-        graphics.endFill();
-
-        // FIXME (rfrishbe): separators should be stylable
-        // draw seperators: two lines
-        // 1 pixel from bottom
-        graphics.lineStyle(1, 0x1C1C1C);
-        graphics.moveTo(0, unscaledHeight-1);
-        graphics.lineTo(unscaledWidth, unscaledHeight-1);
-
-        // line on the bottom
-        graphics.lineStyle(1, 0x606060);
-        graphics.moveTo(0, unscaledHeight);
-        graphics.lineTo(unscaledWidth, unscaledHeight);
+		graphics.lineStyle();
+		graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+		graphics.endFill();
+
+		var topSeparatorColor:uint;
+		var topSeparatorAlpha:Number;
+		var bottomSeparatorColor:uint;
+		var bottomSeparatorAlpha:Number;
+
+		// Selected and down states have a gradient overlay as well
+		// as different separators colors/alphas
+		if (selected || down)
+		{
+			var colors:Array = [0x000000, 0x000000 ];
+			var alphas:Array = [.2, 0];
+			var ratios:Array = [0, 255];
+			var matrix:Matrix = new Matrix();
+
+			// gradient overlay
+			matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI / 2, 0, 0 );
+			graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
+			graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+			graphics.endFill();
+
+			// separator props - dark lines on the top and the bottom
+			topSeparatorColor = 0x000000;
+			topSeparatorAlpha = .3;
+			bottomSeparatorColor = 0x000000;
+			bottomSeparatorAlpha = .3;
+		}
+		else
+		{
+			// default look:  separators are a highlight on the top and
+			// shadow on the bottom
+			topSeparatorColor = 0xFFFFFF;
+			topSeparatorAlpha = .25;
+			bottomSeparatorColor = 0x000000;
+			bottomSeparatorAlpha = .2;
+		}
+
+		// draw separators
+		graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
+		graphics.drawRect(0, 0, unscaledWidth, 1);
+		graphics.endFill();
+
+		graphics.beginFill(bottomSeparatorColor, bottomSeparatorAlpha);
+		graphics.drawRect(0, unscaledHeight - 1, unscaledWidth, 1);
+		graphics.endFill();
+
+
+		// add extra separators to the first and last items so that
+		// the list looks correct during the scrolling bounce/pull effect
+		// top
+		if (itemIndex == 0)
+		{
+			graphics.beginFill(bottomSeparatorColor, bottomSeparatorAlpha);
+			graphics.drawRect(0, -1, unscaledWidth, 1);
+			graphics.endFill();
+		}
+
+		// bottom
+		var dataGroup:DataGroup = parent as DataGroup;
+		if (dataGroup && itemIndex == dataGroup.numElements - 1)
+		{
+			graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
+			graphics.drawRect(0, unscaledHeight, unscaledWidth, 1);
+			graphics.endFill();
+		}
+
+
     }

     /**
@@ -849,16 +958,6 @@
         var paddingBottom:Number = getStyle("paddingBottom");
         var verticalAlign:String = getStyle("verticalAlign");

-        var vAlign:Number;
-        if (verticalAlign == "top")
-            vAlign = 0;
-        else if (verticalAlign == "bottom")
-            vAlign = 1;
-        else // if (verticalAlign == "middle")
-            vAlign = 0.5;
-        // made "middle" last even though it's most likely so it is the default and if someone
-        // types "center", then it will still vertically center itself.
-
         var viewWidth:Number  = unscaledWidth  - paddingLeft - paddingRight;
         var viewHeight:Number = unscaledHeight - paddingTop  - paddingBottom;

@@ -872,18 +971,36 @@
             // reset text if it was truncated before.
             if (labelDisplay.isTruncated)
                 labelDisplay.text = label;
-            textHeight = getElementPreferredHeight(labelDisplay);
-        }
-
+
+			textHeight = labelDisplay.measuredTextSize.y;
+        }
+
+		var metrics:TextLineMetrics = labelDisplay.getLineMetrics(0);
+
+		var ascentDelta:Number = textHeight - (metrics.ascent - 2); // We need the ascent that doesn't include the "slop"
+
         // text should take up the rest of the space width-wise, but only let it take up
         // its measured textHeight so we can position it later based on verticalAlign
         var labelWidth:Number = Math.max(viewWidth, 0);
-        var labelHeight:Number = Math.max(Math.min(viewHeight, textHeight), 0);
+        var labelHeight:Number = Math.max(Math.min(viewHeight + ascentDelta, textHeight), 0);
         setElementSize(labelDisplay, labelWidth, labelHeight);
-
-        var labelY:Number = Math.round(vAlign * (viewHeight - labelHeight)) + paddingTop;
-        setElementPosition(labelDisplay, paddingLeft, labelY);
-
+
+		var labelY:Number = 0;
+
+		// Vertical align is calcuated differently for top/bottom/middle. To get as accurate as possible we
+		// want to avoid calculations using the slop.  We only use it when we absolutely need it when
+		// verticalAlign == "top".
+		if (verticalAlign == "top")
+			labelY = paddingTop - (StyleableTextField.TEXT_HEIGHT_PADDING/2 + 3); // accounts for gutter and slop
+		else if (verticalAlign == "bottom")
+			labelY = viewHeight - (metrics.ascent + StyleableTextField.TEXT_HEIGHT_PADDING/2) + paddingTop; //viewHeight - (labelHeight - metrics.descent - metrics.leading) + paddingTop;
+		else // if (verticalAlign == "middle")
+			labelY = Math.round(.5 * (viewHeight - (textHeight - metrics.descent + StyleableTextField.TEXT_HEIGHT_PADDING))) + paddingTop;
+		// made "middle" last even though it's most likely so it is the default and if someone
+		// types "center", then it will still vertically center itself.
+
+		setElementPosition(labelDisplay, paddingLeft, labelY);
+
         // attempt to truncate the text now that we have its official width
         labelDisplay.truncateToFit();
     }


flash: send blink if > 0

flash: send blink if > 0

--- resources/neurosky/FlashToJs/DisplayWindow.as
+++ resources/neurosky/FlashToJs/DisplayWindow.as
@@ -163,7 +163,7 @@
 				ExternalInterface.call("MindWave.setSignalValue",iconLevel);
 				ExternalInterface.call("MindWave.setAttentionLevel",attentionLevel);
 				ExternalInterface.call("MindWave.setMeditationLevel",meditationLevel);
-				ExternalInterface.call("MindWave.setBlinkStrength",blinkStrength);
+				if (blinkStrength > 0) ExternalInterface.call("MindWave.setBlinkStrength",blinkStrength);
 			}
 			else
 			{


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

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

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

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as
+++ frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as
@@ -39,6 +39,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function PriorityQueue()
     {


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

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


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 18322
Author:   dloverin@adobe.com
Date:     2010-10-26T17:25:39.514942Z

Log Message:
-----------
DataGrid item editor fixes.

 * Changed the bounds of the item editor to include the cell separators.
 * Changed the Text editor padding to keep the text from changing position when transitioning from the renderer to the editor.
 * General cleanup in DataGridEditor – creating common functions, removing unused code.
 * Protect grid mouse event handlers from out of range row indexes and column indexes.
 * Made the GridItemEditor.value property bindable.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/DefaultGridItemEditor.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/ComboBoxGridItemEditor.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
@@ -11,6 +11,7 @@

 package spark.components.gridClasses
 {
+import flash.events.Event;
 import flash.events.MouseEvent;
 import flash.utils.describeType;

@@ -134,30 +135,6 @@
     public function get dataGrid():DataGrid
     {
         return DataGrid(owner);
-    }
-
-    //----------------------------------
-    //  editorUsesEnterKey
-    //----------------------------------
-
-    private var _editorUsesEnterKey:Boolean = false;
-
-    [Inspectable(category="General", defaultValue="false")]
-
-    /**
-     *  @inheritdoc
-     */
-    public function get editorUsesEnterKey():Boolean
-    {
-        return _editorUsesEnterKey;
-    }
-
-    /**
-     *  @private
-     */
-    public function set editorUsesEnterKey(value:Boolean):void
-    {
-        _editorUsesEnterKey = value;
     }

     //----------------------------------
@@ -281,6 +258,10 @@
     //  value
     //----------------------------------

+    private var _value:Object;
+
+    [Bindable("valueChanged")]
+
     /**
      *  Many custom GridItemEditor subclasses will only need to override the
      *  get and set methods for this property.   Override the set method to
@@ -296,7 +277,7 @@
      */
     public function get value():Object
     {
-        return null;
+        return _value;
     }

     /**
@@ -304,6 +285,15 @@
      */
     public function set value(newValue:Object):void
     {
+        if (newValue != value)
+        {
+            _value = newValue
+
+            if (hasEventListener("valueChanged"))
+            {
+                dispatchEvent(new Event("valueChanged"));
+            }
+        }
     }

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


adding explanation

adding explanation

--- actionscript/src/com/freshplanet/ane/AirPushNotification/PushNotification.as
+++ actionscript/src/com/freshplanet/ane/AirPushNotification/PushNotification.as
@@ -147,7 +147,7 @@
          * @param iconPath
          * @param groupId  used to group notifications together
          * @param categoryId  used to display custom summaries on iOS
-         * @param makeSquare  used to display square icons on Android, will default to round
+         * @param makeSquare  used to display square icons on Android, will default to round
 		 */
 		public function sendLocalNotification(message:String,
                                               timestamp:int,


Fixed Taking photos demo for iOS

Fixed Taking photos demo for iOS

--- src/CaptureTakingPhotos.as
+++ src/CaptureTakingPhotos.as
@@ -163,8 +163,24 @@
             try
             {
                 // u can change desired photo quality
-                capture = new CaptureDevice(dev.name, streamW, streamH, streamFPS,
+                if (Capabilities.manufacturer.toLowerCase().indexOf('android') != -1)
+                {
+                    capture = new CaptureDevice(dev.name, streamW, streamH, streamFPS,
                                                 CaptureDevice.ANDROID_STILL_IMAGE_QUALITY_BEST);
+                }
+                else
+                {
+                    // i assume we are on iOS
+                    // here things are more complicated:
+                    // iOS doesnt allow to set photo quility in separate from preview camera stream
+                    // so to get the optimal setup for iOS photo shooting we do a trick
+                    // internally i setup that if u request ZERO width frame it will setup preview
+                    // to photo quality and it is the best quality available
+                    // and the problem is that preview video stream also runs at maximum available size
+                    // on new iPad it is !!! 2048x1536 !!! i would not recommend to render that
+                    // but as long as we use clipRect we can work it out by clipping input data
+                    capture = new CaptureDevice(dev.name, 0, streamH, streamFPS);
+                }

                 // result camera dimension may be different from requested
                 streamW = capture.width;


Reduced arrow helper time to 1.6s from 2.4s

--- src/Helpers/ArrowHelper.as
+++ src/Helpers/ArrowHelper.as
@@ -45,7 +45,7 @@
 		}

 		protected static const BUFFER:int = 4;
-		protected static const PRESS_LIMIT:Number = 2.4; //seconds
+		protected static const PRESS_LIMIT:Number = 1.6; //seconds
 	}

 }


- Added setFocuable().
- createField calls it.

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

--- src/as/com/threerings/flash/TextFieldUtil.as
+++ src/as/com/threerings/flash/TextFieldUtil.as
@@ -91,6 +91,9 @@

     /**
      * Create a TextField.
+     * The field will have setFocusable() called on it.
+     * Note that if the autoSize property is not none, then the field will be resized
+     * to the size of the text, overwriting any width/height properties specified.
      *
      * @param initProps contains properties with which to initialize the TextField.
      * Additionally it may contain the following properties:
@@ -112,6 +115,7 @@
             tf.defaultTextFormat = createFormat(formatProps);
         }
         updateText(tf, text);
+        setFocusable(tf);

         return tf;
     }
@@ -150,6 +154,15 @@
             field.width = field.textWidth + WIDTH_PAD;
             field.height = field.textHeight + HEIGHT_PAD;
         }
+    }
+
+    /**
+     * Add a special MouseEvent.CLICK listener so that the specified field is focusable
+     * even inside a security boundary.
+     */
+    public static function setFocusable (field :TextField) :void
+    {
+        field.addEventListener(MouseEvent.CLICK, handleFieldFocus);
     }

     /**
@@ -208,6 +221,28 @@
         _lastSelected = null;
     }

+    /**
+     * Handle focusing the text field.
+     */
+    protected static function handleFieldFocus (event :MouseEvent) :void
+    {
+        var tf :TextField = TextField(event.currentTarget);
+        if (tf.stage.focus == tf) {
+            return; // already has focus, bail.
+        }
+
+        // else, assign focus
+        tf.stage.focus = tf;
+
+        // try to be smart and move the cursor near the click
+        if (tf.selectable) {
+            var idx :int = tf.getCharIndexAtPoint(event.localX, event.localY);
+            if (idx != -1) {
+                tf.setSelection(idx, idx);
+            }
+        }
+    }
+
     /** The last tracked TextField to be selected. */
     protected static var _lastSelected :TextField;


Second apply parameter must be an array.

--- src/org/puremvc/as3/multicore/utilities/pipes/plumbing/PipeListener.as
+++ src/org/puremvc/as3/multicore/utilities/pipes/plumbing/PipeListener.as
@@ -31,7 +31,7 @@
 		// Write the message to the listener
 		public function write(message:IPipeMessage):Boolean
 		{
-			listener.apply(context,message);
+			listener.apply(context,[message]);
 			return true;
 		}
 	}


This was a test

This was a test

--- src/Modi/ManagedObject.as
+++ src/Modi/ManagedObject.as
@@ -22,6 +22,8 @@
 		private var _registeredAttributes:Array;
 		private var _attributeObservers:Array;

+		private var test:int;
+
 		public function ManagedObject()
 		{
 			_attributeObservers = new Array();


Transferred from the Adobe Open Source Subversion Repository

Revision: 12886
Author:   jszeto@adobe.com
Date:     2009-12-13T01:35:34.061540Z

Log Message:
-----------
SpriteVisualElement globalToLocal bug fix

SDK-24477 - resized SpriteVisualElement returns the incorrect point when calling globalToLocal

Updated GroupBase and SpriteVisualElement to ignore stretchX and stretchY when calculating globalToLocal and localToGlobal

QE notes: Add tests for globalToLocal and localToGlobal
Doc notes: none
Bugs: SDK-24477
Reviewer: Evtim
Tests run: checkintests, primitives, Group
Is noteworthy for integration: Yes. Fixes TH-8488

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -1927,7 +1927,7 @@
      *
      * storage for advanced layout and transform properties.
      */
-    private var _layoutFeatures:AdvancedLayoutFeatures;
+    mx_internal var _layoutFeatures:AdvancedLayoutFeatures;

     /**
      * @private
@@ -6859,6 +6859,7 @@
         return child;
     }

+
     /**
      *  @private
      */