You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/10/10 16:34:48 UTC

[01/16] git commit: [flex-asjs] [refs/heads/develop] - don't need to override x, y getters

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 83574926b -> fdcc62c40


don't need to override x,y getters


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f876241c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f876241c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f876241c

Branch: refs/heads/develop
Commit: f876241c80c5790bbd9190dcd73b9cb64642d7ab
Parents: 8357492
Author: Alex Harui <ah...@apache.org>
Authored: Mon Oct 6 23:18:04 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:30 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/core/UIButtonBase.as    | 65 +-------------------
 1 file changed, 3 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f876241c/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
index 713c37f..6dbcfd3 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
@@ -83,83 +83,24 @@ package org.apache.flex.core
 				dispatchEvent(new Event("click"));
 			}
 		}
-		
-		private var _x:Number;
-		
-		/**
-		 *  @copy org.apache.flex.core.UIBase#x
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		override public function get x():Number
-		{
-			if (isNaN(_x))
-			{
-				var value:* = ValuesManager.valuesImpl.getValue(this, "x");
-				if (value === undefined)
-					return $x;
-				_x = Number(value);
-			}
-			return _x;
-		}
-		
+				
 		/**
 		 *  @private
 		 */
 		override public function set x(value:Number):void
 		{
-			if (_x != value) {
-				_x = value;
+			if (super.x != value) {
 				super.x = value;
 				dispatchEvent(new Event("xChanged"));
 			}
 		}
 		
 		/**
-		 *  Retrieve the low-level bounding box x.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		protected function get $x():Number
-		{
-			return super.x;
-		}
-		
-		private var _y:Number;
-		
-		/**
-		 *  @copy org.apache.flex.core.UIBase#y
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		override public function get y():Number
-		{
-			if (isNaN(_y))
-			{
-				var value:* = ValuesManager.valuesImpl.getValue(this, "y");
-				if (value === undefined)
-					return $y;
-				_y = Number(value);
-			}
-			return _y;
-		}
-		
-		/**
 		 *  @private
 		 */
 		override public function set y(value:Number):void
 		{
-			if (_y != value) {
-				_y = value;
+			if (super.y != value) {
 				super.y = value;
 				dispatchEvent(new Event("yChanged"));
 			}


[13/16] git commit: [flex-asjs] [refs/heads/develop] - fix sizing logic

Posted by ah...@apache.org.
fix sizing logic


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/51947dc8
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/51947dc8
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/51947dc8

Branch: refs/heads/develop
Commit: 51947dc8a2d710513289f6f86c6715a85c8577ba
Parents: c7e263e
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:28:32 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:33 2014 -0700

----------------------------------------------------------------------
 .../html/beads/layouts/NonVirtualBasicLayout.as | 27 ++++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/51947dc8/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
index 0db1cc0..73af2e8 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
@@ -20,11 +20,11 @@ package org.apache.flex.html.beads.layouts
 {
 	
 	import org.apache.flex.core.IBeadLayout;
-    import org.apache.flex.core.ILayoutChild;
+	import org.apache.flex.core.ILayoutChild;
 	import org.apache.flex.core.ILayoutParent;
 	import org.apache.flex.core.IParentIUIBase;
 	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
@@ -70,6 +70,7 @@ package org.apache.flex.html.beads.layouts
 			IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
             IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
 			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
+            IEventDispatcher(value).addEventListener("layoutNeeded", changeHandler);
 			IEventDispatcher(value).addEventListener("itemsCreated", changeHandler);
 			IEventDispatcher(value).addEventListener("beadsAdded", changeHandler);
 		}
@@ -89,39 +90,43 @@ package org.apache.flex.html.beads.layouts
                 var right:Number = ValuesManager.valuesImpl.getValue(child, "right");
                 var top:Number = ValuesManager.valuesImpl.getValue(child, "top");
                 var bottom:Number = ValuesManager.valuesImpl.getValue(child, "bottom");
+                var ww:Number = w;
+                var hh:Number = h;
                 
                 if (!isNaN(left))
                 {
                     child.x = left;
+                    ww -= left;
                 }
                 if (!isNaN(top))
                 {
                     child.y = top;
+                    hh -= top;
                 }
                 var ilc:ILayoutChild;
                 if (child is ILayoutChild)
                 {
                     ilc = child as ILayoutChild;
-                    if (!isNaN(ilc.percentHeight))
-                        ilc.setHeight(contentView.height * ilc.percentHeight / 100);
-                }
-                if (child is ILayoutChild)
-                {
-                    ilc = child as ILayoutChild;
                     if (!isNaN(ilc.percentWidth))
-                        ilc.setWidth(contentView.width * ilc.percentWidth / 100);
+                        ilc.setWidth((ww - (isNaN(right) ? 0 : right)) * ilc.percentWidth / 100);
                 }
                 if (!isNaN(right))
                 {
                     if (!isNaN(left))
-                        child.width = w - right - left;
+                        child.width = ww - right;
                     else
                         child.x = w - right - child.width;
                 }
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight((hh - (isNaN(bottom) ? 0 : bottom)) * ilc.percentHeight / 100);
+                }
                 if (!isNaN(bottom))
                 {
                     if (!isNaN(top))
-                        child.height = h - bottom - top;
+                        child.height = hh - bottom;
                     else
                         child.y = h - bottom - child.height;
                 }


[16/16] git commit: [flex-asjs] [refs/heads/develop] - try to fix nightly

Posted by ah...@apache.org.
try to fix nightly


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fdcc62c4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fdcc62c4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fdcc62c4

Branch: refs/heads/develop
Commit: fdcc62c40f771923a764cf59adb56aeb78f7a628
Parents: d1e991d
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 10 06:38:16 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:34 2014 -0700

----------------------------------------------------------------------
 nightly.properties | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fdcc62c4/nightly.properties
----------------------------------------------------------------------
diff --git a/nightly.properties b/nightly.properties
index 51495a3..34671a1 100644
--- a/nightly.properties
+++ b/nightly.properties
@@ -22,4 +22,5 @@ nightly = true
 # path to falconjx nightly
 falcon.server.url = http://apacheflexbuild.cloudapp.net:8080
 falcon.md5.server.url = http://apacheflexbuild.cloudapp.net:8080
-falcon.folder = job/flex-falcon/lastSuccessfulBuild/artifact/out
\ No newline at end of file
+falcon.folder = job/flex-falcon/lastSuccessfulBuild/artifact/out
+falcon.version = 0.0.3
\ No newline at end of file


[06/16] git commit: [flex-asjs] [refs/heads/develop] - handle being a bead on a component as well as a view

Posted by ah...@apache.org.
handle being a bead on a component as well as a view


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c7f8a2dd
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c7f8a2dd
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c7f8a2dd

Branch: refs/heads/develop
Commit: c7f8a2dda1f37498b1c644248a22553bd21b6ae9
Parents: ec296c1
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:24:41 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:32 2014 -0700

----------------------------------------------------------------------
 .../org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c7f8a2dd/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
index dd7eec8..acd6f92 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
@@ -77,7 +77,10 @@ package org.apache.flex.html.beads.layouts
 			if (_value !== value)
             {
                 _value = value;
-                IBeadView(_strand).host.dispatchEvent(new Event("layoutNeeded"));
+                if (_strand is IBeadView)
+                    IBeadView(_strand).host.dispatchEvent(new Event("layoutNeeded"));
+                else
+                    IEventDispatcher(_strand).dispatchEvent(new Event("layoutNeeded"));
             }
 		}
 		


[11/16] git commit: [flex-asjs] [refs/heads/develop] - handle more than one fx:style block

Posted by ah...@apache.org.
handle more than one fx:style block


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d6dcd95d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d6dcd95d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d6dcd95d

Branch: refs/heads/develop
Commit: d6dcd95d2c7259f36f35c5806f3ae81cd561472f
Parents: ce5f83e
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:26:43 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:33 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/core/SimpleCSSValuesImpl.as       | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d6dcd95d/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
index 1a96f64..263d3a2 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -82,6 +82,16 @@ package org.apache.flex.core
 			}
 			c = mainClass.constructor as Class;
             generateCSSStyleDeclarations(c["factoryFunctions"], c["data"]);
+            var i:int = 1;
+            while (true)
+            {
+                var ffName:String = "factoryFunctions" + i.toString();
+                var ff:Object = c[ffName];
+                if (ff == null)
+                    break;
+                generateCSSStyleDeclarations(c[ffName], c["data" + i.toString()]);
+                i++;
+            }
         }
         
         /**


[09/16] git commit: [flex-asjs] [refs/heads/develop] - needs to be IEventDispatcher to support binding

Posted by ah...@apache.org.
needs to be IEventDispatcher to support binding


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ec296c15
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ec296c15
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ec296c15

Branch: refs/heads/develop
Commit: ec296c155bc6cd347b9a903749a22b3bb3ce356d
Parents: 1649183
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:23:58 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:32 2014 -0700

----------------------------------------------------------------------
 .../as/projects/FlexJSUI/src/org/apache/flex/core/Application.as  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ec296c15/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
index ffc2c8c..ed0175b 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
@@ -28,6 +28,7 @@ package org.apache.flex.core
     import flash.utils.getQualifiedClassName;
     
     import org.apache.flex.events.Event;
+    import org.apache.flex.events.IEventDispatcher;
     import org.apache.flex.utils.MXMLDataInterpreter;
     
     //--------------------------------------
@@ -82,7 +83,7 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class Application extends Sprite implements IStrand, IFlexInfo, IParent
+    public class Application extends Sprite implements IStrand, IFlexInfo, IParent, IEventDispatcher
     {
         /**
          *  Constructor.


[15/16] git commit: [flex-asjs] [refs/heads/develop] - also need to listen for layoutNeeded

Posted by ah...@apache.org.
also need to listen for layoutNeeded


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c26dc8e4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c26dc8e4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c26dc8e4

Branch: refs/heads/develop
Commit: c26dc8e40176a68a2abe66e2196855f06d6f9ae7
Parents: 51947dc
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:28:55 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:34 2014 -0700

----------------------------------------------------------------------
 .../apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as    | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c26dc8e4/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
index 062972b..6a2fe41 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
@@ -69,6 +69,7 @@ package org.apache.flex.html.beads.layouts
             IEventDispatcher(value).addEventListener("layoutNeeded", changeHandler);
 			IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
 			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
+            IEventDispatcher(value).addEventListener("layoutNeeded", changeHandler);
 			IEventDispatcher(value).addEventListener("itemsCreated", changeHandler);
 		}
 	


[03/16] git commit: [flex-asjs] [refs/heads/develop] - layouts need to be IBeadLayout

Posted by ah...@apache.org.
layouts need to be IBeadLayout


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e15c8c2e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e15c8c2e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e15c8c2e

Branch: refs/heads/develop
Commit: e15c8c2e2c3295b4927a258aefc987f14f386a8f
Parents: 8b6c1a9
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 8 10:54:09 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:31 2014 -0700

----------------------------------------------------------------------
 .../apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e15c8c2e/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
index d475d42..082980f 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
@@ -19,7 +19,7 @@
 package org.apache.flex.html.beads.layouts
 {
 	
-	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IBeadLayout;
 	import org.apache.flex.core.ILayoutParent;
     import org.apache.flex.core.IParentIUIBase;
 	import org.apache.flex.core.IStrand;
@@ -39,7 +39,7 @@ package org.apache.flex.html.beads.layouts
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class NonVirtualVerticalLayout implements IBead
+	public class NonVirtualVerticalLayout implements IBeadLayout
 	{
         /**
          *  Constructor.


[14/16] git commit: [flex-asjs] [refs/heads/develop] - new databinding impls

Posted by ah...@apache.org.
new databinding impls


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d1e991d5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d1e991d5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d1e991d5

Branch: refs/heads/develop
Commit: d1e991d55b48ac5a539917abceca8baed0cc18df
Parents: c26dc8e
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:29:11 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:34 2014 -0700

----------------------------------------------------------------------
 .../as/projects/FlexJSJX/basic-manifest.xml     |   2 +
 .../apache/flex/core/ApplicationDataBinding.as  | 328 +++++++++++++++++++
 .../apache/flex/core/ContainerDataBinding.as    | 328 +++++++++++++++++++
 3 files changed, 658 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d1e991d5/frameworks/as/projects/FlexJSJX/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/basic-manifest.xml b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
index ae2109e..b0ea052 100644
--- a/frameworks/as/projects/FlexJSJX/basic-manifest.xml
+++ b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
@@ -65,6 +65,8 @@
     <component id="SimpleCSSStyles" class="org.apache.flex.core.SimpleCSSStyles"/>
     <component id="MXMLBeadViewBase" class="org.apache.flex.core.MXMLBeadViewBase"/>
     <component id="MXMLBeadViewBaseDataBinding" class="org.apache.flex.core.MXMLBeadViewBaseDataBinding"/>
+    <component id="ApplicationDataBinding" class="org.apache.flex.core.ApplicationDataBinding"/>
+    <component id="ContainerDataBinding" class="org.apache.flex.core.ContainerDataBinding"/>
     <component id="LayoutChangeNotifier" class="org.apache.flex.html.beads.layouts.LayoutChangeNotifier"/>
     <component id="ImageButton" class="org.apache.flex.html.ImageButton"/>
     <component id="ParentDocumentBead" class="org.apache.flex.core.ParentDocumentBead"/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d1e991d5/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ApplicationDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ApplicationDataBinding.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ApplicationDataBinding.as
new file mode 100644
index 0000000..9a14e0e
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ApplicationDataBinding.as
@@ -0,0 +1,328 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+    import org.apache.flex.binding.ConstantBinding;
+    import org.apache.flex.binding.GenericBinding;
+    import org.apache.flex.binding.PropertyWatcher;
+    import org.apache.flex.binding.SimpleBinding;
+    import org.apache.flex.binding.WatcherBase;
+    import org.apache.flex.core.IBead;
+    import org.apache.flex.core.IStrand;
+    import org.apache.flex.events.Event;
+    import org.apache.flex.events.IEventDispatcher;
+    
+    /**
+     *  The ApplicationDataBinding class implements databinding for
+     *  Application instances.  Different classes can have
+     *  different databinding implementation that optimize for
+     *  the different lifecycles.  For example, an item renderer
+     *  databinding implementation can wait to execute databindings
+     *  until the data property is set.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class ApplicationDataBinding extends DataBindingBase implements IBead
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function ApplicationDataBinding()
+		{
+			super();
+		}
+        
+        private var _strand:IStrand;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function set strand(value:IStrand):void
+        {
+            _strand = value;
+            IEventDispatcher(_strand).addEventListener("viewChanged", initCompleteHandler);
+        }    
+
+        private function initCompleteHandler(event:Event):void
+        {
+            var fieldWatcher:Object;
+            var sb:SimpleBinding;
+            if (!("_bindings" in _strand))
+                return;
+            var bindingData:Array = _strand["_bindings"];
+            var n:int = bindingData[0];
+            var bindings:Array = [];
+            var i:int;
+            var index:int = 1;
+            for (i = 0; i < n; i++)
+            {
+                var binding:Object = {};
+                binding.source = bindingData[index++];
+				binding.destFunc = bindingData[index++];
+                binding.destination = bindingData[index++];
+                bindings.push(binding);
+            }
+            var watchers:Object = decodeWatcher(bindingData.slice(index));
+            for (i = 0; i < n; i++)
+            {
+                    binding = bindings[i];
+                if (binding.source is Array)
+                {
+                    if (binding.source[0] in _strand)
+                    {
+                        if (binding.source.length == 2 && binding.destination.length == 2)
+                        {
+                            // simple component.property binding
+                            var destObject:Object;
+                            var destination:IStrand;
+                            // can be simplebinding or constantbinding
+                            var compWatcher:Object = watchers.watcherMap[binding.source[0]];
+                            fieldWatcher = compWatcher.children.watcherMap[binding.source[1]];
+                            if (fieldWatcher.eventNames is String)
+                            {
+                                sb = new SimpleBinding();
+                                sb.destinationPropertyName = binding.destination[1];
+                                sb.eventName = fieldWatcher.eventNames as String;
+                                sb.sourceID = binding.source[0];
+                                sb.sourcePropertyName = binding.source[1];
+                                sb.setDocument(_strand);
+                                destObject = getProperty(_strand, binding.destination[0]);                                
+                                destination = destObject as IStrand;
+                                if (destination)
+                                    destination.addBead(sb);
+                                else
+                                {
+                                    if (destObject)
+                                    {
+                                        sb.destination = destObject;
+                                        _strand.addBead(sb);
+                                    }
+                                    else
+                                    {
+                                        deferredBindings[binding.destination[0]] = sb;
+                                        IEventDispatcher(_strand).addEventListener("valueChange", deferredBindingsHandler);
+                                    }
+                                }
+                            }
+                            else if (fieldWatcher.eventNames == null)
+                            {
+                                var cb:ConstantBinding = new ConstantBinding();
+                                cb.destinationPropertyName = binding.destination[1];
+                                cb.sourceID = binding.source[0];
+                                cb.sourcePropertyName = binding.source[1];
+                                cb.setDocument(_strand);
+                                destObject = getProperty(_strand, binding.destination[0]);                                
+                                destination = destObject as IStrand;
+                                if (destination)
+                                    destination.addBead(cb);
+                                else
+                                {
+                                    if (destObject)
+                                    {
+                                        cb.destination = destObject;
+                                        _strand.addBead(sb);
+                                    }
+                                    else
+                                    {
+                                        deferredBindings[binding.destination[0]] = sb;
+                                        IEventDispatcher(_strand).addEventListener("valueChange", deferredBindingsHandler);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                else if (binding.source is String)
+                {
+                    fieldWatcher = watchers.watcherMap[binding.source];
+                    if (fieldWatcher.eventNames is String)
+                    {
+                        sb = new SimpleBinding();
+                        sb.destinationPropertyName = binding.destination[1];
+                        sb.eventName = fieldWatcher.eventNames as String;
+                        sb.sourcePropertyName = binding.source;
+                        sb.setDocument(_strand);
+                        destObject = getProperty(_strand, binding.destination[0]);                                
+                        destination = destObject as IStrand;
+                        if (destination)
+                            destination.addBead(sb);
+                        else
+                        {
+                            if (destObject)
+                            {
+                                sb.destination = destObject;
+                                _strand.addBead(sb);
+                            }
+                            else
+                            {
+                                deferredBindings[binding.destination[0]] = sb;
+                                IEventDispatcher(_strand).addEventListener("valueChange", deferredBindingsHandler);
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    makeGenericBinding(binding, i, watchers);
+                }
+            }
+        }
+
+        private function makeGenericBinding(binding:Object, index:int, watchers:Object):void
+        {
+            var gb:GenericBinding = new GenericBinding();
+            gb.setDocument(_strand);
+            gb.destinationData = binding.destination;
+			gb.destinationFunction = binding.destFunc;
+            gb.source = binding.source;
+            setupWatchers(gb, index, watchers.watchers, null);
+        }
+        
+        private function setupWatchers(gb:GenericBinding, index:int, watchers:Array, parentWatcher:WatcherBase):void
+        {
+            var n:int = watchers.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                var watcher:Object = watchers[i];
+                if (watcher.bindings.indexOf(index) != -1)
+                {
+                    var type:String = watcher.type;
+                    switch (type)
+                    {
+                        case "property":
+                        {
+                            var pw:PropertyWatcher = new PropertyWatcher(this, 
+                                        watcher.propertyName, 
+                                        watcher.eventNames,
+                                        watcher.getterFunction);
+                            watcher.watcher = pw;
+                            if (parentWatcher)
+                                pw.parentChanged(parentWatcher.value);
+                            else
+                                pw.parentChanged(_strand);
+                            if (parentWatcher)
+                                parentWatcher.addChild(pw);
+                            if (watcher.children == null)
+                                pw.addBinding(gb);
+                            break;
+                        }
+                    }
+                    if (watcher.children)
+                    {
+                        setupWatchers(gb, index, watcher.children, watcher.watcher);
+                    }
+                }
+            }
+        }
+        
+        private function decodeWatcher(bindingData:Array):Object
+        {
+            var watcherMap:Object = {};
+            var watchers:Array = [];
+            var n:int = bindingData.length;
+            var index:int = 0;
+            var watcherData:Object;
+            // FalconJX adds an extra null to the data so make sure
+            // we have enough data for a complete watcher otherwise
+            // say we are done
+            while (index < n - 2)
+            {
+                var watcherIndex:int = bindingData[index++];
+                var type:int = bindingData[index++];
+                switch (type)
+                {
+                    case 0:
+                    {
+                        watcherData = { type: "function" };
+                        watcherData.functionName = bindingData[index++];
+						watcherData.paramFunction = bindingData[index++];
+                        watcherData.eventNames = bindingData[index++];
+                        watcherData.bindings = bindingData[index++];
+                        break;
+                    }
+                    case 1:
+					{
+						watcherData = { type: "static" };
+						watcherData.propertyName = bindingData[index++];
+						watcherData.eventNames = bindingData[index++];
+						watcherData.bindings = bindingData[index++];
+						watcherData.getterFunction = bindingData[index++];
+						watcherData.parentObj = bindingData[index++];
+						watcherMap[watcherData.propertyName] = watcherData;
+						break;
+					}
+                    case 2:
+                    {
+                        watcherData = { type: "property" };
+                        watcherData.propertyName = bindingData[index++];
+                        watcherData.eventNames = bindingData[index++];
+                        watcherData.bindings = bindingData[index++];
+                        watcherData.getterFunction = bindingData[index++];
+                        watcherMap[watcherData.propertyName] = watcherData;
+                        break;
+                    }
+                    case 3:
+                    {
+                        watcherData = { type: "xml" };
+                        watcherData.propertyName = bindingData[index++];
+                        watcherData.bindings = bindingData[index++];
+                        watcherMap[watcherData.propertyName] = watcherData;
+                        break;
+                    }
+                }
+                watcherData.children = bindingData[index++];
+                if (watcherData.children != null)
+                {
+                    watcherData.children = decodeWatcher(watcherData.children);
+                }
+                watcherData.index = watcherIndex;
+                watchers.push(watcherData);
+            }            
+            return { watchers: watchers, watcherMap: watcherMap };
+        }
+        
+        private var deferredBindings:Object = {};
+        private function deferredBindingsHandler(event:Event):void
+        {
+            for (var p:String in deferredBindings)
+            {
+                if (_strand[p] != null)
+                {
+                    var destination:IStrand = _strand[p] as IStrand;
+                    destination.addBead(deferredBindings[p]);
+                    delete deferredBindings[p];
+                }
+            }
+        }
+        
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d1e991d5/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ContainerDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ContainerDataBinding.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ContainerDataBinding.as
new file mode 100644
index 0000000..3b2a2e0
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/ContainerDataBinding.as
@@ -0,0 +1,328 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+    import org.apache.flex.binding.ConstantBinding;
+    import org.apache.flex.binding.GenericBinding;
+    import org.apache.flex.binding.PropertyWatcher;
+    import org.apache.flex.binding.SimpleBinding;
+    import org.apache.flex.binding.WatcherBase;
+    import org.apache.flex.core.IBead;
+    import org.apache.flex.core.IStrand;
+    import org.apache.flex.events.Event;
+    import org.apache.flex.events.IEventDispatcher;
+    
+    /**
+     *  The ContainerDataBinding class implements databinding for
+     *  Container instances.  Different classes can have
+     *  different databinding implementation that optimize for
+     *  the different lifecycles.  For example, an item renderer
+     *  databinding implementation can wait to execute databindings
+     *  until the data property is set.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class ContainerDataBinding extends DataBindingBase implements IBead
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function ContainerDataBinding()
+		{
+			super();
+		}
+        
+        private var _strand:IStrand;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function set strand(value:IStrand):void
+        {
+            _strand = value;
+            IEventDispatcher(_strand).addEventListener("initComplete", initCompleteHandler);
+        }    
+
+        private function initCompleteHandler(event:Event):void
+        {
+            var fieldWatcher:Object;
+            var sb:SimpleBinding;
+            if (!("_bindings" in _strand))
+                return;
+            var bindingData:Array = _strand["_bindings"];
+            var n:int = bindingData[0];
+            var bindings:Array = [];
+            var i:int;
+            var index:int = 1;
+            for (i = 0; i < n; i++)
+            {
+                var binding:Object = {};
+                binding.source = bindingData[index++];
+				binding.destFunc = bindingData[index++];
+                binding.destination = bindingData[index++];
+                bindings.push(binding);
+            }
+            var watchers:Object = decodeWatcher(bindingData.slice(index));
+            for (i = 0; i < n; i++)
+            {
+                    binding = bindings[i];
+                if (binding.source is Array)
+                {
+                    if (binding.source[0] in _strand)
+                    {
+                        if (binding.source.length == 2 && binding.destination.length == 2)
+                        {
+                            // simple component.property binding
+                            var destObject:Object;
+                            var destination:IStrand;
+                            // can be simplebinding or constantbinding
+                            var compWatcher:Object = watchers.watcherMap[binding.source[0]];
+                            fieldWatcher = compWatcher.children.watcherMap[binding.source[1]];
+                            if (fieldWatcher.eventNames is String)
+                            {
+                                sb = new SimpleBinding();
+                                sb.destinationPropertyName = binding.destination[1];
+                                sb.eventName = fieldWatcher.eventNames as String;
+                                sb.sourceID = binding.source[0];
+                                sb.sourcePropertyName = binding.source[1];
+                                sb.setDocument(_strand);
+                                destObject = getProperty(_strand, binding.destination[0]);                                
+                                destination = destObject as IStrand;
+                                if (destination)
+                                    destination.addBead(sb);
+                                else
+                                {
+                                    if (destObject)
+                                    {
+                                        sb.destination = destObject;
+                                        _strand.addBead(sb);
+                                    }
+                                    else
+                                    {
+                                        deferredBindings[binding.destination[0]] = sb;
+                                        IEventDispatcher(_strand).addEventListener("valueChange", deferredBindingsHandler);
+                                    }
+                                }
+                            }
+                            else if (fieldWatcher.eventNames == null)
+                            {
+                                var cb:ConstantBinding = new ConstantBinding();
+                                cb.destinationPropertyName = binding.destination[1];
+                                cb.sourceID = binding.source[0];
+                                cb.sourcePropertyName = binding.source[1];
+                                cb.setDocument(_strand);
+                                destObject = getProperty(_strand, binding.destination[0]);                                
+                                destination = destObject as IStrand;
+                                if (destination)
+                                    destination.addBead(cb);
+                                else
+                                {
+                                    if (destObject)
+                                    {
+                                        cb.destination = destObject;
+                                        _strand.addBead(sb);
+                                    }
+                                    else
+                                    {
+                                        deferredBindings[binding.destination[0]] = sb;
+                                        IEventDispatcher(_strand).addEventListener("valueChange", deferredBindingsHandler);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                else if (binding.source is String)
+                {
+                    fieldWatcher = watchers.watcherMap[binding.source];
+                    if (fieldWatcher.eventNames is String)
+                    {
+                        sb = new SimpleBinding();
+                        sb.destinationPropertyName = binding.destination[1];
+                        sb.eventName = fieldWatcher.eventNames as String;
+                        sb.sourcePropertyName = binding.source;
+                        sb.setDocument(_strand);
+                        destObject = getProperty(_strand, binding.destination[0]);                                
+                        destination = destObject as IStrand;
+                        if (destination)
+                            destination.addBead(sb);
+                        else
+                        {
+                            if (destObject)
+                            {
+                                sb.destination = destObject;
+                                _strand.addBead(sb);
+                            }
+                            else
+                            {
+                                deferredBindings[binding.destination[0]] = sb;
+                                IEventDispatcher(_strand).addEventListener("valueChange", deferredBindingsHandler);
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    makeGenericBinding(binding, i, watchers);
+                }
+            }
+        }
+
+        private function makeGenericBinding(binding:Object, index:int, watchers:Object):void
+        {
+            var gb:GenericBinding = new GenericBinding();
+            gb.setDocument(_strand);
+            gb.destinationData = binding.destination;
+			gb.destinationFunction = binding.destFunc;
+            gb.source = binding.source;
+            setupWatchers(gb, index, watchers.watchers, null);
+        }
+        
+        private function setupWatchers(gb:GenericBinding, index:int, watchers:Array, parentWatcher:WatcherBase):void
+        {
+            var n:int = watchers.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                var watcher:Object = watchers[i];
+                if (watcher.bindings.indexOf(index) != -1)
+                {
+                    var type:String = watcher.type;
+                    switch (type)
+                    {
+                        case "property":
+                        {
+                            var pw:PropertyWatcher = new PropertyWatcher(this, 
+                                        watcher.propertyName, 
+                                        watcher.eventNames,
+                                        watcher.getterFunction);
+                            watcher.watcher = pw;
+                            if (parentWatcher)
+                                pw.parentChanged(parentWatcher.value);
+                            else
+                                pw.parentChanged(_strand);
+                            if (parentWatcher)
+                                parentWatcher.addChild(pw);
+                            if (watcher.children == null)
+                                pw.addBinding(gb);
+                            break;
+                        }
+                    }
+                    if (watcher.children)
+                    {
+                        setupWatchers(gb, index, watcher.children, watcher.watcher);
+                    }
+                }
+            }
+        }
+        
+        private function decodeWatcher(bindingData:Array):Object
+        {
+            var watcherMap:Object = {};
+            var watchers:Array = [];
+            var n:int = bindingData.length;
+            var index:int = 0;
+            var watcherData:Object;
+            // FalconJX adds an extra null to the data so make sure
+            // we have enough data for a complete watcher otherwise
+            // say we are done
+            while (index < n - 2)
+            {
+                var watcherIndex:int = bindingData[index++];
+                var type:int = bindingData[index++];
+                switch (type)
+                {
+                    case 0:
+                    {
+                        watcherData = { type: "function" };
+                        watcherData.functionName = bindingData[index++];
+						watcherData.paramFunction = bindingData[index++];
+                        watcherData.eventNames = bindingData[index++];
+                        watcherData.bindings = bindingData[index++];
+                        break;
+                    }
+                    case 1:
+					{
+						watcherData = { type: "static" };
+						watcherData.propertyName = bindingData[index++];
+						watcherData.eventNames = bindingData[index++];
+						watcherData.bindings = bindingData[index++];
+						watcherData.getterFunction = bindingData[index++];
+						watcherData.parentObj = bindingData[index++];
+						watcherMap[watcherData.propertyName] = watcherData;
+						break;
+					}
+                    case 2:
+                    {
+                        watcherData = { type: "property" };
+                        watcherData.propertyName = bindingData[index++];
+                        watcherData.eventNames = bindingData[index++];
+                        watcherData.bindings = bindingData[index++];
+                        watcherData.getterFunction = bindingData[index++];
+                        watcherMap[watcherData.propertyName] = watcherData;
+                        break;
+                    }
+                    case 3:
+                    {
+                        watcherData = { type: "xml" };
+                        watcherData.propertyName = bindingData[index++];
+                        watcherData.bindings = bindingData[index++];
+                        watcherMap[watcherData.propertyName] = watcherData;
+                        break;
+                    }
+                }
+                watcherData.children = bindingData[index++];
+                if (watcherData.children != null)
+                {
+                    watcherData.children = decodeWatcher(watcherData.children);
+                }
+                watcherData.index = watcherIndex;
+                watchers.push(watcherData);
+            }            
+            return { watchers: watchers, watcherMap: watcherMap };
+        }
+        
+        private var deferredBindings:Object = {};
+        private function deferredBindingsHandler(event:Event):void
+        {
+            for (var p:String in deferredBindings)
+            {
+                if (_strand[p] != null)
+                {
+                    var destination:IStrand = _strand[p] as IStrand;
+                    destination.addBead(deferredBindings[p]);
+                    delete deferredBindings[p];
+                }
+            }
+        }
+        
+    }
+}
\ No newline at end of file


[08/16] git commit: [flex-asjs] [refs/heads/develop] - handle no border

Posted by ah...@apache.org.
handle no border


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4efdd81d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4efdd81d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4efdd81d

Branch: refs/heads/develop
Commit: 4efdd81d979cf5ac8206bd4302f2c0a2eb47e203
Parents: ec17863
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 8 22:44:05 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:32 2014 -0700

----------------------------------------------------------------------
 .../NonVirtualVerticalScrollingLayout.as        | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4efdd81d/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalScrollingLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalScrollingLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalScrollingLayout.as
index c18b9ef..de0f745 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalScrollingLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalScrollingLayout.as
@@ -87,17 +87,21 @@ package org.apache.flex.html.beads.layouts
                 _strand.getBeadByType(IScrollingLayoutParent) as IScrollingLayoutParent;
             var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
 			var border:Border = layoutParent.border;
-			var borderModel:IBorderModel = border.model as IBorderModel;
-			
+   			var borderModel:IBorderModel;
+            if (border)
+                borderModel = border.model as IBorderModel;
             var ww:Number = layoutParent.resizableView.width;
             var hh:Number = layoutParent.resizableView.height;
-            border.width = ww;
-            border.height = hh;
-           
-			contentView.width = ww - borderModel.offsets.left - borderModel.offsets.right;
-			contentView.height = hh - borderModel.offsets.top - borderModel.offsets.bottom;
-			contentView.x = borderModel.offsets.left;
-			contentView.y = borderModel.offsets.top;
+            if (border)
+            {
+                border.width = ww;
+                border.height = hh;
+            }
+            
+			contentView.width = ww - ((border) ? borderModel.offsets.left + borderModel.offsets.right : 0);
+			contentView.height = hh - ((border) ? borderModel.offsets.top - borderModel.offsets.bottom : 0);
+			contentView.x = (border) ? borderModel.offsets.left : 0;
+			contentView.y = (border) ? borderModel.offsets.top : 0;
 			
 			var n:int = contentView.numElements;
 			var yy:Number = 0;


[02/16] git commit: [flex-asjs] [refs/heads/develop] - BasicLayout

Posted by ah...@apache.org.
BasicLayout


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/1dd28aff
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1dd28aff
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1dd28aff

Branch: refs/heads/develop
Commit: 1dd28aff0875f176a1440dc527cddad5909ff1a2
Parents: e15c8c2
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 8 10:54:29 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:31 2014 -0700

----------------------------------------------------------------------
 .../as/projects/FlexJSUI/src/FlexJSUIClasses.as |   1 +
 .../org/apache/flex/html/beads/ContainerView.as |  12 ++
 .../html/beads/layouts/NonVirtualBasicLayout.as | 117 +++++++++++++++++++
 3 files changed, 130 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1dd28aff/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as b/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
index a63b88b..6810d10 100644
--- a/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
+++ b/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
@@ -102,6 +102,7 @@ internal class FlexJSUIClasses
 	import org.apache.flex.html.beads.layouts.ButtonBarLayout; ButtonBarLayout;
     import org.apache.flex.html.beads.layouts.NonVirtualVerticalScrollingLayout; NonVirtualVerticalScrollingLayout;  
 	import org.apache.flex.html.beads.layouts.NonVirtualHorizontalScrollingLayout; NonVirtualHorizontalScrollingLayout;
+    import org.apache.flex.html.beads.layouts.NonVirtualBasicLayout; NonVirtualBasicLayout;
     import org.apache.flex.html.beads.layouts.VScrollBarLayout; VScrollBarLayout;
 	import org.apache.flex.html.beads.layouts.TileLayout; TileLayout;
     import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1dd28aff/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ContainerView.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ContainerView.as
index 1e12776..0928372 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ContainerView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ContainerView.as
@@ -20,6 +20,7 @@ package org.apache.flex.html.beads
 {
     import org.apache.flex.core.BeadViewBase;
 	import org.apache.flex.core.IBead;
+    import org.apache.flex.core.IBeadLayout;
 	import org.apache.flex.core.IBeadView;
 	import org.apache.flex.core.ILayoutParent;
     import org.apache.flex.core.IParentIUIBase;
@@ -117,6 +118,17 @@ package org.apache.flex.html.beads
 				if (value.getBeadByType(IBorderBead) == null)
 					value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);	
 			}
+            
+            if (_strand.getBeadByType(IBeadLayout) == null)
+            {
+                var c:Class = ValuesManager.valuesImpl.getValue(_strand, "iBeadLayout");
+                if (c)
+                {
+                    var mapper:IBeadLayout = new c() as IBeadLayout;
+                    _strand.addBead(mapper);
+                }
+            }  
+
 		}
 		
 		/**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1dd28aff/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
new file mode 100644
index 0000000..7def726
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
@@ -0,0 +1,117 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.layouts
+{
+	
+	import org.apache.flex.core.IBeadLayout;
+	import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+
+    /**
+     *  The NonVirtualBasicLayout class is a simple layout
+     *  bead.  It takes the set of children and lays them out
+     *  as specified by CSS properties like left, right, top
+     *  and bottom.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class NonVirtualBasicLayout implements IBeadLayout
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function NonVirtualBasicLayout()
+		{
+		}
+		
+		private var _strand:IStrand;
+		
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
+            IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
+			IEventDispatcher(value).addEventListener("itemsCreated", changeHandler);
+			IEventDispatcher(value).addEventListener("beadsAdded", changeHandler);
+		}
+	
+		private function changeHandler(event:Event):void
+		{
+			var layoutParent:ILayoutParent = _strand.getBeadByType(ILayoutParent) as ILayoutParent;
+			var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(_strand);
+			
+            var w:Number = contentView.width;
+            var h:Number = contentView.height;
+			var n:int = contentView.numElements;
+			for (var i:int = 0; i < n; i++)
+			{
+				var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+                var left:Number = ValuesManager.valuesImpl.getValue(child, "left");
+                var right:Number = ValuesManager.valuesImpl.getValue(child, "right");
+                var top:Number = ValuesManager.valuesImpl.getValue(child, "top");
+                var bottom:Number = ValuesManager.valuesImpl.getValue(child, "bottom");
+                
+                if (!isNaN(left))
+                {
+                    child.x = left;
+                }
+                if (!isNaN(top))
+                {
+                    child.y = top;
+                }
+                if (!isNaN(right))
+                {
+                    if (!isNaN(left))
+                        child.width = w - right - left;
+                    else
+                        child.x = w - right - child.width;
+                }
+                if (!isNaN(bottom))
+                {
+                    if (!isNaN(top))
+                        child.height = h - bottom - top;
+                    else
+                        child.y = h - bottom - child.height;
+                }
+			}
+		}
+	}
+}


[04/16] git commit: [flex-asjs] [refs/heads/develop] - also init styles in the main document

Posted by ah...@apache.org.
also init styles in the main document


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/8b6c1a95
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/8b6c1a95
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/8b6c1a95

Branch: refs/heads/develop
Commit: 8b6c1a9570091d32581ec0049e11a4ff130ba9e5
Parents: f876241
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 8 10:53:23 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:31 2014 -0700

----------------------------------------------------------------------
 .../FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8b6c1a95/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
index 85681da..1a96f64 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -78,11 +78,9 @@ package org.apache.flex.core
 	            var mainClassName:String = getQualifiedClassName(mainClass);
 				styleClassName = "_" + mainClassName + "_Styles";
 				c = ApplicationDomain.currentDomain.getDefinition(styleClassName) as Class;
+                generateCSSStyleDeclarations(c["factoryFunctions"], c["data"]);
 			}
-			else
-			{
-				c = mainClass.constructor as Class;
-			}
+			c = mainClass.constructor as Class;
             generateCSSStyleDeclarations(c["factoryFunctions"], c["data"]);
         }
         


[05/16] git commit: [flex-asjs] [refs/heads/develop] - don't lock in a default size for images

Posted by ah...@apache.org.
don't lock in a default size for images


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ec178634
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ec178634
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ec178634

Branch: refs/heads/develop
Commit: ec178634f044fbf2413873ff6f069de6ff63c3f7
Parents: 1dd28af
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 8 22:43:48 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:31 2014 -0700

----------------------------------------------------------------------
 frameworks/as/projects/FlexJSUI/defaults.css | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ec178634/frameworks/as/projects/FlexJSUI/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/defaults.css b/frameworks/as/projects/FlexJSUI/defaults.css
index 092f95b..b616d0d 100644
--- a/frameworks/as/projects/FlexJSUI/defaults.css
+++ b/frameworks/as/projects/FlexJSUI/defaults.css
@@ -259,8 +259,6 @@ DropDownListList
 
 Image
 {
-    width: 64;
-    height: 64;
     IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageModel");
     IBeadView:  ClassReference("org.apache.flex.html.beads.ImageView");
 }


[07/16] git commit: [flex-asjs] [refs/heads/develop] - handle percentages in layout

Posted by ah...@apache.org.
handle percentages in layout


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/16491839
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/16491839
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/16491839

Branch: refs/heads/develop
Commit: 16491839de8e84d3adfa54b4be68a0042cf1ab89
Parents: 4efdd81
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 8 22:44:21 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:32 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/core/ILayoutChild.as    | 94 ++++++++++++++++++++
 .../src/org/apache/flex/core/IUIBase.as         |  8 +-
 .../FlexJSUI/src/org/apache/flex/core/UIBase.as | 74 ++++++++++++---
 .../src/org/apache/flex/core/UIButtonBase.as    | 60 ++++++++++++-
 .../html/beads/layouts/NonVirtualBasicLayout.as | 18 +++-
 .../beads/layouts/NonVirtualHorizontalLayout.as | 14 +++
 .../beads/layouts/NonVirtualVerticalLayout.as   | 14 +++
 7 files changed, 266 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/16491839/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/ILayoutChild.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/ILayoutChild.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/ILayoutChild.as
new file mode 100755
index 0000000..b2bf2cb
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/ILayoutChild.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+    import flash.display.DisplayObjectContainer;
+    
+    /**
+     *  The IChild interface is the basic interface for a 
+     *  component that is parented by another component.
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    public interface ILayoutChild extends IChild, IUIBase
+	{
+        /**
+         *  The requested percentage width of
+         *  this component in its container.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        function get percentWidth():Number;
+        function set percentWidth(value:Number):void;
+        
+        /**
+         *  The requested percentage height of
+         *  this component in its container.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        function get percentHeight():Number;
+        function set percentHeight(value:Number):void;
+        
+        /**
+         * Sets the height of the component without
+         * setting explicitHeight.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        function setHeight(value:Number):void;
+        
+        /**
+         * Sets the width of the component without
+         * setting explicitWidth.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        function setWidth(value:Number):void;
+        
+        /**
+         * Sets the width and height of the component 
+         * without setting explicitWidth or explicitHeight.
+         * It also sends one change event.  If both
+         * values change it only sends heightCHange event.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        function setWidthAndHeight(newWidth:Number, newHeight:Number):void;
+        
+   	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/16491839/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
index 8509678..445241b 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
@@ -99,8 +99,14 @@ package org.apache.flex.core
 		
 		/**
 		 * The height of the bounding box.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
 		 */
 		function get height():Number;
 		function set height(value:Number):void;
-	}
+        
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/16491839/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
index 98a7c86..18953be 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
@@ -49,7 +49,7 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class UIBase extends Sprite implements IStrandWithModel, IEventDispatcher, IParentIUIBase, IStyleableObject, IChild
+	public class UIBase extends Sprite implements IStrandWithModel, IEventDispatcher, IParentIUIBase, IStyleableObject, ILayoutChild
 	{
         /**
          *  Constructor.
@@ -252,11 +252,7 @@ package org.apache.flex.core
 				explicitWidth = value;
 			}
 			
-			if (_width != value)
-			{
-				_width = value;
-				dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
-			}
+            setWidth(value);
 		}
 
         /**
@@ -314,11 +310,7 @@ package org.apache.flex.core
 				explicitHeight = value;
 			}
 			
-			if (_height != value)
-			{
-				_height = value;
-				dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
-			}
+            setHeight(value);
 		}
         
         /**
@@ -334,7 +326,65 @@ package org.apache.flex.core
 		{
 			return super.height;
 		}
-		
+        
+        /**
+         *  @copy org.apache.flex.core.IUIBase#setHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function setHeight(value:Number):void
+        {
+            if (_height != value)
+            {
+                _height = value;
+                dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+            }            
+        }
+
+        /**
+         *  @copy org.apache.flex.core.IUIBase#setWidth
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function setWidth(value:Number):void
+        {
+            if (_width != value)
+            {
+                _width = value;
+                dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+            }
+        }
+        
+        /**
+         *  @copy org.apache.flex.core.IUIBase#setWidthAndHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function setWidthAndHeight(newWidth:Number, newHeight:Number):void
+        {
+            if (_width != newWidth)
+            {
+                _width = newWidth;
+                if (_height == newHeight)
+                    dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+            }
+            if (_height != newHeight)
+            {
+                _height = newHeight;
+                dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+            }            
+            
+        }
+        
 		private var _model:IBeadModel;
 
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/16491839/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
index 6dbcfd3..09e1d96 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
@@ -57,7 +57,7 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class UIButtonBase extends SimpleButton implements IStrandWithModel, IEventDispatcher, IUIBase, IStyleableObject
+	public class UIButtonBase extends SimpleButton implements IStrandWithModel, IEventDispatcher, IUIBase, IStyleableObject, ILayoutChild
 	{
         /**
          *  Constructor.
@@ -371,6 +371,64 @@ package org.apache.flex.core
 			return super.height;
 		}
 
+        /**
+         *  @copy org.apache.flex.core.IUIBase#setHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function setHeight(value:Number):void
+        {
+            if (_height != value)
+            {
+                _height = value;
+                dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+            }            
+        }
+        
+        /**
+         *  @copy org.apache.flex.core.IUIBase#setWidth
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function setWidth(value:Number):void
+        {
+            if (_width != value)
+            {
+                _width = value;
+                dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+            }
+        }
+        
+        /**
+         *  @copy org.apache.flex.core.IUIBase#setWidthAndHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function setWidthAndHeight(newWidth:Number, newHeight:Number):void
+        {
+            if (_width != newWidth)
+            {
+                _width = newWidth;
+                if (_height == newHeight)
+                    dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+            }
+            if (_height != newHeight)
+            {
+                _height = newHeight;
+                dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+            }            
+            
+        }
+        
         private var _model:IBeadModel;
 
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/16491839/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
index 7def726..0db1cc0 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
@@ -20,10 +20,11 @@ package org.apache.flex.html.beads.layouts
 {
 	
 	import org.apache.flex.core.IBeadLayout;
+    import org.apache.flex.core.ILayoutChild;
 	import org.apache.flex.core.ILayoutParent;
 	import org.apache.flex.core.IParentIUIBase;
 	import org.apache.flex.core.IStrand;
-	import org.apache.flex.core.IUIBase;
+    import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
@@ -83,7 +84,7 @@ package org.apache.flex.html.beads.layouts
 			var n:int = contentView.numElements;
 			for (var i:int = 0; i < n; i++)
 			{
-				var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+				var child:ILayoutChild = contentView.getElementAt(i) as ILayoutChild;
                 var left:Number = ValuesManager.valuesImpl.getValue(child, "left");
                 var right:Number = ValuesManager.valuesImpl.getValue(child, "right");
                 var top:Number = ValuesManager.valuesImpl.getValue(child, "top");
@@ -97,6 +98,19 @@ package org.apache.flex.html.beads.layouts
                 {
                     child.y = top;
                 }
+                var ilc:ILayoutChild;
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight(contentView.height * ilc.percentHeight / 100);
+                }
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentWidth))
+                        ilc.setWidth(contentView.width * ilc.percentWidth / 100);
+                }
                 if (!isNaN(right))
                 {
                     if (!isNaN(left))

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/16491839/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
index 1da19a8..062972b 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
@@ -19,6 +19,7 @@
 package org.apache.flex.html.beads.layouts
 {
 	import org.apache.flex.core.IBeadLayout;
+    import org.apache.flex.core.ILayoutChild;
 	import org.apache.flex.core.ILayoutParent;
 	import org.apache.flex.core.IStrand;
     import org.apache.flex.core.IParentIUIBase;
@@ -77,6 +78,7 @@ package org.apache.flex.html.beads.layouts
 			var contentView:IParentIUIBase = layoutParent.contentView;
 			
 			var n:int = contentView.numElements;
+            var ilc:ILayoutChild;
 			var marginLeft:Object;
 			var marginRight:Object;
 			var marginTop:Object;
@@ -151,6 +153,12 @@ package org.apache.flex.html.beads.layouts
 					child.x = ml;
 				else
 					child.x = xx + ml + lastmr;
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentWidth))
+                        ilc.setWidth(contentView.width * ilc.percentWidth / 100);
+                }
 				xx = child.x + child.width;
 				lastmr = mr;
 				var valign:Object = ValuesManager.valuesImpl.getValue(child, "vertical-align");
@@ -160,6 +168,12 @@ package org.apache.flex.html.beads.layouts
 			{
 				var obj:Object = verticalMargins[0]
 				child = contentView.getElementAt(i) as IUIBase;
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight(contentView.height * ilc.percentHeight / 100);
+                }
 				if (obj.valign == "middle")
 					child.y = maxHeight - child.height / 2;
 				else if (valign == "bottom")

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/16491839/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
index 082980f..0bc1bdd 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
@@ -20,6 +20,7 @@ package org.apache.flex.html.beads.layouts
 {
 	
 	import org.apache.flex.core.IBeadLayout;
+    import org.apache.flex.core.ILayoutChild;
 	import org.apache.flex.core.ILayoutParent;
     import org.apache.flex.core.IParentIUIBase;
 	import org.apache.flex.core.IStrand;
@@ -80,6 +81,7 @@ package org.apache.flex.html.beads.layouts
 			var n:int = contentView.numElements;
 			var hasHorizontalFlex:Boolean;
 			var flexibleHorizontalMargins:Array = [];
+            var ilc:ILayoutChild;
 			var marginLeft:Object;
 			var marginRight:Object;
 			var marginTop:Object;
@@ -134,6 +136,12 @@ package org.apache.flex.html.beads.layouts
 					child.y = mt;
 				else
 					child.y = yy + Math.max(mt, lastmb);
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight(contentView.height * ilc.percentHeight / 100);
+                }
 				yy = child.y + child.height;
 				lastmb = mb;
 				flexibleHorizontalMargins[i] = {};
@@ -179,6 +187,12 @@ package org.apache.flex.html.beads.layouts
 				for (i = 0; i < n; i++)
 				{
 					child = contentView.getElementAt(i) as IUIBase;
+                    if (child is ILayoutChild)
+                    {
+                        ilc = child as ILayoutChild;
+                        if (!isNaN(ilc.percentWidth))
+                            ilc.setWidth(contentView.width * ilc.percentWidth / 100);
+                    }
 					var obj:Object = flexibleHorizontalMargins[i];
 					if (obj.marginLeft == "auto" && obj.marginRight == "auto")
 						child.x = maxWidth - child.width / 2;


[10/16] git commit: [flex-asjs] [refs/heads/develop] - send size change events if needed when image arrives

Posted by ah...@apache.org.
send size change events if needed when image arrives


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ce5f83ed
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ce5f83ed
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ce5f83ed

Branch: refs/heads/develop
Commit: ce5f83ed039724be3a3309a9833318dfa123b78d
Parents: c7f8a2d
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:25:53 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:33 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/html/beads/ImageView.as | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ce5f83ed/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
index c3911d2..2bbed3e 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
@@ -96,15 +96,20 @@ package org.apache.flex.html.beads
 		 */
 		private function onComplete(event:Object):void
 		{
+            var host:UIBase = UIBase(_strand);
 			if (bitmap) {
-				UIBase(_strand).removeChild(bitmap);
+				host.removeChild(bitmap);
 			}
 			
 			bitmap = Bitmap(LoaderInfo(event.target).content);
 			
-			UIBase(_strand).addChild(bitmap);
+			host.addChild(bitmap);
 			
-			handleSizeChange(null);
+            if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
+                host.dispatchEvent(new Event("widthChanged"));
+            if (isNaN(host.explicitHeight) && isNaN(host.percentHeight))
+                host.dispatchEvent(new Event("heightChanged"));
+                
 		}
 		
 		/**
@@ -112,9 +117,12 @@ package org.apache.flex.html.beads
 		 */
 		private function handleSizeChange(event:Object):void
 		{
-			if (bitmap) {
-				bitmap.width = UIBase(_strand).width;
-				bitmap.height = UIBase(_strand).height;
+            var host:UIBase = UIBase(_strand);
+            if (bitmap) {
+                if (!isNaN(host.explicitWidth) || !isNaN(host.percentWidth))
+	    			bitmap.width = UIBase(_strand).width;
+                if (!isNaN(host.explicitHeight) || !isNaN(host.percentHeight))
+    				bitmap.height = UIBase(_strand).height;
 			}
 		}
 	}


[12/16] git commit: [flex-asjs] [refs/heads/develop] - fix when we set the width of children

Posted by ah...@apache.org.
fix when we set the width of children


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c7e263eb
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c7e263eb
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c7e263eb

Branch: refs/heads/develop
Commit: c7e263eb34a6d6a8684e92b06c9c053869b50a1a
Parents: d6dcd95
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 9 14:27:31 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 10 07:34:33 2014 -0700

----------------------------------------------------------------------
 .../html/beads/layouts/NonVirtualVerticalLayout.as     | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c7e263eb/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
index 0bc1bdd..fb7977f 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
@@ -70,6 +70,7 @@ package org.apache.flex.html.beads.layouts
 			IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
 			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
 			IEventDispatcher(value).addEventListener("itemsCreated", changeHandler);
+            IEventDispatcher(value).addEventListener("layoutNeeded", changeHandler);
 			IEventDispatcher(value).addEventListener("beadsAdded", changeHandler);
 		}
 	
@@ -180,6 +181,12 @@ package org.apache.flex.html.beads.layouts
 						flexibleHorizontalMargins[i].marginRight = mr;
 				}
 				child.x = ml;
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentWidth))
+                        ilc.setWidth(contentView.width * ilc.percentWidth / 100);
+                }
 				maxWidth = Math.max(maxWidth, ml + child.width + mr);
 			}
 			if (hasHorizontalFlex)
@@ -187,12 +194,6 @@ package org.apache.flex.html.beads.layouts
 				for (i = 0; i < n; i++)
 				{
 					child = contentView.getElementAt(i) as IUIBase;
-                    if (child is ILayoutChild)
-                    {
-                        ilc = child as ILayoutChild;
-                        if (!isNaN(ilc.percentWidth))
-                            ilc.setWidth(contentView.width * ilc.percentWidth / 100);
-                    }
 					var obj:Object = flexibleHorizontalMargins[i];
 					if (obj.marginLeft == "auto" && obj.marginRight == "auto")
 						child.x = maxWidth - child.width / 2;