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] - Removed viewWidth and viewHeight from BeadViewBase and IBeadView (et al). Reset UIBase width and height getters so they look at _width and _height, returning $width and $height if necessary. Modified UIBase.
Date Thu, 30 Jul 2015 17:51:16 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop dd7e86284 -> a5649a568


Removed viewWidth and viewHeight from BeadViewBase and IBeadView (et al). Reset UIBase width
and height getters so they look at _width and _height, returning $width and $height if necessary.
Modified UIBase.addedToParent() to check and use CSS values for width and height if available.


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

Branch: refs/heads/develop
Commit: a5649a5680634fe76f73e2f65a25a8da62600842
Parents: dd7e862
Author: Peter Ent <pent@apache.org>
Authored: Thu Jul 30 13:51:12 2015 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Thu Jul 30 13:51:12 2015 -0400

----------------------------------------------------------------------
 .../as/src/org/apache/flex/core/BeadViewBase.as | 28 -----------
 .../as/src/org/apache/flex/core/IBeadView.as    | 20 --------
 .../Core/as/src/org/apache/flex/core/UIBase.as  | 51 ++++++++++++++------
 .../org/apache/flex/html/beads/ContainerView.as | 10 ----
 .../src/org/apache/flex/html/beads/ListView.as  | 28 -----------
 5 files changed, 35 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a5649a56/frameworks/projects/Core/as/src/org/apache/flex/core/BeadViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/BeadViewBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/BeadViewBase.as
index c83faa0..6bb686a 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/BeadViewBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/BeadViewBase.as
@@ -86,33 +86,5 @@ package org.apache.flex.core
         {
             return _strand as IUIBase;
         }
-		
-        /**
-         *  @copy org.apache.flex.core.IBeadView#viewHeight
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		public function get viewHeight():Number
-		{
-            // don't want to put $height in an interface
-			return _strand["$height"];
-		}
-		
-        /**
-         *  @copy org.apache.flex.core.IBeadView#viewWidth
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public function get viewWidth():Number
-        {
-            // don't want to put $width in an interface
-            return _strand["$width"];
-        }
    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a5649a56/frameworks/projects/Core/as/src/org/apache/flex/core/IBeadView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/IBeadView.as b/frameworks/projects/Core/as/src/org/apache/flex/core/IBeadView.as
index 1934134..2835bfc 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/IBeadView.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/IBeadView.as
@@ -42,25 +42,5 @@ package org.apache.flex.core
          *  @productversion FlexJS 0.0
          */
         function get host():IUIBase
-
-        /**
-         *  The width of the view. 
-         * 
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        function get viewWidth():Number;
-        
-        /**
-         *  The height of the view. 
-         * 
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        function get viewHeight():Number;
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a5649a56/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
index e8720f7..4a2916f 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
@@ -321,15 +321,11 @@ package org.apache.flex.core
          */
         override public function get width():Number
 		{
-			if (isNaN(explicitWidth))
-			{
-				var w:Number = _width;
-				if (isNaN(w)) w = $width;
-				var metrics:UIMetrics = BeadMetrics.getMetrics(this);
-				return w + metrics.left + metrics.right;
+			var w:Number = _width;
+			if (isNaN(w)) {
+				w = $width;
 			}
-			else
-				return explicitWidth;
+			return w;
 		}
 
         /**
@@ -376,15 +372,11 @@ package org.apache.flex.core
          */
 		override public function get height():Number
 		{
-			if (isNaN(explicitHeight))
-			{
-				var h:Number = _height;
-				if (isNaN(h)) h = $height;
-				var metrics:UIMetrics = BeadMetrics.getMetrics(this);
-				return h + metrics.top + metrics.bottom;
+			var h:Number = _height;
+			if (isNaN(h)) {
+				h = $height;
 			}
-			else
-				return explicitHeight;
+			return h;
 		}
 
         /**
@@ -902,6 +894,33 @@ package org.apache.flex.core
         public function addedToParent():void
         {
             var c:Class;
+			
+			if (isNaN(_width)) {
+				var value:* = ValuesManager.valuesImpl.getValue(this,"width");
+				if (value !== undefined) {
+					var s:String = String(value);
+					var lastChar:String = s.substr(s.length-1,s.length);
+					if (lastChar == "%") {
+						_percentWidth = Number(s);
+					}
+					else {
+						_width = Number(s);
+					}
+				}
+			}
+			
+			if (isNaN(_height)) {
+				value = ValuesManager.valuesImpl.getValue(this,"height");
+				if (value !== undefined) {
+					s = String(value);
+					lastChar = s.substr(s.length-1,s.length);
+					if (lastChar == "%") {
+						_percentHeight = Number(s);
+					} else {
+						_height = Number(s);
+					}
+				}
+			}
             
             for each (var bead:IBead in beads)
                 addBead(bead);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a5649a56/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
index fc0c4aa..e7fd2ae 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
@@ -483,16 +483,6 @@ package org.apache.flex.html.beads
 			resizingChildren = false;
 		}
 		
-		override public function get viewWidth():Number
-		{
-			return 0;
-		}
-		
-		override public function get viewHeight():Number
-		{
-			return 0;
-		}
-		
 		protected function displayBackgroundAndBorder(host:UIBase) : void
 		{
 			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(host, "background-color");

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a5649a56/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
index e98db41..ecfbafd 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
@@ -237,33 +237,5 @@ package org.apache.flex.html.beads
 			super.resizeHandler(event);
 			_dataGroup.updateAllItemRenderers();
 		}
-				
-        /**
-         *  @copy org.apache.flex.core.IBeadView#viewHeight
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        override public function get viewHeight():Number
-        {
-            // don't want to put $height in an interface
-            return _strand["$height"];
-        }
-        
-        /**
-         *  @copy org.apache.flex.core.IBeadView#viewWidth
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        override public function get viewWidth():Number
-        {
-            // don't want to put $width in an interface
-            return _strand["$width"];
-        }
 	}
 }


Mime
View raw message