harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r578224 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MouseDispatcher.java
Date Fri, 21 Sep 2007 18:45:40 GMT
Author: apetrenko
Date: Fri Sep 21 11:45:39 2007
New Revision: 578224

URL: http://svn.apache.org/viewvc?rev=578224&view=rev
Log:
Patch for HARMONY-4826 "[classlib][awt] MouseEvent can not fall into desired component in
Insets"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MouseDispatcher.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MouseDispatcher.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MouseDispatcher.java?rev=578224&r1=578223&r2=578224&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MouseDispatcher.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MouseDispatcher.java
Fri Sep 21 11:45:39 2007
@@ -212,35 +212,25 @@
     }
 
     private void fall2Child(PointerInfo info) {
-        Insets insets = info.src.getInsets();
+		final Point pos = info.position;
+		final int x = pos.x;
+		final int y = pos.y;
 
-        final Point pos = info.position;
-        final int x = pos.x;
-        final int y = pos.y;
-        if ((x >= insets.left) && (y >= insets.top) &&
-                (x < (info.src.w - insets.right)) &&
-                (y < (info.src.h - insets.bottom)))
-        {
-            Component[] children = ((Container) info.src).getComponents();
+		for (Component child : ((Container) info.src).getComponents()) {
+			if (child.isShowing()) {
+				if (child.contains(x - child.x, y - child.y)) {
+					info.src = child;
+					pos.translate(-child.x, -child.y);
 
-            for (Component child : children) {
-                if (child.isShowing()) {
-                    if (child.contains(x - child.getX(),
-                            y - child.getY()))
-                    {
-                        info.src = child;
-                        pos.translate(-child.x, -child.y);
+					if (child instanceof Container) {
+						fall2Child(info);
+					}
 
-                        if (child instanceof Container) {
-                            fall2Child(info);
-                        }
-
-                        return;
-                    }
-                }
-            }
-        }
-    }
+					return;
+				}
+			}
+		}
+	}
 
     private void dispatchButtonEvent(PointerInfo info, NativeEvent event) {
         int button = event.getMouseButton();



Mime
View raw message