flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [07/12] git commit: [flex-asjs] [refs/heads/develop] - move ScrollBarLayout from View strand to ScrollBar strand for consistency
Date Thu, 06 Feb 2014 14:39:53 GMT
move ScrollBarLayout from View strand to ScrollBar strand for consistency


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

Branch: refs/heads/develop
Commit: 2a2d6a4c9de8ac5a802ae5f9ebe61a76f25fa232
Parents: 2fb768a
Author: Alex Harui <aharui@apache.org>
Authored: Tue Feb 4 15:42:58 2014 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Feb 5 21:59:37 2014 -0800

----------------------------------------------------------------------
 .../html/staticControls/beads/IScrollBarView.as | 19 --------------
 .../html/staticControls/beads/ScrollBarView.as  | 27 +++++++++++---------
 .../beads/layouts/VScrollBarLayout.as           | 12 +++++----
 3 files changed, 22 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a2d6a4c/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/IScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/IScrollBarView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/IScrollBarView.as
index a3ecb47..0ccfac2 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/IScrollBarView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/IScrollBarView.as
@@ -76,24 +76,5 @@ package org.apache.flex.html.staticControls.beads
          */
 		function get thumb():DisplayObject;
 		
-        /**
-         *  The data model for the view
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		function get scrollBarModel():IScrollBarModel;
-        
-        /**
-         *  The ScrollBar itself.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		function get strand():IStrand;
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a2d6a4c/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ScrollBarView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ScrollBarView.as
index d698037..0acd0a3 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ScrollBarView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/ScrollBarView.as
@@ -30,25 +30,28 @@ package org.apache.flex.html.staticControls.beads
 	import org.apache.flex.html.staticControls.Button;
 	import org.apache.flex.html.staticControls.beads.controllers.ButtonAutoRepeatController;
 
+    /**
+     *  The ScrollBarView class is the default view for
+     *  the org.apache.flex.html.staticControls.supportClasses.ScrollBar class.
+     *  It implements the classic desktop-like ScrollBar.
+     *  A different view would implement more modern scrollbars that hide themselves
+     *  until hovered over with the mouse.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
 	public class ScrollBarView extends Strand implements IBeadView, IStrand, IScrollBarView
 	{
 		public function ScrollBarView()
 		{
 		}
-		
-		public function get scrollBarModel():IScrollBarModel
-		{
-			return sbModel;
-		}
-		
+				
 		private var sbModel:IScrollBarModel;
 		
 		private var _strand:IStrand;
 		
-		public function get strand():IStrand
-		{
-			return _strand;
-		}
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
@@ -71,9 +74,9 @@ package org.apache.flex.html.staticControls.beads
             UIBase(value).addChild(_track);
             UIBase(value).addChild(_thumb);
             
-            if( getBeadByType(IBeadLayout) == null ) {
+            if( _strand.getBeadByType(IBeadLayout) == null ) {
                 var layout:IBeadLayout = new (ValuesManager.valuesImpl.getValue(_strand,
"iBeadLayout")) as IBeadLayout;
-                addBead(layout);
+                _strand.addBead(layout);
             }
             
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a2d6a4c/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
index 3d33ca0..0cc92be 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/beads/layouts/VScrollBarLayout.as
@@ -19,12 +19,14 @@
 package org.apache.flex.html.staticControls.beads.layouts
 {
 	import flash.display.DisplayObject;
+	import flash.display.DisplayObjectContainer;
 	
 	import org.apache.flex.core.IBeadLayout;
+	import org.apache.flex.core.ILayoutParent;
 	import org.apache.flex.core.IScrollBarModel;
 	import org.apache.flex.core.IStrand;
-	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.html.staticControls.beads.IScrollBarView;
 
 	public class VScrollBarLayout implements IBeadLayout
@@ -41,21 +43,21 @@ package org.apache.flex.html.staticControls.beads.layouts
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
-			sbView = value as IScrollBarView;
-			sbModel = sbView.scrollBarModel;
+			sbView = _strand.getBeadByType(IScrollBarView) as IScrollBarView;
+			sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel;
 			sbModel.addEventListener("maximumChange", changeHandler);
 			sbModel.addEventListener("minimumChange", changeHandler);
 			sbModel.addEventListener("snapIntervalChange", changeHandler);
 			sbModel.addEventListener("stepSizeChange", changeHandler);
             sbModel.addEventListener("pageSizeChange", changeHandler);
 			sbModel.addEventListener("valueChange", changeHandler);
-			IEventDispatcher(sbView.strand).addEventListener("heightChanged", changeHandler);
+			IEventDispatcher(_strand).addEventListener("heightChanged", changeHandler);
 			changeHandler(null);
 		}
 	
 		private function changeHandler(event:Event):void
 		{
-			var h:Number = DisplayObject(sbView.strand).height;
+			var h:Number = DisplayObject(_strand).height;
 			var increment:DisplayObject = sbView.increment;
 			var decrement:DisplayObject = sbView.decrement;
 			var track:DisplayObject = sbView.track;


Mime
View raw message