flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [3/6] git commit: [flex-asjs] [refs/heads/feature/chart-work] - Changes to get charts to work.
Date Wed, 29 Mar 2017 21:26:19 GMT
Changes to get charts to work.


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

Branch: refs/heads/feature/chart-work
Commit: bbca528df68201352c225142e8209587d6d3b04e
Parents: 822c152
Author: Peter Ent <pent@apache.org>
Authored: Wed Mar 29 14:03:53 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Wed Mar 29 14:03:53 2017 -0400

----------------------------------------------------------------------
 .../apache/flex/charts/beads/AxisBaseBead.as    |  8 ++
 .../org/apache/flex/charts/beads/ChartView.as   | 86 ++++++++---------
 .../flex/charts/beads/layouts/BarChartLayout.as |  8 +-
 .../beads/layouts/BarChartLayoutForArrayList.as |  8 +-
 .../charts/beads/layouts/ColumnChartLayout.as   |  8 +-
 .../layouts/ColumnChartLayoutForArrayList.as    |  8 +-
 .../layouts/LineChartCategoryVsLinearLayout.as  |  8 +-
 .../layouts/LineChartLinearVsLinearLayout.as    |  8 +-
 .../flex/charts/beads/layouts/PieChartLayout.as |  4 +-
 .../beads/layouts/PieChartLayoutForArrayList.as |  4 +-
 .../beads/layouts/StackedBarChartLayout.as      |  8 +-
 .../StackedBarChartLayoutForArrayList.as        |  8 +-
 .../beads/layouts/StackedColumnChartLayout.as   |  8 +-
 .../StackedColumnChartLayoutForArrayList.as     |  8 +-
 .../org/apache/flex/charts/core/ChartBase.as    | 21 +----
 .../charts/supportClasses/ChartDataGroup.as     | 98 +-------------------
 .../org/apache/flex/html/beads/ContainerView.as | 10 ++
 17 files changed, 118 insertions(+), 193 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as
index 3ce75ce..9ca5046 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as
@@ -167,6 +167,10 @@ package org.apache.flex.charts.beads
 			wrapper.y = 0;
 			wrapper.width = UIBase(_axisGroup).width;
 			wrapper.height = UIBase(_axisGroup).height;
+			COMPILE::JS {
+				wrapper.element.style.position = "absolute";
+				UIBase(_axisGroup).element.style.position = "absolute";
+			}
 		}
 		
 		/**
@@ -219,6 +223,10 @@ package org.apache.flex.charts.beads
 			if (isHorizontal) label = axisGroup.drawHorizontalTickLabel(text, xpos, ypos, boxWidth,
boxHeight, tickFill);
 			else label = axisGroup.drawVerticalTickLabel(text, xpos, ypos, boxWidth, boxHeight, tickFill);
 			
+			COMPILE::JS {
+				label.element.style.position = "absolute";
+			}
+			
 			return label;
 		}
 		

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
index c26f22c..79f9823 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
@@ -39,11 +39,12 @@ package org.apache.flex.charts.beads
 //	import org.apache.flex.core.IViewportModel;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.html.DataContainer;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
     import org.apache.flex.geom.Rectangle;
     import org.apache.flex.geom.Size;
-	import org.apache.flex.html.beads.GroupView;
+	import org.apache.flex.html.beads.ListView;
 //	import org.apache.flex.html.beads.models.ViewportModel;
 //	import org.apache.flex.html.supportClasses.Viewport;
 	import org.apache.flex.utils.CSSContainerUtils;
@@ -57,7 +58,7 @@ package org.apache.flex.charts.beads
 	 *  @playerversion AIR 2.6
 	 *  @productversion FlexJS 0.0
 	 */
-	public class ChartView extends GroupView implements IBeadView
+	public class ChartView extends ListView implements IBeadView
 	{
 		/**
 		 *  Constructor
@@ -72,7 +73,7 @@ package org.apache.flex.charts.beads
 			super();
 		}
 		
-		protected var dataModel:IChartDataModel;
+		//protected var dataModel:IChartDataModel;
 		
 		private var _horizontalAxisGroup:IAxisGroup;
 		private var _verticalAxisGroup:IAxisGroup;
@@ -94,28 +95,24 @@ package org.apache.flex.charts.beads
 		
 		/**
 		 * @private
+		 * @flexjsignorecoercion org.apache.flex.core.IChild
 		 */
 		override protected function completeSetup():void
 		{	
 			super.completeSetup();
-		}
-		
-		override protected function beadsAddedHandler(event:Event):void
-		{
-			super.beadsAddedHandler(event);
 			
 			dataModel = _strand.getBeadByType(IChartDataModel) as IChartDataModel;
 			dataModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
 			
-			IParent(_strand).addElement(dataGroup as IChild, false);
-						
+//			DataContainer(_strand).$addElement(dataGroup as IChild);
+			
 			var haxis:IHorizontalAxisBead = _strand.getBeadByType(IHorizontalAxisBead) as IHorizontalAxisBead;
 			if (haxis && _horizontalAxisGroup == null) {
 				var m1:Class = ValuesManager.valuesImpl.getValue(_strand, "iHorizontalAxisGroup");
 				_horizontalAxisGroup = new m1();
 				haxis.axisGroup = _horizontalAxisGroup;
 				UIBase(_horizontalAxisGroup).className = "HorizontalAxis";
-				IParent(_strand).addElement(_horizontalAxisGroup, false);
+				DataContainer(_strand).$addElement(_horizontalAxisGroup, false);
 			}
 			
 			var vaxis:IVerticalAxisBead = _strand.getBeadByType(IVerticalAxisBead) as IVerticalAxisBead;
@@ -124,30 +121,13 @@ package org.apache.flex.charts.beads
 				_verticalAxisGroup = new m2();
 				vaxis.axisGroup = _verticalAxisGroup;
 				UIBase(_verticalAxisGroup).className = "VerticalAxis";
-				IParent(_strand).addElement(_verticalAxisGroup, false);
+				DataContainer(_strand).$addElement(_verticalAxisGroup, false);
 			}
 		}
 		
-		override public function get contentView():ILayoutView
-		{
-			return dataGroup as ILayoutView;
-		}
-		
-		private var _chartDataGroup:IChartDataGroup;
-		
-		/**
-		 * 
-		 */
-		public function get dataGroup():IItemRendererParent
+		override protected function beadsAddedHandler(event:Event):void
 		{
-			if (_chartDataGroup == null) {
-				// pull out of valuesManager
-				var c:Class = ValuesManager.valuesImpl.getValue(_strand, "iContentView");
-				if (c) {
-					_chartDataGroup = new c();
-				}
-			}
-			return _chartDataGroup;
+			super.beadsAddedHandler(event);
 		}
 		
 		/**
@@ -179,7 +159,7 @@ package org.apache.flex.charts.beads
 		/**
 		 * @private
 		 */
-		protected function dataProviderChangeHandler(event:Event):void
+		override protected function dataProviderChangeHandler(event:Event):void
 		{
 			if (verticalAxisGroup) {
 				verticalAxisGroup.removeAllElements();
@@ -191,6 +171,12 @@ package org.apache.flex.charts.beads
 			
 			dataGroup.removeAllItemRenderers();
 		}
+		
+		override protected function handleChildrenAdded(event:Event):void
+		{
+			// ignore this for charts.
+			trace("Ignoring children added");
+		}
 				
 		/**
 		 * ChartView overrides performLayout so that the exact area of the ChartDataGroup can
@@ -218,6 +204,9 @@ package org.apache.flex.charts.beads
 			var strandWidth:Number = UIBase(_strand).width;
 			var strandHeight:Number = UIBase(_strand).height;
 			
+			trace("widthAdjustment="+widthAdjustment+"; heightAdjustment="+heightAdjustment);
+			trace("strand width="+strandWidth+"; strand height="+strandHeight);
+			
 			var chartArea:UIBase = dataGroup as UIBase;
 			
 			chartArea.x = widthAdjustment + metrics.left;
@@ -227,6 +216,8 @@ package org.apache.flex.charts.beads
 			COMPILE::JS {
 				chartArea.element.style.position = "absolute";
 			}
+				
+			trace("Chart area x:"+chartArea.x+", y:"+chartArea.y+"; width="+chartArea.width+"; height="+chartArea.height);
 			
 //            viewport.setPosition(widthAdjustment + metrics.left, metrics.top);
 //			viewport.layoutViewportBeforeContentLayout(strandWidth - widthAdjustment - metrics.right
- metrics.left,
@@ -237,9 +228,12 @@ package org.apache.flex.charts.beads
 				UIBase(verticalAxisGroup).y = metrics.top;
 				UIBase(verticalAxisGroup).width = widthAdjustment;
 				UIBase(verticalAxisGroup).height = strandHeight - heightAdjustment - metrics.bottom -
metrics.top;
-				COMPILE::JS {
-					verticalAxisGroup.element.style.position = "absolute";
-				}
+//				COMPILE::JS {
+//					verticalAxisGroup.element.style.position = "absolute";
+//				}
+					
+				var vga:UIBase = verticalAxisGroup as UIBase;
+				trace("vertical axis x:"+vga.x+"; y:"+vga.y+"; width="+vga.width+"; height="+vga.height);
 			}
 			
 			if (horizontalAxisGroup) {
@@ -247,12 +241,20 @@ package org.apache.flex.charts.beads
 				UIBase(horizontalAxisGroup).y = strandHeight - heightAdjustment - metrics.bottom;
 				UIBase(horizontalAxisGroup).width = strandWidth - widthAdjustment - metrics.left - metrics.right;
 				UIBase(horizontalAxisGroup).height = heightAdjustment;
-				COMPILE::JS {
-					horizontalAxisGroup.element.style.position = "absolute";
-				}
+//				COMPILE::JS {
+//					horizontalAxisGroup.element.style.position = "absolute";
+//				}
+					
+				var hga:UIBase = horizontalAxisGroup as UIBase;
+				trace("horizontal axis x:"+hga.x+"; y:"+hga.y+"; width="+hga.width+"; height="+hga.height);
 			}
 		}
 		
+		override protected function layoutViewAfterContentLayout():void
+		{
+			trace("Ignore this for charts, too");	
+		}
+		
 		/**
 		 * @private
 		 */
@@ -261,7 +263,7 @@ package org.apache.flex.charts.beads
 		/**
 		 * @private
 		 */
-		protected function selectionChangeHandler(event:Event):void
+		override protected function selectionChangeHandler(event:Event):void
 		{
 			var model:IChartDataModel = event.currentTarget as IChartDataModel;
 			var chartDataGroup:ChartDataGroup = dataGroup as ChartDataGroup;
@@ -289,18 +291,18 @@ package org.apache.flex.charts.beads
 		/**
 		 * @private
 		 */
-		protected var lastRollOverIndex:Number = -1;
+		//protected var lastRollOverIndex:Number = -1;
 		
 		/**
 		 * @private
 		 */
-		protected var lastSelectedIndex:Number = -1
+		//protected var lastSelectedIndex:Number = -1
 		
 		/**
 		 * @private
 		 */
 		COMPILE::SWF
-		protected function rollOverIndexChangeHandler(event:Event):void
+		override protected function rollOverIndexChangeHandler(event:Event):void
 		{
 			var model:IChartDataModel = event.currentTarget as IChartDataModel;
 			var chartDataGroup:ChartDataGroup = dataGroup as ChartDataGroup;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayout.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayout.as
index 44c123b..4172b1c 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayout.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayout.as
@@ -78,7 +78,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{			
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
@@ -139,13 +139,15 @@ package org.apache.flex.charts.beads.layouts
 					child.height = seriesHeight;
 					ypos -= seriesHeight;
 					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
+					
 					child.updateRenderer();
 				}
 				
 				ypos -= gap;
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayoutForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayoutForArrayList.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayoutForArrayList.as
index c59f329..39710e8 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayoutForArrayList.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/BarChartLayoutForArrayList.as
@@ -58,7 +58,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{			
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:ArrayList = selectionModel.dataProvider as ArrayList;
 			if (!dp)
 				return;
@@ -121,13 +121,15 @@ package org.apache.flex.charts.beads.layouts
 					child.height = seriesHeight;
 					ypos -= seriesHeight;
 					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
+					
 					child.updateRenderer();
 				}
 				
 				ypos -= gap;
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayout.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayout.as
index 93cdb1c..56f5f10 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayout.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayout.as
@@ -69,7 +69,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
@@ -129,12 +129,14 @@ package org.apache.flex.charts.beads.layouts
 					child.width = seriesWidth;
 					child.height = yValue;
 					xpos += seriesWidth;
+					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
 				}
 				
 				xpos += gap;
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayoutForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayoutForArrayList.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayoutForArrayList.as
index f1c3396..64b065d 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayoutForArrayList.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/ColumnChartLayoutForArrayList.as
@@ -58,7 +58,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:ArrayList = selectionModel.dataProvider as ArrayList;
 			if (!dp)
 				return;
@@ -118,12 +118,14 @@ package org.apache.flex.charts.beads.layouts
 					child.width = seriesWidth;
 					child.height = yValue;
 					xpos += seriesWidth;
+					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
 				}
 				
 				xpos += gap;
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartCategoryVsLinearLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartCategoryVsLinearLayout.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartCategoryVsLinearLayout.as
index d94d225..10b1324 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartCategoryVsLinearLayout.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartCategoryVsLinearLayout.as
@@ -51,7 +51,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{			
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
@@ -124,6 +124,10 @@ package org.apache.flex.charts.beads.layouts
 						child.y = childY - 5;
 						child.width = 10;
 						child.height = 10;
+						
+						COMPILE::JS {
+							child.element.style.position = "absolute";
+						}
 					}
 					
 					xpos += itemWidth;
@@ -145,8 +149,6 @@ package org.apache.flex.charts.beads.layouts
 					renderer.points = seriesPoints[s].points;
 				}
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartLinearVsLinearLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartLinearVsLinearLayout.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartLinearVsLinearLayout.as
index 9a18295..4dd0ab3 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartLinearVsLinearLayout.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/LineChartLinearVsLinearLayout.as
@@ -51,7 +51,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
@@ -140,6 +140,10 @@ package org.apache.flex.charts.beads.layouts
 						child.y = childY - 5;
 						child.width = 10;
 						child.height = 10;
+						
+						COMPILE::JS {
+							child.element.style.position = "absolute";
+						}
 					}
 				}
 			}
@@ -159,8 +163,6 @@ package org.apache.flex.charts.beads.layouts
 					renderer.points = seriesPoints[s].points;
 				}
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as
index ed4d75e..0ec982a 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as
@@ -59,7 +59,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
@@ -133,8 +133,6 @@ package org.apache.flex.charts.beads.layouts
 					start += arc;
 				}
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayoutForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayoutForArrayList.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayoutForArrayList.as
index 09418f3..f206cc4 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayoutForArrayList.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayoutForArrayList.as
@@ -61,7 +61,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:ArrayList = selectionModel.dataProvider as ArrayList;
 			if (!dp)
 				return;
@@ -135,8 +135,6 @@ package org.apache.flex.charts.beads.layouts
 					start += arc;
 				}
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayout.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayout.as
index c170076..61a910e 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayout.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayout.as
@@ -79,7 +79,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
@@ -152,13 +152,15 @@ package org.apache.flex.charts.beads.layouts
 					child.y = Math.floor(ypos - seriesHeight);
 					child.height = seriesHeight;
 					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
+					
 					xpos += xValue;
 				}
 				
 				ypos -= (itemHeight + gap);
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayoutForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayoutForArrayList.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayoutForArrayList.as
index f0f87dc..9edab56 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayoutForArrayList.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedBarChartLayoutForArrayList.as
@@ -60,7 +60,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:ArrayList = selectionModel.dataProvider as ArrayList;
 			if (!dp)
 				return;
@@ -133,13 +133,15 @@ package org.apache.flex.charts.beads.layouts
 					child.y = Math.floor(ypos - seriesHeight);
 					child.height = seriesHeight;
 					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
+					
 					xpos += xValue;
 				}
 				
 				ypos -= (itemHeight + gap);
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayout.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayout.as
index ba49ac9..fbe5989 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayout.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayout.as
@@ -78,7 +78,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
 				return;
@@ -149,13 +149,15 @@ package org.apache.flex.charts.beads.layouts
 					child.y = ypos - Math.ceil(yValue);
 					child.height = Math.floor(yValue);
 					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
+					
 					ypos = child.y;
 				}
 				
 				xpos += gap + itemWidth;
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayoutForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayoutForArrayList.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayoutForArrayList.as
index 716aff5..355205a 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayoutForArrayList.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/StackedColumnChartLayoutForArrayList.as
@@ -59,7 +59,7 @@ package org.apache.flex.charts.beads.layouts
 		 */
 		override protected function performLayout():void
 		{
-			var selectionModel:ISelectionModel = chart.getBeadByType(ISelectionModel) as ISelectionModel;
+			var selectionModel:ISelectionModel = strand.getBeadByType(ISelectionModel) as ISelectionModel;
 			var dp:ArrayList = selectionModel.dataProvider as ArrayList;
 			if (!dp)
 				return;
@@ -130,13 +130,15 @@ package org.apache.flex.charts.beads.layouts
 					child.y = ypos - Math.ceil(yValue);
 					child.height = Math.floor(yValue);
 					
+					COMPILE::JS {
+						child.element.style.position = "absolute";
+					}
+					
 					ypos = child.y;
 				}
 				
 				xpos += gap + itemWidth;
 			}
-			
-			IEventDispatcher(chart).dispatchEvent(new Event("layoutComplete"));
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/ChartBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/ChartBase.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/ChartBase.as
index 27961bf..0feffa9 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/ChartBase.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/ChartBase.as
@@ -19,7 +19,8 @@
 package org.apache.flex.charts.core
 {
 	import org.apache.flex.charts.core.IChart;
-	import org.apache.flex.events.Event
+	import org.apache.flex.events.Event;
+	import org.apache.flex.html.List;
 	
 	/**
 	 *  The ChartBase class contains all of the properties common to most
@@ -73,23 +74,5 @@ package org.apache.flex.charts.core
 			_series = value;
 			dispatchEvent(new Event("seriesChanged"));
 		}
-		
-		/*
-		 * IList
-		 */
-				
-		/**
-		*  @copy org.apache.flex.core.IList#dataGroup
-		* 
-		*  @langversion 3.0
-		*  @playerversion Flash 10.2
-		*  @playerversion AIR 2.6
-		*  @productversion FlexJS 0.8
-		*/
-//		public function get dataGroup():IItemRendererParent
-//		{
-//			var chartView:ChartView = view as ChartView;
-//			return chartView.contentView as IItemRendererParent;
-//		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartDataGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartDataGroup.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartDataGroup.as
index 4cc911b..a3ac959 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartDataGroup.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartDataGroup.as
@@ -26,6 +26,7 @@ package org.apache.flex.charts.supportClasses
 	import org.apache.flex.core.IChild;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
+	import org.apache.flex.html.supportClasses.DataGroup;
 	import org.apache.flex.html.supportClasses.DataItemRenderer;
 	import org.apache.flex.geom.Point;
 	
@@ -38,7 +39,7 @@ package org.apache.flex.charts.supportClasses
 	 *  @playerversion AIR 2.6
 	 *  @productversion FlexJS 0.0
 	 */
-	public class ChartDataGroup extends UIBase implements IChartDataGroup
+	public class ChartDataGroup extends DataGroup implements IChartDataGroup
 	{
 		/**
 		 *  constructor.
@@ -104,100 +105,5 @@ package org.apache.flex.charts.supportClasses
 			
 			return null;
 		}
-		
-		/*
-		* IItemRendererParent (via IChartDataGroup)
-		*/
-		
-		/**
-		 * @copy org.apache.flex.core.IItemRendererParent#addItemRenderer()
-		 * @private
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.8
-		 */
-		public function addItemRenderer(renderer:IItemRenderer):void
-		{
-			addElement(renderer, true);
-			
-//			var newEvent:ItemAddedEvent = new ItemAddedEvent("itemAdded");
-//			newEvent.item = renderer;
-//			
-//			dispatchEvent(newEvent);
-		}
-		
-		/**
-		 * @copy org.apache.flex.core.IItemRendererParent#removeItemRenderer()
-		 * @private
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.8
-		 */
-		public function removeItemRenderer(renderer:IItemRenderer):void
-		{
-			removeElement(renderer, true);
-			
-//			var newEvent:ItemRemovedEvent = new ItemRemovedEvent("itemRemoved");
-//			newEvent.item = renderer;
-//			
-//			dispatchEvent(newEvent);
-		}
-		
-		/**
-		 * @copy org.apache.flex.core.IItemRendererParent#removeAllItemRenderers()
-		 * @private
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.8
-		 */
-		public function removeAllItemRenderers():void
-		{
-			while (numElements > 0) {
-				var child:IChild = getElementAt(0);
-				removeElement(child);
-			}
-		}
-		
-		/**
-		 *  @copy org.apache.flex.core.IItemRendererParent#getItemRendererForIndex()
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.8
-		 */
-		public function getItemRendererForIndex(index:int):IItemRenderer
-		{
-			if (index < 0 || index >= numElements) return null;
-			return getElementAt(index) as IItemRenderer;
-		}
-		
-		/**
-		 *  Refreshes the itemRenderers. Useful after a size change by the data group.
-		 *
-		 *  @copy org.apache.flex.core.IItemRendererParent#updateAllItemRenderers()
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.8
-		 */
-		public function updateAllItemRenderers():void
-		{
-			var n:Number = numElements;
-			for (var i:Number = 0; i < n; i++)
-			{
-				var renderer:DataItemRenderer = getItemRendererForIndex(i) as DataItemRenderer;
-				if (renderer) {
-					renderer.setWidth(this.width,true);
-					renderer.adjustSize();
-				}
-			}
-		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bbca528d/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
index 140c4eb..31a2d2c 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
@@ -394,6 +394,16 @@ package org.apache.flex.html.beads
 					}
 				}
 			}
+			
+			if (viewport != null) {
+				var chost:IContainer = host as IContainer;
+				// add the viewport's contentView to this host ONLY if
+				// the contentView is not the host itself, which is likely
+				// most situations.
+				if (chost != viewport.contentView) {
+					chost.addElement(viewport.contentView);
+				}
+			}
 		}
 	}
 }


Mime
View raw message