flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [2/3] git commit: [flex-asjs] [refs/heads/develop] - Container support. Change addToParent to call internalAddChild in parent
Date Fri, 10 May 2013 03:37:10 GMT
Container support.  Change addToParent to call internalAddChild in parent


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

Branch: refs/heads/develop
Commit: bb532a5362fdd062fbf0d6365d295939e4a8cd11
Parents: 80e53e6
Author: Alex Harui <aharui@apache.org>
Authored: Thu May 9 17:18:52 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu May 9 17:21:13 2013 -0700

----------------------------------------------------------------------
 frameworks/as/basic-manifest.xml                   |    3 +
 frameworks/as/defaults.css                         |    5 +
 .../as/src/org/apache/flex/core/IContainer.as      |   26 +++
 frameworks/as/src/org/apache/flex/core/UIBase.as   |   63 +++++-
 .../org/apache/flex/html/staticControls/Button.as  |   24 ++-
 .../apache/flex/html/staticControls/Container.as   |   77 +++++++
 .../html/staticControls/beads/CSSTextButtonBead.as |    4 +-
 .../html/staticControls/beads/ContainerBead.as     |  104 ++++++++++
 .../html/staticControls/beads/IBackgroundBead.as   |   26 +++
 .../flex/html/staticControls/beads/IBorderBead.as  |   26 +++
 .../html/staticControls/beads/IContainerBead.as    |   26 +++
 .../staticControls/beads/SingleLineBorderBead.as   |    2 +-
 .../staticControls/beads/SolidBackgroundBead.as    |    2 +-
 .../beads/layouts/NonVirtualHorizontalLayout.as    |  142 +++++++++++++
 .../beads/layouts/NonVirtualVerticalLayout.as      |  161 +++++++++++++++
 .../org/apache/flex/utils/MXMLDataInterpreter.as   |    9 +
 .../FlexJS/src/org/apache/flex/core/Application.js |   11 +-
 .../js/FlexJS/src/org/apache/flex/core/ListBase.js |    2 +-
 .../js/FlexJS/src/org/apache/flex/core/UIBase.js   |   12 +-
 .../apache/flex/html/staticControls/CheckBox.js    |    2 +-
 .../apache/flex/html/staticControls/ComboBox.js    |    2 +-
 .../apache/flex/html/staticControls/Container.js   |   70 +++++++
 .../apache/flex/html/staticControls/RadioButton.js |    2 +-
 .../apache/flex/html/staticControls/TextArea.js    |    2 +-
 .../apache/flex/html/staticControls/TextButton.js  |    2 +-
 .../apache/flex/html/staticControls/TextInput.js   |    2 +-
 .../beads/layouts/NonVirtualHorizontalLayout.js    |   64 ++++++
 .../beads/layouts/NonVirtualVerticalLayout.js      |   64 ++++++
 .../apache/flex/html5/staticControls/CheckBox.js   |    2 +-
 .../apache/flex/html5/staticControls/ComboBox.js   |    2 +-
 .../flex/html5/staticControls/RadioButton.js       |    2 +-
 .../apache/flex/html5/staticControls/TextArea.js   |    2 +-
 .../apache/flex/html5/staticControls/TextButton.js |    2 +-
 .../apache/flex/html5/staticControls/TextInput.js  |    2 +-
 .../src/org/apache/flex/net/BinaryUploader.js      |    3 +-
 .../FlexJS/src/org/apache/flex/utils/BinaryData.js |   20 +-
 .../org/apache/flex/utils/MXMLDataInterpreter.js   |    4 +-
 37 files changed, 933 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/basic-manifest.xml b/frameworks/as/basic-manifest.xml
index 8654660..a453dd9 100644
--- a/frameworks/as/basic-manifest.xml
+++ b/frameworks/as/basic-manifest.xml
@@ -44,5 +44,8 @@
     <component id="JSONItemConverter" class="org.apache.flex.net.JSONItemConverter"/>
     <component id="ViewSourceContextMenuOption" class="org.apache.flex.utils.ViewSourceContextMenuOption"/>
     <component id="BinaryUploader" class="org.apache.flex.net.BinaryUploader"/>
+    <component id="Container" class="org.apache.flex.html.staticControls.Container"/>
+    <component id="NonVirtualVerticalLayout" class="org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout"/>
+    <component id="NonVirtualHorizontalLayout" class="org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout"/>
 
 </componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index 64b9b07..900c97d 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -67,6 +67,11 @@ CheckBox
     ICheckBoxBead:  ClassReference("org.apache.flex.html.staticControls.beads.CheckBoxBead");			
 }
 
+Container
+{
+	IContainerBead: ClassReference("org.apache.flex.html.staticControls.beads.ContainerBead")
+}
+
 ComboBox
 {
     IComboBoxBead: ClassReference("org.apache.flex.html.staticControls.beads.ComboBoxBead");

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/core/IContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/IContainer.as b/frameworks/as/src/org/apache/flex/core/IContainer.as
new file mode 100644
index 0000000..edcd66f
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/core/IContainer.as
@@ -0,0 +1,26 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+    public interface IContainer
+	{
+        function internalAddChild(child:Object):void;
+		function childrenAdded():void;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/UIBase.as b/frameworks/as/src/org/apache/flex/core/UIBase.as
index a624eca..d368b14 100644
--- a/frameworks/as/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/as/src/org/apache/flex/core/UIBase.as
@@ -18,8 +18,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.core
 {
-	import flash.display.DisplayObjectContainer;
+	import flash.display.DisplayObject;
 	import flash.display.Sprite;
+	
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
 	
@@ -34,7 +35,12 @@ package org.apache.flex.core
 		override public function get width():Number
 		{
 			if (isNaN(_width))
-				_width = Number(ValuesManager.valuesImpl.getValue(this, "width"));
+            {
+                var value:* = ValuesManager.valuesImpl.getValue(this, "width");
+                if (value === undefined)
+                    return $width;
+				_width = Number(value);
+            }
 			return _width;
 		}
 		override public function set width(value:Number):void
@@ -54,7 +60,12 @@ package org.apache.flex.core
 		override public function get height():Number
 		{
 			if (isNaN(_height))
-				_height = Number(ValuesManager.valuesImpl.getValue(this, "height"));
+            {
+                var value:* = ValuesManager.valuesImpl.getValue(this, "height");
+                if (value === undefined)
+                    return $height;
+  	            _height = Number(value);
+            }
 			return _height;
 		}
 		override public function set height(value:Number):void
@@ -157,9 +168,51 @@ package org.apache.flex.core
 			
 		}
 		
-		public function addToParent(p:DisplayObjectContainer):void
+		public function addToParent(p:Object):void
 		{
-			p.addChild(this);
+			if (p is UIBase)
+				UIBase(p).internalAddChild(this);
+            else
+    			p.addChild(this);
 		}
+		
+		/**
+		 * Used internally by addToParent() implementations
+		 * to determine attach a child to a parent.  Containers
+		 * may host controls in a sub-component in order to
+		 * manage scrolling and margins and other internal abstractions.
+		 * Each platform assumes that the appropriate platform call
+		 * will add the child to the parent (i.e. addChild on Flash, 
+		 * appendChild on HTML).
+		 */
+		public function internalAddChild(child:Object):void
+		{
+			addChild(child as DisplayObject);
+		}
+
+        /*
+        public function addToParent(p:Object):void
+        {
+            var doc:DisplayObjectContainer = p as DisplayObjectContainer;
+            if (p is UIBase)
+                doc = UIBase(p).getParentForChild(this) as DisplayObjectContainer;
+            doc.addChild(this);
+        }
+        */
+        
+        /**
+         * Used internally by addToParent() implementations
+         * to determine suitable parent for a child.  Containers
+         * may host controls in a sub-component in order to
+         * manage scrolling and margins and other internal abstractions.
+         * Each platform assumes that the appropriate platform call
+         * will add the child to the parent (i.e. addChild on Flash, 
+         * appendTo on HTML).
+        public function getParentForChild(child:Object):Object
+        {
+            return this;
+        }
+         */
+        
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/Button.as b/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
index ce74237..d27e860 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/Button.as
@@ -28,6 +28,7 @@ package org.apache.flex.html.staticControls
 	import org.apache.flex.core.IInitModel;
 	import org.apache.flex.core.IInitSkin;
 	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
 	
@@ -52,10 +53,17 @@ package org.apache.flex.html.staticControls
 			}
 		}
 		
-		private var _width:Number = 0;
+		private var _width:Number;
 		override public function get width():Number
 		{
-			return _width;
+            if (isNaN(_width))
+            {
+                var value:* = ValuesManager.valuesImpl.getValue(this, "width");
+                if (value === undefined)
+                    return $width;
+                _width = Number(value);
+            }
+            return _width;
 		}
 		override public function set width(value:Number):void
 		{
@@ -70,11 +78,19 @@ package org.apache.flex.html.staticControls
 			return super.width;
 		}
 		
-		private var _height:Number = 0;
+		private var _height:Number;
 		override public function get height():Number
 		{
-			return _height;
+            if (isNaN(_height))
+            {
+                var value:* = ValuesManager.valuesImpl.getValue(this, "height");
+                if (value === undefined)
+                    return $height;
+                _height = Number(value);
+            }
+            return _height;
 		}
+        
 		override public function set height(value:Number):void
 		{
 			if (_height != value)

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/Container.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/Container.as b/frameworks/as/src/org/apache/flex/html/staticControls/Container.as
new file mode 100644
index 0000000..35b2d19
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/Container.as
@@ -0,0 +1,77 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls
+{
+	import flash.display.DisplayObject;
+	import flash.display.DisplayObjectContainer;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IContainer;
+	import org.apache.flex.core.IInitSkin;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.html.staticControls.beads.IContainerBead;
+	
+    [Event(name="change", type="org.apache.flex.events.Event")]
+    
+	[DefaultProperty("mxmlContent")]
+	public class Container extends UIBase implements IContainer, IInitSkin
+	{
+		public function Container()
+		{
+			super();
+			actualParent = this;
+		}
+		
+		public var mxmlContent:Array;
+
+		public function initSkin():void
+		{
+			if (getBeadByType(IContainerBead) == null)
+				addBead(new (ValuesManager.valuesImpl.getValue(this, "iContainerBead")) as IBead);	
+		}
+		
+		private var actualParent:DisplayObjectContainer;
+		
+		public function setActualParent(parent:DisplayObjectContainer):void
+		{
+			actualParent = parent;	
+		}
+		
+		override public function internalAddChild(child:Object):void
+		{
+			actualParent.addChild(child as DisplayObject);
+		}
+
+		public function getChildren():Array
+		{
+			var children:Array = [];
+			var n:int = actualParent.numChildren;
+			for (var i:int = 0; i < n; i++)
+				children.push(actualParent.getChildAt(i));
+			return children;
+		}
+
+		public function childrenAdded():void
+		{
+			dispatchEvent(new Event("childrenAdded"));
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/CSSTextButtonBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/CSSTextButtonBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/CSSTextButtonBead.as
index 2992a8a..4e3ce57 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/CSSTextButtonBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/CSSTextButtonBead.as
@@ -110,7 +110,7 @@ package org.apache.flex.html.staticControls.beads
 			if (value != null)
 				borderThickness = value as uint;
 			var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
-			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "backgroundColor", state);
+			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
 			if (borderStyle == "solid")
 			{
 				SolidBorderUtil.drawBorder(sprite.graphics, 
@@ -119,7 +119,7 @@ package org.apache.flex.html.staticControls.beads
 				textField.y = (sprite.height - textField.height) / 2;
 				textField.x = (sprite.width - textField.width) / 2;
 			}			
-			var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "backgroundImage", state);
+			var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
 			if (backgroundImage)
 			{
 				var loader:Loader = new Loader();

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerBead.as
new file mode 100644
index 0000000..faac381
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerBead.as
@@ -0,0 +1,104 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+	import flash.display.DisplayObjectContainer;
+	import flash.display.Sprite;
+
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.html.staticControls.Container;
+	
+	public class ContainerBead implements IBead, IContainerBead
+	{
+		public function ContainerBead()
+		{
+		}
+				
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			var borderStyle:String;
+			var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
+			if (borderStyles is Array)
+			{
+				borderStyle = borderStyles[1];
+			}
+			if (borderStyle == null)
+			{
+				borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
+			}
+			if (borderStyle != null && borderStyle != "none")
+			{
+				if (value.getBeadByType(IBorderBead) == null)
+					value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);	
+			}
+			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
+			var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
+			if (backgroundColor != null || backgroundImage != null)
+			{
+				if (value.getBeadByType(IBackgroundBead) == null)
+					value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);					
+			}
+			
+			var paddingLeft:Object;
+			var paddingTop:Object;
+			var padding:Object = ValuesManager.valuesImpl.getValue(value, "padding");
+			if (padding is Array)
+			{
+				if (padding.length == 1)
+					paddingLeft = paddingTop = padding[0];
+				else if (padding.length <= 3)
+				{
+					paddingLeft = padding[1];
+					paddingTop = padding[0];
+				}
+				else if (padding.length == 4)
+				{
+					paddingLeft = padding[3];
+					paddingTop = padding[0];					
+				}
+			}
+			else if (padding == null)
+			{
+				paddingLeft = ValuesManager.valuesImpl.getValue(value, "padding-left");
+				paddingTop = ValuesManager.valuesImpl.getValue(value, "padding-top");
+			}
+			else
+			{
+				paddingLeft = paddingTop = padding;
+			}
+			var pl:Number = Number(paddingLeft);
+			var pt:Number = Number(paddingTop);
+			if ((!isNaN(pl) && pl > 0 ||
+				!isNaN(pt) && pt > 0))
+			{
+				var actualParent:Sprite = new Sprite();
+				DisplayObjectContainer(value).addChild(actualParent);
+				Container(value).setActualParent(actualParent);
+				actualParent.x = pl;
+				actualParent.y = pt;
+			}
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBackgroundBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBackgroundBead.as
new file mode 100644
index 0000000..f73da26
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBackgroundBead.as
@@ -0,0 +1,26 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+	import org.apache.flex.core.IBead;
+
+	public interface IBackgroundBead extends IBead
+	{
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBorderBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBorderBead.as
new file mode 100644
index 0000000..813be04
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IBorderBead.as
@@ -0,0 +1,26 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+	import org.apache.flex.core.IBead;
+
+	public interface IBorderBead extends IBead
+	{
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/IContainerBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IContainerBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IContainerBead.as
new file mode 100644
index 0000000..261d4d4
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IContainerBead.as
@@ -0,0 +1,26 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+	import org.apache.flex.core.IBead;
+
+	public interface IContainerBead extends IBead
+	{
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
index 6aaaad0..e10dafe 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
@@ -26,7 +26,7 @@ package org.apache.flex.html.staticControls.beads
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
 
-	public class SingleLineBorderBead implements IBead
+	public class SingleLineBorderBead implements IBead, IBorderBead
 	{
 		public function SingleLineBorderBead()
 		{

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SolidBackgroundBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SolidBackgroundBead.as
index 77c94e3..f588990 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SolidBackgroundBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SolidBackgroundBead.as
@@ -26,7 +26,7 @@ package org.apache.flex.html.staticControls.beads
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
 
-	public class SolidBackgroundBead implements IBead
+	public class SolidBackgroundBead implements IBead, IBackgroundBead
 	{
 		public function SolidBackgroundBead()
 		{

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.as
new file mode 100644
index 0000000..8f74871
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.as
@@ -0,0 +1,142 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads.layouts
+{
+	import flash.display.DisplayObject;
+	import flash.display.DisplayObjectContainer;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.staticControls.Container;
+
+	public class NonVirtualHorizontalLayout implements IBead
+	{
+		public function NonVirtualHorizontalLayout()
+		{
+		}
+		
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
+		}
+	
+		private function changeHandler(event:Event):void
+		{
+			var children:Array = 
+					Container(_strand).getChildren();
+			var n:int = children.length;
+			var marginLeft:Object;
+			var marginRight:Object;
+			var marginTop:Object;
+			var marginBottom:Object;
+			var margin:Object;
+			var maxHeight:Number = 0;
+            var verticalMargins:Array = [];
+			for (var i:int = 0; i < n; i++)
+			{
+				var child:DisplayObject = children[i];
+				margin = ValuesManager.valuesImpl.getValue(child, "margin");
+				if (margin is Array)
+				{
+					if (margin.length == 1)
+						marginLeft = marginTop = marginRight = marginBottom = margin[0];
+					else if (margin.length <= 3)
+					{
+						marginLeft = marginRight = margin[1];
+						marginTop = marginBottom = margin[0];
+					}
+					else if (margin.length == 4)
+					{
+						marginLeft = margin[3];
+						marginBottom = margin[2];
+						marginRight = margin[1];
+						marginTop = margin[0];					
+					}
+				}
+				else if (margin == null)
+				{
+					marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
+					marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
+					marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
+					marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
+				}
+				else
+				{
+					marginLeft = marginTop = marginBottom = marginRight = margin;
+				}
+				var ml:Number;
+				var mr:Number;
+				var mt:Number;
+				var mb:Number;
+				var lastmr:Number;
+				mt = Number(marginTop);
+				if (isNaN(mt))
+					mt = 0;
+				mb = Number(marginBottom);
+				if (isNaN(mb))
+					mb = 0;
+                if (marginLeft == "auto")
+                    ml = 0;
+                else
+                {
+                    ml = Number(marginLeft);
+                    if (isNaN(ml))
+                        ml = 0;
+                }
+				if (marginRight == "auto")
+					mr = 0;
+				else
+				{
+					mr = Number(marginRight);
+					if (isNaN(mr))
+						mr = 0;
+				}
+				child.y = mt;
+				maxHeight = Math.max(maxHeight, ml + child.height + mr);
+                var xx:Number;
+                if (i == 0)
+                    child.x = ml;
+                else
+                    child.x = xx + ml + lastmr;
+                xx = child.x + child.width;
+                lastmr = mr;
+                var valign:Object = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+                verticalMargins.push({ marginTop: marginTop, marginBottom: marginBottom, valign: valign });
+			}
+			for (i = 0; i < n; i++)
+			{
+                var obj:Object = verticalMargins[0]
+				child = children[i];
+				if (obj.valign == "middle")
+					child.y = maxHeight - child.height / 2;
+                else if (valign == "bottom")
+                    child.y = maxHeight - child.height - obj.marginBottom;
+                else
+                    child.y = obj.marginTop;
+			}
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.as
new file mode 100644
index 0000000..a7d3836
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads.layouts
+{
+	import flash.display.DisplayObject;
+	import flash.display.DisplayObjectContainer;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.staticControls.Container;
+
+	public class NonVirtualVerticalLayout implements IBead
+	{
+		public function NonVirtualVerticalLayout()
+		{
+		}
+		
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
+			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
+		}
+	
+		private function changeHandler(event:Event):void
+		{
+			var children:Array = 
+					Container(_strand).getChildren();
+			var n:int = children.length;
+			var hasHorizontalFlex:Boolean;
+			var flexibleHorizontalMargins:Array = [];
+			var marginLeft:Object;
+			var marginRight:Object;
+			var marginTop:Object;
+			var marginBottom:Object;
+			var margin:Object;
+			var maxWidth:Number = 0;
+			for (var i:int = 0; i < n; i++)
+			{
+				var child:DisplayObject = children[i];
+				margin = ValuesManager.valuesImpl.getValue(child, "margin");
+				if (margin is Array)
+				{
+					if (margin.length == 1)
+						marginLeft = marginTop = marginRight = marginBottom = margin[0];
+					else if (margin.length <= 3)
+					{
+						marginLeft = marginRight = margin[1];
+						marginTop = marginBottom = margin[0];
+					}
+					else if (margin.length == 4)
+					{
+						marginLeft = margin[3];
+						marginBottom = margin[2];
+						marginRight = margin[1];
+						marginTop = margin[0];					
+					}
+				}
+				else if (margin == null)
+				{
+					marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
+					marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
+					marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
+					marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
+				}
+				else
+				{
+					marginLeft = marginTop = marginBottom = marginRight = margin;
+				}
+				var ml:Number;
+				var mr:Number;
+				var mt:Number;
+				var mb:Number;
+				var lastmb:Number;
+				mt = Number(marginTop);
+				if (isNaN(mt))
+					mt = 0;
+				mb = Number(marginBottom);
+				if (isNaN(mb))
+					mb = 0;
+				var yy:Number;
+				if (i == 0)
+					child.y = mt;
+				else
+					child.y = yy + Math.max(mt, lastmb);
+				yy = child.y + child.height;
+				lastmb = mb;
+				flexibleHorizontalMargins[i] = {};
+				if (marginLeft == "auto")
+				{
+					ml = 0;
+					flexibleHorizontalMargins[i].marginLeft = marginLeft;
+					hasHorizontalFlex = true;
+				}
+				else
+				{
+					ml = Number(marginLeft);
+					if (isNaN(ml))
+					{
+						ml = 0;
+						flexibleHorizontalMargins[i].marginLeft = marginLeft;
+					}
+					else
+						flexibleHorizontalMargins[i].marginLeft = ml;
+				}
+				if (marginRight == "auto")
+				{
+					mr = 0;
+					flexibleHorizontalMargins[i].marginRight = marginRight;
+					hasHorizontalFlex = true;
+				}
+				else
+				{
+					mr = Number(marginRight);
+					if (isNaN(mr))
+					{
+						mr = 0;
+						flexibleHorizontalMargins[i].marginRight = marginRight;
+					}
+					else
+						flexibleHorizontalMargins[i].marginRight = mr;
+				}
+				child.x = ml;
+				maxWidth = Math.max(maxWidth, ml + child.width + mr);
+			}
+			if (hasHorizontalFlex)
+			{
+				for (i = 0; i < n; i++)
+				{
+					child = children[i];
+					var obj:Object = flexibleHorizontalMargins[i];
+					if (obj.marginLeft == "auto" && obj.marginRight == "auto")
+						child.x = maxWidth - child.width / 2;
+					else if (obj.marginLeft == "auto")
+						child.x = maxWidth - child.width - obj.marginRight;
+				}
+			}
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/as/src/org/apache/flex/utils/MXMLDataInterpreter.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/utils/MXMLDataInterpreter.as b/frameworks/as/src/org/apache/flex/utils/MXMLDataInterpreter.as
index 170f302..8b75606 100644
--- a/frameworks/as/src/org/apache/flex/utils/MXMLDataInterpreter.as
+++ b/frameworks/as/src/org/apache/flex/utils/MXMLDataInterpreter.as
@@ -27,6 +27,7 @@ import org.apache.flex.core.IDocument;
 import org.apache.flex.core.IInitModel;
 import org.apache.flex.core.IInitSkin;
 import org.apache.flex.core.UIBase;
+import org.apache.flex.core.IContainer;
 
 public class MXMLDataInterpreter
 {
@@ -92,6 +93,8 @@ public class MXMLDataInterpreter
             {
                 if (comp is UIBase)
                     comp.addToParent(parent);
+                else if (parent is IContainer)
+                    IContainer(parent).internalAddChild(comp as DisplayObject);
                 else if (comp is DisplayObject)
                     parent.addChild(comp as DisplayObject);
             }
@@ -210,7 +213,13 @@ public class MXMLDataInterpreter
             if (children)
             {
                 if (recursive)
+				{
                     generateMXMLInstances(document, comp as DisplayObjectContainer, children, recursive);
+					if (comp is IContainer)
+					{
+						IContainer(comp).childrenAdded();
+					}
+				}
                 else
                     comp.setMXMLDescriptor(children);
             }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js b/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
index b588ac7..e73db30 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
@@ -70,9 +70,18 @@ org.apache.flex.core.Application.prototype.start = function() {
 
   this.dispatchEvent('initialize');
 
-  this.initialView.addToParent(this.element);
+  this.initialView.addToParent(this);
   this.initialView.initUI(this.model);
 
   this.dispatchEvent('viewChanged');
 };
 
+/**
+ * @this {org.apache.flex.core.Application}
+ * @param {Object} child The element to be added.
+ */
+org.apache.flex.core.Application.prototype.internalAddChild =
+    function(child) {
+  this.element.appendChild(child);
+};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
index 275a679..29c5a8c 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
@@ -51,7 +51,7 @@ org.apache.flex.core.ListBase.prototype.addToParent = function(p) {
   goog.events.listen(this.element, 'change',
       goog.bind(this.changeHandler, this));
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
index b4f9f1b..c52c222 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
@@ -43,12 +43,20 @@ goog.inherits(org.apache.flex.core.UIBase,
 
 /**
  * @this {org.apache.flex.core.UIBase}
- * @param {Object} p The parent element.
+ * @param {Object} child The element to be added.
+ */
+org.apache.flex.core.UIBase.prototype.internalAddChild = function(child) {
+  this.element.appendChild(child);
+};
+
+/**
+ * @this {org.apache.flex.core.UIBase}
+ * @param {Object} p The parent component.
  */
 org.apache.flex.core.UIBase.prototype.addToParent = function(p) {
   this.element = document.createElement('div');
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
index 5142cb5..1f07a3a 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/CheckBox.js
@@ -45,7 +45,7 @@ org.apache.flex.html.staticControls.CheckBox.prototype.addToParent =
   this.element.appendChild(cb);
   this.element.appendChild(document.createTextNode('check box'));
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
   cb.flexjs_wrapper = this;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
index c8469c2..134b764 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
@@ -59,7 +59,7 @@ org.apache.flex.html.staticControls.ComboBox.prototype.addToParent =
 
   this.element.style.position = 'relative';
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Container.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Container.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Container.js
new file mode 100644
index 0000000..ff4dc97
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Container.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.Container');
+
+goog.require('org.apache.flex.core.UIBase');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.html.staticControls.Container = function() {
+  goog.base(this);
+};
+goog.inherits(org.apache.flex.html.staticControls.Container,
+    org.apache.flex.core.UIBase);
+
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.Container}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.html.staticControls.Container.prototype.addToParent =
+    function(p) {
+  var cb;
+
+  this.element = document.createElement('div');
+
+  p.internalAddChild(this.element);
+
+  this.positioner = this.element;
+  this.element.flexjs_wrapper = this;
+};
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.Container}
+ * @param {Object} child The element to be added.
+ */
+org.apache.flex.html.staticControls.Container.prototype.childrenAdded =
+    function() {
+
+  this.dispatchEvent('childrenAdded');
+};
+
+/**
+ * @this {org.apache.flex.html.staticControls.Container}
+ * @return {Array} the HTML DOM element children.
+ */
+org.apache.flex.html.staticControls.Container.prototype.internalChildren =
+    function() {
+
+  return this.element.children;
+};
+
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
index e8f67d6..4714f4c 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/RadioButton.js
@@ -45,7 +45,7 @@ org.apache.flex.html.staticControls.RadioButton.prototype.addToParent =
   this.element.appendChild(rb);
   this.element.appendChild(document.createTextNode('radio button'));
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
   rb.flexjs_wrapper = this;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
index 162199b..1ec8cb5 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextArea.js
@@ -38,7 +38,7 @@ org.apache.flex.html.staticControls.TextArea.prototype.addToParent =
     function(p) {
   this.element = document.createElement('textarea');
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
   this.element.flexjs_wrapper = this;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
index 59fe22b..1277fb2 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
@@ -39,7 +39,7 @@ org.apache.flex.html.staticControls.TextButton.prototype.addToParent =
   this.element = document.createElement('button');
   this.element.setAttribute('type', 'button');
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
   this.element.flexjs_wrapper = this;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
index 352a00e..87af395 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextInput.js
@@ -39,7 +39,7 @@ org.apache.flex.html.staticControls.TextInput.prototype.addToParent =
   this.element = document.createElement('input');
   this.element.setAttribute('type', 'input');
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
   this.element.flexjs_wrapper = this;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js
new file mode 100644
index 0000000..35828df
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalLayout.js
@@ -0,0 +1,64 @@
+/**
+ * Licensed 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.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout');
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout =
+    function() {
+
+  /**
+   * @private
+   * @type {Object}
+   */
+  this.strand_ = null;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout}
+ * @param {Object} value The new host.
+ */
+org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout.prototype.set_strand =
+    function(value) {
+  if (this.strand_ !== value) {
+    this.strand_ = value;
+    this.strand_.addEventListener('childrenAdded',
+        goog.bind(this.changeHandler, this));
+  }
+};
+
+
+/**
+ * @this {org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout}
+ * @param {org.apache.flex.events.Event} event The text getter.
+ */
+org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout.prototype.changeHandler = function(event) {
+  var children, i, n;
+
+  children = this.strand_.internalChildren();
+  n = children.length;
+  for (i = 0; i < n; i++)
+  {
+    if (children[i].style.display == 'none')
+      children[i].lastDisplay_ = 'inline-block';
+    else
+      children[i].style.display = 'inline-block';
+  }
+};
+
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.js
new file mode 100644
index 0000000..49285ce
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalLayout.js
@@ -0,0 +1,64 @@
+/**
+ * Licensed 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.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout');
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout =
+    function() {
+
+  /**
+   * @private
+   * @type {Object}
+   */
+  this.strand_ = null;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout}
+ * @param {Object} value The new host.
+ */
+org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout.prototype.set_strand =
+    function(value) {
+  if (this.strand_ !== value) {
+    this.strand_ = value;
+    this.strand_.addEventListener('childrenAdded',
+        goog.bind(this.changeHandler, this));
+  }
+};
+
+
+/**
+ * @this {org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout}
+ * @param {org.apache.flex.events.Event} event The text getter.
+ */
+org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout.prototype.changeHandler = function(event) {
+  var children, i, n;
+
+  children = this.strand_.internalChildren();
+  n = children.length;
+  for (i = 0; i < n; i++)
+  {
+    if (children[i].style.display == 'none')
+      children[i].lastDisplay_ = 'block';
+    else
+      children[i].style.display = 'block';
+  }
+};
+
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/CheckBox.js
index 7fc70e3..1be60e1 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/CheckBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/CheckBox.js
@@ -45,7 +45,7 @@ org.apache.flex.html5.staticControls.CheckBox.prototype.addToParent =
   this.element.appendChild(cb);
   this.element.appendChild(document.createTextNode('check box'));
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/ComboBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/ComboBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/ComboBox.js
index da79a74..63fb839 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/ComboBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/ComboBox.js
@@ -59,7 +59,7 @@ org.apache.flex.html5.staticControls.ComboBox.prototype.addToParent =
 
   this.element.style.position = 'relative';
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/RadioButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/RadioButton.js
index 9df7bb3..3df0fb7 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/RadioButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/RadioButton.js
@@ -45,7 +45,7 @@ org.apache.flex.html5.staticControls.RadioButton.prototype.addToParent =
   this.element.appendChild(rb);
   this.element.appendChild(document.createTextNode('radio button'));
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextArea.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextArea.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextArea.js
index 8aabd64..6ef785e 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextArea.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextArea.js
@@ -38,7 +38,7 @@ org.apache.flex.html5.staticControls.TextArea.prototype.addToParent =
     function(p) {
   this.element = document.createElement('textarea');
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextButton.js
index c0cad37..0e102a8 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextButton.js
@@ -39,7 +39,7 @@ org.apache.flex.html5.staticControls.TextButton.prototype.addToParent =
   this.element = document.createElement('button');
   this.element.setAttribute('type', 'button');
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextInput.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextInput.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextInput.js
index b093b98..11b72c7 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextInput.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/staticControls/TextInput.js
@@ -39,7 +39,7 @@ org.apache.flex.html5.staticControls.TextInput.prototype.addToParent =
   this.element = document.createElement('input');
   this.element.setAttribute('type', 'input');
 
-  p.appendChild(this.element);
+  p.internalAddChild(this.element);
 
   this.positioner = this.element;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js b/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js
index 448ced0..19eeb5c 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js
@@ -424,6 +424,7 @@ org.apache.flex.net.BinaryUploader.prototype.get_MXMLProperties = function() {
  * @param {Object} document The MXML object.
  * @param {string} id The id for the instance.
  */
-org.apache.flex.net.BinaryUploader.prototype.setDocument = function(document, id) {
+org.apache.flex.net.BinaryUploader.prototype.setDocument =
+  function(document, id) {
   this.document = document;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js
index f503fb8..5ca63a7 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js
@@ -51,7 +51,7 @@ org.apache.flex.utils.BinaryData.prototype.writeByte = function(b) {
   var view;
 
   this.growBuffer(1);
-  
+
   view = new Int8Array(this.data_, this.position_, 1);
   view[0] = b;
   this.position_++;
@@ -64,7 +64,7 @@ org.apache.flex.utils.BinaryData.prototype.writeByte = function(b) {
  */
 org.apache.flex.utils.BinaryData.prototype.writeShort = function(s) {
   var view;
-  
+
   this.growBuffer(2);
 
   view = new Int16Array(this.data_, this.position_, 1);
@@ -81,7 +81,7 @@ org.apache.flex.utils.BinaryData.prototype.writeInt = function(num) {
   var view;
 
   this.growBuffer(4);
-  
+
   view = new Int32Array(this.data_, this.position_, 1);
   view[0] = num;
   this.position_ += 4;
@@ -92,12 +92,12 @@ org.apache.flex.utils.BinaryData.prototype.writeInt = function(num) {
  * @this {org.apache.flex.utils.BinaryData}
  * @param {number} num The 32-bit unsigned integer to write.
  */
-org.apache.flex.utils.BinaryData.prototype.writeUnsignedInt = 
+org.apache.flex.utils.BinaryData.prototype.writeUnsignedInt =
     function(num) {
   var view;
 
   this.growBuffer(4);
-  
+
   view = new Uint32Array(this.data_, this.position_, 1);
   view[0] = num;
   this.position_ += 4;
@@ -110,7 +110,7 @@ org.apache.flex.utils.BinaryData.prototype.writeUnsignedInt =
  */
 org.apache.flex.utils.BinaryData.prototype.readByte = function() {
   var view;
-  
+
   view = new Int8Array(this.data_, this.position_, 1);
   this.position_++;
   return view[0];
@@ -123,7 +123,7 @@ org.apache.flex.utils.BinaryData.prototype.readByte = function() {
  */
 org.apache.flex.utils.BinaryData.prototype.readShort = function() {
   var view;
-  
+
   view = new Int16Array(this.data_, this.position_, 1);
   this.position_ += 2;
   return view[0];
@@ -136,7 +136,7 @@ org.apache.flex.utils.BinaryData.prototype.readShort = function() {
  */
 org.apache.flex.utils.BinaryData.prototype.readInteger = function() {
   var view;
-  
+
   view = new Int32Array(this.data_, this.position_, 1);
   this.position_ += 4;
   return view[0];
@@ -150,7 +150,7 @@ org.apache.flex.utils.BinaryData.prototype.readInteger = function() {
 org.apache.flex.utils.BinaryData.prototype.readUnsignedInteger =
     function() {
   var view;
-  
+
   view = new Uint32Array(this.data_, this.position_, 1);
   this.position_ += 4;
   return view[0];
@@ -199,7 +199,7 @@ org.apache.flex.utils.BinaryData.prototype.get_bytesAvailable = function() {
  */
 org.apache.flex.utils.BinaryData.prototype.growBuffer = function(extra) {
   var newBuffer, newView, view, i, n;
-  
+
   if (this.position_ >= this.data_.byteLength)
   {
     n = this.data_.byteLength;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bb532a53/frameworks/js/FlexJS/src/org/apache/flex/utils/MXMLDataInterpreter.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/MXMLDataInterpreter.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/MXMLDataInterpreter.js
index 4dc476d..949a202 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/MXMLDataInterpreter.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/MXMLDataInterpreter.js
@@ -112,7 +112,7 @@ org.apache.flex.utils.MXMLDataInterpreter.generateMXMLArray =
     comp = new Cls();
 
     if (parent) {
-      comp.addToParent(parent.element);
+      comp.addToParent(parent);
     }
 
     id = null;
@@ -257,6 +257,8 @@ org.apache.flex.utils.MXMLDataInterpreter.generateMXMLArray =
         self = org.apache.flex.utils.MXMLDataInterpreter;
         self.generateMXMLInstances(
             document, comp, children, opt_recursive);
+        if (typeof comp.childrenAdded === 'function') 
+            comp.childrenAdded();
       } else {
         comp.setMXMLDescriptor(children);
       }


Mime
View raw message