flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [11/15] git commit: [flex-asjs] [refs/heads/develop] - move CSSUtils so it gets cross-compiled
Date Fri, 07 Aug 2015 17:12:07 GMT
move CSSUtils so it gets cross-compiled


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

Branch: refs/heads/develop
Commit: 1bd190bd6ce3f5c387ca967e5b5870744a06bc6b
Parents: 9d3261a
Author: Alex Harui <aharui@apache.org>
Authored: Fri Aug 7 09:57:28 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Aug 7 10:00:59 2015 -0700

----------------------------------------------------------------------
 frameworks/projects/Core/as/src/CoreClasses.as  |   1 -
 .../as/src/org/apache/flex/utils/CSSUtils.as    | 323 -------------------
 .../projects/Core/asjs/src/CoreASJSClasses.as   |   1 +
 .../asjs/src/org/apache/flex/utils/CSSUtils.as  | 323 +++++++++++++++++++
 4 files changed, 324 insertions(+), 324 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1bd190bd/frameworks/projects/Core/as/src/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/CoreClasses.as b/frameworks/projects/Core/as/src/CoreClasses.as
index 0b575af..ba8f22f 100644
--- a/frameworks/projects/Core/as/src/CoreClasses.as
+++ b/frameworks/projects/Core/as/src/CoreClasses.as
@@ -86,7 +86,6 @@ internal class CoreClasses
     import org.apache.flex.geom.Rectangle; Rectangle;
     import org.apache.flex.utils.BinaryData; BinaryData;
     import org.apache.flex.utils.BeadMetrics; BeadMetrics;
-    import org.apache.flex.utils.CSSUtils; CSSUtils;
     import org.apache.flex.utils.CSSBorderUtils; CSSBorderUtils;
     import org.apache.flex.utils.dbg.DOMPathUtil; DOMPathUtil;
 	import org.apache.flex.utils.EffectTimer; EffectTimer;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1bd190bd/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
deleted file mode 100644
index 10dad30..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
+++ /dev/null
@@ -1,323 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.utils
-{
-
-	/**
-	 *  The CSSUtils class is a collection of static functions that provide utility
-	 *  features for managing CSS values.
-	 *  
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion FlexJS 0.0
-	 */
-	public class CSSUtils
-	{
-		/**
-		 * @private
-		 */
-		public function CSSUtils()
-		{
-			throw new Error("CSSUtils should not be instantiated.");
-		}
-		
-        /**
-         *  Converts a String to number.
-         *
-         *  @param str The String. 
-         *  @param reference A Number that will be used to convert percentages. 
-         *
-         *  @return Number. 
-         *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-         */
-        public static function toNumber(str:String, reference:Number = 0):Number
-        {
-            var c:int = str.indexOf("px");
-            if (c != -1)
-                return Number(str.substr(0, c));
-            
-            c = str.indexOf("%");
-            if (c != -1)
-                return Number(str.substr(0, c)) * reference / 100;
-            
-            return Number(str);
-        }
-
-        /**
-         *  Converts a value describing a color to a uint 
-         *
-         *  @param value The value. 
-         *
-         *  @return uint of the color. 
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static function toColor(value:Object):uint
-        {
-            return toColorWithAlpha(value) & 0xFFFFFF;
-        }
-        
-        /**
-         *  Converts a value describing a color and alpha in a uint 
-         *
-         *  @param value The value. 
-         *
-         *  @return uint of the color. 
-         *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-         */
-        public static function toColorWithAlpha(value:Object):uint
-        {
-            if (!(value is String))
-                return uint(value) | 0xFF000000; // css parser converted #rrggbb without
alpha channel
-            
-            var c:int;
-            var c2:int;
-            
-            var stringValue:String = value as String;
-            if (stringValue.charAt(0) == '#')
-            {
-                if (stringValue.length == 4)
-                    return uint("0x" + stringValue.charAt(1) + stringValue.charAt(1) +
-                        stringValue.charAt(2) + stringValue.charAt(2) +
-                        stringValue.charAt(3) + stringValue.charAt(3));
-                if (stringValue.length == 7)
-                    return uint("0xFF" + stringValue.substr(1));
-                return uint("0x" + stringValue.substr(1));
-            }
-            else if ((c = stringValue.indexOf("rgb(")) != -1)
-            {
-                c2 = stringValue.indexOf(")");
-                stringValue = stringValue.substring(c + 4, c2);
-                var parts3:Array = stringValue.split(",");
-                return (0xFF000000 + 
-                        uint(parts3[0]) << 16 +
-                        uint(parts3[1]) << 8 +
-                        uint(parts3[2]));
-            }
-            else if ((c = stringValue.indexOf("rgba(")) != -1)
-            {
-                c2 = stringValue.indexOf(")");
-                stringValue = stringValue.substring(c + 4, c2);
-                var parts4:Array = stringValue.split(",");
-                return (uint(parts4[3]) << 24 + 
-                    uint(parts3[0]) << 16 +
-                    uint(parts3[1]) << 8 +
-                    uint(parts3[2]));
-            }
-            
-            if (colorMap.hasOwnProperty(stringValue))
-                return colorMap[stringValue];
-            return uint(stringValue);
-        }
-        
-        /**
-         *  Computes paddingLeft or marginLeft.
-         *
-         *  @param value The value of padding-left or margin-left. 
-         *  @param values The value of padding or margin. 
-         *  @param reference A Number that will be used to convert percentages. 
-         *
-         *  @return Number. 
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static function getLeftValue(value:Object, values:Object, reference:Number
= NaN):Number
-        {
-            if (value is Number)
-                return value as Number;
-
-            if (values is Number)
-                return values as Number;
-            
-            if (value != null)
-                return toNumber(value as String, reference);
-            if (values == null)
-                return 0;
-            if (values is Array)
-            {
-                var arr:Array = values as Array;
-                var n:int = arr.length;
-                // shouldn't be n == 1. values would not be an array
-                var index:int = n < 3 ? 1 : 3;
-                value = arr[index];
-                if (value is String)
-                  return toNumber(value as String, reference);
-                return value as Number;
-            }
-            return toNumber(values as String, reference);
-        }
-        
-        /**
-         *  Computes paddingRight or marginRight.
-         *
-         *  @param value The value of padding-right or margin-right. 
-         *  @param values The value of padding or margin. 
-         *  @param reference A Number that will be used to convert percentages. 
-         *
-         *  @return Number. 
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static function getRightValue(value:Object, values:Object, reference:Number
= NaN):Number
-        {
-            if (value is Number)
-                return value as Number;
-
-            if (values is Number)
-                return values as Number;
-            
-            if (value != null)
-                return toNumber(value as String, reference);
-            if (values == null)
-                return 0;
-            if (values is Array)
-            {
-                var arr:Array = values as Array;
-                value = arr[1];
-                if (value is String)
-                    return toNumber(value as String, reference);
-                return value as Number;
-            }
-            return toNumber(values as String, reference);
-        }
-        
-        /**
-         *  Computes paddingTop or marginTop.
-         *
-         *  @param value The value of padding-top or margin-top. 
-         *  @param values The value of padding or margin. 
-         *  @param reference A Number that will be used to convert percentages. 
-         *
-         *  @return Number. 
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static function getTopValue(value:Object, values:Object, reference:Number
= NaN):Number
-        {
-            if (value is Number)
-                return value as Number;
-            
-            if (values is Number)
-                return values as Number;
-            
-            if (value != null)
-                return toNumber(value as String, reference);
-            if (values == null)
-                return 0;
-            if (values is Array)
-            {
-                var arr:Array = values as Array;
-                value = arr[0];
-                if (value is String)
-                    return toNumber(value as String, reference);
-                return value as Number;
-            }
-            return toNumber(values as String, reference);
-        }
-        
-        /**
-         *  Computes paddingBottom or marginBottom.
-         *
-         *  @param value The value of padding-bottom or margin-bottom. 
-         *  @param values The value of padding or margin. 
-         *  @param reference A Number that will be used to convert percentages. 
-         *
-         *  @return Number. 
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static function getBottomValue(value:Object, values:Object, reference:Number
= NaN):Number
-        {
-            if (value is Number)
-                return value as Number;
-            
-            if (values is Number)
-                return values as Number;
-            
-            if (value != null)
-                return toNumber(value as String, reference);
-            if (values == null)
-                return 0;
-            if (values is Array)
-            {
-                var arr:Array = values as Array;
-                var n:int = arr.length;
-                // shouldn't be n == 1. values would not be an array
-                var index:int = n == 2 ? 0 : 2;
-                value = arr[index];
-                if (value is String)
-                    return toNumber(value as String, reference);
-                return value as Number;
-            }
-            return toNumber(values as String, reference);
-        }
-        
-        /**
-         *  The map of color names to uints.
-         *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-         */
-        public static var colorMap:Object = {
-            transparent:   0,
-            white:   0xFFFFFFFF,
-            silver:	 0xFFC0C0C0,
-            gray:    0xFF808080,
-            black:	 0xFF000000,
-            red:     0xFFFF0000,
-            maroon:  0xFF800000,
-            yellow:	 0xFFFFFF00,
-            olive:	 0xFF808000,
-            lime:	 0xFF00FF00,
-            green:	 0xFF008000,
-            aqua:	 0xFF00FFFF,
-            teal:	 0xFF008080,
-            blue:	 0xFF0000FF,
-            navy:	 0xFF000080,
-            fuchsia: 0xFFFF00FF,
-            purple:	 0xFF800080
-        }
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1bd190bd/frameworks/projects/Core/asjs/src/CoreASJSClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/asjs/src/CoreASJSClasses.as b/frameworks/projects/Core/asjs/src/CoreASJSClasses.as
index e31ff89..ef6790d 100644
--- a/frameworks/projects/Core/asjs/src/CoreASJSClasses.as
+++ b/frameworks/projects/Core/asjs/src/CoreASJSClasses.as
@@ -32,6 +32,7 @@ internal class CoreASJSClasses
     import org.apache.flex.core.IDataGridPresentationModel; IDataGridPresentationModel;
     import org.apache.flex.core.IDateChooserModel; IDateChooserModel;
     import org.apache.flex.core.ParentDocumentBead; ParentDocumentBead;
+    import org.apache.flex.utils.CSSUtils; CSSUtils;
 }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1bd190bd/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as
new file mode 100644
index 0000000..10dad30
--- /dev/null
+++ b/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as
@@ -0,0 +1,323 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.utils
+{
+
+	/**
+	 *  The CSSUtils class is a collection of static functions that provide utility
+	 *  features for managing CSS values.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class CSSUtils
+	{
+		/**
+		 * @private
+		 */
+		public function CSSUtils()
+		{
+			throw new Error("CSSUtils should not be instantiated.");
+		}
+		
+        /**
+         *  Converts a String to number.
+         *
+         *  @param str The String. 
+         *  @param reference A Number that will be used to convert percentages. 
+         *
+         *  @return Number. 
+         *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+         */
+        public static function toNumber(str:String, reference:Number = 0):Number
+        {
+            var c:int = str.indexOf("px");
+            if (c != -1)
+                return Number(str.substr(0, c));
+            
+            c = str.indexOf("%");
+            if (c != -1)
+                return Number(str.substr(0, c)) * reference / 100;
+            
+            return Number(str);
+        }
+
+        /**
+         *  Converts a value describing a color to a uint 
+         *
+         *  @param value The value. 
+         *
+         *  @return uint of the color. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function toColor(value:Object):uint
+        {
+            return toColorWithAlpha(value) & 0xFFFFFF;
+        }
+        
+        /**
+         *  Converts a value describing a color and alpha in a uint 
+         *
+         *  @param value The value. 
+         *
+         *  @return uint of the color. 
+         *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+         */
+        public static function toColorWithAlpha(value:Object):uint
+        {
+            if (!(value is String))
+                return uint(value) | 0xFF000000; // css parser converted #rrggbb without
alpha channel
+            
+            var c:int;
+            var c2:int;
+            
+            var stringValue:String = value as String;
+            if (stringValue.charAt(0) == '#')
+            {
+                if (stringValue.length == 4)
+                    return uint("0x" + stringValue.charAt(1) + stringValue.charAt(1) +
+                        stringValue.charAt(2) + stringValue.charAt(2) +
+                        stringValue.charAt(3) + stringValue.charAt(3));
+                if (stringValue.length == 7)
+                    return uint("0xFF" + stringValue.substr(1));
+                return uint("0x" + stringValue.substr(1));
+            }
+            else if ((c = stringValue.indexOf("rgb(")) != -1)
+            {
+                c2 = stringValue.indexOf(")");
+                stringValue = stringValue.substring(c + 4, c2);
+                var parts3:Array = stringValue.split(",");
+                return (0xFF000000 + 
+                        uint(parts3[0]) << 16 +
+                        uint(parts3[1]) << 8 +
+                        uint(parts3[2]));
+            }
+            else if ((c = stringValue.indexOf("rgba(")) != -1)
+            {
+                c2 = stringValue.indexOf(")");
+                stringValue = stringValue.substring(c + 4, c2);
+                var parts4:Array = stringValue.split(",");
+                return (uint(parts4[3]) << 24 + 
+                    uint(parts3[0]) << 16 +
+                    uint(parts3[1]) << 8 +
+                    uint(parts3[2]));
+            }
+            
+            if (colorMap.hasOwnProperty(stringValue))
+                return colorMap[stringValue];
+            return uint(stringValue);
+        }
+        
+        /**
+         *  Computes paddingLeft or marginLeft.
+         *
+         *  @param value The value of padding-left or margin-left. 
+         *  @param values The value of padding or margin. 
+         *  @param reference A Number that will be used to convert percentages. 
+         *
+         *  @return Number. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function getLeftValue(value:Object, values:Object, reference:Number
= NaN):Number
+        {
+            if (value is Number)
+                return value as Number;
+
+            if (values is Number)
+                return values as Number;
+            
+            if (value != null)
+                return toNumber(value as String, reference);
+            if (values == null)
+                return 0;
+            if (values is Array)
+            {
+                var arr:Array = values as Array;
+                var n:int = arr.length;
+                // shouldn't be n == 1. values would not be an array
+                var index:int = n < 3 ? 1 : 3;
+                value = arr[index];
+                if (value is String)
+                  return toNumber(value as String, reference);
+                return value as Number;
+            }
+            return toNumber(values as String, reference);
+        }
+        
+        /**
+         *  Computes paddingRight or marginRight.
+         *
+         *  @param value The value of padding-right or margin-right. 
+         *  @param values The value of padding or margin. 
+         *  @param reference A Number that will be used to convert percentages. 
+         *
+         *  @return Number. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function getRightValue(value:Object, values:Object, reference:Number
= NaN):Number
+        {
+            if (value is Number)
+                return value as Number;
+
+            if (values is Number)
+                return values as Number;
+            
+            if (value != null)
+                return toNumber(value as String, reference);
+            if (values == null)
+                return 0;
+            if (values is Array)
+            {
+                var arr:Array = values as Array;
+                value = arr[1];
+                if (value is String)
+                    return toNumber(value as String, reference);
+                return value as Number;
+            }
+            return toNumber(values as String, reference);
+        }
+        
+        /**
+         *  Computes paddingTop or marginTop.
+         *
+         *  @param value The value of padding-top or margin-top. 
+         *  @param values The value of padding or margin. 
+         *  @param reference A Number that will be used to convert percentages. 
+         *
+         *  @return Number. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function getTopValue(value:Object, values:Object, reference:Number
= NaN):Number
+        {
+            if (value is Number)
+                return value as Number;
+            
+            if (values is Number)
+                return values as Number;
+            
+            if (value != null)
+                return toNumber(value as String, reference);
+            if (values == null)
+                return 0;
+            if (values is Array)
+            {
+                var arr:Array = values as Array;
+                value = arr[0];
+                if (value is String)
+                    return toNumber(value as String, reference);
+                return value as Number;
+            }
+            return toNumber(values as String, reference);
+        }
+        
+        /**
+         *  Computes paddingBottom or marginBottom.
+         *
+         *  @param value The value of padding-bottom or margin-bottom. 
+         *  @param values The value of padding or margin. 
+         *  @param reference A Number that will be used to convert percentages. 
+         *
+         *  @return Number. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function getBottomValue(value:Object, values:Object, reference:Number
= NaN):Number
+        {
+            if (value is Number)
+                return value as Number;
+            
+            if (values is Number)
+                return values as Number;
+            
+            if (value != null)
+                return toNumber(value as String, reference);
+            if (values == null)
+                return 0;
+            if (values is Array)
+            {
+                var arr:Array = values as Array;
+                var n:int = arr.length;
+                // shouldn't be n == 1. values would not be an array
+                var index:int = n == 2 ? 0 : 2;
+                value = arr[index];
+                if (value is String)
+                    return toNumber(value as String, reference);
+                return value as Number;
+            }
+            return toNumber(values as String, reference);
+        }
+        
+        /**
+         *  The map of color names to uints.
+         *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+         */
+        public static var colorMap:Object = {
+            transparent:   0,
+            white:   0xFFFFFFFF,
+            silver:	 0xFFC0C0C0,
+            gray:    0xFF808080,
+            black:	 0xFF000000,
+            red:     0xFFFF0000,
+            maroon:  0xFF800000,
+            yellow:	 0xFFFFFF00,
+            olive:	 0xFF808000,
+            lime:	 0xFF00FF00,
+            green:	 0xFF008000,
+            aqua:	 0xFF00FFFF,
+            teal:	 0xFF008080,
+            blue:	 0xFF0000FF,
+            navy:	 0xFF000080,
+            fuchsia: 0xFFFF00FF,
+            purple:	 0xFF800080
+        }
+	}
+}
\ No newline at end of file


Mime
View raw message