Transferred from the Adobe Open Source Subversion Repository

Revision: 4958
Author:   rfrishbe@adobe.com
Date:     2009-02-13T23:07:46.243121Z

Log Message:
-----------
Change the initialization sequence of FxComponent and Group.  Basically now children (including the skin) should get created at createChildren() time and follow the correct lifecycle pattern.  Unfortunately, this change got mingled in with all my PARB changes, so I'm submitting a bunch of PARB changes for Group, DataGroup, FxContainer, and FxDataContainer, outlined below:

1.     New event classes/names for Group/FxContainer and DataGroup ("elementAdd" and "elementRemove" event of type ElementExistenceEvent for Group/FxContainer and "rendererAdd" and "rendererRemove" event of type RendererExistenceEvent for DataGroup). It was just one event class of ItemExistenceChangedEvent before.
2.     LayoutBase.clipContent->clipAndEnableScrolling (same with IViewport.clipContent and GroupBase.clipContent)
3.     GroupBase.getLayoutELementAt()->getElementAt()
4.     GroupBase.numLayoutElements -> numElements.
5.     LayoutBase.virtualLayout -> useVirtualLayout
6.     ScrollUnit constants are now changed to be uints instead of typed as ScrollUnit.  This means the signature for getHorizontalScrollPositionDelta(unit:ScrollUnit):Number has changed to getHorizontalScrollPositionDelta(scrollUnit:uint):Number (and ditto for getVerticalScrollPositionDelta())
7.  DataGroup.getRendererForItemAt() -> getElementAt()
8.  DataGroup.getItemIndexForRenderer() -> getElementIndex()

Other changes:
 - Change IVisualElement interface so that it's smaller now.  It also extends ILayoutElement now.  The properties removed from IVisualElement are: rotation, rotationX, rotationY, rotationZ, transformX, transformY, offsets, x, y, z, scaleX, scaleY, scaleZ, explicitWidth, explicitMinWidth, explicitMaxWidth, explicitHeight, explicitMinHeight, explicitMaxHeight)
-  Fix in DataGroup so we don’t remove/add elements if we’re gonna do it later anyways.  I also need to do some other work in here around cleaning up of renderers.
- AddItems fix around handling IVisualElementContainers more effeciently
- get mxmlContent now returns a copy of the Array rather than the one we're using internally
- Had to update mustella since there was special case logic for dealing with getLayoutElementAt().  I added this logic for getElementAt(), which replaces that method.

QE Notes: Thanks for changing all the tests and working on the cyclone
Doc Notes: Made some ASDoc changes to some core classes to move the comments into the interfaces.  I did update the comments a bit as well.
Bugs: SDK-18115, SDK-19004
Reviewer: Jason, Glenn, Hans for initialization sequence change and Hans for all PARB changes
tests: checkintests, all mustella tests

Modified Paths:
--------------
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/ItemExistenceChangedEvent.as" copyfrom-rev="4812" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/ElementExistenceEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/layouts/WheelLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/RendererExistenceEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/ItemExistenceChangedEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/ScrollUnit.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxVScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/states/AddItems.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/mustella/mustella.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
@@ -86,10 +86,10 @@
     }

     //----------------------------------
-    //  virtualLayout
-    //----------------------------------
-
-    private var _virtualLayout:Boolean = false;
+    //  useVirtualLayout
+    //----------------------------------
+
+    private var _useVirtualLayout:Boolean = false;

     [Inspectable(defaultValue="false")]

@@ -97,29 +97,23 @@
      *  If true, subclasses will be advised that when scrolling it's
      *  preferable to lazily create layout elements as they come into view,
      *  and to discard or recycle layout elements that are no longer in view.
-     *
-     *  If true, the layout class will call the target's GroupBase methods
-     *  beginVirtualLayout and endVirtualLayout when the visible part of
-     *  the layout is updated.
      *
      *  @default false
-     *  @see GroupBase::beginVirtualLayout
-     *  @see GroupBase::endVirtualLayout
-     */
-    public function get virtualLayout():Boolean
-    {
-        return _virtualLayout;
+     */
+    public function get useVirtualLayout():Boolean
+    {
+        return _useVirtualLayout;
     }

     /**
      *  @private
      */
-    public function set virtualLayout(value:Boolean):void
-    {
-        if (_virtualLayout == value)
+    public function set useVirtualLayout(value:Boolean):void
+    {
+        if (_useVirtualLayout == value)
             return;

-        _virtualLayout = value;
+        _useVirtualLayout = value;
         if (target)
             target.invalidateDisplayList();
     }
@@ -183,30 +177,30 @@
     }

     //----------------------------------
-    //  clipContent
+    //  clipAndEnableScrolling
     //----------------------------------

-    private var _clipContent:Boolean = false;
+    private var _clipAndEnableScrolling:Boolean = false;

     [Inspectable(category="General")]

     /**
-     *  @copy flex.intf.IViewport#clipContent
-     */
-    public function get clipContent():Boolean
-    {
-        return _clipContent;
+     *  @copy flex.intf.IViewport#clipAndEnableScrolling
+     */
+    public function get clipAndEnableScrolling():Boolean
+    {
+        return _clipAndEnableScrolling;
     }

     /**
      *  @private
      */
-    public function set clipContent(value:Boolean):void
-    {
-        if (value == _clipContent)
+    public function set clipAndEnableScrolling(value:Boolean):void
+    {
+        if (value == _clipAndEnableScrolling)
             return;

-        _clipContent = value;
+        _clipAndEnableScrolling = value;
         var g:GroupBase = target;
         if (g)
             updateScrollRect(g.width, g.height);
@@ -222,7 +216,7 @@
      *  Used by layouts when fixed row/column sizes are requested but
      *  a specific size isn't specified.
      *
-     *  Used by virtualLayouts to estimate the size of layout elements
+     *  Used by virtual layouts to estimate the size of layout elements
      *  that have not been scrolled into view.
      *
      *  If this property has not been set and the target is non-null
@@ -236,8 +230,8 @@
      */
     public function get typicalLayoutElement():ILayoutElement
     {
-        if (!_typicalLayoutElement && target && (target.numLayoutElements > 0))
-            _typicalLayoutElement = target.getLayoutElementAt(0);
+        if (!_typicalLayoutElement && target && (target.numElements > 0))
+            _typicalLayoutElement = target.getElementAt(0);
         return _typicalLayoutElement;
     }

@@ -275,12 +269,12 @@
      *  Layout methods should not get the target's scrollRect directly.
      *
      *  @return The bounds of the target's scrollRect in layout coordinates, null
-     *      if target or clipContent is false.
+     *      if target or clipAndEnableScrolling is false.
      */
     protected function getTargetScrollRect():Rectangle
     {
         var g:GroupBase = target;
-        if (!g || !g.clipContent)
+        if (!g || !g.clipAndEnableScrolling)
             return null;
         var vsp:Number = g.verticalScrollPosition;
         var hsp:Number = g.horizontalScrollPosition;
@@ -469,7 +463,7 @@
      *  @see #elementBoundsRightOfScrollRect
      *  @see #getHorizontalScrollPositionDelta
      */
-    public function getHorizontalScrollPositionDelta(unit:ScrollUnit):Number
+    public function getHorizontalScrollPositionDelta(scrollUnit:uint):Number
     {
         var g:GroupBase = target;
         if (!g)
@@ -489,7 +483,7 @@
         var maxDelta:Number = g.contentWidth - scrollRect.right;
         var minDelta:Number = -scrollRect.left;
         var elementBounds:Rectangle;
-        switch(unit)
+        switch(scrollUnit)
         {
             case ScrollUnit.LEFT:
             case ScrollUnit.PAGE_LEFT:
@@ -519,7 +513,7 @@
             return 0;

         var delta:Number = 0;
-        switch (unit)
+        switch (scrollUnit)
         {
             case ScrollUnit.LEFT:
                 // Snap the left edge of element to the left edge of the scrollRect.
@@ -621,7 +615,7 @@
      *  @see #elementBoundsBelowScrollRect
      *  @see #getVerticalScrollPositionDelta
      */
-    public function getVerticalScrollPositionDelta(unit:ScrollUnit):Number
+    public function getVerticalScrollPositionDelta(scrollUnit:uint):Number
     {
         var g:GroupBase = target;
         if (!g)
@@ -641,7 +635,7 @@
         var maxDelta:Number = g.contentHeight - scrollRect.bottom;
         var minDelta:Number = -scrollRect.top;
         var elementBounds:Rectangle;
-        switch(unit)
+        switch(scrollUnit)
         {
             case ScrollUnit.UP:
             case ScrollUnit.PAGE_UP:
@@ -671,7 +665,7 @@
             return 0;

         var delta:Number = 0;
-        switch (unit)
+        switch (scrollUnit)
         {
             case ScrollUnit.UP:
                 // Snap the top edge of element to the top edge of the scrollRect.
@@ -719,7 +713,7 @@
      *  vertical and horizontalScrollPosition deltas needed to
      *  scroll the element at the specified index into view.
      *
-     *  If clipContent is true and the element at the specified index is not
+     *  If clipAndEnableScrolling is true and the element at the specified index is not
      *  entirely visible relative to the target's scrollRect, then
      *  return the delta to be added to horizontalScrollPosition and
      *  verticalScrollPosition that will scroll the element completely
@@ -743,7 +737,7 @@
      *      and verticalScrollPosition that will scroll the specified
      *      element into view, or null if no change is needed.
      *
-     *  @see clipContent
+     *  @see clipAndEnableScrolling
      *  @see verticalScrollPosition
      *  @see horizontalScrollPosition
      *  @see udpdateScrollRect
@@ -751,14 +745,14 @@
      public function getScrollPositionDelta(index:int):Point
      {
         var g:GroupBase = target;
-        if (!g || !clipContent)
+        if (!g || !clipAndEnableScrolling)
             return null;

-         var n:int = g.numLayoutElements;
+         var n:int = g.numElements;
          if ((index < 0) || (index >= n))
             return null;

-         var element:ILayoutElement = g.getLayoutElementAt(index);
+         var element:ILayoutElement = g.getElementAt(index);
          if (!element || !element.includeInLayout)
             return null;

@@ -822,11 +816,11 @@
     }

     /**
-     *  If clipContent is true, sets the origin of the scrollRect to
+     *  If clipAndEnableScrolling is true, sets the origin of the scrollRect to
      *  verticalScrollPosition,horizontalScrollPosition and its width
      *  width,height to w,h (the target's unscaled width,height).
      *
-     *  If clipContent is false, sets the scrollRect to null.
+     *  If clipAndEnableScrolling is false, sets the scrollRect to null.
      *
      *  @param w The target's unscaled width.
      *  @param h The target's unscaled height.
@@ -841,7 +835,7 @@
         if (!g)
             return;

-        if (clipContent)
+        if (clipAndEnableScrolling)
         {
             var hsp:Number = horizontalScrollPosition;
             var vsp:Number = verticalScrollPosition;


Loader3D loading methods now return the Loader3D object itself and allow multiple content loading with a single instance

--- src/aerys/minko/scene/node/Loader3D.as
+++ src/aerys/minko/scene/node/Loader3D.as
@@ -17,6 +17,7 @@
 	import flash.events.Event;
 	import flash.events.EventDispatcher;
 	import flash.events.IEventDispatcher;
+	import flash.globalization.LastOperationStatus;
 	import flash.net.URLLoader;
 	import flash.net.URLLoaderDataFormat;
 	import flash.net.URLRequest;
@@ -49,13 +50,13 @@
 		private static const FORMATS	: RegExp	= /^.*\.(swf|jpg|png)$/s
 		private static const PARSERS	: Object	= new Object();

-//		private var _content			: Group			= new Group();
 		private var _loaderToURI		: Dictionary		= new Dictionary(true);
+		private var _loaderToPosition	: Dictionary		= new Dictionary(true);
+
 		private var _dispatcher			: EventDispatcher	= null;

-//		public function get name()	 	: String			{ return _content.name; }
-//		public function get content() 	: Group				{ return _content; }
-//		public function get actions()	: Vector.<IAction>	{ return _content.actions; }
+		private var _total				: uint				= 0;
+		private var _loaded				: uint				= 0;

 		public static function registerParser(extension : String,
 											  parser 	: IParser3D) : void
@@ -70,11 +71,20 @@
 			_dispatcher = new EventDispatcher(this);
 		}

-		public function load(request : URLRequest) : Group
+		/**
+		 * Load the content corresponding to the specified URLRequest object.
+		 *
+		 * @param request
+		 * @return The Loader3D object itself.
+		 *
+		 */
+		public function load(request : URLRequest) : Loader3D
 		{
 			if (request.url.match(FORMATS))
 			{
 				var loader : Loader = new Loader();
+
+				_loaderToPosition[loader] = numChildren;

 				loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
 														  loaderCompleteHandler);
@@ -91,18 +101,19 @@
 					throw new Error("No data parser registered for extension '" + extension + "'");

 				_loaderToURI[urlLoader] = request.url;
+				_loaderToPosition[loader] = numChildren;

 				urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
 				urlLoader.addEventListener(Event.COMPLETE, urlLoaderCompleteHandler);
 				urlLoader.load(request);
 			}

-//			return _content;
+			++_total;

 			return this;
 		}

-		public function loadBytes(bytes : ByteArray) : Group
+		public function loadBytes(bytes : ByteArray) : Loader3D
 		{
 			for (var extension : String in PARSERS)
 			{
@@ -114,12 +125,11 @@
 				{
 					var data	: Vector.<IScene>	= parser.data;
 					var length	: int				= data ? data.length : 0;
-					var content : Group				= new Group();

 					for (var i : int = 0; i < length; ++i)
-						content.addChild(data[i]);
-
-					return content;
+						addChild(data[i]);
+
+					return this;
 				}
 			}

@@ -128,14 +138,14 @@
 			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
 			loader.loadBytes(bytes);

-//			return _content;
-
 			return this;
 		}

-		public static function loadBytes(bytes : ByteArray) : Group
-		{
-			for (var extension : String in PARSERS)
+		public static function loadBytes(bytes : ByteArray) : Loader3D
+		{
+			return new Loader3D().loadBytes(bytes);
+
+/*			for (var extension : String in PARSERS)
 			{
 				var parser : IParser3D = PARSERS[extension];

@@ -145,19 +155,18 @@
 				{
 					var data	: Vector.<IScene>	= parser.data;
 					var length	: int				= data ? data.length : 0;
-					var content : Group				= new Group();

 					for (var i : int = 0; i < length; ++i)
-						content.addChild(data[i]);
-
-					return content;
-				}
-			}
-
-			var loader 		 : Loader 	= new Loader();
-			var textureGroup : IGroup 	= new Group();
-
-			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e : Event) : void
+						loader.addChild(data[i]);
+
+					return loader;
+				}
+			}
+
+			var contentLoader 	: Loader 	= new Loader();
+			var textureGroup 	: IGroup 	= new Group();
+
+			contentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e : Event) : void
 			{
 				var info 	: LoaderInfo 	= e.target as LoaderInfo;
 				var texture	: ITexture 		= null;
@@ -167,12 +176,14 @@
 				else if (info.content is Bitmap)
 					textureGroup.addChild(texture = new BitmapTexture((info.content as Bitmap).bitmapData));
 			});
-			loader.loadBytes(bytes);
-
-			return new Group(textureGroup);
-		}
-
-		public static function loadAsset(asset : Class) : Group
+			contentLoader.loadBytes(bytes);
+
+			loader.addChild(textureGroup)
+
+			return loader;*/
+		}
+
+		public static function loadAsset(asset : Class) : Loader3D
 		{
 			var assetObject : Object 	= new asset();

@@ -214,6 +225,7 @@
 		{
 			var loader 		: URLLoader			= event.target as URLLoader;
 			var uri			: String			= _loaderToURI[loader];
+			var offset		: uint				= _loaderToPosition[loader];
 			var extension	: String			= uri.substr(uri.lastIndexOf(".") + 1);
 			var parser		: IParser3D			= PARSERS[extension.toLocaleLowerCase()];
 			var data		: Vector.<IScene>	= parser.parse(loader.data as ByteArray)
@@ -221,12 +233,13 @@
 												  : null;
 			var length		: int				= data ? data.length : 0;

-			//_content.removeAllChildren();
 			for (var i : int = 0; i < length; ++i)
-//				_content.addChild(data[i]);
-				addChild(data[i]);
-
-			dispatchEvent(new Event(Event.COMPLETE));
+				addChildAt(data[i], offset + i);
+
+			++_loaded;
+
+			if (_loaded == _total)
+				dispatchEvent(new Event(Event.COMPLETE));
 		}

 		private function loaderCompleteHandler(event : Event) : void
@@ -239,12 +252,12 @@
 			else if (info.content is Bitmap)
 				texture = new BitmapTexture((info.content as Bitmap).bitmapData);

-//			_content.removeAllChildren();
-//			_content.addChild(texture);
-
-			addChild(texture);
-
-			dispatchEvent(new Event(Event.COMPLETE));
+			addChildAt(texture, _loaderToPosition[info.loader]);
+
+			++_loaded;
+
+			if (_loaded == _total)
+				dispatchEvent(new Event(Event.COMPLETE));
 		}

 		public function addEventListener(type 				: String,


Add onBWDone handler to remove errors. See http://stackoverflow.com/questions/2296822/flash-as3-streaming-player-onbwdone

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -110,6 +110,7 @@
 			addChild(_video);

 			_connection = new NetConnection();
+			_connection.client = { onBWDone: function():void{} };
 			_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
 			_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
 			//_connection.connect(null);


Fix merge conflict

Fix merge conflict

--- src/ageofai/home/view/HomeMediator.as
+++ src/ageofai/home/view/HomeMediator.as
@@ -3,57 +3,6 @@
  */
 package ageofai.home.view
 {
-<<<<<<< HEAD
-    import ageofai.home.event.HomeEvent;
-    import ageofai.home.view.event.HomeViewEvent;
-
-    import common.mvc.view.base.ABaseMediator;
-
-    public class HomeMediator extends ABaseMediator
-    {
-        [Inject]
-        public var view:HomeView;
-
-        override public function initialize():void
-        {
-            this.addContextListener( HomeEvent.REQUEST_TO_CREATE_VILLAGER, this.villagerCredatedEventHandler );
-            this.addContextListener( HomeEvent.VILLAGER_CREATION_IN_PROGRESS, this.villagerCreatingInProgressEventHandler );
-            this.addContextListener( HomeEvent.FOOD_AMOUNT_UPDATED, this.foodAmountUpdatedHandler );
-            this.addContextListener( HomeEvent.WOOD_AMOUNT_UPDATED, this.woodAmountUpdatedHandler );
-
-            this.addViewListener( HomeViewEvent.VILLAGER_VIEW_CREATED, this.villageViewCreatedHandler );
-        }
-
-        private function villageViewCreatedHandler( e:HomeViewEvent ):void
-        {
-            var homeEvent:HomeEvent = new HomeEvent( HomeEvent.VILLAGER_VIEW_CREATED );
-            homeEvent.villagerView = e.villagerView;
-            homeEvent.homeVO = e.homeVO;
-
-            this.dispatch( homeEvent );
-        }
-
-        private function villagerCredatedEventHandler( e:HomeEvent ):void
-        {
-            this.view.createVillagerView( e.homeVO );
-        }
-
-        private function villagerCreatingInProgressEventHandler( e:HomeEvent ):void
-        {
-            this.view.showProgressValue( e.progressPercentage / 100 );
-        }
-
-        private function foodAmountUpdatedHandler( event:HomeEvent ):void
-        {
-            this.view.updateFoodAmount( event.homeVO.food );
-        }
-
-        private function woodAmountUpdatedHandler( event:HomeEvent ):void
-        {
-            this.view.updateWoodAmount( event.homeVO.wood );
-        }
-    }
-=======
 	import ageofai.home.event.HomeEvent;
 	import ageofai.home.view.event.HomeViewEvent;
 	import ageofai.home.vo.HomeVO;
@@ -100,15 +49,18 @@
 			this.view.showProgressValue( e.progressPercentage / 100 );
 		}

-		private function foodAmountUpdatedHandler( home:HomeVO ):void
-		{
-			this.view.updateFoodAmount( home.food );
-		}
+        private function foodAmountUpdatedHandler( event:HomeEvent ):void
+        {
+            if (event.homeVO.id != this.view.id) return;
+
+            this.view.updateFoodAmount( event.homeVO.food );
+        }

-		private function woodAmountUpdatedHandler( home:HomeVO ):void
-		{
-			this.view.updateWoodAmount( home.wood );
-		}
-	}
->>>>>>> origin/master
+        private function woodAmountUpdatedHandler( event:HomeEvent ):void
+        {
+            if (event.homeVO.id != this.view.id) return;
+
+            this.view.updateWoodAmount( event.homeVO.wood );
+        }
+    }
 }


Added more helpful error message to assertThrows

--- as3/src/asunit/framework/Assert.as
+++ as3/src/asunit/framework/Assert.as
@@ -1,5 +1,7 @@
 package asunit.framework {
     import asunit.errors.AssertionFailedError;
+
+    import flash.utils.getQualifiedClassName;

     import flash.errors.IllegalOperationError;
     import flash.events.EventDispatcher;
@@ -100,7 +102,7 @@
             }
             catch(e:Error) {
                 if(!(e is errorType)) {
-                    fail("assertThrows did not throw the expected error type.");
+                    fail("assertThrows did not throw the expected error type, instead threw: " + getQualifiedClassName(e));
                 }
             }
         }


#derp

#derp

--- HUDsrc/TrollsAndElves.as
+++ HUDsrc/TrollsAndElves.as
@@ -62,8 +62,8 @@

 			LumberOverlay
 			lumberOverlay = new LumberOverlay();
-			//addChild(lumberOverlay);
-			//lumberOverlay.visible = true;
+			addChild(lumberOverlay);
+			lumberOverlay.visible = true;
 			lumberOverlay.setLumber("9876"); //TEMP just to test if it looks nice
 			//Resizing is blitz
 			Globals.instance.resizeManager.AddListener(this);


update readme

update readme

--- testSrc/TestStream.as
+++ testSrc/TestStream.as
@@ -319,8 +319,6 @@
             assertEquals(names[0], "first");
             assertEquals(names[1], "second");
             assertEquals(names[2], "third");
-
-            var test:Stream = items.value(or(eq(4), eq(0)));
         }

         [Test]


Convinient methods for (de)serialization.

--- src/Modi/ManagedObject.as
+++ src/Modi/ManagedObject.as
@@ -387,5 +387,25 @@

         public function get requiresInitialization():Boolean { return _requiresInitialization; }
         public function set requiresInitialization(value:Boolean):void { _requiresInitialization = value; }
+
+        public static function deserializeObject(data:*, Type:Class, Deserializator:Class):*
+        {
+            var object:ManagedObject = new Type;
+            var deserializator:IDeserializator = new Deserializator();
+
+            deserializator.deserializeData(data);
+            object.deserialize(deserializator);
+
+            return object;
+        }
+
+        public static function serializeObject(object:ManagedObject, Serializator:Class):*
+        {
+            var serializator:ISerializator = new Serializator();
+
+            object.serialize(serializator);
+
+            return serializator.serializeData();
+        }
     }
 }


* Added onRegister and onRemove to IMediator and Mediator.   * View now calls IMediator.onRegister when registration of an IMediator is complete   * View now calls IMediator.onRemove when removal of an IMediator is complete

--- org/puremvc/as3/interfaces/IMediator.as
+++ org/puremvc/as3/interfaces/IMediator.as
@@ -13,7 +13,8 @@
 	 *

 	 *
Implement a common method which returns a list of all INotifications
 	 * the IMediator has interest in.

-	 *
Implement a common notification (callback) method.

+	 *
Implement a notification callback method.

+	 *
Implement methods that are called when the IMediator is registered or removed from the View.

 	 *

 	 *

 	 * Additionally, IMediators typically:
@@ -60,12 +61,12 @@
 	 * 			combo.addEventListener( Event.CHANGE, onChange );
 	 * 		}
 	 *
-	 * 		public function listNotificationInterests():Array {
+	 * 		override public function listNotificationInterests():Array {
 	 * 				return [ MyFacade.SET_SELECTION,
 	 * 						 MyFacade.SET_DATAPROVIDER ];
 	 * 		}
 	 *
-	 * 		public function handleNotification( notification:INotification ):void {
+	 * 		override public function handleNotification( notification:INotification ):void {
 	 * 				switch ( notification.getName() ) {
 	 * 					case MyFacade.SET_SELECTION:
 	 * 						setSelection(notification);
@@ -77,18 +78,18 @@
 	 * 		}
 	 *
 	 * 		// Set the data provider of the combo box
-	 * 		private function setDataProvider( notification:INotification ):void {
+	 * 		protected function setDataProvider( notification:INotification ):void {
 	 * 			combo.dataProvider = notification.getBody() as Array;
 	 * 		}
 	 *
 	 * 		// Invoked when the combo box dispatches a change event, we send a
 	 *      // notification with the
-	 * 		private function onChange(event:ListEvent):void {
+	 * 		protected function onChange(event:ListEvent):void {
 	 * 			sendNotification( MyFacade.MYCOMBO_CHANGED, this );
 	 * 		}
 	 *
 	 * 		// A private getter for accessing the view object by class
-	 *      private function get combo():ComboBox  {
+	 *      protected function get combo():ComboBox  {
 	 *         return view as ComboBox;
 	 *      }
 	 *


Transferred from the Adobe Open Source Subversion Repository

Revision: 5098
Author:   gauravj@adobe.com
Date:     2009-02-27T02:21:27.489350Z

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:
--------------
151 paths were modified

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -38,6 +38,11 @@
  *  due to a user interaction.
  *
  *  @eventType mx.events.FlexEvent.SELECTION_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Event(name="selectionChange", type="mx.events.FlexEvent")]

@@ -47,6 +52,11 @@
  *  to prevent the operation from being processed.
  *
  *  @eventType mx.events.TextOperationEvent.CHANGING
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Event(name="changing", type="mx.events.TextOperationEvent")]

@@ -54,6 +64,11 @@
  *  Dispatched after a user editing operation is complete.
  *
  *  @eventType mx.events.TextOperationEvent.CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Event(name="change", type="mx.events.TextOperationEvent")]

@@ -63,17 +78,32 @@

 /**
  *  @copy mx.components.baseClasses.GroupBase#contentBackgroundColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="contentBackgroundColor", type="uint", format="Color", inherit="yes")]

 /**
  *  @copy mx.components.baseClasses.GroupBase#focusColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="focusColor", type="uint", format="Color", inherit="yes")]

 /**
  *  Documentation is not currently available.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public class FxTextBase extends FxComponent implements IFocusManagerComponent
 {
@@ -87,6 +117,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function FxTextBase()
     {
@@ -181,6 +216,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get displayAsPassword():Boolean
     {
@@ -219,6 +259,11 @@
      *  Specifies whether the user is allowed to edit the text in this control.
      *
      *  @default true;
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get editable():Boolean
     {
@@ -266,6 +311,11 @@
      *  @default null
      *
      *  @see flash.system.IMEConversionMode
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
      public function get imeMode():String
     {
@@ -309,6 +359,11 @@
      *  a user can enter an unlimited amount of text.
      *
      *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get maxChars():int
     {
@@ -347,6 +402,11 @@
      *  Documentation is not currently available.
      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get restrict():String
     {
@@ -386,6 +446,11 @@
      *  Making the text selectable lets you copy text from the control.
      *
      *  @default true;
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectable():Boolean
     {
@@ -425,6 +490,11 @@
      *  or the end of the selection.
      *
      *  @default -1
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectionActivePosition():int
     {
@@ -450,6 +520,11 @@
      *  or the end of the selection.
      *
      *  @default -1
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectionAnchorPosition():int
     {
@@ -475,6 +550,11 @@
      *  Documentation is not currently available.
      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get selectionVisibility():String
     {
@@ -517,6 +597,11 @@

     /**
      *  The text String displayed by this component.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get text():String
     {
@@ -548,6 +633,11 @@
     /**
      *  The TextView that must be present
      *  in any skin assigned to this component.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var textView:TextView;

@@ -733,6 +823,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function setSelection(anchorIndex:int = 0,
                                  activeIndex:int = int.MAX_VALUE):void
@@ -745,6 +840,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function insertText(text:String):void
     {
@@ -760,6 +860,11 @@

     /**
      *  Documentation is not currently available.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function appendText(text:String):void
     {
@@ -827,6 +932,11 @@
     /**
      *  Called when the TextView dispatches a 'change' event
      *  after an editing operation.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     protected function textView_changeHandler(event:TextOperationEvent):void
     {


- bugfix: ApplicationContext always used its own loaderInfo to gather applicationParameters. In almost all cases, this is wrong as soon as the application is loaded into another SWF. This fix uses the Stage's loaderInfo and afterwards merges any parameters defined for the application's own SWF.

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

--- src/reprise/core/ApplicationContext.as
+++ src/reprise/core/ApplicationContext.as
@@ -59,11 +59,20 @@
 			 */
 			coreResourceLoader = new CoreResourceLoader(this);

+			//copy parameters of stage loader
 			var objCopy:ByteArray = new ByteArray();
-			objCopy.writeObject(loaderInfo.parameters);
+			objCopy.writeObject(application.stage.loaderInfo.parameters);
 			objCopy.position = 0;
 			applicationURL = application.applicationURL();
 			applicationParameters = objCopy.readObject();
+			//merge parameters of application loader if it's not the same as the stage loader
+			if (loaderInfo.url != application.stage.loaderInfo.url)
+			{
+				for (var i : String in loaderInfo.parameters)
+				{
+					applicationParameters[i] = loaderInfo.parameters[i];
+				}
+			}
 		}

 		public function setI18NService(i18nService : II18NService) : void


Whoops, should have removed this with the JID refactoring

git-svn-id: c197267f952b24206666de142881703007ca05d5@10698 b35dd754-fafc-0310-a699-88a17e54d16e


flashlsFlowPlayer.swf:retrieve media position and buffer length dynamically

--- src/org/mangui/flowplayer/HLSStreamProvider.as
+++ src/org/mangui/flowplayer/HLSStreamProvider.as
@@ -40,9 +40,7 @@
         /** reference to the framework. **/
         private var _hls : HLS;
         // event values
-        private var _position : Number = 0;
         private var _duration : Number = 0;
-        private var _bufferedTime : Number = 0;
         private var _videoWidth : int = -1;
         private var _videoHeight : int = -1;
         private var _isManifestLoaded : Boolean = false;
@@ -135,10 +133,8 @@
         };

         private function _mediaTimeHandler(event : HLSEvent) : void {
-            _position = Math.max(0, event.mediatime.position);
             _duration = event.mediatime.duration;
             _clip.duration = _duration;
-            _bufferedTime = event.mediatime.buffer + event.mediatime.position;
             var videoWidth : int = _video.videoWidth;
             var videoHeight : int = _video.videoHeight;
             if (videoWidth && videoHeight) {
@@ -292,8 +288,6 @@
                 Log.info("seek()");
             }
             _hls.stream.seek(seconds);
-            _position = seconds;
-            _bufferedTime = seconds;
             _clip.dispatch(ClipEventType.SEEK, seconds);
             return;
         }
@@ -309,7 +303,7 @@
          * Current playhead time in seconds.
          */
         public function get time() : Number {
-            return _position;
+            return _hls.position;
         }

         /**
@@ -323,7 +317,7 @@
          * The point in timeline where the buffered data region ends, in seconds.
          */
         public function get bufferEnd() : Number {
-            return _bufferedTime;
+            return _hls.position + _hls.stream.bufferLength;
         }

         /**


Add ability to choose HTTP protocol for Emitter.  Change default to HTTPS.

--- snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/emitter/Emitter.as
+++ snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/emitter/Emitter.as
@@ -38,14 +38,14 @@
 		 * Create an Emitter instance with a collector URL and HttpMethod to send requests.
 		 * @param URI The collector URL. Don't include "http://" - this is done automatically.
 		 * @param httpMethod The HTTP request method. If GET, BufferOption is set to Instant.
-		 * @param successCallback The callback function to handle success cases when sending events.
-		 * @param errorCallback The callback function to handle error cases when sending events.
+		 * @param protocol The protocol for the call. Either http or https. Defaults to https.
 		 */
-		public function Emitter(uri:String, httpMethod:String = URLRequestMethod.GET) {
+		public function Emitter(uri:String, httpMethod:String = URLRequestMethod.GET, protocol:String = "https") {
+
 			if (httpMethod == URLRequestMethod.GET) {
-				_uri = new URI("http://" + uri + "/i");
+				_uri = new URI(protocol + "://" + uri + "/i");
 			} else { // POST
-				_uri = new URI("http://" + uri + "/" + Constants.PROTOCOL_VENDOR + "/" + Constants.PROTOCOL_VERSION);
+				_uri = new URI(protocol + "://" + uri + "/" + Constants.PROTOCOL_VENDOR + "/" + Constants.PROTOCOL_VERSION);
 			}

 			this.httpMethod = httpMethod;


fix for CBioNodeRenderer.as

fix for CBioNodeRenderer.as

--- portal/web/swf/src/CBioNodeRenderer.as
+++ portal/web/swf/src/CBioNodeRenderer.as
@@ -0,0 +1,474 @@
+/*
+ * This class is used as a special renderer for CBio nodes where details about a node
+ * can be displayed using 3 different disc segments around the node.
+ **/
+package org.cytoscapeweb.view.render
+{
+	import flare.util.Shapes;
+	import flare.vis.data.DataSprite;
+	import flare.vis.data.NodeSprite;
+
+	import flash.display.*;
+	import flash.display.BitmapData;
+	import flash.display.Graphics;
+	import flash.display.Sprite;
+	import flash.geom.Matrix;
+	import flash.geom.Rectangle;
+	import flash.ui.Mouse;
+	import flash.utils.setTimeout;
+
+	import mx.utils.StringUtil;
+
+	import org.alivepdf.display.Display;
+	import org.cytoscapeweb.util.GraphUtils;
+	import org.cytoscapeweb.util.NodeShapes;
+
+	public class CBioNodeRenderer extends NodeRenderer
+	{
+		private static var _instance:CBioNodeRenderer =
+			new CBioNodeRenderer();
+
+		private var _imgCache:ImageCache = ImageCache.instance;
+
+		private var _detailFlag:Boolean = false;
+
+		public static function get instance() : CBioNodeRenderer
+		{
+			return _instance;
+		}
+
+		public function get detailFlag() : Boolean
+		{
+			return this._detailFlag;
+		}
+
+		public function set detailFlag(value:Boolean) : void
+		{
+			this._detailFlag = value;
+		}
+
+		public function CBioNodeRenderer(defaultSize:Number=6)
+		{
+			super(defaultSize);
+		}
+
+		/** @inheritDoc */
+		public override function render(d:DataSprite):void {trace("RENDER NODE: " + d.data.id);
+			var lineAlpha:Number = d.lineAlpha;
+			var fillAlpha:Number = d.fillAlpha;
+			var size:Number = d.size * defaultSize;
+
+			var g:Graphics = d.graphics;
+			g.clear();
+
+			if (lineAlpha > 0 && d.lineWidth > 0)
+			{
+				var pixelHinting:Boolean = d.shape === NodeShapes.ROUND_RECTANGLE;
+				g.lineStyle(d.lineWidth, d.lineColor, lineAlpha, pixelHinting);
+			}
+
+			if (fillAlpha > 0)
+			{
+				// 1. Draw the background color:
+				// Using a bit mask to avoid transparent mdes when fillcolor=0xffffffff.
+				// See https://sourceforge.net/forum/message.php?msg_id=7393265
+				g.beginFill(0xffffff & d.fillColor, fillAlpha);
+				drawShape(d, d.shape, null);
+				g.endFill();
+
+				// 2. Draw an image on top:
+				drawImage(d,0,0);
+			}
+		}
+
+		// Draws the corresponding shape on given sprite
+		protected override function drawShape(st:Sprite, shape:String, bounds:Rectangle):void
+		{
+			var d:DataSprite = st as DataSprite;
+			var g:Graphics = d.graphics;
+			var size:Number = d.size*defaultSize;
+
+			switch (shape) {
+				case null:
+					break;
+				case NodeShapes.RECTANGLE:
+					g.drawRect(-size/2, -size/2, size, size);
+					break;
+				case NodeShapes.TRIANGLE:
+				case NodeShapes.DIAMOND:
+				case NodeShapes.HEXAGON:
+				case NodeShapes.OCTAGON:
+				case NodeShapes.PARALLELOGRAM:
+				case NodeShapes.V:
+					var r:Rectangle = new Rectangle(-size/2, -size/2, size, size);
+					var points:Array = NodeShapes.getDrawPoints(r, shape);
+					Shapes.drawPolygon(g, points);
+					break;
+				case NodeShapes.ROUND_RECTANGLE:
+					g.drawRoundRect(-size/2, -size/2, size, size, size/2, size/2);
+					break;
+				case NodeShapes.ELLIPSE:
+				default:
+					if (this._detailFlag || Boolean(d.props.detailFlag))
+					{
+						// Draws the disc containing details
+						drawDetails(d, size/2);
+					}
+
+					// Genes are colored according to total alteration percentage
+					var total:Number = Number(d.data.PERCENT_ALTERED) * 100;
+
+					g.beginFill(getNodeColorRW(total), 50);
+
+					// Seeded genes (IN_QUERY = true) are drawn with thicker borders
+					var inQuery:String = d.data.IN_QUERY;
+
+					if (inQuery == "false")
+					{
+						g.lineStyle(1, 0x000000, 1);
+					}
+					else
+					{
+						g.lineStyle(5, 0x000000, 1);
+					}
+
+					g.drawCircle(0, 0, size/2);
+			}
+		}
+
+		protected override function drawImage(d:DataSprite, w:Number, h:Number):void
+		{
+			var url:String = d.props.imageUrl;
+			var size:Number = d.size*defaultSize;
+
+			if (size > 0 && url != null && StringUtil.trim(url).length > 0) {
+				// Load the image into the cache first?
+				if (!_imgCache.contains(url)) {trace("Will load IMAGE...");
+					_imgCache.loadImage(url);
+				}
+				if (_imgCache.isLoaded(url)) {trace(" .LOADED :-)");
+					draw();
+				} else {trace(" .NOT loaded :-(");
+					drawWhenLoaded();
+				}
+
+				function drawWhenLoaded():void {
+					setTimeout(function():void {trace(" .TIMEOUT: Checking again...");
+						if (_imgCache.isLoaded(url)) draw();
+						else if (!_imgCache.isBroken(url)) drawWhenLoaded();
+					}, 50);
+				}
+
+				function draw():void {trace("Will draw: " + d.data.id);
+					// Get the image from cache:
+					var bd:BitmapData = _imgCache.getImage(url);
+
+					if (bd != null) {
+						var bmpSize:Number = Math.min(bd.height, bd.width);
+						var scale:Number = size/bmpSize;
+
+						var m:Matrix = new Matrix();
+						m.scale(scale, scale);
+						m.translate(-(bd.width*scale)/2, -(bd.height*scale)/2);
+
+						d.graphics.beginBitmapFill(bd, m, false, true);
+						drawShape(d, d.shape, null);
+						d.graphics.endFill();
+					}
+				}
+			}
+		}
+
+		// Draws the details of the node around the node circle
+		private function drawDetails(d:DataSprite, RADIUS:int):void
+		{
+			var g:Graphics = d.graphics;
+
+			// Flags represent whether a disc part will be drawn or not
+			var topFlag:Boolean = false;
+			var rightFlag:Boolean = false;
+			var leftFlag:Boolean = false;
+
+			var thickness:int = 16; // Thickness of the detail disc
+			var smoothness:int = 90; // Determines how smooth the ars are drawn
+			var circleMargin:int = 0; // Margin between the discs and the node
+			var insideMargin:Number = 1.0; // Inner margins for the percentage slices (should be half the border thickness!)
+
+			// These variables are used for the gradient color for unused disc parts
+			var fillType:String = "linear"
+			var colors:Array = [0xDCDCDC, 0xFFFFFF];
+			var alphas:Array = [100, 100];
+			var ratios:Array = [0x00, 0xFF];
+			var matrix:Matrix = new Matrix();
+			matrix.createGradientBox(3, 3, 0, 0, 0);
+			matrix.rotate(90/360);
+			var spreadMethod:String = "repeat";
+
+			g.lineStyle(0,0x000000,1);
+
+			// Following part looks at available data and sets percentages if data is available
+
+			// Top disc
+			if (d.data.PERCENT_CNA_HEMIZYGOUSLY_DELETED != null ||
+				d.data.PERCENT_CNA_AMPLIFIED != null ||
+				d.data.PERCENT_CNA_HOMOZYGOUSLY_DELETED != null ||
+				d.data.PERCENT_CNA_GAINED != null)
+			{
+				var hemizygousDeletion:Number = Number(d.data.PERCENT_CNA_HEMIZYGOUSLY_DELETED) * 100;
+				var amplification:Number = Number(d.data.PERCENT_CNA_AMPLIFIED) * 100;
+				var homozygousDeletion:Number = Number(d.data.PERCENT_CNA_HOMOZYGOUSLY_DELETED) * 100;
+				var gain:Number = Number(d.data.PERCENT_CNA_GAINED) * 100;
+				topFlag = true;
+			}
+
+			// Right disc
+			if (d.data.PERCENT_MUTATED != null)
+			{
+				var mutation:Number = Number(d.data.PERCENT_MUTATED) * 100;
+				rightFlag = true;
+			}
+
+			// Left disc
+			if (d.data.PERCENT_MRNA_WAY_UP != null ||
+				d.data.PERCENT_MRNA_WAY_DOWN != null)
+			{
+				var upRegulation:Number = Number(d.data.PERCENT_MRNA_WAY_UP) * 100;
+				var downRegulation:Number = Number(d.data.PERCENT_MRNA_WAY_DOWN) * 100;
+				leftFlag = true;
+			}
+
+			/* Following part draws the disc slice if associated flag is on, 3 disc parts are drawn in such a
+			 * way that there are 20 degrees empty space between each part and the parts themselves have a
+			 * 100 degrees space each, adding up to 360 degrees. The gray backgrounds are drawn first and the
+			 * corresponing colored percentages are filled using the data about the node.
+			 */
+
+			// Don't draw anything if none is available
+			if (!(topFlag || rightFlag || leftFlag))
+			{
+				return;
+			}
+
+			var innerRadius:Number;
+			var outerRadius:Number;
+
+			// Draws the top arc if its flag is on
+			if (topFlag == true)
+			{
+				innerRadius = RADIUS + circleMargin;
+				outerRadius = RADIUS + thickness;
+
+				// The gray back part is drawn
+				g.lineStyle(2, 0xDCDCDC, 1);
+				g.beginFill(0xFFFFFF, 50);
+				drawSolidArc(0, 0, innerRadius, outerRadius, 218/360, 104/360, smoothness, g);
+
+				innerRadius += insideMargin;
+				outerRadius -= insideMargin;
+
+				g.lineStyle(0, 0xFFFFFF, 0);
+
+				var amplificationArc:int = amplification;
+				g.beginFill(0xFF2500, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, 220/360, (amplificationArc/360), smoothness, g);
+
+				var homozygousDeletionArc:int = homozygousDeletion;
+				g.beginFill(0x0332FF, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, 220/360 + (amplificationArc/360), (homozygousDeletionArc/360), smoothness,g);
+
+				var gainArc:int = gain;
+				g.beginFill(0xFFC5CC, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, 220/360 + ((amplificationArc+homozygousDeletionArc)/360), (gainArc/360), smoothness,g);
+
+				var hemizygousDeletionArc:int = hemizygousDeletion;
+				g.beginFill(0x9EDFE0, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, 220/360 + ((amplificationArc+homozygousDeletionArc+gainArc)/360), (hemizygousDeletionArc/360), smoothness,g);
+
+				g.lineStyle(1, 0x000000, 1);
+			}
+			else
+			{
+				g.lineStyle(1, 0xDCDCDC, 0.5);
+				g.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod);
+				drawSolidArc(0, 0, RADIUS+circleMargin, RADIUS+thickness, 219/360, 102/360, smoothness, g);
+				g.endFill();
+			}
+
+			if (rightFlag == true)
+			{
+				innerRadius = RADIUS + circleMargin;
+				outerRadius = RADIUS + thickness;
+
+				g.lineStyle(2, 0xDCDCDC, 1);
+				g.beginFill(0xFFFFFF, 50);
+				drawSolidArc(0, 0, innerRadius, outerRadius, -22/360, 104/360, smoothness, g);
+
+				innerRadius += insideMargin;
+				outerRadius -= insideMargin;
+
+				g.lineStyle(0,0xDCDCDC,0);
+
+				var mutationArc:int = mutation;
+				g.beginFill(0x008F00, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, -20/360, (mutationArc/360), smoothness,g);
+
+				g.lineStyle(1, 0x000000, 1);
+			}
+			else
+			{
+				g.lineStyle(1, 0xDCDCDC, 0.5);
+				g.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod);
+				drawSolidArc(0, 0, RADIUS+circleMargin, RADIUS+thickness, -21/360, 102/360, smoothness, g);
+				g.endFill();
+			}
+
+			if (leftFlag == true)
+			{
+				innerRadius = RADIUS + circleMargin;
+				outerRadius = RADIUS + thickness;
+
+				g.lineStyle(2, 0xDCDCDC, 1);
+				g.beginFill(0xFFFFFF, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, 202/360, -(104/360), smoothness,g);
+
+				innerRadius += insideMargin;
+				outerRadius -= insideMargin;
+
+				g.lineStyle(0, 0xDCDCDC, 0);
+
+				var upRegulationArc:int = upRegulation;
+				g.beginFill(0xFFACA9, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, 200/360, -(upRegulationArc/360), smoothness,g);
+
+				var downRegulationArc:int = downRegulation;
+				g.beginFill(0x78AAD6, 50);
+				drawSolidArc (0, 0, innerRadius, outerRadius, 200/360 - (upRegulationArc/360), -(downRegulationArc/360), smoothness,g);
+
+				// When only borders are to be drawn (like in the OncoPrint)
+//				g.endFill();
+//				var upRegulationArc:int = upRegulation;
+//				g.lineStyle(1.5,0xFFACA9,1);
+//				drawSolidArc (0, 0, RADIUS+circleMargin+1.5, RADIUS+thickness-1.5, 201/360-4/360, -(upRegulationArc/360), smoothness,g);
+//
+//				var downRegulationArc:int = downRegulation;
+//				g.lineStyle(1.5,0x78AAD6,1);
+//				drawSolidArc (0, 0, RADIUS+circleMargin+1.5, RADIUS+thickness-1.5, 201/360 - (upRegulationArc/360)-8/360, -(downRegulationArc/360), smoothness,g);
+
+				g.lineStyle(1, 0x000000, 1);
+			}
+			else
+			{
+				g.lineStyle(1, 0xDCDCDC, 0.5);
+				g.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod);
+				drawSolidArc (0, 0, RADIUS+circleMargin, RADIUS+thickness, 201/360, -(102/360), smoothness,g);
+				g.endFill();
+			}
+
+			g.lineStyle(1, 0x000000, 1);
+		}
+
+		/**
+		 * Draws a solid arc part using the given parameters
+		 *
+		 * @param centerX	X-axis of the center of the shape
+		 * @param centerY	Y-axis of the center of the shape
+		 * @param innerRadius	radius of the inner circle
+		 * @param outerRadius	radius of the outer circle
+		 * @param startAngle	starting angle of the arc
+		 * @param arcAngle	the angle that arc fills
+		 * @param steps		determines how smooth the curve of the arc is
+		 * @param g			graphics object to draw on it
+		 * Reference: http://www.pixelwit.com/blog/2008/12/drawing-closed-arc-shape/
+		 * */
+		private function drawSolidArc (centerX:Number, centerY:Number, innerRadius:Number, outerRadius:Number, startAngle:Number, arcAngle:Number, steps:Number, g:Graphics):void{
+			var twoPI:Number = 2 * Math.PI;
+			var angleStep:Number = arcAngle/steps;
+			var angle:Number, i:Number, endAngle:Number;
+
+			var xx:Number = centerX + Math.cos(startAngle * twoPI) * innerRadius;
+			var yy:Number = centerY + Math.sin(startAngle * twoPI) * innerRadius;
+
+			var startPoint:Object = {x:xx, y:yy};
+			g.moveTo(xx, yy);
+
+			for(i=1; i<=steps; i++){
+				angle = (startAngle + i * angleStep) * twoPI;
+				xx = centerX + Math.cos(angle) * innerRadius;
+				yy = centerY + Math.sin(angle) * innerRadius;
+				g.lineTo(xx, yy);
+			}
+
+			endAngle = startAngle + arcAngle;
+
+			for(i=0; i<=steps; i++){
+				angle = (endAngle - i * angleStep) * twoPI;
+				xx = centerX + Math.cos(angle) * outerRadius;
+				yy = centerY + Math.sin(angle) * outerRadius;
+				g.lineTo(xx, yy);
+			}
+
+			g.lineTo(startPoint.x, startPoint.y);
+		}
+
+		// Returns the color between Red and White using the given value as a ratio
+		private function getNodeColorRW(value:int):Number
+		{
+			var high:int = 100;
+			var low:int = 0;
+
+			var highCRed:int = 255;
+			var highCGreen:int = 0;
+			var highCBlue:int = 0;
+
+			var lowCRed:int = 255;
+			var lowCGreen:int = 255;
+			var lowCBlue:int = 255;
+
+			// transform percentage value by using the formula:
+			// y = 0.000166377 x^3  +  -0.0380704 x^2  +  3.14277x
+			// instead of linear scaling, we use polynomial scaling to better
+			// emphasize lower alteration frequencies
+			value = (0.000166377 * value * value * value) -
+				(0.0380704 * value * value) +
+				(3.14277 * value);
+
+			// check boundary values
+			if (value > 100)
+			{
+				value = 100;
+			}
+			else if (value < 0)
+			{
+				value = 0;
+			}
+
+			if (value >= high)
+			{
+				return rgb2hex(highCRed, highCGreen, highCBlue);
+			}
+			else if (value > low)
+			{
+				return rgb2hex( getValueByRatio(value, low, high, lowCRed, highCRed),
+					getValueByRatio(value, low, high, lowCGreen, highCGreen),
+					getValueByRatio(value, low, high, lowCBlue, highCBlue)
+				);
+			}
+			else
+			{
+				return rgb2hex(lowCRed, lowCGreen, lowCBlue);
+			}
+		}
+
+		// used in getNodeColorRW to calculate a color number according to the ratio given
+		private function getValueByRatio(num:Number,
+				numLow:Number, numHigh:Number, colorNum1:int, colorNum2:int):int
+		{
+			return ((((num - numLow) / (numHigh - numLow)) * (colorNum2 - colorNum1)) + colorNum1)
+		}
+
+		// bitwise conversion of rgb color to a hex value
+		private function rgb2hex(r:int, g:int, b:int):Number {
+			return(r<<16 | g<<8 | b);
+		}
+	}
+}


added todo

added todo

--- WeaveJS/src/WeaveTest.as
+++ WeaveJS/src/WeaveTest.as
@@ -149,7 +149,6 @@
 			CKANDataSource,
 			KeyColumn,
 			ExternalTool,
-//			EntityNodeSearch,

 			WeaveMenuItem,
 			ZoomBounds,
@@ -160,6 +159,8 @@
 			IVisTool,
 			IVisTool_Basic,
 			IVisTool_Utility,
+
+			//EntityNodeSearch, //TODO - resolve circular dependency issue

 			null
 		];


More silly.

More silly.

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


refix FLEX-34078 in a more general way

refix FLEX-34078 in a more general way

--- frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/DropDownController.as
@@ -626,6 +626,12 @@
                 }
             }

+			// contains() doesn't cover popups/dropdowns, but owns() does.
+			if (dropDown is IUIComponent)
+			{
+				if ((dropDown as IUIComponent).owns(target))
+					return;
+			}
             closeDropDown(true);
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3552
Author:   rfrishbe@adobe.com
Date:     2008-10-09T22:07:55.906700Z

Log Message:
-----------
This patch contains multiple changes, mostly renames, outlined below:

1.Rename properties in FxComponent: skinObject -> skin, skinZZ -> skinClass.
2.Rename property in Skin: data -> fxComponent (this also means Skin doesn’t implement IDataRenderer anymore)
3.Renames in DataGroup: Mostly around "skin" to "renderer" to get terminology correct
4.Random other cleanups: For instance changing typing of "*" to "Object" in ItemsComponent and DataGroup or removing some un-used imports in Group and GroupBase.
5.Lots of cleanup in flex4tests to deal with renaming of classes and renaming of properties
6.Gumbo-manifest.mxml  - typo...some files listed as mx.componentss.* instead of mx.components.*.  This file is going away as all components are moved into the 2009 namespace, but we'll fix this for now.
7.Defaults.css – FxDataComponent should be FxDataContainer.
8.SystemManger fix: this was in the previous SystemManager but got overwritten by a bad merge.  Jim’s aware of the issue, and I’m checking in the fix for it.

QE: Yes - Joann and Steve have pre-emptively made the changes
Doc: Yes
Bugs: SDK-17056, SDK-17174
Reviewer: Chet, Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxApplicationSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/NewEffects.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/AddItemsTest.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxVSliderSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/MyVScrollBarSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxVScrollBarSkin.mxml</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/development/eclipse/flex/flex4test/src/EffectsProperties.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/RemoveItemsTest.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxSpinnerSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/components/AnimationPropertiesForm.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Skin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxHSliderSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxHScrollBarSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/ScrollbarFrenzy.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/components/CircularScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/CircularScrollBarSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -36,33 +36,27 @@
 include "../../styles/metadata/AdvancedCharacterFormatTextStyles.as"

 /**
- *  Name of the skin to use for this component. The skin must be a class that extends
+ *  Name of the skin class to use for this component. The skin must be a class that extends
  *  the mx.components.Skin class.
- *
- *  NOTE: We need to give the "skin" style a different name in order to resolve the
- *  collision with the Flex 3 "skin" style.
- *  This is an obviously bad name to serve as a reminder that it needs to get fixed.
- *
- *  TODO: Fix name
  */
-[Style(name="skinZZ", type="Class")]
+[Style(name="skinClass", type="Class")]

 /**
  *  The FxComponent class defines the base class for skinnable components.
  *  The skins used by a FxComponent class are child classes of the Skin class.
  *
- *
Associate a skin class with a component class by setting the skinZZ style property of the
- *  component class. You can set the skinZZ property in CSS, as the following example shows:

+ *
Associate a skin class with a component class by setting the skinClass style property of the
+ *  component class. You can set the skinClass property in CSS, as the following example shows:

  *
- *
  MyComponent
+ *
MyComponent
  *  {
  *    skinClass: ClassReference("my.skins.MyComponentSkin")
  *  }

  *
- *
The following example sets the skinZZ property in MXML:

+ *
The following example sets the skinClass property in MXML:

  *
  *

- *  <MyComponent skinZZ="my.skins.MyComponentSkin"/>

+ *  <MyComponent skinClass="my.skins.MyComponentSkin"/>

  *
  *
  *  @see mx.components.Skin
@@ -92,40 +86,36 @@
     //
     //--------------------------------------------------------------------------

-    // we need all these getters/setters around skinObject so it
-    // can be a public read-only Bindable variable and a protected
-    // read/write variable.
-    private var __skinObject:Skin;
-
-    [Bindable("skinObjectChanged")]
-
-    /**
-     *  @private
-     */
-    private function get _skinObject():Skin
-    {
-        return __skinObject;
-    }
-
-    private function set _skinObject(value:Skin):void
-    {
-        if (value === __skinObject)
-           return;
-
-        __skinObject = value;
-        dispatchEvent(new Event("skinObjectChanged"));
-    }
-
-    [Bindable("skinObjectChanged")]
+    /**
+     * @private
+     * Storage for skin instance
+     */
+    private var _skin:Skin;
+
+    [Bindable("skinChanged")]

     /**
      *  The instance of the skin class for this component instance.
      *  This is a read-only property that you set
      *  by calling the loadSkin() method.
      */
-    public function get skinObject():Skin
-    {
-        return _skinObject;
+    public function get skin():Skin
+    {
+        return _skin;
+    }
+
+    /**
+     *  @private
+     *  Setter for the skin instance.  This is so the bindable event
+     *  is dispatched
+     */
+    private function setSkin(value:Skin):void
+    {
+        if (value === _skin)
+           return;
+
+        _skin = value;
+        dispatchEvent(new Event("skinChanged"));
     }

     //--------------------------------------------------------------------------
@@ -154,7 +144,7 @@
         if (skinChanged)
         {
             skinChanged = false;
-            if (skinObject)
+            if (skin)
                 unloadSkin();
             loadSkin();
         }
@@ -171,12 +161,12 @@
      */
     override protected function measure():void
     {
-        if (skinObject)
-        {
-            measuredWidth = skinObject.getExplicitOrMeasuredWidth();
-            measuredHeight = skinObject.getExplicitOrMeasuredHeight();
-            measuredMinWidth = isNaN( skinObject.explicitWidth ) ? skinObject.minWidth : skinObject.explicitWidth;
-            measuredMinHeight = isNaN( skinObject.explicitHeight ) ? skinObject.minHeight : skinObject.explicitHeight;
+        if (skin)
+        {
+            measuredWidth = skin.getExplicitOrMeasuredWidth();
+            measuredHeight = skin.getExplicitOrMeasuredHeight();
+            measuredMinWidth = isNaN( skin.explicitWidth ) ? skin.minWidth : skin.explicitWidth;
+            measuredMinHeight = isNaN( skin.explicitHeight ) ? skin.minHeight : skin.explicitHeight;
         }
     }

@@ -185,8 +175,8 @@
      */
     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
     {
-        if (skinObject)
-            skinObject.setActualSize(unscaledWidth, unscaledHeight);
+        if (skin)
+            skin.setActualSize(unscaledWidth, unscaledHeight);
     }

     /**
@@ -196,7 +186,7 @@
     {
         var allStyles:Boolean = styleProp == null || styleProp == "styleName";

-        if (allStyles || styleProp == "skinZZ" || styleProp == "skinFactory")
+        if (allStyles || styleProp == "skinClass" || styleProp == "skinFactory")
         {
             skinChanged = true;
             invalidateProperties();
@@ -227,7 +217,7 @@

     /**
      *  Marks the component so that its commitSkinState() method
-     *  gets called during a later screen update.
+     *  gets called during a later screen update.
      *  The commitSkinState() method sets the new state of the skin.
      */
     protected function invalidateSkinState():void
@@ -251,7 +241,7 @@
      */
     protected function commitSkinState(newState:String):void
     {
-        skinObject.currentState = newState;
+        skin.currentState = newState;
     }

     //--------------------------------------------------------------------------
@@ -277,21 +267,21 @@
         var skinClassFactory:IFactory = getStyle("skinFactory") as IFactory;

         if (skinClassFactory)
-            _skinObject = skinClassFactory.newInstance() as Skin;
+            setSkin( skinClassFactory.newInstance() as Skin );

         // Class
-        if (!skinObject)
-        {
-            var skinClass:Class = getStyle("skinZZ") as Class;
+        if (!skin)
+        {
+            var skinClass:Class = getStyle("skinClass") as Class;

             if (skinClass)
-                _skinObject = new skinClass();
-        }
-
-        if (skinObject)
-        {
-            skinObject.owner = this;
-            skinObject.data = this;
+                setSkin( new skinClass() );
+        }
+
+        if (skin)
+        {
+            skin.owner = this;
+            skin.fxComponent = this;

             // As a convenience if someone has declared hostComponent
             // we assign a reference to ourselves.  If the hostComponent
@@ -299,16 +289,16 @@
             // metadata it will be strongly typed. We need to do more work
             // here and only assign if the type exactly matches our component
             // type.
-            if ("hostComponent" in skinObject)
+            if ("hostComponent" in skin)
             {
                 try
                 {
-                    Object(skinObject).hostComponent = this;
+                    Object(skin).hostComponent = this;
                 }
                 catch (err:Error) {}
             }

-            addChild(skinObject);
+            addChild(skin);
         }
         else
         {
@@ -339,13 +329,13 @@

                 if (part.required)
                 {
-                    if (!(part.id in skinObject))
+                    if (!(part.id in skin))
                         throw(new Error("Required skin part \"" + part.id + "\" cannot be found."));
                 }

-                if (part.id in skinObject)
+                if (part.id in skin)
                 {
-                    this[part.id] = skinObject[part.id];
+                    this[part.id] = skin[part.id];

                     // If the assigned part has already been instantiated, call partAdded() here,
                     // but only for static parts.
@@ -360,7 +350,11 @@
      *  Attach behaviors to the skin object.
      *  You do not call this method directly.
      *  Flex calls it automatically when it calls the loadSkin() method.
+<<<<<<< .mine
+     *
+=======
      *
+>>>>>>> .theirs
      *
A subclass of FxComponent must override this method to
      *  attach behaviors to the skin object.

      *
@@ -369,7 +363,7 @@
      */
     protected function skinLoaded():void
     {
-        skinObject.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, skin_propertyChangeHandler);
+        skin.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, skin_propertyChangeHandler);

         // Declarative behaviors to the skin get attached here.
         // Use partAdded for individual part behaviors
@@ -384,7 +378,7 @@
      */
     protected function unloadingSkin():void
     {
-        skinObject.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, skin_propertyChangeHandler);
+        skin.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, skin_propertyChangeHandler);

         // Declarative behaviors to the skin get removed here.
         // Use partRemoved for individual part behaviors
@@ -440,8 +434,8 @@

         unloadingSkin();
         clearSkinParts();
-        removeChild(skinObject);
-        _skinObject = null;
+        removeChild(skin);
+        setSkin(null);
     }

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


Level display names (con't)

Level display names (con't)

--- src/Displays/DGoal.as
+++ src/Displays/DGoal.as
@@ -27,7 +27,7 @@
 			var X:int = bg.x + INNER_BORDER;
 			var Y:int = bg.y + RAISED_BORDER_WIDTH * 3;
 			var Width:int = bg.width - INNER_BORDER * 2 - 48/2;
-			title = new FlxText(X, Y, Width, level.name);
+			title = new FlxText(X, Y, Width, level.displayName);
 			U.TITLE_FONT.configureFlxText(title, 0xffffff, 'center');
 			Y += title.height + 8;
 			add(title);


improved handling of null label

improved handling of null label

--- WeaveCore/src/weave/utils/DebugUtils.as
+++ WeaveCore/src/weave/utils/DebugUtils.as
@@ -256,7 +256,7 @@
 			}
 			catch (e:*) { }

-			var str:String = StandardLib.substitute("{0}{1} ({2}) {3}\n", indent, label, debugId(root), rect);
+			var str:String = StandardLib.substitute("{0}{1}({2}) {3}\n", indent, label != null ? label + ' ' : '', debugId(root), rect);

 			var container:DisplayObjectContainer = root as DisplayObjectContainer;
 			if (container && currentDepth != maxDepth)


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

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


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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2010 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: 17316
Author:   klin@adobe.com
Date:     2010-08-13T19:04:51.716189Z

Log Message:
-----------
Fix batch of bugs in DataGrid and also add basic border and background styles.

DataGrid.as - Added style metadata for borderAlpha, borderColor, borderVisible, contentBackgroundAlpha, and contentBackgroundColor.
Grid.as - Add backing variable for variableRowHeight so it doesn't depend on gridDimensions.fixedRowHeight anymore.
GridLayout.as - Modified updateTypicalCellSizes() to set the fixedRowHeight to the maximum height of the typical cells when no rowHeight is set and variableRowHeight is false. Also, measuredHeight is now calculated only using the typical item instead of the content.
GridDimensions.as - Added getTypicalContentHeight() for GridLayout to calculate the measuredHeight. Also, we now reset the data structure when the columnCount is 0.
GridColumn.as - Invalidate the grid when dataField and labelFunction are set.
GridEvent.as - Fixed misspelled event constants.
DataGridSkin.mxml - Changed background color to white, caret color to dark blue, and removed the rowBackground.

QE notes: No
Doc notes: No
Bugs: SDK-26895, SDK-26897, SDK-26934, SDK-27166, SDK-27170, SDK-27176, SDK-27216, SDK-27264
Reviewer: Hans
Tests run: checkintests, DataGrid
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/GridEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridDimensions.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DataGridSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -60,6 +60,63 @@
  */
 [Style(name="alternatingRowColors", type="Array", arrayType="uint", format="Color", inherit="no", theme="spark")]

+/**
+ *  The alpha of the border for this component.
+ *
+ *  @default 1.0
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="borderAlpha", type="Number", inherit="no", theme="spark", minValue="0.0", maxValue="1.0")]
+
+/**
+ *  The color of the border for this component.
+ *
+ *  @default #696969
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="borderColor", type="uint", format="Color", inherit="no", theme="spark")]
+
+/**
+ *  Controls the visibility of the border for this component.
+ *
+ *  @default true
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="borderVisible", type="Boolean", inherit="no", theme="spark")]
+
+/**
+ *  The alpha of the content background for this component.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="contentBackgroundAlpha", type="Number", inherit="yes", theme="spark", minValue="0.0", maxValue="1.0")]
+
+/**
+ *  @copy spark.components.supportClasses.GroupBase#style:contentBackgroundColor
+ *
+ *  @default 0xF9F9F9
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="contentBackgroundColor", type="uint", format="Color", inherit="yes", theme="spark")]

 include "../styles/metadata/BasicNonInheritingTextStyles.as"
 include "../styles/metadata/BasicInheritingTextStyles.as"
@@ -1450,7 +1507,7 @@
             selectionChanged = gridSelection.selectAll();
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1476,7 +1533,7 @@
             selectionChanged = gridSelection.removeAll();
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1539,7 +1596,7 @@
             selectionChanged = gridSelection.setRow(rowIndex);
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1565,7 +1622,7 @@
             selectionChanged = gridSelection.addRow(rowIndex);
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1591,7 +1648,7 @@
             selectionChanged = gridSelection.removeRow(rowIndex);
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1617,7 +1674,7 @@
             selectionChanged = gridSelection.setRows(rowIndex, rowCount);
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1686,7 +1743,7 @@
             selectionChanged = gridSelection.setCell(rowIndex, columnIndex);
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1712,7 +1769,7 @@
             selectionChanged = gridSelection.addCell(rowIndex, columnIndex);
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }
@@ -1767,7 +1824,7 @@
                 rowIndex, columnIndex, rowCount, columnCount);
             if (selectionChanged)
                 dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
-            }
+        }

         return selectionChanged;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 12539
Author:   mhorn@adobe.com
Date:     2009-12-04T18:26:28.712292Z

Log Message:
-----------
asdoc updates in prep for l10n

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextSelectionHighlighting.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/events/TextOperationEvent.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -194,6 +194,22 @@
  *  @see flash.text.engine.TextLineValidity
  *
  *  @includeExample examples/RichTextExample.mxml
+ *
+ *  @mxml
+ *
+ *
The <s:RichText> tag inherits all of the tag
+ *  attributes of its superclass and adds the following tag attributes:

+ *
+ *

+ *  <s:RichText
+ *    Properties
+ *    fontContext="IFlexModuleFactory"
+ *    luminosityClip="false"
+ *    luminosityInvert="false"
+ *    maskType="MaskType.CLIP"
+ *    textFlow="TextFlow"
+ *  />
+ *

  *
  *  @langversion 3.0
  *  @playerversion Flash 10


Transferred from the Adobe Open Source Subversion Repository

Revision: 5098
Author:   gauravj@adobe.com
Date:     2009-02-27T02:21:27.489350Z

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:
--------------
151 paths were modified

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -36,26 +36,51 @@

 /**
  *  @copy mx.components.baseClasses.GroupBase#alternatingItemColors
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes")]

 /**
  *  @copy mx.components.baseClasses.GroupBase#contentBackgroundColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="contentBackgroundColor", type="uint", format="Color", inherit="yes")]

 /**
  *  @copy mx.components.baseClasses.GroupBase#focusColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="focusColor", type="uint", format="Color", inherit="yes")]

 /**
  * @copy mx.components.baseClasses.GroupBase#rollOverColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="rollOverColor", type="uint", format="Color", inherit="yes")]

 /**
  *  @copy mx.components.baseClasses.GroupBase#symbolColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="symbolColor", type="uint", format="Color", inherit="yes")]

@@ -83,6 +108,11 @@
  *  policy, which can be auto, on, or off.
  *  The auto policy means that the scrollbar will be visible and included
  *  in the layout when the viewport's content is larger than the viewport itself.

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */

 public class FxScroller extends FxComponent
@@ -98,6 +128,11 @@

     /**
      * Constructor
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function FxScroller()
     {
@@ -133,6 +168,11 @@
      *  set by the FxScroller's skin.
      *
      *  This property is Bindable.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var horizontalScrollBar:FxHScrollBar;

@@ -150,6 +190,11 @@
      *  set by the FxScroller's skin.
      *
      *  This property is Bindable.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var verticalScrollBar:FxVScrollBar;

@@ -179,6 +224,11 @@
      *  This property is Bindable.
      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get viewport():IViewport
     {
@@ -230,6 +280,11 @@
     /**
      *  Boolean to let us know if we need to add system handlers or not.
      *  We can't do this early on because systemManager may be null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     private var systemListenersNeeded:Boolean = true;

@@ -283,6 +338,11 @@
      *  @default ScrollPolicy.AUTO
      *
      *  @see mx.core.ScrollPolicy
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get verticalScrollPolicy():String
     {
@@ -336,6 +396,11 @@
      *  @default ScrollPolicy.AUTO
      *
      *  @see mx.core.ScrollPolicy
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get horizontalScrollPolicy():String
     {
@@ -383,6 +448,11 @@
      *  Returns 1 if there is a viewport, 0 otherwise.
      *
      *  @return The number of visual elements in this visual container
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get numElements():int
     {
@@ -398,6 +468,11 @@
      *  @return The element at the specified index.
      *
      *  @throws RangeError If the index position does not exist in the child list.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function getElementAt(index:int):IVisualElement
     {
@@ -416,6 +491,11 @@
      *  @return The index position of the element to identify.
      *
      *  @throws ArgumentError If the element is not a child of this object.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function getElementIndex(element:IVisualElement):int
     {
@@ -431,6 +511,11 @@
      *
This operation is not supported in FxScroller.  FxScroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function addElement(element:IVisualElement):IVisualElement
     {
@@ -443,6 +528,11 @@
      *
This operation is not supported in FxScroller.  FxScroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function addElementAt(element:IVisualElement, index:int):IVisualElement
     {
@@ -455,6 +545,11 @@
      *
This operation is not supported in FxScroller.  FxScroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function removeElement(element:IVisualElement):IVisualElement
     {
@@ -467,6 +562,11 @@
      *
This operation is not supported in FxScroller.  FxScroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function removeElementAt(index:int):IVisualElement
     {
@@ -479,6 +579,11 @@
      *
This operation is not supported in FxScroller.  FxScroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function setElementIndex(element:IVisualElement, index:int):void
     {
@@ -491,6 +596,11 @@
      *
This operation is not supported in FxScroller.  FxScroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function swapElements(element1:IVisualElement, element2:IVisualElement):void
     {
@@ -503,6 +613,11 @@
      *
This operation is not supported in FxScroller.  FxScroller only
      *  has one child.  Use the viewport property to manipulate
      *  it.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function swapElementsAt(index1:int, index2:int):void
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 2954
Author:   chaase@adobe.com
Date:     2008-08-22T01:01:32.343242Z

Log Message:
-----------
Fixes to some ending and repeat bugs in the new Flex4 effects, plus refactoring of Sine/Power to subclass from new class, EaseInOut, which takes care of common easing in/out functionality and simplifies each subclass.

reviewed by: Jason S
tests: checkintests, mustella tests/Effects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animation.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/EaseInOut.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Power.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Sine.as</path>

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

--- frameworks/projects/spark/src/spark/effects/easing/Sine.as
+++ frameworks/projects/spark/src/spark/effects/easing/Sine.as
@@ -11,60 +11,41 @@
 package flex.effects.easing
 {
 /**
- * Provides easing functionality using a Sine wave, where the
- * instance is created with a power paramter describing the
- * behavior of the expression.
+ * Provides easing functionality using a Sine function and a
+ * parameter that specifies how much time to spend easing in
+ * and out.
  */
-public class Sine implements IEaser
-{
+public class Sine extends EaseInOut
+{
     /**
-     * Storage for the easeIn property
+     * Constructs a Sine instance with an optional
+     * easeInFraction parameter.
      */
-    private var _easeIn:Number;
+    public function Sine(easeInFraction:Number = .5)
+    {
+        super(easeInFraction);
+    }
+
     /**
-     * The percentage of an animation that should be spent accelerating.
-     * This factor sets an implicit
-     * "easeOut" parameter, equal to (1 - easeIn), so that any time not
-     * spent easing in is spent easing out. For example, to have an easing
-     * equation that spends half the time easing in and half easing out,
-     * set easeIn equal to .5.
+     * @inheritDoc
      *
-     * @default .5
+     * The easeIn calculation for Sine is equal to
+     * 1 - cos(fraction*PI/2).
      */
-    public function get easeIn():Number
+    override protected function easeIn(fraction:Number):Number
     {
-        return _easeIn;
-    }
-    public function set easeIn(value:Number):void
-    {
-        _easeIn = value;
+        return 1 - Math.cos(fraction * Math.PI/2);
     }

     /**
-     * Constructs a Sine instance with an optional easeIn
-     * parameter.
+     * @inheritDoc
+     *
+     * The easeOut calculation for Sine is equal to
+     * sin(fraction*PI/2).
      */
-    public function Sine(easeIn:Number = .5)
+    override protected function easeOut(fraction:Number):Number
     {
-        this.easeIn = easeIn;
-    }
-
-    /**
-     * Performs an easing on the elapsed fraction of an animation
-     * using a sine curve calculation.
-     *
-     * @param fraction The elapsed fraction of the animation
-     * @return The eased fraction of the animation
-     */
-    public function ease(fraction:Number):Number
-    {
-        var easeOut:Number = 1 - easeIn;
-
-        if (fraction <= easeIn)
-            return (1 - Math.cos((fraction/easeIn) * Math.PI/2)) * easeIn;
-        else
-            return easeIn + Math.sin(((fraction - easeIn)/easeOut) * Math.PI/2) * easeOut;
-    }
-
+        return Math.sin(fraction * Math.PI/2);
+    }
 }
 }