You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/10/24 23:40:13 UTC

[1/2] git commit: [flex-asjs] [refs/heads/develop] - in some configs the mouse event doesn't have these properties

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 1bbf65223 -> 652481466


in some configs the mouse event doesn't have these properties


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

Branch: refs/heads/develop
Commit: 3f1e687bf264ce4e05232768027f3a0423cac6de
Parents: 1bbf652
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 24 14:24:41 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 24 14:24:41 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/events/MouseEvent.as      | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3f1e687b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
index 254565c..d627fc0 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
@@ -45,7 +45,14 @@ package org.apache.flex.events
 
         public static const UNCONVERTED_EVENTS:Object = { mouseWheel: 1 };
         
-        public static function convert(event:flash.events.MouseEvent):org.apache.flex.events.MouseEvent
+        /**
+         *  A method used to copy properties from flash.events.MouseEvent to 
+         *  org.apache.flex.events.Event.  The set of properties can be
+         *  different based on platform and runtime.
+         */
+        public static var convert:Function = flashConvert;
+        
+        private static function flashConvert(event:flash.events.MouseEvent):org.apache.flex.events.MouseEvent
         {
             if (UNCONVERTED_EVENTS[event.type])
                 return null;
@@ -56,15 +63,6 @@ package org.apache.flex.events
                                                         event.ctrlKey, event.altKey, event.shiftKey,
                                                         event.buttonDown, event.delta);
 
-            try 
-            {
-                newEvent.commandKey = event.commandKey;
-                newEvent.controlKey = event.controlKey;
-                newEvent.clickCount = event.clickCount;
-            }
-            catch (e:Error)
-            {          
-            }
             return newEvent;
         }
         


[2/2] git commit: [flex-asjs] [refs/heads/develop] - DOMPathUtil was in a package called 'debug' which was somehow ignored by git. I don't see it in .gitignore, but I changed the package name so it would be visible

Posted by ah...@apache.org.
DOMPathUtil was in a package called 'debug' which was somehow ignored by git.  I don't see it in .gitignore, but I changed the package name so it would be visible


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

Branch: refs/heads/develop
Commit: 6524814664121d04025f41906b1ad973997fc0ed
Parents: 3f1e687
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 24 14:40:04 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 24 14:40:04 2014 -0700

----------------------------------------------------------------------
 .../html/beads/layouts/NonVirtualBasicLayout.as |  2 +-
 .../beads/layouts/NonVirtualHorizontalLayout.as |  2 +-
 .../beads/layouts/NonVirtualVerticalLayout.as   |  2 +-
 .../org/apache/flex/utils/dbg/DOMPathUtil.as    | 94 ++++++++++++++++++++
 4 files changed, 97 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
index b83b2ff..6a19204 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
@@ -28,7 +28,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-    import org.apache.flex.utils.debug.DOMPathUtil;
+    import org.apache.flex.utils.dbg.DOMPathUtil;
 
     /**
      *  The NonVirtualBasicLayout class is a simple layout

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
index 820c410..c663d8f 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
@@ -27,7 +27,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-    import org.apache.flex.utils.debug.DOMPathUtil;
+    import org.apache.flex.utils.dbg.DOMPathUtil;
 
     /**
      *  The NonVirtualHorizontalLayout class is a simple layout

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
index cf0de6a..5b7e5d6 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
@@ -28,7 +28,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
-    import org.apache.flex.utils.debug.DOMPathUtil;
+    import org.apache.flex.utils.dbg.DOMPathUtil;
 
     /**
      *  The NonVirtualVerticalLayout class is a simple layout

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as
new file mode 100644
index 0000000..8e783ac
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.dbg
+{
+    import flash.utils.Dictionary;
+    import flash.utils.getQualifiedClassName;
+    
+    import org.apache.flex.core.IChild;
+
+	/**
+	 *  The DOMPathUtil class is a tracks instances of display objects
+     *  and provides a unique string for each one based on its position
+     *  in the tree of display objects.  It is generally used for
+     *  trace output.  If you think you need this for production applications
+     *  you might want to re-think your design.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DOMPathUtil
+	{
+		/**
+		 * @private
+		 */
+		public function DOMPathUtil()
+		{
+			throw new Error("DOMPathUtil should not be instantiated.");
+		}
+		
+        private static var dict:Dictionary = new Dictionary(true);
+        private static var counter:int = 0;
+        
+		/**
+		 *  Returns a string for an object.  IF the object is parented, it
+         *  creates a string based on the DOMPathUtil of the parent.
+		 *  
+         *  @param obj The object to generate a path/name for.
+		 *  @return The unique name based on the parents.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public static function getPath(obj:Object):String
+		{
+            if (obj == null) return "";
+            
+            var name:String = null;
+            if (dict[obj] == null)
+            {
+                try {
+                    name = obj.id;
+                } catch (e:Error)
+                {
+                }
+                if (name == null)
+                {
+                    name = getQualifiedClassName(obj);
+                    var c:int = name.lastIndexOf(":");
+                    if (c != -1)
+                        name = name.substr(c + 1);
+                    name += (counter++).toString();
+                }
+                dict[obj] = name;
+            }
+            name = dict[obj];
+            
+            if (obj is IChild)
+            {
+                name = getPath(IChild(obj).parent) + "/" + name;
+            }
+            return name;
+		}
+	}
+}
\ No newline at end of file