flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Charts should compile now.
Date Thu, 23 Mar 2017 17:58:01 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop fe552ea27 -> 3ea6b07ed


Charts should compile now.


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

Branch: refs/heads/develop
Commit: 3ea6b07edb9b9c940fe94c7581b120c473d9c8e4
Parents: fe552ea
Author: Peter Ent <pent@apache.org>
Authored: Thu Mar 23 13:57:59 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Thu Mar 23 13:57:59 2017 -0400

----------------------------------------------------------------------
 .../charts/beads/ChartItemRendererFactory.as    |  29 ++++--
 .../org/apache/flex/charts/beads/ChartView.as   |  21 +++-
 ...ItemRendererFactoryForSeriesArrayListData.as |   4 +-
 .../DataItemRendererFactoryForSeriesData.as     |   4 +-
 .../flex/charts/optimized/SVGChartDataGroup.as  |  30 +++++-
 .../charts/supportClasses/ChartDataGroup.as     | 102 ++++++++++++++++++-
 6 files changed, 165 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ea6b07e/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartItemRendererFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartItemRendererFactory.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartItemRendererFactory.as
index a291365..6f57f06 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartItemRendererFactory.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartItemRendererFactory.as
@@ -58,7 +58,7 @@ package org.apache.flex.charts.beads
 		}
 		
 		private var selectionModel:ISelectionModel;
-		protected var dataGroup:IItemRendererParent;
+		//protected var dataGroup:IItemRendererParent;
 		
 		private var _seriesRenderers:Array;
 		
@@ -92,10 +92,21 @@ package org.apache.flex.charts.beads
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
-			var listView:IListView = value.getBeadByType(IListView) as IListView;
-			dataGroup = listView.dataGroup;
-			//			selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+			IEventDispatcher(value).addEventListener("beadsAdded",finishSetup);
+			IEventDispatcher(value).addEventListener("initComplete",finishSetup);
+			
+		}
+		public function get strand():IStrand
+		{
+			return _strand;
+		}
+		
+		private function finishSetup(event:Event):void
+		{
+			selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
+			
+			var dataGroup:IItemRendererParent = listView.dataGroup;
 			
 			var dp:Array = selectionModel.dataProvider as Array;
 			if (!dp)
@@ -103,7 +114,7 @@ package org.apache.flex.charts.beads
 			
 			_seriesRenderers = new Array();
 			
-			dataGroup.removeAllElements();
+			dataGroup.removeAllItemRenderers();
 			
 			var series:Array = IChart(_strand).series;
 			
@@ -124,7 +135,7 @@ package org.apache.flex.charts.beads
 					
 					renderers.push(k);
 					
-					dataGroup.addElement(k);
+					dataGroup.addItemRenderer(k);
 				}
 				
 				_seriesRenderers.push(renderers);
@@ -132,10 +143,6 @@ package org.apache.flex.charts.beads
 			
 			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
 		}
-		public function get strand():IStrand
-		{
-			return _strand;
-		}
 		
 		/**
 		 * @private

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ea6b07e/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 dce3079..dcdf5cc 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
@@ -112,9 +112,9 @@ package org.apache.flex.charts.beads
 		 */
 		override protected function completeSetup():void
 		{
-			if (border) {
-				IParent(_strand).removeElement(border);
-			}
+//			if (border) {
+//				IParent(_strand).removeElement(border);
+//			}
 					
 			super.completeSetup();
 		}
@@ -158,7 +158,7 @@ package org.apache.flex.charts.beads
 				horizontalAxisGroup.removeAllElements();
 			}
 			
-			dataGroup.removeAllElements();
+			dataGroup.removeAllItemRenderers();
 		}
 				
 		/**
@@ -166,6 +166,13 @@ package org.apache.flex.charts.beads
 		 * be calculated so the chart's layout algorithm knows precisely the dimensions of 
 		 * chart for its item renderers.
 		 */
+		COMPILE::JS
+		protected function layoutViewBeforeContentLayout():void
+		{
+			// to do
+		}
+		
+		COMPILE::SWF
 		override protected function layoutViewBeforeContentLayout():void
 		{			
 			var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
@@ -242,6 +249,12 @@ package org.apache.flex.charts.beads
 		/**
 		 * @private
 		 */
+		//protected var lastRollOverIndex:Number = -1;
+		
+		/**
+		 * @private
+		 */
+		COMPILE::SWF
 		override protected function rollOverIndexChangeHandler(event:Event):void
 		{
 			var model:IChartDataModel = event.currentTarget as IChartDataModel;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ea6b07e/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesArrayListData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesArrayListData.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesArrayListData.as
index 7010627..e41010a 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesArrayListData.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesArrayListData.as
@@ -107,7 +107,7 @@ package org.apache.flex.charts.beads
 			
 			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
 			var dataGroup:IChartDataGroup = listView.dataGroup as IChartDataGroup;
-			dataGroup.removeAllElements();
+			dataGroup.removeAllItemRenderers();
 			
 			var chart:IChart = _strand as IChart;
 			var series:Array = chart.series;
@@ -122,7 +122,7 @@ package org.apache.flex.charts.beads
 					if (chartSeries.itemRenderer)
 					{
 						var ir:IChartItemRenderer = chartSeries.itemRenderer.newInstance() as IChartItemRenderer;
-						dataGroup.addElement(ir);
+						dataGroup.addItemRenderer(ir);
 						ir.itemRendererParent = dataGroup;
 						ir.index = i;
 						ir.data = dp.getItemAt(i)

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ea6b07e/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesData.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesData.as
index dfd931a..2f33797 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesData.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/DataItemRendererFactoryForSeriesData.as
@@ -101,7 +101,7 @@ package org.apache.flex.charts.beads
 			
 			var listView:IListView = _strand.getBeadByType(IListView) as IListView;
 			var dataGroup:IChartDataGroup = listView.dataGroup as IChartDataGroup;
-			dataGroup.removeAllElements();
+			dataGroup.removeAllItemRenderers();
 			
 			var chart:IChart = _strand as IChart;
 			var series:Array = chart.series;
@@ -116,7 +116,7 @@ package org.apache.flex.charts.beads
 					if (chartSeries.itemRenderer)
 					{
 						var ir:IChartItemRenderer = chartSeries.itemRenderer.newInstance() as IChartItemRenderer;
-						dataGroup.addElement(ir);
+						dataGroup.addItemRenderer(ir);
 						ir.itemRendererParent = dataGroup;
 						ir.index = i;
 						ir.data = dp[i];

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ea6b07e/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
index 270c034..44ef9fc 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
@@ -30,6 +30,9 @@ package org.apache.flex.charts.optimized
 	import org.apache.flex.svg.CompoundGraphic;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.geom.Point;
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.core.IChild;
+	import org.apache.flex.html.supportClasses.DataItemRenderer;
 	
 	/**
 	 *  The SVGChartDataGroup serves as the drawing canvas for SVG itemRenderers. Rather than
having
@@ -127,7 +130,7 @@ package org.apache.flex.charts.optimized
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
-		override public function removeAllElements():void
+		public function removeAllItemRenderers():void
 		{
 			super.removeAllElements();
 			_children = new Array();
@@ -142,14 +145,14 @@ package org.apache.flex.charts.optimized
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
-		override public function addElement(value:IChild, dispatchEvent:Boolean = true):void
+		public function addItemRenderer(value:IItemRenderer):void
 		{
 			_children.push(value);
 			
 			var base:UIBase = value as UIBase;
 			base.addedToParent();
 			
-			super.addElement(value, dispatchEvent);
+			super.addElement(value, true);
 		}
 		
 		/**
@@ -161,7 +164,7 @@ package org.apache.flex.charts.optimized
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
-		override public function addElementAt(value:IChild, index:int, dispatchEvent:Boolean =
true):void
+		public function addItemRendererAt(value:IChild, index:int, dispatchEvent:Boolean = true):void
 		{
 			if (index >= _children.length) _children.push(value);
 			else _children.splice(index, 0, value);
@@ -173,6 +176,25 @@ package org.apache.flex.charts.optimized
 		}
 		
 		/**
+		 * @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);
+		}
+		
+		/**
 		 *  @private
 		 */
 		private function resizeContainer(event:Event) : void

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ea6b07e/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 957d7b1..41ac0bb 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
@@ -23,7 +23,10 @@ package org.apache.flex.charts.supportClasses
 	import org.apache.flex.charts.core.IChartSeries;
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.geom.Point;
-	import org.apache.flex.html.supportClasses.DataGroup;
+	import org.apache.flex.html.supportClasses.ContainerContentArea;
+	import org.apache.flex.core.IItemRenderer;
+	import org.apache.flex.core.IChild;
+	import org.apache.flex.html.supportClasses.DataItemRenderer;
 	
 	/**
 	 *  The ChartDataGroup class provides the actual space for rendering the
@@ -34,7 +37,7 @@ package org.apache.flex.charts.supportClasses
 	 *  @playerversion AIR 2.6
 	 *  @productversion FlexJS 0.0
 	 */
-	public class ChartDataGroup extends DataGroup implements IChartDataGroup
+	public class ChartDataGroup extends ContainerContentArea implements IChartDataGroup
 	{
 		/**
 		 *  constructor.
@@ -96,5 +99,100 @@ package org.apache.flex.charts.supportClasses
 			
 			return null;
 		}
+		
+		/*
+		* IItemRendererParent
+		*/
+		
+		/**
+		 * @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();
+				}
+			}
+		}
 	}
 }


Mime
View raw message