flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [25/50] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - Merge commit 'b7dc23b30a0b712d97b27f4d0d0db6310405564b' into dual
Date Mon, 01 May 2017 03:48:24 GMT
Merge commit 'b7dc23b30a0b712d97b27f4d0d0db6310405564b' into dual

* commit 'b7dc23b30a0b712d97b27f4d0d0db6310405564b':
  - Remove unwanted quotation marks
  Added new Table component and pieces.
  Uses beadsAdded event instead of viewChanged.
  Map examples now working on JS platform.
  Updated MapSearch example.
  Updates for DesktopMap example.

Conflicts:
	frameworks/projects/HTML/src/main/flex/HTMLClasses.as
	frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as
	frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as
	frameworks/projects/HTML/src/main/resources/basic-manifest.xml


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

Branch: refs/heads/develop
Commit: a168d45a26928e988c79aae09ef308e9c211588b
Parents: 9ae73e0 b7dc23b
Author: Peter Ent <pent@apache.org>
Authored: Mon Apr 24 15:24:55 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Mon Apr 24 15:24:55 2017 -0400

----------------------------------------------------------------------
 .../DesktopMap/src/main/flex/MyInitialView.mxml | 113 ++++++----
 .../flexjs/DesktopMap/src/main/flex/NoLayout.as |  35 +++
 .../DesktopMap/src/main/flex/models/MyModel.as  |   6 +-
 .../main/resources/mdl-js-index-template.html   |   2 +-
 .../MapSearch/src/main/flex/MyInitialView.mxml  |  93 +++++---
 .../flexjs/MapSearch/src/main/flex/NoLayout.as  |  26 +++
 .../src/main/flex/SearchResultItemRenderer.mxml |  53 +++++
 .../MapSearch/src/main/flex/models/MyModel.as   |   6 +-
 .../Basic/src/main/flex/BasicClasses.as         |   9 +
 .../src/main/flex/org/apache/flex/html/Table.as |  67 ++++++
 .../main/flex/org/apache/flex/html/TableCell.as |  68 ++++++
 .../flex/org/apache/flex/html/TableHeader.as    |  67 ++++++
 .../main/flex/org/apache/flex/html/TableRow.as  |  69 ++++++
 .../org/apache/flex/html/beads/TableCellView.as |  54 +++++
 .../html/beads/layouts/SimpleTableLayout.as     | 213 +++++++++++++++++++
 .../flex/html/beads/layouts/TableCellLayout.as  | 120 +++++++++++
 .../html/beads/layouts/TableHeaderLayout.as     | 124 +++++++++++
 .../Basic/src/main/resources/basic-manifest.xml |   5 +
 .../Basic/src/main/resources/defaults.css       |  16 ++
 .../flex/maps/google/beads/GoogleMapView.as     |   2 +-
 20 files changed, 1073 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/BasicClasses.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/BasicClasses.as
index 07bb731,a81838b..70665e1
--- a/frameworks/projects/Basic/src/main/flex/BasicClasses.as
+++ b/frameworks/projects/Basic/src/main/flex/BasicClasses.as
@@@ -220,8 -208,6 +220,17 @@@ internal class BasicClasse
  		import org.apache.flex.html.beads.VRuleView; VRuleView;
  		import org.apache.flex.html.beads.MultilineTextFieldView; MultilineTextFieldView;
  	}
 +	
 +	import org.apache.flex.html.SubAppLoader; SubAppLoader;
++	
++	import org.apache.flex.html.Table; Table;
++	import org.apache.flex.html.TableRow; TableRow;
++	import org.apache.flex.html.TableCell; TableCell;
++	import org.apache.flex.html.TableHeader; TableHeader;
++	import org.apache.flex.html.beads.TableCellView; TableCellView;
++	import org.apache.flex.html.beads.layouts.SimpleTableLayout; SimpleTableLayout;
++	import org.apache.flex.html.beads.layouts.TableCellLayout; TableCellLayout;
++	import org.apache.flex.html.beads.layouts.TableHeaderLayout; TableHeaderLayout;
  }
  
  }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/Table.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/Table.as
index 0000000,0000000..2a572d4
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/Table.as
@@@ -1,0 -1,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
++{
++    COMPILE::JS
++    {
++        import org.apache.flex.core.WrappedHTMLElement;            
++    }
++
++	/**
++	 *  The Table class represents an HTML <table> element
++     *  
++	 *  
++     *  @toplevel
++	 *  @langversion 3.0
++	 *  @playerversion Flash 10.2
++	 *  @playerversion AIR 2.6
++	 *  @productversion FlexJS 0.0
++	 */
++	public class Table extends Group
++	{
++		/**
++		 *  constructor.
++		 *
++		 *  @langversion 3.0
++		 *  @playerversion Flash 10.2
++		 *  @playerversion AIR 2.6
++		 *  @productversion FlexJS 0.0
++		 */
++		public function Table()
++		{
++			super();
++			
++			className = "Table";
++		}
++
++        /**
++         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
++         */
++        COMPILE::JS
++        override protected function createElement():WrappedHTMLElement
++        {
++			element = document.createElement('table') as WrappedHTMLElement;
++
++            positioner = element;
++            element.flexjs_wrapper = this;
++            
++            return element;
++        }
++    }
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableCell.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableCell.as
index 0000000,0000000..863eeb7
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableCell.as
@@@ -1,0 -1,0 +1,68 @@@
++////////////////////////////////////////////////////////////////////////////////
++//
++//  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
++{
++    COMPILE::JS
++    {
++        import org.apache.flex.core.WrappedHTMLElement;            
++    }
++	
++	/**
++	 *  The TableCell class defines a table data cell in the Table component. This element
++	 *  may have nearly any type of FlexJS component as children.
++     *  
++	 *  
++     *  @toplevel
++	 *  @langversion 3.0
++	 *  @playerversion Flash 10.2
++	 *  @playerversion AIR 2.6
++	 *  @productversion FlexJS 0.0
++	 */
++	public class TableCell extends Group
++	{
++		/**
++		 *  constructor.
++		 *
++		 *  @langversion 3.0
++		 *  @playerversion Flash 10.2
++		 *  @playerversion AIR 2.6
++		 *  @productversion FlexJS 0.0
++		 */
++		public function TableCell()
++		{
++			super();
++			
++			className = "TableCell";
++		}
++		
++		/**
++		 * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
++		 */
++		COMPILE::JS
++		override protected function createElement():WrappedHTMLElement
++		{
++			element = document.createElement('td') as WrappedHTMLElement;
++			
++			positioner = element;
++			element.flexjs_wrapper = this;
++			
++			return element;
++		}
++    }
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableHeader.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableHeader.as
index 0000000,0000000..9c6e043
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableHeader.as
@@@ -1,0 -1,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
++{
++    COMPILE::JS
++    {
++        import org.apache.flex.core.WrappedHTMLElement;            
++    }
++	
++	/**
++	 *  The TableHeader class defines a table header cell in the Table component. 
++     *  
++	 *  
++     *  @toplevel
++	 *  @langversion 3.0
++	 *  @playerversion Flash 10.2
++	 *  @playerversion AIR 2.6
++	 *  @productversion FlexJS 0.0
++	 */
++	public class TableHeader extends TableCell
++	{
++		/**
++		 *  constructor.
++		 *
++		 *  @langversion 3.0
++		 *  @playerversion Flash 10.2
++		 *  @playerversion AIR 2.6
++		 *  @productversion FlexJS 0.0
++		 */
++		public function TableHeader()
++		{
++			super();
++			
++			className = "TableHeader";
++		}
++		
++		/**
++		 * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
++		 */
++		COMPILE::JS
++		override protected function createElement():WrappedHTMLElement
++		{
++			element = document.createElement('th') as WrappedHTMLElement;
++			
++			positioner = element;
++			element.flexjs_wrapper = this;
++			
++			return element;
++		}
++    }
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableRow.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableRow.as
index 0000000,0000000..f5bc359
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/TableRow.as
@@@ -1,0 -1,0 +1,69 @@@
++////////////////////////////////////////////////////////////////////////////////
++//
++//  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.UIBase;
++	
++	COMPILE::JS
++	{
++		import org.apache.flex.core.WrappedHTMLElement;            
++	}
++	
++	/**
++	 *  The TableRow class defines a row of a Table. This will translate to a <tr> elemement
++     *  
++	 *  
++     *  @toplevel
++	 *  @langversion 3.0
++	 *  @playerversion Flash 10.2
++	 *  @playerversion AIR 2.6
++	 *  @productversion FlexJS 0.0
++	 */
++	public class TableRow extends Group
++	{
++		/**
++		 *  constructor.
++		 *
++		 *  @langversion 3.0
++		 *  @playerversion Flash 10.2
++		 *  @playerversion AIR 2.6
++		 *  @productversion FlexJS 0.0
++		 */
++		public function TableRow()
++		{
++			super();
++			
++			className = "TableRow";
++		}
++		
++		/**
++		 * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
++		 */
++		COMPILE::JS
++		override protected function createElement():WrappedHTMLElement
++		{
++			element = document.createElement('tr') as WrappedHTMLElement;
++			
++			positioner = element;
++			element.flexjs_wrapper = this;
++			
++			return element;
++		}
++    }
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TableCellView.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TableCellView.as
index 0000000,0000000..443b4c3
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TableCellView.as
@@@ -1,0 -1,0 +1,54 @@@
++////////////////////////////////////////////////////////////////////////////////
++//
++//  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
++{
++    
++	
++	/**
++	 *  The TableCellView class is the view bead for TableCell. It has no function
++	 *  on the JS platform, but with SWF, it prevents the cell from shrinking
++	 *  to fit its content.
++	 *  
++	 *  @viewbead
++	 *  @langversion 3.0
++	 *  @playerversion Flash 10.2
++	 *  @playerversion AIR 2.6
++	 *  @productversion FlexJS 0.0
++	 */
++	public class TableCellView extends GroupView
++	{
++		/**
++		 *  constructor.
++		 *
++		 *  @langversion 3.0
++		 *  @playerversion Flash 10.2
++		 *  @playerversion AIR 2.6
++		 *  @productversion FlexJS 0.0
++		 */
++		public function TableCellView()
++		{
++			super();
++		}
++		
++		override public function afterLayout():void
++		{
++			// do nothing for TableCell
++		}
++	}
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/SimpleTableLayout.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/SimpleTableLayout.as
index 0000000,0000000..bf8b35a
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/SimpleTableLayout.as
@@@ -1,0 -1,0 +1,213 @@@
++////////////////////////////////////////////////////////////////////////////////
++//
++//  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.LayoutBase;
++	
++	import org.apache.flex.core.IBeadLayout;
++	import org.apache.flex.core.ILayoutView;
++	import org.apache.flex.html.TableCell;
++	import org.apache.flex.html.TableRow;
++	
++	COMPILE::SWF {
++		import org.apache.flex.geom.Rectangle;
++		import org.apache.flex.utils.CSSUtils;
++		import org.apache.flex.utils.CSSContainerUtils;
++	}
++
++    /**
++     *  The SimpleTableLayout is the layout for the Table component. On the SWF platform
it mimics
++	 *  the HTML <table> element and makes sure all the columns and rows are even. It
does not
++	 *  support column or row spanning.
++     *
++     *  @langversion 3.0
++     *  @playerversion Flash 10.2
++     *  @playerversion AIR 2.6
++     *  @productversion FlexJS 0.0
++     */
++	public class SimpleTableLayout extends LayoutBase implements IBeadLayout
++	{
++        /**
++         *  Constructor.
++         *
++         *  @langversion 3.0
++         *  @playerversion Flash 10.2
++         *  @playerversion AIR 2.6
++         *  @productversion FlexJS 0.0
++         */
++		public function SimpleTableLayout()
++		{
++			super();
++		}
++
++        /**
++         * @copy org.apache.flex.core.IBeadLayout#layout
++		 * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
++		 * @flexjsignorecoercion org.apache.flex.core.UIBase
++         */
++		override public function layout():Boolean
++		{
++            COMPILE::SWF
++            {
++				var contentView:ILayoutView = layoutView;
++				
++				var n:int = contentView.numElements;
++				if (n == 0) return false;
++
++				var hostWidthSizedToContent:Boolean = host.isWidthSizedToContent();
++				var hostHeightSizedToContent:Boolean = host.isHeightSizedToContent();
++				var hostWidth:Number = hostWidthSizedToContent ? host.width : contentView.width;
++				var hostHeight:Number = hostHeightSizedToContent ? host.height : contentView.height;
++				
++				var paddingMetrics:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
++				var borderMetrics:Rectangle = CSSContainerUtils.getBorderMetrics(host);
++				
++				// adjust the host's usable size by the metrics. If hostSizedToContent, then the
++				// resulting adjusted value may be less than zero.
++				hostWidth -= paddingMetrics.left + paddingMetrics.right + borderMetrics.left + borderMetrics.right;
++				hostHeight -= paddingMetrics.top + paddingMetrics.bottom + borderMetrics.top + borderMetrics.bottom;
++				
++				var numRows:int = n;
++				var numCols:int = 0;
++
++				// pass 1: figure out the number of columns (numRows is already given)
++                for (var i:int = 0; i < n; i++)
++                {
++                    var row:TableRow = contentView.getElementAt(i) as TableRow;
++					if (row == null || !row.visible) {
++						numRows -= 1;
++						continue;
++					}
++					
++					numCols = Math.max(numCols,row.numElements);
++				}
++				
++				// these defaults may change once the next pass is complete.
++				var defaultColWidth:Number = hostWidth / numCols;
++				var defaultRowHeight:Number = hostHeight / numRows;
++				
++				var remainingWidth:Number = hostWidth;
++				var remainingHeight:Number = hostHeight;
++				
++				var colWidths:Array = new Array(numCols);
++				var colActuals:Array = new Array(numCols);
++				for(j=0; j < numCols; j++) { colWidths[j] = 0; colActuals[j] = 0; }
++				
++				var rowHeights:Array = new Array(numRows);
++				for(i=0; i < numRows; i++) rowHeights[i] = 0;
++				
++				// pass2: figure out the sizes things should be
++				for(i=0; i < n; i++)
++				{
++					row = contentView.getElementAt(i) as TableRow;
++					if (row == null || !row.visible) continue;
++					
++					for(var j:int=0; j < row.numElements; j++)
++					{
++						var cell:TableCell = row.getElementAt(j) as TableCell;
++						if (cell == null || !cell.visible) continue;
++						
++						if (cell.isWidthSizedToContent()) {
++							colWidths[j] = Math.max(colWidths[j],0);
++							colActuals[j] = Math.max(colActuals[j],cell.width);
++						} else {
++							if (isNaN(cell.percentWidth)) {
++								colWidths[j] = Math.max(colWidths[j],cell.width);
++							} else {
++								colWidths[j] = Math.max(colWidths[j],(hostWidth*cell.percentWidth/100.0));
++							}
++							colActuals[j] = Math.max(colActuals[j],colWidths[j]);
++						}
++						
++						if (cell.isHeightSizedToContent()) {
++							rowHeights[i] = Math.max(rowHeights[i],0);
++						} else {
++							if (isNaN(cell.percentHeight)) {
++								rowHeights[i] = Math.max(rowHeights[i],cell.height);
++							} else {
++								rowHeights[i] = Math.max(rowHeights[i],(hostHeight*cell.percentHeight/100.0));
++							}
++						}
++					}
++                }
++				
++				var needsDefaultColWidthCount:int = 0;
++				var needsDefaultRowHeightCount:int = 0;
++				
++				// pass3: determine default sizes for cells without size
++				for(i=0; i < rowHeights.length; i++) {
++					if (!isNaN(rowHeights[i]) && rowHeights[i] > 0) remainingHeight -= rowHeights[i];
++					else needsDefaultRowHeightCount++;
++				}
++				for(j=0; j < colWidths.length; j++) {
++					if (colWidths[j] == 0) {
++						if (colActuals[j] > defaultColWidth) {
++							colWidths[j] = colActuals[j];
++							remainingWidth -= colActuals[j];
++						}
++						else {
++							needsDefaultColWidthCount++;
++						}
++					} else {
++						remainingWidth -= colWidths[j];
++					}
++				}
++				
++				defaultColWidth = remainingWidth / needsDefaultColWidthCount;
++				defaultRowHeight = remainingHeight / needsDefaultRowHeightCount;
++				
++				var ypos:Number = paddingMetrics.top + borderMetrics.top;
++				
++				// pass4: size everything
++				for(i=0; i < n; i++)
++				{
++					row = contentView.getElementAt(i) as TableRow;
++					if (row == null || !row.visible) continue;
++					
++					var xpos:Number = paddingMetrics.left + borderMetrics.left;
++					
++					for(j=0; j < row.numElements; j++)
++					{
++						cell = row.getElementAt(j) as TableCell;
++						if (cell == null || !cell.visible) continue;
++						
++						var useWidth:Number = colWidths[j] > 0 ? colWidths[j] : defaultColWidth;
++						var useHeight:Number = rowHeights[i] > 0 ? rowHeights[i] : defaultRowHeight;
++						
++						cell.x = xpos;
++						cell.y = ypos;
++						cell.setWidthAndHeight(useWidth, useHeight);
++						
++						xpos += useWidth;
++					}
++					
++					ypos += rowHeights[i] > 0 ? rowHeights[i] : defaultRowHeight;
++				}
++
++                return true;
++
++            }
++
++            COMPILE::JS
++            {
++                return true;
++            }
++		}
++	}
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/TableCellLayout.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/TableCellLayout.as
index 0000000,0000000..0dd9dc4
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/TableCellLayout.as
@@@ -1,0 -1,0 +1,120 @@@
++////////////////////////////////////////////////////////////////////////////////
++//
++//  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.LayoutBase;
++	
++	import org.apache.flex.core.IBeadLayout;
++	import org.apache.flex.core.ILayoutChild;
++	import org.apache.flex.core.ILayoutView;
++	import org.apache.flex.html.TableCell;
++	import org.apache.flex.html.TableRow;
++	
++	COMPILE::SWF {
++		import org.apache.flex.geom.Rectangle;
++		import org.apache.flex.utils.CSSUtils;
++		import org.apache.flex.utils.CSSContainerUtils;
++	}
++
++    /**
++     *  The TableCellLayout is the default layout for TableCell items. It places the cell's
contents
++	 *  vertically centered within the cell.
++     *
++     *  @langversion 3.0
++     *  @playerversion Flash 10.2
++     *  @playerversion AIR 2.6
++     *  @productversion FlexJS 0.0
++     */
++	public class TableCellLayout extends HorizontalLayout implements IBeadLayout
++	{
++        /**
++         *  Constructor.
++         *
++         *  @langversion 3.0
++         *  @playerversion Flash 10.2
++         *  @playerversion AIR 2.6
++         *  @productversion FlexJS 0.0
++         */
++		public function TableCellLayout()
++		{
++			super();
++		}
++
++        /**
++         * @copy org.apache.flex.core.IBeadLayout#layout
++		 * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
++		 * @flexjsignorecoercion org.apache.flex.core.UIBase
++         */
++		override public function layout():Boolean
++		{
++            COMPILE::SWF
++            {
++				if (!super.layout()) return false;
++				
++				var contentView:ILayoutView = layoutView;
++				var n:int = contentView.numElements;
++				if (n == 0) return false;
++				
++				// find the overall size and position in the centervar contentView:ILayoutView = layoutView;
++				
++				var hostWidthSizedToContent:Boolean = host.isWidthSizedToContent();
++				var hostHeightSizedToContent:Boolean = host.isHeightSizedToContent();
++				var hostWidth:Number = hostWidthSizedToContent ? host.width : contentView.width;
++				var hostHeight:Number = hostHeightSizedToContent ? host.height : contentView.height;
++				
++				var paddingMetrics:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
++				var borderMetrics:Rectangle = CSSContainerUtils.getBorderMetrics(host);
++				
++				// adjust the host's usable size by the metrics. If hostSizedToContent, then the
++				// resulting adjusted value may be less than zero.
++				hostWidth -= paddingMetrics.left + paddingMetrics.right + borderMetrics.left + borderMetrics.right;
++				hostHeight -= paddingMetrics.top + paddingMetrics.bottom + borderMetrics.top + borderMetrics.bottom;
++				
++				var totalHeight:Number = 0;
++				
++				for(var i:int=0; i < n; i++)
++				{
++					var child:ILayoutChild = contentView.getElementAt(i) as ILayoutChild;
++					if (child == null || !child.visible) continue;
++					var positions:Object = childPositions(child);
++					var margins:Object = childMargins(child, hostWidth, hostHeight);
++					
++					totalHeight += margins.top + child.height + margins.bottom;
++				}
++				
++				var shiftBy:Number = (hostHeight - totalHeight)/2;
++				
++				for(i=0; i < n; i++)
++				{
++					child = contentView.getElementAt(i) as ILayoutChild;
++					if (child == null || !child.visible) continue;
++					child.y += shiftBy;
++				}
++
++                return true;
++
++            }
++
++            COMPILE::JS
++            {
++                return true;
++            }
++		}
++	}
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/TableHeaderLayout.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/TableHeaderLayout.as
index 0000000,0000000..a955c83
new file mode 100644
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/TableHeaderLayout.as
@@@ -1,0 -1,0 +1,124 @@@
++////////////////////////////////////////////////////////////////////////////////
++//
++//  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.LayoutBase;
++	
++	import org.apache.flex.core.IBeadLayout;
++	import org.apache.flex.core.ILayoutChild;
++	import org.apache.flex.core.ILayoutView;
++	import org.apache.flex.html.TableCell;
++	import org.apache.flex.html.TableRow;
++	
++	COMPILE::SWF {
++		import org.apache.flex.geom.Rectangle;
++		import org.apache.flex.utils.CSSUtils;
++		import org.apache.flex.utils.CSSContainerUtils;
++	}
++
++    /**
++     *  The TableHeaderLayout is the default layout for TableHeader items. It places the
cell's contents
++	 *  vertically and horizontally centered within the cell.
++     *
++     *  @langversion 3.0
++     *  @playerversion Flash 10.2
++     *  @playerversion AIR 2.6
++     *  @productversion FlexJS 0.0
++     */
++	public class TableHeaderLayout extends HorizontalLayout implements IBeadLayout
++	{
++        /**
++         *  Constructor.
++         *
++         *  @langversion 3.0
++         *  @playerversion Flash 10.2
++         *  @playerversion AIR 2.6
++         *  @productversion FlexJS 0.0
++         */
++		public function TableHeaderLayout()
++		{
++			super();
++		}
++
++        /**
++         * @copy org.apache.flex.core.IBeadLayout#layout
++		 * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
++		 * @flexjsignorecoercion org.apache.flex.core.UIBase
++         */
++		override public function layout():Boolean
++		{
++            COMPILE::SWF
++            {
++				if (!super.layout()) return false;
++				
++				var contentView:ILayoutView = layoutView;
++				var n:int = contentView.numElements;
++				if (n == 0) return false;
++				
++				// find the overall size and position in the centervar contentView:ILayoutView = layoutView;
++				
++				var hostWidthSizedToContent:Boolean = host.isWidthSizedToContent();
++				var hostHeightSizedToContent:Boolean = host.isHeightSizedToContent();
++				var hostWidth:Number = hostWidthSizedToContent ? host.width : contentView.width;
++				var hostHeight:Number = hostHeightSizedToContent ? host.height : contentView.height;
++				
++				var paddingMetrics:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
++				var borderMetrics:Rectangle = CSSContainerUtils.getBorderMetrics(host);
++				
++				// adjust the host's usable size by the metrics. If hostSizedToContent, then the
++				// resulting adjusted value may be less than zero.
++				hostWidth -= paddingMetrics.left + paddingMetrics.right + borderMetrics.left + borderMetrics.right;
++				hostHeight -= paddingMetrics.top + paddingMetrics.bottom + borderMetrics.top + borderMetrics.bottom;
++				
++				var totalHeight:Number = 0;
++				var totalWidth:Number = 0;
++				
++				for(var i:int=0; i < n; i++)
++				{
++					var child:ILayoutChild = contentView.getElementAt(i) as ILayoutChild;
++					if (child == null || !child.visible) continue;
++					var positions:Object = childPositions(child);
++					var margins:Object = childMargins(child, hostWidth, hostHeight);
++					
++					totalHeight += margins.top + child.height + margins.bottom;
++					totalWidth += margins.left + child.width + margins.right;
++				}
++				
++				var shiftYBy:Number = (hostHeight - totalHeight)/2;
++				var shiftXBy:Number = (hostWidth - totalWidth)/2;
++				
++				for(i=0; i < n; i++)
++				{
++					child = contentView.getElementAt(i) as ILayoutChild;
++					if (child == null || !child.visible) continue;
++					child.x += shiftXBy;
++					child.y += shiftYBy;
++				}
++
++                return true;
++
++            }
++
++            COMPILE::JS
++            {
++                return true;
++            }
++		}
++	}
++}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/resources/basic-manifest.xml
index d57c592,072aed9..4e3d261
--- a/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
@@@ -148,10 -124,8 +148,15 @@@
      <component id="OneFlexibleChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildHorizontalLayout"/>
      <component id="MXMLBeadView" class="org.apache.flex.html.MXMLBeadView"/>
  
 +    <component id="SubAppLoader" class="org.apache.flex.html.SubAppLoader" />
 +
      <component id="Border" class="org.apache.flex.html.supportClasses.Border"/>
 -    
 +
      <component id="WebBrowser" class="org.apache.flex.html.WebBrowser" />
++    
++    <component id="Table" class="org.apache.flex.html.Table"/>
++    <component id="TableRow" class="org.apache.flex.html.TableRow"/>
++    <component id="TableCell" class="org.apache.flex.html.TableCell"/>
++    <component id="TableHeader" class="org.apache.flex.html.TableHeader"/>
  
  </componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/Basic/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --cc frameworks/projects/Basic/src/main/resources/defaults.css
index 02a5bdb,5ce20fb..1a944dd
--- a/frameworks/projects/Basic/src/main/resources/defaults.css
+++ b/frameworks/projects/Basic/src/main/resources/defaults.css
@@@ -344,28 -240,11 +344,44 @@@ Lis
  	IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
  	border-style: solid;
  	border-color: #222222;
 +	background-color: #FFFFFF;
  }
  
 -Tree
 +Accordion
  {
  	IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
 +	IBeadView:  ClassReference("org.apache.flex.html.beads.AccordionView");			
 +	IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
 +	IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.OneFlexibleChildVerticalLayout");
 +	IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
 +	IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
 +	IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.AccordionItemRenderer");
 +	IViewport: ClassReference("org.apache.flex.html.supportClasses.ClippingViewport");
 +	IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
 +	IAccordionCollapseBead: ClassReference("org.apache.flex.html.beads.AccordionCollapseBead");
 +	border-style: solid;
 +	border-color: #222222;
 +}
 +
++Table
++{
++	IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.SimpleTableLayout");
++}
++
++TableHeader
++{
++	font-weight: bold;
++	border: 1px solid #999999;
++}
++
++TableCell
++{
++	border: 1px solid #999999;
++}
++
 +Tree
 +{
 +	IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArrayListSelectionModel");
  	IBeadView:  ClassReference("org.apache.flex.html.beads.ListView");			
  	IBeadController: ClassReference("org.apache.flex.html.beads.controllers.TreeSingleSelectionMouseController");
  	IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a168d45a/frameworks/projects/GoogleMaps/src/main/flex/org/apache/flex/maps/google/beads/GoogleMapView.as
----------------------------------------------------------------------


Mime
View raw message