flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [08/13] git commit: [flex-asjs] [refs/heads/core_js_to_as] - move asjs to as
Date Fri, 30 Oct 2015 20:16:51 GMT
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
new file mode 100644
index 0000000..4198fea
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
@@ -0,0 +1,244 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.ILayoutChild;
+    import org.apache.flex.core.ILayoutHost;
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.IViewport;
+	import org.apache.flex.core.IViewportModel;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.geom.Rectangle;
+    import org.apache.flex.html.supportClasses.Viewport;
+    import org.apache.flex.utils.CSSContainerUtils;
+
+    /**
+     *  The FlexibleFirstChildHorizontalLayout class is a simple layout
+     *  bead.  It takes the set of children and lays them out
+     *  horizontally in one row, separating them according to
+     *  CSS layout rules for margin and padding styles. But it
+     *  will size the first child to take up as much or little
+     *  room as possible.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class FlexibleFirstChildHorizontalLayout implements IBeadLayout
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function FlexibleFirstChildHorizontalLayout()
+		{
+		}
+		
+        // the strand/host container is also an ILayoutChild because
+        // can have its size dictated by the host's parent which is
+        // important to know for layout optimization
+        private var host:ILayoutChild;
+		
+        /**
+         *  @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
+		{
+            host = value as ILayoutChild;
+		}
+		
+        private var _maxWidth:Number;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#maxWidth
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get maxWidth():Number
+        {
+            return _maxWidth;
+        }
+        
+        /**
+         *  @private 
+         */
+        public function set maxWidth(value:Number):void
+        {
+            _maxWidth = value;
+        }
+        
+        private var _maxHeight:Number;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#maxHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get maxHeight():Number
+        {
+            return _maxHeight;
+        }
+        
+        /**
+         *  @private 
+         */
+        public function set maxHeight(value:Number):void
+        {
+            _maxHeight = value;
+        }
+        
+        /**
+         * @copy org.apache.flex.core.IBeadLayout#layout
+         */
+		public function layout():Boolean
+		{
+			var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+			var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+            var hostSizedToContent:Boolean = host.isHeightSizedToContent();
+			
+			var n:int = contentView.numElements;
+			var marginLeft:Object;
+			var marginRight:Object;
+			var marginTop:Object;
+			var marginBottom:Object;
+			var margin:Object;
+			maxHeight = 0;
+			var verticalMargins:Array = [];
+			
+            var xx:Number = contentView.width;
+            if (isNaN(xx) || xx <= 0)
+                return true;
+            xx -= padding.right + 1; // some browsers won't layout to the edge
+            
+            for (var i:int = n - 1; i >= 0; i--)
+			{
+				var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+				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 + padding.top;
+				if (i == 0)
+                {
+                    child.x = ml + padding.left;
+                    child.width = xx - mr - child.x;
+                }
+				else
+                    child.x = xx - child.width - mr;
+                maxHeight = Math.max(maxHeight, mt + child.height + mb);
+				xx -= child.width + mr + ml;
+				lastmr = mr;
+				var valign:Object = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+				verticalMargins.push({ marginTop: mt, marginBottom: mb, valign: valign });
+			}
+			for (i = 0; i < n; i++)
+			{
+				var obj:Object = verticalMargins[0]
+				child = contentView.getElementAt(i) as IUIBase;
+				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;
+			}
+            if (hostSizedToContent)
+                ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom, true);
+			
+            return true;
+		}
+
+    }
+        
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
new file mode 100644
index 0000000..00d328b
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.IBead;
+    import org.apache.flex.core.IBeadView;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	
+	/**
+	 *  The LayoutChangeNotifier notifies layouts when a property
+     *  it is watching changes.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class LayoutChangeNotifier implements IBead
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function LayoutChangeNotifier()
+		{
+		}
+		
+		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;
+		}
+			
+        private var _value:* = undefined;
+        
+        /**
+         *  The value of the property being watched.  This is usually
+         *  a data binding expression.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function set initialValue(value:Object):void
+        {
+            _value = value;
+        }
+        
+		/**
+		 *  The value of the property being watched.  This is usually
+         *  a data binding expression.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function set watchedProperty(value:Object):void
+		{
+			if (_value !== value)
+            {
+                _value = value;
+                if (_strand is IBeadView)
+                    IBeadView(_strand).host.dispatchEvent(new Event("layoutNeeded"));
+                else
+                    IEventDispatcher(_strand).dispatchEvent(new Event("layoutNeeded"));
+            }
+		}
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
new file mode 100644
index 0000000..309ef3b
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
@@ -0,0 +1,332 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.IDocument;
+	import org.apache.flex.core.ILayoutChild;
+	import org.apache.flex.core.ILayoutHost;
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.utils.CSSUtils;
+    import org.apache.flex.utils.CSSContainerUtils;
+
+    /**
+     *  The OneFlexibleChildHorizontalLayout class is a simple layout
+     *  bead.  It takes the set of children and lays them out
+     *  horizontally in one row, separating them according to
+     *  CSS layout rules for margin and padding styles. But it
+     *  will size the one child to take up as much or little
+     *  room as possible.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class OneFlexibleChildHorizontalLayout implements IBeadLayout, IDocument
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function OneFlexibleChildHorizontalLayout()
+		{
+		}
+		
+        
+        /**
+         *  The id of the flexible child
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public var flexibleChild:String;
+        
+        private var actualChild:ILayoutChild;
+        
+        // the strand/host container is also an ILayoutChild because
+        // can have its size dictated by the host's parent which is
+        // important to know for layout optimization
+        private var host:ILayoutChild;
+		
+        /**
+         *  @private
+         *  The document.
+         */
+        private var document:Object;
+        
+        /**
+         *  @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
+		{
+            host = value as ILayoutChild;
+		}
+	
+        private var _maxWidth:Number;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#maxWidth
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get maxWidth():Number
+        {
+            return _maxWidth;
+        }
+        
+        /**
+         *  @private 
+         */
+        public function set maxWidth(value:Number):void
+        {
+            _maxWidth = value;
+        }
+        
+        private var _maxHeight:Number;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#maxHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get maxHeight():Number
+        {
+            return _maxHeight;
+        }
+        
+        /**
+         *  @private 
+         */
+        public function set maxHeight(value:Number):void
+        {
+            _maxHeight = value;
+        }
+        
+        /**
+         * @copy org.apache.flex.core.IBeadLayout#layout
+         */
+		public function layout():Boolean
+		{
+            var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+            var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+            actualChild = document[flexibleChild];
+
+            var ilc:ILayoutChild;
+			var n:int = contentView.numElements;
+			var marginLeft:Object;
+			var marginRight:Object;
+			var marginTop:Object;
+			var marginBottom:Object;
+			var margin:Object;
+			maxHeight = 0;
+			var verticalMargins:Array = new Array(n);
+			
+            var ww:Number = contentView.width - padding.right;
+            var hh:Number = contentView.height;
+            var xx:int = padding.left;
+            var flexChildIndex:int;
+            var ml:Number;
+            var mr:Number;
+            var mt:Number;
+            var mb:Number;
+            var lastmr:Number;
+            var lastml:Number;
+            var valign:Object;
+            var hostSizedToContent:Boolean = host.isHeightSizedToContent();
+            
+            for (var i:int = 0; i < n; i++)
+            {
+                var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+                if (child == actualChild)
+                {
+                    flexChildIndex = i;
+                    break;
+                }
+                margin = ValuesManager.valuesImpl.getValue(child, "margin");
+                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");
+                mt = CSSUtils.getTopValue(marginTop, margin, hh);
+                mb = CSSUtils.getBottomValue(marginBottom, margin, hh);
+                mr = CSSUtils.getRightValue(marginRight, margin, ww);
+                ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+                child.y = mt + padding.top;
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
+                }
+                maxHeight = Math.max(maxHeight, mt + child.height + mb);
+                child.x = xx + ml;
+                xx += child.width + ml + mr;
+                lastmr = mr;
+                valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+                verticalMargins[i] = { marginTop: mt, marginBottom: mb, valign: valign };
+            }
+
+            if (n > 0 && n > flexChildIndex)
+            {
+                for (i = n - 1; i > flexChildIndex; i--)
+    			{
+    				child = contentView.getElementAt(i) as IUIBase;
+    				margin = ValuesManager.valuesImpl.getValue(child, "margin");
+					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");
+    				mt = CSSUtils.getTopValue(marginTop, margin, hh);
+    				mb = CSSUtils.getTopValue(marginBottom, margin, hh);
+                    mr = CSSUtils.getRightValue(marginRight, margin, ww);
+                    ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+                    child.y = mt + padding.top;
+                    if (child is ILayoutChild)
+                    {
+                        ilc = child as ILayoutChild;
+                        if (!isNaN(ilc.percentHeight))
+                            ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
+                    }
+                    maxHeight = Math.max(maxHeight, mt + child.height + mb);
+                    child.x = ww - child.width - mr;
+    				ww -= child.width + ml + mr;
+    				lastml = ml;
+                    valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+                    verticalMargins[i] = { marginTop: mt, marginBottom: mb, valign: valign };
+    			}
+            
+                child = contentView.getElementAt(flexChildIndex) as IUIBase;
+                margin = ValuesManager.valuesImpl.getValue(child, "margin");
+                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");
+                mt = CSSUtils.getTopValue(marginTop, margin, hh);
+                mb = CSSUtils.getTopValue(marginBottom, margin, hh);
+                mr = CSSUtils.getRightValue(marginRight, margin, ww);
+                ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
+                }
+                child.x = xx + ml;
+                child.width = ww - child.x;
+                maxHeight = Math.max(maxHeight, mt + child.height + mb);
+                valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+                verticalMargins[flexChildIndex] = { marginTop: mt, marginBottom: mb, valign: valign };
+            }
+            if (hostSizedToContent)
+                ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom, true);
+            
+            for (i = 0; i < n; i++)
+			{
+				var obj:Object = verticalMargins[i]
+				child = contentView.getElementAt(i) as IUIBase;
+                setPositionAndHeight(child, obj.top, obj.marginTop, padding.top,
+                    obj.bottom, obj.marginBottom, padding.bottom, maxHeight, obj.valign);
+			}
+            return true;
+		}
+
+        private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number, pt:Number,
+                                              bottom:Number, mb:Number, pb:Number, h:Number, valign:String):void
+        {
+            var heightSet:Boolean = false; // if we've set the height in a way that gens a change event
+            var ySet:Boolean = false; // if we've set the y yet.
+            
+            var hh:Number = h;
+            var ilc:ILayoutChild = child as ILayoutChild;
+            if (!isNaN(top))
+            {
+                child.y = top + mt;
+                ySet = true;
+                hh -= top + mt;
+            }
+            else 
+            {
+                hh -= mt;
+            }
+            if (!isNaN(bottom))
+            {
+                if (!isNaN(top))
+                {
+                    if (ilc)
+                        ilc.setHeight(hh - bottom - mb, true);
+                    else 
+                    {
+                        child.height = hh - bottom - mb;
+                        heightSet = true;
+                    }
+                }
+                else
+                {
+                    child.y = h - bottom - mb - child.height - 1; // some browsers don't like going to the edge
+                    ySet = true;
+                }
+            }
+            if (ilc)
+            {
+                if (!isNaN(ilc.percentHeight))
+                    ilc.setHeight(h * ilc.percentHeight / 100, true);
+            }
+            if (valign == "center")
+                child.y = (h - child.height) / 2;
+            else if (valign == "bottom")
+                child.y = h - child.height - mb;
+            else
+                child.y = mt + pt;
+            if (!heightSet)
+                child.dispatchEvent(new Event("sizeChanged"));
+        }
+        
+        public function setDocument(document:Object, id:String = null):void
+        {
+            this.document = document;	
+        }
+    }
+        
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
new file mode 100644
index 0000000..77af305
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
@@ -0,0 +1,459 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.IDocument;
+	import org.apache.flex.core.ILayoutChild;
+	import org.apache.flex.core.ILayoutHost;
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.geom.Rectangle;
+    import org.apache.flex.utils.CSSContainerUtils;
+
+    /**
+     *  The OneFlexibleChildVerticalLayout class is a simple layout
+     *  bead.  It takes the set of children and lays them out
+     *  vertically in one column, separating them according to
+     *  CSS layout rules for margin and padding styles. But it
+     *  will size the one child to take up as much or little
+     *  room as possible.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class OneFlexibleChildVerticalLayout implements IBeadLayout, IDocument
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function OneFlexibleChildVerticalLayout()
+		{
+		}
+		
+        
+        /**
+         *  The id of the flexible child
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public var flexibleChild:String;
+        
+        private var actualChild:ILayoutChild;
+        
+        // the strand/host container is also an ILayoutChild because
+        // can have its size dictated by the host's parent which is
+        // important to know for layout optimization
+        private var host:ILayoutChild;
+		
+        /**
+         *  @private
+         *  The document.
+         */
+        private var document:Object;
+        
+        /**
+         *  @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
+		{
+            host = value as ILayoutChild;
+		}
+	       
+        private var _maxWidth:Number;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#maxWidth
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get maxWidth():Number
+        {
+            return _maxWidth;
+        }
+        
+        /**
+         *  @private 
+         */
+        public function set maxWidth(value:Number):void
+        {
+            _maxWidth = value;
+        }
+        
+        private var _maxHeight:Number;
+        
+        /**
+         *  @copy org.apache.flex.core.IBead#maxHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get maxHeight():Number
+        {
+            return _maxHeight;
+        }
+        
+        /**
+         *  @private 
+         */
+        public function set maxHeight(value:Number):void
+        {
+            _maxHeight = value;
+        }
+        
+        /**
+         * @copy org.apache.flex.core.IBeadLayout#layout
+         */
+		public function layout():Boolean
+		{
+            var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+            var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+			actualChild = document[flexibleChild];
+            
+            var ilc:ILayoutChild;
+			var n:int = contentView.numElements;
+			var marginLeft:Object;
+			var marginRight:Object;
+			var marginTop:Object;
+			var marginBottom:Object;
+			var margin:Object;
+			maxWidth = 0;
+            
+            var w:Number = contentView.width;			
+            var hh:Number = contentView.height - padding.bottom;
+            var yy:int = padding.top;
+            var flexChildIndex:int;
+            var ml:Number;
+            var mr:Number;
+            var mt:Number;
+            var mb:Number;
+            var lastmb:Number;
+            var lastmt:Number;
+            var halign:Object;
+            var left:Number;
+            var right:Number;
+            
+            for (var i:int = 0; i < n; i++)
+            {
+                var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+                ilc = child as ILayoutChild;
+                left = ValuesManager.valuesImpl.getValue(child, "left");
+                right = ValuesManager.valuesImpl.getValue(child, "right");
+                if (child == actualChild)
+                {
+                    flexChildIndex = i;
+                    break;
+                }
+                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;
+                }
+                mt = Number(marginTop);
+                if (isNaN(mt))
+                    mt = 0;
+                mb = Number(marginBottom);
+                if (isNaN(mb))
+                    mb = 0;
+                if (ilc)
+                {
+                    if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
+                }
+                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;
+                }
+                if (child is ILayoutChild)
+                {
+                    ilc = child as ILayoutChild;
+                    if (!isNaN(ilc.percentWidth))
+                        ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
+                }
+                maxWidth = Math.max(maxWidth, ml + child.width + mr);
+                setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
+                child.y = yy + mt;
+                yy += child.height + mt + mb;
+                lastmb = mb;
+            }
+
+            if (n > 0 && n > flexChildIndex)
+            {
+                for (i = n - 1; i > flexChildIndex; i--)
+    			{
+    				child = contentView.getElementAt(i) as IUIBase;
+                    ilc = child as ILayoutChild;
+                    left = ValuesManager.valuesImpl.getValue(child, "left");
+                    right = ValuesManager.valuesImpl.getValue(child, "right");
+    				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;
+    				}
+    				mt = Number(marginTop);
+    				if (isNaN(mt))
+    					mt = 0;
+    				mb = Number(marginBottom);
+    				if (isNaN(mb))
+    					mb = 0;
+                    if (ilc)
+                    {
+                        if (!isNaN(ilc.percentHeight))
+                            ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
+                    }
+    				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;
+    				}
+                    if (child is ILayoutChild)
+                    {
+                        ilc = child as ILayoutChild;
+                        if (!isNaN(ilc.percentWidth))
+                            ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
+                    }
+                    setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
+                    maxWidth = Math.max(maxWidth, ml + child.width + mr);
+                    child.y = hh - child.height - mb;
+    				hh -= child.height + mt + mb;
+    				lastmt = mt;
+    			}
+            } 
+            
+            child = contentView.getElementAt(flexChildIndex) as IUIBase;
+            ilc = child as ILayoutChild;
+            left = ValuesManager.valuesImpl.getValue(child, "left");
+            right = ValuesManager.valuesImpl.getValue(child, "right");
+            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;
+            }
+            mt = Number(marginTop);
+            if (isNaN(mt))
+                mt = 0;
+            mb = Number(marginBottom);
+            if (isNaN(mb))
+                mb = 0;
+            if (ilc)
+            {
+                if (!isNaN(ilc.percentHeight))
+                    ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
+            }
+            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;
+            }
+            if (child is ILayoutChild)
+            {
+                ilc = child as ILayoutChild;
+                if (!isNaN(ilc.percentWidth))
+                    ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
+            }
+            setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
+            maxWidth = Math.max(maxWidth, ml + child.width + mr);
+            child.y = yy + mt;
+            child.height = hh - mb - child.y;
+            
+            return true;
+		}
+
+        private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number, pl:Number,
+                                             right:Number, mr:Number, pr:Number, w:Number):void
+        {
+            var widthSet:Boolean = false;
+            
+            var ww:Number = w;
+            var ilc:ILayoutChild = child as ILayoutChild;
+            if (!isNaN(left))
+            {
+                child.x = left + ml;
+                ww -= left + ml;
+            }
+            else 
+            {
+                if (isNaN(right))
+                    child.x = ml + pl;
+                ww -= ml;
+            }
+            if (!isNaN(right))
+            {
+                if (!isNaN(left))
+                {
+                    if (ilc)
+                        ilc.setWidth(ww - right - mr, true);
+                    else
+                    {
+                        child.width = ww - right - mr;
+                        widthSet = true;
+                    }
+                }
+                else
+                    child.x = w - right - mr - child.width - 1; // some browsers don't like going all the way to the edge
+            }
+            if (ilc)
+            {
+                if (!isNaN(ilc.percentWidth))
+                    ilc.setWidth(w * ilc.percentWidth / 100, true);
+            }
+            if (!widthSet)
+                child.dispatchEvent(new Event("sizeChanged"));
+        }
+        
+        public function setDocument(document:Object, id:String = null):void
+        {
+            this.document = document;	
+        }
+        
+    }
+        
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
new file mode 100644
index 0000000..d32777d
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
@@ -0,0 +1,199 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.IContainer;
+	import org.apache.flex.core.ILayoutHost;
+	import org.apache.flex.core.IMeasurementBead;
+	import org.apache.flex.core.IParent;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.utils.CSSUtils;
+    import org.apache.flex.utils.CSSContainerUtils;    
+	
+	/**
+	 * ColumnLayout is a class that organizes the positioning of children
+	 * of a container into a set of columns where each column's width is set to
+	 * the maximum size of all of the children in that column.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class VerticalColumnLayout implements IBeadLayout
+	{
+		/**
+		 *  constructor
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function VerticalColumnLayout()
+		{
+		}
+		
+		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;
+		}
+		
+		
+		private var _numColumns:int;
+		
+		/**
+		 * The number of columns.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get numColumns():int
+		{
+			return _numColumns;
+		}
+		public function set numColumns(value:int):void
+		{
+			_numColumns = value;
+		}
+		
+        /**
+         * @copy org.apache.flex.core.IBeadLayout#layout
+         */
+		public function layout():Boolean
+		{			
+            var host:UIBase = UIBase(_strand);
+            var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+            var contentView:IParent = layoutParent.contentView;
+            var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+			var sw:Number = host.width;
+			var sh:Number = host.height;
+			
+            var hasWidth:Boolean = !host.isWidthSizedToContent();
+            var hasHeight:Boolean = !host.isHeightSizedToContent();
+			var e:IUIBase;
+			var i:int;
+			var col:int = 0;
+			var columns:Array = [];
+            var rows:Array = [];
+            var data:Array = [];
+			for (i = 0; i < numColumns; i++)
+				columns[i] = 0;
+
+            var marginLeft:Object;
+            var marginRight:Object;
+            var marginTop:Object;
+            var marginBottom:Object;
+            var margin:Object;
+            var ml:Number;
+            var mr:Number;
+            var mt:Number;
+            var mb:Number;
+			var n:int = contentView.numElements;
+            var rowData:Object = { rowHeight: 0 };
+			
+			// determine max widths of columns
+			for (i = 0; i < n; i++) {
+				e = contentView.getElementAt(i) as IUIBase;
+                margin = ValuesManager.valuesImpl.getValue(e, "margin");
+                marginLeft = ValuesManager.valuesImpl.getValue(e, "margin-left");
+                marginTop = ValuesManager.valuesImpl.getValue(e, "margin-top");
+                marginRight = ValuesManager.valuesImpl.getValue(e, "margin-right");
+                marginBottom = ValuesManager.valuesImpl.getValue(e, "margin-bottom");
+                mt = CSSUtils.getTopValue(marginTop, margin, sh);
+                mb = CSSUtils.getBottomValue(marginBottom, margin, sh);
+                mr = CSSUtils.getRightValue(marginRight, margin, sw);
+                ml = CSSUtils.getLeftValue(marginLeft, margin, sw);
+                data.push({ mt: mt, mb: mb, mr: mr, ml: ml});
+				var thisPrefWidth:int = 0;
+				if (e is IStrand)
+				{
+					var measure:IMeasurementBead = e.getBeadByType(IMeasurementBead) as IMeasurementBead;
+					if (measure)
+						thisPrefWidth = measure.measuredWidth + ml + mr;
+					else
+						thisPrefWidth = e.width + ml + mr;						
+				}
+				else
+					thisPrefWidth = e.width + ml + mr;
+				
+                rowData.rowHeight = Math.max(rowData.rowHeight, e.height + mt + mb);
+				columns[col] = Math.max(columns[col], thisPrefWidth);
+                col = col + 1;
+                if (col == numColumns)
+                {
+                    rows.push(rowData);
+                    rowData = {rowHeight: 0};
+                    col = 0;
+                }
+			}
+			
+            var lastmb:Number = 0;
+			var curx:int = padding.left;
+			var cury:int = padding.top;
+			var maxHeight:int = 0;
+            var maxWidth:int = 0;
+			col = 0;
+			for (i = 0; i < n; i++) 
+            {
+				e = contentView.getElementAt(i) as IUIBase;
+				e.x = curx + ml;
+				e.y = cury + data[i].mt;
+				curx += columns[col++];
+                maxHeight = Math.max(maxHeight, e.y + e.height + data[i].mb);
+                maxWidth = Math.max(maxWidth, e.x + e.width + data[i].mr);
+				if (col == numColumns)
+				{
+					cury += rows[0].rowHeight;
+                    rows.shift();
+					col = 0;
+					curx = padding.left;
+				}
+			}
+			if (!hasWidth && n > 0 && !isNaN(maxWidth))
+            {
+                UIBase(contentView).setWidth(maxWidth, true);
+            }
+            if (!hasHeight && n > 0 && !isNaN(maxHeight))
+            {
+                UIBase(contentView).setHeight(maxHeight, true);
+            }
+			return true;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as
new file mode 100644
index 0000000..f50b36a
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as
@@ -0,0 +1,72 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.models
+{
+	import org.apache.flex.core.IDataGridModel;
+	import org.apache.flex.events.Event;
+	
+	/**
+	 *  The DataGridModel class bead extends org.apache.flex.html.beads.modelsArraySelectionModel 
+	 *  and adds the array of org.apache.flex.html.supportClasses.DataGridColumns used to define 
+	 *  each of the column in the DataGrid.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DataGridModel extends ArraySelectionModel implements IDataGridModel
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DataGridModel()
+		{
+			super();
+		}
+		
+		private var _columns:Array;
+		
+		/**
+		 *  The array of org.apache.flex.html.supportClasses.DataGridColumns used to 
+		 *  define each column of the org.apache.flex.html.DataGrid.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get columns():Array
+		{
+			return _columns;
+		}
+		public function set columns(value:Array):void
+		{
+			if (_columns != value) {
+				_columns = value;
+				dispatchEvent( new Event("columnsChanged"));
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as
new file mode 100644
index 0000000..2959aad
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as
@@ -0,0 +1,86 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.models
+{
+	import org.apache.flex.core.IDataGridPresentationModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	
+	/**
+	 *  The DataGridPresentationModel class contains the data to label the columns
+	 *  of the org.apache.flex.html.DataGrid along with the height of the rows. 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DataGridPresentationModel extends ListPresentationModel implements IDataGridPresentationModel
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DataGridPresentationModel()
+		{
+			super();
+		}
+		
+		private var _columnLabels:Array;
+		
+		/**
+		 *  The labels for each column.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get columnLabels():Array
+		{
+			return _columnLabels;
+		}
+		public function set columnLabels(value:Array):void
+		{
+			if (value != _columnLabels) {
+				_columnLabels = value;
+				dispatchEvent(new Event("columnsChanged"));
+			}
+		}
+		
+		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
+		 */
+		override public function set strand(value:IStrand):void
+		{
+			_strand = value;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as
new file mode 100644
index 0000000..4b6fc18
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as
@@ -0,0 +1,189 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.models
+{	
+	import org.apache.flex.core.IDateChooserModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	
+	/**
+	 *  The DateChooserModel is a bead class that manages the data for a DataChooser. 
+	 *  This includes arrays of names for the months and days of the week as well the
+	 *  currently selected date.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DateChooserModel extends EventDispatcher implements IDateChooserModel
+	{
+		public function DateChooserModel()
+		{
+			// default displayed year and month to "today"
+			var today:Date = new Date();
+			displayedYear = today.getFullYear();
+			displayedMonth = today.getMonth();
+		}
+		
+		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;
+		}
+		
+		private var _dayNames:Array   = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
+		private var _monthNames:Array = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
+		private var _displayedYear:Number;
+		private var _displayedMonth:Number;
+		private var _firstDayOfWeek:Number = 0;
+		private var _selectedDate:Date;
+		
+		/**
+		 *  An array of strings used to name the days of the week with Sunday being the
+		 *  first element of the array.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get dayNames():Array
+		{
+			return _dayNames;
+		}
+		public function set dayNames(value:Array):void
+		{
+			_dayNames = value;
+			dispatchEvent( new Event("dayNamesChanged") );
+		}
+		
+		/**
+		 *  An array of strings used to name the months of the year with January being
+		 *  the first element of the array.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get monthNames():Array
+		{
+			return _monthNames;
+		}
+		public function set monthNames(value:Array):void
+		{
+			_monthNames = value;
+			dispatchEvent( new Event("monthNames") );
+		}
+		
+		/**
+		 *  The year currently displayed by the DateChooser.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get displayedYear():Number
+		{
+			return _displayedYear;
+		}
+		public function set displayedYear(value:Number):void
+		{
+			if (value != _displayedYear) {
+				_displayedYear = value;
+				dispatchEvent( new Event("displayedYearChanged") );
+			}
+		}
+		
+		/**
+		 *  The month currently displayed by the DateChooser.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get displayedMonth():Number
+		{
+			return _displayedMonth;
+		}
+		public function set displayedMonth(value:Number):void
+		{
+			if (_displayedMonth != value) {
+				_displayedMonth = value;
+				dispatchEvent( new Event("displayedMonthChanged") );
+			}
+		}
+		
+		/**
+		 *  The index of the first day of the week, Sunday = 0.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get firstDayOfWeek():Number
+		{
+			return _firstDayOfWeek;
+		}
+		public function set firstDayOfWeek(value:Number):void
+		{
+			if (value != _firstDayOfWeek) {
+				_firstDayOfWeek = value;
+				dispatchEvent( new Event("firstDayOfWeekChanged") );
+			}
+		}
+		
+		/**
+		 *  The currently selected date or null if no date has been selected.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get selectedDate():Date
+		{
+			return _selectedDate;
+		}
+		public function set selectedDate(value:Date):void
+		{
+			if (value != _selectedDate) {
+				_selectedDate = value;
+				dispatchEvent( new Event("selectedDateChanged") );
+				
+				displayedMonth = value.getMonth();
+				displayedYear  = value.getFullYear();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as
new file mode 100644
index 0000000..24e16fd
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.supportClasses
+{
+	import org.apache.flex.core.IFactory;
+
+	/**
+	 *  The DataGridColumn class is the collection of properties that describe
+	 *  a column of the org.apache.flex.html.DataGrid: which renderer 
+	 *  to use for each cell in the column, the width of the column, the label for the 
+	 *  column, and the name of the field in the data containing the value to display 
+	 *  in the column. 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DataGridColumn
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DataGridColumn()
+		{
+		}
+		
+		private var _itemRenderer:IFactory;
+		
+		/**
+		 *  The itemRenderer class or factory to use to make instances of itemRenderers for
+		 *  display of data.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get itemRenderer():IFactory
+		{
+			return _itemRenderer;
+		}
+		public function set itemRenderer(value:IFactory):void
+		{
+			_itemRenderer = value;
+		}
+		
+		private var _columnWidth:Number = Number.NaN;
+		
+		/**
+		 *  The width of the column (default is 100 pixels).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get columnWidth():Number
+		{
+			return _columnWidth;
+		}
+		public function set columnWidth(value:Number):void
+		{
+			_columnWidth = value;
+		}
+		
+		private var _label:String;
+		
+		/**
+		 *  The label for the column (appears in the header area).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get label():String
+		{
+			return _label;
+		}
+		public function set label(value:String):void
+		{
+			_label = value;
+		}
+		
+		private var _dataField:String;
+		
+		/**
+		 *  The name of the field containing the data value presented by the column. This value is used
+		 *  by the itemRenderer is select the property from the data.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get dataField():String
+		{
+			return _dataField;
+		}
+		public function set dataField(value:String):void
+		{
+			_dataField = value;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as
new file mode 100644
index 0000000..2d80b2f
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as
@@ -0,0 +1,67 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.supportClasses
+{
+	import org.apache.flex.html.TextButton;
+	
+	/**
+	 *  The DateChooserButton class is used for each button in the DateChooser. The
+	 *  button holds the day of the month the button is representing.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DateChooserButton extends TextButton
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DateChooserButton()
+		{
+			super();
+			className = "DateChooserButton";
+		}
+		
+		private var _dayOfMonth:int;
+		
+		/**
+		 *  The day of the month the button represents.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get dayOfMonth():int
+		{
+			return _dayOfMonth;
+		}
+		public function set dayOfMonth(value:int):void
+		{
+			_dayOfMonth = value;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
new file mode 100644
index 0000000..4d90c03
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
@@ -0,0 +1,295 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.supportClasses
+{
+	import org.apache.flex.core.ISelectableItemRenderer;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.core.graphics.GraphicsContainer;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.utils.MXMLDataInterpreter;
+	
+	/**
+	 *  The GraphicsItemRenderer provides a base class for itemRenderers that use graphics rather than
+	 *  components.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class GraphicsItemRenderer extends GraphicsContainer implements ISelectableItemRenderer
+	{
+		/**
+		 *  Constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function GraphicsItemRenderer()
+		{
+			super();
+		}
+		
+		/**
+		 * @private
+		 */
+		override public function addedToParent():void
+		{
+			super.addedToParent();
+			
+			// very common for item renderers to be resized by their containers,
+			addEventListener("widthChanged", sizeChangeHandler);
+			addEventListener("heightChanged", sizeChangeHandler);
+			
+			// each MXML file can also have styles in fx:Style block
+			ValuesManager.valuesImpl.init(this);
+			
+			MXMLDataInterpreter.generateMXMLProperties(this, mxmlProperties);
+			MXMLDataInterpreter.generateMXMLInstances(this, this, MXMLDescriptor);
+			
+			dispatchEvent(new Event("initBindings"));
+			dispatchEvent(new Event("initComplete"));
+			
+		}
+		
+		private var _labelField:String = "label";
+		
+		/**
+		 * The name of the field within the data to use as a label. Some itemRenderers use this field to
+		 * identify the value they should show while other itemRenderers ignore this if they are showing
+		 * complex information.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get labelField():String
+		{
+			return _labelField;
+		}
+		public function set labelField(value:String):void
+		{
+			_labelField = value;
+		}
+		
+		private var _index:int;
+		
+		/**
+		 *  The position with the dataProvider being shown by the itemRenderer instance.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get index():int
+		{
+			return _index;
+		}
+		public function set index(value:int):void
+		{
+			_index = value;
+		}
+		
+		private var _selected:Boolean;
+		
+		/**
+		 *  Whether or not the itemRenderer is in a selected state.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get selected():Boolean
+		{
+			return _selected;
+		}
+		public function set selected(value:Boolean):void
+		{
+			_selected = value;
+			updateRenderer();
+		}
+		
+		private var _hovered:Boolean;
+		
+		/**
+		 *  Whether or not the itemRenderer is in a hovered state.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get hovered():Boolean
+		{
+			return _hovered;
+		}
+		public function set hovered(value:Boolean):void
+		{
+			_hovered = value;
+			updateRenderer();
+		}
+		
+		private var _down:Boolean;
+		
+		/**
+		 *  Whether or not the itemRenderer is in a down (or pre-selected) state.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get down():Boolean
+		{
+			return _down;
+		}
+		public function set down(value:Boolean):void
+		{
+			_down = value;
+			updateRenderer();
+		}
+		
+		private var _data:Object;
+		
+		[Bindable("__NoChangeEvent__")]
+		/**
+		 *  The data being represented by this itemRenderer. This can be something simple like a String or
+		 *  a Number or something very complex.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get data():Object
+		{
+			return _data;
+		}
+		public function set data(value:Object):void
+		{
+			_data = value;
+		}
+		
+		private var _dataField:String;
+		
+		/**
+		 *  The name of the field within the data the itemRenderer should use.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get dataField():String
+		{
+			return _dataField;
+		}
+		public function set dataField(value:String):void
+		{
+			_dataField = value;
+		}
+		
+		private var _itemRendererParent:Object;
+		
+		/**
+		 * The parent container for the itemRenderer instance.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get itemRendererParent():Object
+		{
+			return _itemRendererParent;
+		}
+		public function set itemRendererParent(value:Object):void
+		{
+			_itemRendererParent = value;
+		}
+		
+		/**
+		 * @private
+		 */
+		public function updateRenderer():void
+		{
+//			if (down)
+//				backgroundColor = downColor;
+//			else if (hovered)
+//				backgroundColor = highlightColor;
+//			else if (selected)
+//				backgroundColor = selectedColor;
+		}
+		
+		/**
+		 *  @copy org.apache.flex.core.ItemRendererClassFactory#mxmlContent
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public var mxmlContent:Array;
+		
+		/**
+		 * @private
+		 */
+		public function get MXMLDescriptor():Array
+		{
+			return null;
+		}
+		
+		private var mxmlProperties:Array ;
+		
+		/**
+		 * @private
+		 */
+		public function generateMXMLAttributes(data:Array):void
+		{
+			mxmlProperties = data;
+		}
+		
+		/**
+		 * @private
+		 */
+		private function sizeChangeHandler(event:Event):void
+		{
+			adjustSize();
+		}
+		
+		/**
+		 *  This function is called whenever the itemRenderer changes size. Sub-classes should override
+		 *  this method an handle the size change.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function adjustSize():void
+		{
+			// handle in subclass
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/asjs/src/HTMLASJSClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/HTMLASJSClasses.as b/frameworks/projects/HTML/asjs/src/HTMLASJSClasses.as
deleted file mode 100644
index 4e7b67f..0000000
--- a/frameworks/projects/HTML/asjs/src/HTMLASJSClasses.as
+++ /dev/null
@@ -1,52 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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
-{
-
-/**
- *  @private
- *  This class is used to link additional classes into rpc.swc
- *  beyond those that are found by dependecy analysis starting
- *  from the classes specified in manifest.xml.
- */
-internal class HTMLASJSClasses
-{
-	import org.apache.flex.html.beads.DataGridColumnView; DataGridColumnView;
-	import org.apache.flex.html.beads.DataGridView; DataGridView;
-	import org.apache.flex.html.beads.DateChooserView; DateChooserView;
-	import org.apache.flex.html.beads.DateFieldView; DateFieldView;
-	import org.apache.flex.html.beads.layouts.DataGridLayout; DataGridLayout;
-    import org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout; FlexibleFirstChildHorizontalLayout;
-	import org.apache.flex.html.beads.models.DataGridModel; DataGridModel;
-	import org.apache.flex.html.beads.models.DateChooserModel; DateChooserModel;
-	import org.apache.flex.html.beads.models.DataGridPresentationModel; DataGridPresentationModel;
-	import org.apache.flex.html.beads.controllers.DateChooserMouseController; DateChooserMouseController;
-	import org.apache.flex.html.beads.controllers.DateFieldMouseController; DateFieldMouseController;
-	import org.apache.flex.html.supportClasses.DataGridColumn; DataGridColumn;
-	import org.apache.flex.html.supportClasses.DateChooserButton; DateChooserButton;
-	import org.apache.flex.html.supportClasses.GraphicsItemRenderer; GraphicsItemRenderer;
-    
-    import org.apache.flex.html.MXMLBeadViewBase; MXMLBeadViewBase;
-    import org.apache.flex.html.beads.TitleBarView; TitleBarView;
-    import org.apache.flex.html.beads.TitleBarMeasurementBead; TitleBarMeasurementBead;
-
-}
-
-}
-

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DataGrid.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DataGrid.as
deleted file mode 100644
index 4aa38d2..0000000
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DataGrid.as
+++ /dev/null
@@ -1,144 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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
-{
-	import org.apache.flex.core.IBead;
-	import org.apache.flex.core.IDataGridModel;
-	import org.apache.flex.core.IDataGridPresentationModel;
-	import org.apache.flex.core.UIBase;
-	import org.apache.flex.html.beads.models.DataGridPresentationModel;
-	
-	[Event(name="change", type="org.apache.flex.events.Event")]
-	
-	/**
-	 *  The DataGrid class displays a collection of data using columns and rows. Each
-	 *  column represents a specific field in the data set; each row represents a specific
-	 *  datum. The DataGrid is a composite component built with a org.apache.flex.html.ButtonBar 
-	 *  for the column headers and a org.apache.flex.html.List for each column. The DataGrid's 
-	 *  view bead (usually org.apache.flex.html.beads.DataGridView) constructs these parts while 
-	 *  itemRenderer factories contruct the elements to display the data in each cell.
-	 *  
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion FlexJS 0.0
-	 */
-	public class DataGrid extends UIBase
-	{
-		/**
-		 *  constructor.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function DataGrid()
-		{
-			super();
-		}
-		
-		/**
-		 *  The array of org.apache.flex.html.supportClasses.DataGridColumns used to 
-		 *  describe each column.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get columns():Array
-		{
-			return IDataGridModel(model).columns;
-		}
-		public function set columns(value:Array):void
-		{
-			IDataGridModel(model).columns = value;
-		}
-		
-		/**
-		 *  The object used to provide data to the org.apache.flex.html.DataGrid.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get dataProvider():Object
-		{
-			return IDataGridModel(model).dataProvider;
-		}
-		public function set dataProvider(value:Object):void
-		{
-			IDataGridModel(model).dataProvider = value;
-		}
-		
-		/**
-		 *  The currently selected row.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get selectedIndex():int
-		{
-			return IDataGridModel(model).selectedIndex;
-		}
-		
-		/**
-		 *  The DataGrid's presentation model
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get presentationModel():IDataGridPresentationModel
-		{
-			var beadMod:IBead = getBeadByType(IDataGridPresentationModel);
-			var presModel:IDataGridPresentationModel;
-			
-			if (beadMod == null) {
-				presModel = new DataGridPresentationModel();
-				addBead(presModel);
-			} else {
-				presModel = beadMod as IDataGridPresentationModel;
-			}
-			return presModel;
-		}
-				
-		/**
-		 *  The default height of each cell in every column
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get rowHeight():Number
-		{
-			return presentationModel.rowHeight;
-		}
-		public function set rowHeight(value:Number):void
-		{
-			presentationModel.rowHeight = value;
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fab34be3/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateChooser.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateChooser.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateChooser.as
deleted file mode 100644
index 33615ea..0000000
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/DateChooser.as
+++ /dev/null
@@ -1,74 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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
-{
-	import org.apache.flex.core.IDateChooserModel;
-	import org.apache.flex.core.UIBase;
-	
-	/**
-	 * The change event is dispatched when the selectedDate is changed.
-	 */
-	[Event(name="change", type="org.apache.flex.events.Event")]
-	
-	/**
-	 *  The DateChooser class is a component that displays a calendar.
-	 *  
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion FlexJS 0.0
-	 */
-	public class DateChooser extends UIBase
-	{
-		/**
-		 *  constructor.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function DateChooser()
-		{
-			super();
-			className = "DateChooser";
-			
-			// fix the DateChooser's size
-//			width = 280;
-//			height = 240;
-		}
-		
-		/**
-		 *  The currently selected date (or null if no date has been selected).
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function get selectedDate():Date
-		{
-			return IDateChooserModel(model).selectedDate;
-		}
-		public function set selectedDate(value:Date):void
-		{
-			IDateChooserModel(model).selectedDate = value;
-		}
-	}
-}


Mime
View raw message