flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [14/44] git commit: [flex-asjs] [refs/heads/develop] - Clean up chart changes.
Date Tue, 11 Apr 2017 16:00:39 GMT
Clean up chart changes.


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

Branch: refs/heads/develop
Commit: 060a9c09923ad1c831b02629eef91c684e82922b
Parents: efc4847
Author: Peter Ent <pent@apache.org>
Authored: Fri Mar 31 16:08:31 2017 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Fri Mar 31 16:08:31 2017 -0400

----------------------------------------------------------------------
 .../org/apache/flex/charts/beads/ChartView.as   | 99 +++++++-------------
 .../controllers/ChartSeriesMouseController.as   | 40 ++++----
 2 files changed, 55 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/060a9c09/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 79f9823..9ce64a9 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
@@ -18,35 +18,23 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.charts.beads
 {
-	import org.apache.flex.charts.core.IAxisGroup;
-	import org.apache.flex.charts.core.IHorizontalAxisBead;
-	import org.apache.flex.charts.core.IVerticalAxisBead;
-	import org.apache.flex.charts.core.IChartDataGroup;
-	import org.apache.flex.charts.core.IChartSeries;
-	import org.apache.flex.charts.core.IChartDataModel;
-	import org.apache.flex.charts.supportClasses.ChartDataGroup;
 	import org.apache.flex.core.IBeadLayout;
 	import org.apache.flex.core.IBeadView;
-	import org.apache.flex.core.IParent;
-	import org.apache.flex.core.IChild;
-	import org.apache.flex.core.ILayoutView;
-	import org.apache.flex.core.IItemRendererParent;
-	import org.apache.flex.core.IRollOverModel;
-	import org.apache.flex.core.ISelectionModel;
-	import org.apache.flex.core.ISelectableItemRenderer;
+	import org.apache.flex.core.IContainer;
 	import org.apache.flex.core.IStrand;
-//	import org.apache.flex.core.IViewport;
-//	import org.apache.flex.core.IViewportModel;
+	import org.apache.flex.core.ISelectableItemRenderer;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
-	import org.apache.flex.html.DataContainer;
+	import org.apache.flex.charts.core.IAxisGroup;
+	import org.apache.flex.charts.core.IChartDataGroup;
+	import org.apache.flex.charts.core.IChartDataModel;
+	import org.apache.flex.charts.core.IChartSeries;
+	import org.apache.flex.charts.core.IHorizontalAxisBead;
+	import org.apache.flex.charts.core.IVerticalAxisBead;
 	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.geom.Rectangle;
 	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;
 	
 	/**
@@ -73,8 +61,6 @@ package org.apache.flex.charts.beads
 			super();
 		}
 		
-		//protected var dataModel:IChartDataModel;
-		
 		private var _horizontalAxisGroup:IAxisGroup;
 		private var _verticalAxisGroup:IAxisGroup;
 		
@@ -96,6 +82,11 @@ package org.apache.flex.charts.beads
 		/**
 		 * @private
 		 * @flexjsignorecoercion org.apache.flex.core.IChild
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
 		 */
 		override protected function completeSetup():void
 		{	
@@ -103,16 +94,14 @@ package org.apache.flex.charts.beads
 			
 			dataModel = _strand.getBeadByType(IChartDataModel) as IChartDataModel;
 			dataModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-			
-//			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";
-				DataContainer(_strand).$addElement(_horizontalAxisGroup, false);
+				IContainer(_strand).strandChildren.addElement(_horizontalAxisGroup, false);
 			}
 			
 			var vaxis:IVerticalAxisBead = _strand.getBeadByType(IVerticalAxisBead) as IVerticalAxisBead;
@@ -121,10 +110,13 @@ package org.apache.flex.charts.beads
 				_verticalAxisGroup = new m2();
 				vaxis.axisGroup = _verticalAxisGroup;
 				UIBase(_verticalAxisGroup).className = "VerticalAxis";
-				DataContainer(_strand).$addElement(_verticalAxisGroup, false);
+				IContainer(_strand).strandChildren.addElement(_verticalAxisGroup, false);
 			}
 		}
 		
+		/**
+		 * @private
+		 */
 		override protected function beadsAddedHandler(event:Event):void
 		{
 			super.beadsAddedHandler(event);
@@ -172,16 +164,23 @@ package org.apache.flex.charts.beads
 			dataGroup.removeAllItemRenderers();
 		}
 		
+		/**
+		 * @private
+		 */
 		override protected function handleChildrenAdded(event:Event):void
 		{
-			// ignore this for charts.
-			trace("Ignoring children added");
+			// ignore for charts.
 		}
 				
 		/**
 		 * ChartView overrides performLayout so that the exact area of the ChartDataGroup can
 		 * be calculated so the chart's layout algorithm knows precisely the dimensions of 
 		 * chart for its item renderers.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
 		 */		
 		override protected function layoutViewBeforeContentLayout():void
 		{			
@@ -204,9 +203,6 @@ 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;
@@ -216,24 +212,12 @@ 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,
-//                                                        strandHeight - heightAdjustment
- metrics.bottom - metrics.top);
             
 			if (verticalAxisGroup) {
 				UIBase(verticalAxisGroup).x = metrics.left;
 				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";
-//				}
-					
-				var vga:UIBase = verticalAxisGroup as UIBase;
-				trace("vertical axis x:"+vga.x+"; y:"+vga.y+"; width="+vga.width+"; height="+vga.height);
 			}
 			
 			if (horizontalAxisGroup) {
@@ -241,18 +225,15 @@ 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";
-//				}
-					
-				var hga:UIBase = horizontalAxisGroup as UIBase;
-				trace("horizontal axis x:"+hga.x+"; y:"+hga.y+"; width="+hga.width+"; height="+hga.height);
 			}
 		}
 		
+		/**
+		 * @private
+		 */
 		override protected function layoutViewAfterContentLayout():void
 		{
-			trace("Ignore this for charts, too");	
+			// ignore for charts
 		}
 		
 		/**
@@ -266,7 +247,7 @@ package org.apache.flex.charts.beads
 		override protected function selectionChangeHandler(event:Event):void
 		{
 			var model:IChartDataModel = event.currentTarget as IChartDataModel;
-			var chartDataGroup:ChartDataGroup = dataGroup as ChartDataGroup;
+			var chartDataGroup:IChartDataGroup = dataGroup as IChartDataGroup;
 			var ir:ISelectableItemRenderer = null;
 			
 			if (lastSelectedIndex != -1)
@@ -291,21 +272,11 @@ package org.apache.flex.charts.beads
 		/**
 		 * @private
 		 */
-		//protected var lastRollOverIndex:Number = -1;
-		
-		/**
-		 * @private
-		 */
-		//protected var lastSelectedIndex:Number = -1
-		
-		/**
-		 * @private
-		 */
 		COMPILE::SWF
 		override protected function rollOverIndexChangeHandler(event:Event):void
 		{
 			var model:IChartDataModel = event.currentTarget as IChartDataModel;
-			var chartDataGroup:ChartDataGroup = dataGroup as ChartDataGroup;
+			var chartDataGroup:IChartDataGroup = dataGroup as IChartDataGroup;
 			var ir:ISelectableItemRenderer = null;
 
 			if (lastRollOverIndex != -1)

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/060a9c09/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/controllers/ChartSeriesMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/controllers/ChartSeriesMouseController.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/controllers/ChartSeriesMouseController.as
index c4e20ac..4873615 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/controllers/ChartSeriesMouseController.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/controllers/ChartSeriesMouseController.as
@@ -30,54 +30,54 @@ package org.apache.flex.charts.beads.controllers
 	import org.apache.flex.events.ItemRemovedEvent;
 	import org.apache.flex.events.MouseEvent;
 	import org.apache.flex.html.beads.IListView;
-	
+
 	import org.apache.flex.events.ItemClickedEvent;
-	
+
 	import org.apache.flex.charts.core.IChartItemRenderer;
 	import org.apache.flex.charts.core.IChartDataModel;
-	
+
 	public class ChartSeriesMouseController implements IBeadController
 	{
 		public function ChartSeriesMouseController()
 		{
-			
+
 		}
-		
+
 		/**
 		 *  The model.
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
 		protected var listModel:IChartDataModel;
-		
+
 		/**
 		 *  The view.
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
 		protected var listView:IListView;
-		
+
 		/**
 		 *  The parent of the item renderers.
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.0
 		 */
 		protected var dataGroup:IItemRendererParent;
-		
+
 		private var _strand:IStrand;
-		
+
 		/**
 		 *  @copy org.apache.flex.core.IBead#strand
-		 *  
+		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
@@ -91,21 +91,21 @@ package org.apache.flex.charts.beads.controllers
 			IEventDispatcher(_strand).addEventListener("itemAdded", handleItemAdded);
 			IEventDispatcher(_strand).addEventListener("itemRemoved", handleItemRemoved);
 		}
-		
+
 		protected function handleItemAdded(event:ItemAddedEvent):void
 		{
 			IEventDispatcher(event.item).addEventListener("itemClicked", selectedHandler);
 			IEventDispatcher(event.item).addEventListener("itemRollOver", rolloverHandler);
 			IEventDispatcher(event.item).addEventListener("itemRollOut", rolloutHandler);
 		}
-		
-		protected function handleItemRemoved(event:ItemAddedEvent):void
+
+		protected function handleItemRemoved(event:ItemRemovedEvent):void
 		{
 			IEventDispatcher(event.item).removeEventListener("itemClicked", selectedHandler);
 			IEventDispatcher(event.item).removeEventListener("itemRollOver", rolloverHandler);
 			IEventDispatcher(event.item).removeEventListener("itemRollOut", rolloutHandler);
 		}
-		
+
 		protected function selectedHandler(event:ItemClickedEvent):void
 		{
 			var renderer:IChartItemRenderer = event.currentTarget as IChartItemRenderer;
@@ -115,7 +115,7 @@ package org.apache.flex.charts.beads.controllers
 				listView.host.dispatchEvent(new Event("change"));
 			}
 		}
-		
+
 		protected function rolloverHandler(event:Event):void
 		{
 			var renderer:IChartItemRenderer = event.currentTarget as IChartItemRenderer;
@@ -125,7 +125,7 @@ package org.apache.flex.charts.beads.controllers
 				listModel.rollOverIndex = renderer.index;
 			}
 		}
-		
+
 		protected function rolloutHandler(event:Event):void
 		{
 			var renderer:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
@@ -137,4 +137,4 @@ package org.apache.flex.charts.beads.controllers
 			}
 		}
 	}
-}
\ No newline at end of file
+}


Mime
View raw message