flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [03/13] Rename xxxBead that was a view bead to xxxView
Date Tue, 16 Jul 2013 07:56:20 GMT
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ed706e14/frameworks/as/src/org/apache/flex/html/staticControls/beads/VScrollBarTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/VScrollBarTrackView.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/VScrollBarTrackView.as
new file mode 100644
index 0000000..96ebdaf
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/VScrollBarTrackView.as
@@ -0,0 +1,83 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.staticControls.beads
+{
+	import flash.display.Graphics;
+	import flash.display.SimpleButton;
+	import flash.display.Shape;
+	
+    import org.apache.flex.core.IBeadView;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	
+	public class VScrollBarTrackView implements IBeadView
+	{
+		public function VScrollBarTrackView()
+		{
+			upView = new Shape();
+			downView = new Shape();
+			overView = new Shape();
+
+		}
+		
+		private function drawView(g:Graphics, bgColor:uint, h:Number):void
+		{
+			g.clear();
+			g.lineStyle(1);
+			g.beginFill(bgColor);
+			g.drawRect(0, 0, 16, h);
+			g.endFill();
+			g.lineStyle(0);
+		}
+
+		private function heightChangeHandler(event:Event):void
+		{
+			var h:Number = SimpleButton(_strand).height;
+			
+			drawView(upView.graphics, 0xCCCCCC, h);
+			drawView(downView.graphics, 0x808080, h);
+			drawView(overView.graphics, 0xEEEEEE, h);	
+			shape.graphics.clear();
+			shape.graphics.beginFill(0xCCCCCC);
+			shape.graphics.drawRect(0, 0, 16, h);
+			shape.graphics.endFill();
+			
+		}
+		
+		private var _strand:IStrand;
+		
+		private var shape:Shape;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			SimpleButton(value).addEventListener("heightChanged", heightChangeHandler);
+			shape = new Shape();
+			SimpleButton(value).upState = upView;
+			SimpleButton(value).downState = downView;
+			SimpleButton(value).overState = overView;
+			SimpleButton(value).hitTestState = shape;
+		}
+				
+		private var upView:Shape;
+		private var downView:Shape;
+		private var overView:Shape;
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ed706e14/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/DropDownListController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/DropDownListController.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/DropDownListController.as
index e58e7a7..0bc9dca 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/DropDownListController.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/DropDownListController.as
@@ -26,7 +26,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-	import org.apache.flex.html.staticControls.beads.IDropDownListBead;
+	import org.apache.flex.html.staticControls.beads.IDropDownListView;
 
 	public class DropDownListController implements IBead
 	{
@@ -44,7 +44,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 		
         private function clickHandler(event:Event):void
         {
-            var viewBead:IDropDownListBead = _strand.getBeadByType(IDropDownListBead) as
IDropDownListBead;
+            var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as
IDropDownListView;
             viewBead.popUpVisible = true;
             var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as
ISelectionModel;
             var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel)
as ISelectionModel;
@@ -61,7 +61,7 @@ package org.apache.flex.html.staticControls.beads.controllers
         
         private function changeHandler(event:Event):void
         {
-            var viewBead:IDropDownListBead = _strand.getBeadByType(IDropDownListBead) as
IDropDownListBead;
+            var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as
IDropDownListView;
             viewBead.popUpVisible = false;
             var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as
ISelectionModel;
             var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel)
as ISelectionModel;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ed706e14/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as
index 1c5e182..9b1db41 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ListSingleSelectionMouseController.as
@@ -23,7 +23,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 	import org.apache.flex.core.IItemRendererParent;
 	import org.apache.flex.core.ISelectionModel;
 	import org.apache.flex.core.IStrand;
-	import org.apache.flex.html.staticControls.beads.IListBead;
+	import org.apache.flex.html.staticControls.beads.IListView;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
 	
@@ -35,7 +35,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 		}
 		
 		protected var listModel:ISelectionModel;
-		protected var listView:IListBead;
+		protected var listView:IListView;
 		protected var dataGroup:IItemRendererParent;
 
 		private var _strand:IStrand;
@@ -44,7 +44,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 		{
 			_strand = value;
 			listModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
-			listView = value.getBeadByType(IListBead) as IListBead;
+			listView = value.getBeadByType(IListView) as IListView;
 			dataGroup = listView.dataGroup;
             dataGroup.addEventListener("selected", selectedHandler, true);
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ed706e14/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ScrollBarMouseControllerBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ScrollBarMouseControllerBase.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ScrollBarMouseControllerBase.as
index 11d02c7..7684206 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ScrollBarMouseControllerBase.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ScrollBarMouseControllerBase.as
@@ -25,7 +25,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-	import org.apache.flex.html.staticControls.beads.IScrollBarBead;
+	import org.apache.flex.html.staticControls.beads.IScrollBarView;
 
 	public class ScrollBarMouseControllerBase implements IBead
 	{
@@ -34,7 +34,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 		}
 		
 		protected var sbModel:IScrollBarModel;
-		protected var sbView:IScrollBarBead;
+		protected var sbView:IScrollBarView;
 		
 		private var _strand:IStrand;
 		
@@ -47,7 +47,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 		{
 			_strand = value;
 			sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
-			sbView = value.getBeadByType(IScrollBarBead) as IScrollBarBead;
+			sbView = value.getBeadByType(IScrollBarView) as IScrollBarView;
 			sbView.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);
 			sbView.increment.addEventListener(MouseEvent.CLICK, incrementClickHandler);
             sbView.decrement.addEventListener("buttonRepeat", decrementClickHandler);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ed706e14/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
index 5ab06dc..593234f 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
@@ -25,7 +25,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-	import org.apache.flex.html.staticControls.beads.ISpinnerBead;
+	import org.apache.flex.html.staticControls.beads.ISpinnerView;
 	
 	public class SpinnerMouseController implements IBead
 	{
@@ -42,7 +42,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 			
 			spinnerModel = value.getBeadByType(ISpinnerModel) as ISpinnerModel;
 			
-			var spinnerBead:ISpinnerBead = value.getBeadByType(ISpinnerBead) as ISpinnerBead;
+			var spinnerBead:ISpinnerView = value.getBeadByType(ISpinnerView) as ISpinnerView;
 			spinnerBead.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);
 			spinnerBead.decrement.addEventListener("buttonRepeat", decrementClickHandler);
 			spinnerBead.increment.addEventListener(MouseEvent.CLICK, incrementClickHandler);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ed706e14/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
index 2d1d21d..2b0e0f9 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
@@ -28,7 +28,7 @@ package org.apache.flex.html.staticControls.beads.layouts
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-	import org.apache.flex.html.staticControls.beads.IListBead;
+	import org.apache.flex.html.staticControls.beads.IListView;
 	import org.apache.flex.html.staticControls.supportClasses.Border;
 	import org.apache.flex.html.staticControls.supportClasses.ScrollBar;
 
@@ -43,26 +43,26 @@ package org.apache.flex.html.staticControls.beads.layouts
         private var border:Border;		
         private var borderModel:IBorderModel
         private var vScrollBar:ScrollBar;		
-		private var listBead:IListBead;
+		private var listView:IListView;
 
 		private var _strand:IStrand;
 		
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			listBead = value as IListBead;
-			dataGroup = listBead.dataGroup as DisplayObjectContainer;
-            border = listBead.border;
+			listView = value as IListView;
+			dataGroup = listView.dataGroup as DisplayObjectContainer;
+            border = listView.border;
             borderModel = border.model as IBorderModel;
-			IEventDispatcher(listBead.strand).addEventListener("heightChanged", changeHandler);
-			IEventDispatcher(listBead.strand).addEventListener("widthChanged", changeHandler);
+			IEventDispatcher(listView.strand).addEventListener("heightChanged", changeHandler);
+			IEventDispatcher(listView.strand).addEventListener("widthChanged", changeHandler);
 			changeHandler(null);
 		}
 	
 		private function changeHandler(event:Event):void
 		{            
-            var ww:Number = DisplayObject(listBead.strand).width;
-            var hh:Number = DisplayObject(listBead.strand).height;
+            var ww:Number = DisplayObject(listView.strand).width;
+            var hh:Number = DisplayObject(listView.strand).height;
             border.width = ww;
             border.height = hh;
            
@@ -82,7 +82,7 @@ package org.apache.flex.html.staticControls.beads.layouts
 			}
 			if (yy > dataGroup.height)
 			{
-                vScrollBar = listBead.vScrollBar;
+                vScrollBar = listView.vScrollBar;
 				dataGroup.width -= vScrollBar.width;
 				IScrollBarModel(vScrollBar.model).maximum = yy;
 				IScrollBarModel(vScrollBar.model).pageSize = dataGroup.height;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ed706e14/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
index bbed850..4a464d4 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
@@ -25,7 +25,7 @@ package org.apache.flex.html.staticControls.beads.layouts
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.events.Event;
-	import org.apache.flex.html.staticControls.beads.IScrollBarBead;
+	import org.apache.flex.html.staticControls.beads.IScrollBarView;
 
 	public class VScrollBarLayout implements IBead
 	{
@@ -34,14 +34,14 @@ package org.apache.flex.html.staticControls.beads.layouts
 		}
 		
 		private var sbModel:IScrollBarModel;
-		private var sbView:IScrollBarBead;
+		private var sbView:IScrollBarView;
 		
 		private var _strand:IStrand;
 		
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			sbView = value as IScrollBarBead;
+			sbView = value as IScrollBarView;
 			sbModel = sbView.scrollBarModel;
 			sbModel.addEventListener("maximumChange", changeHandler);
 			sbModel.addEventListener("minimumChange", changeHandler);


Mime
View raw message