Hi,
the attached patch makes it possible that one can click and *hold* on a JButton
A, move over to other buttons without setting their rollover state to true and
come back to A.

This is important because in the OceanTheme setting the rollover flag to true
makes the button paint a thick border or if they are part of a JToolBar paint
the gradient.

With this patch we behave like the RI.

ChangeLog:

2006-05-18  Robert Schuster  <[EMAIL PROTECTED]>

        * java/awt/LightweightDispatcher.java:
        (handleMouseEvent): Added note, added subexpression to if-statement.

cya
Robert
Index: java/awt/LightweightDispatcher.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/LightweightDispatcher.java,v
retrieving revision 1.7
diff -u -r1.7 LightweightDispatcher.java
--- java/awt/LightweightDispatcher.java	17 May 2006 16:53:19 -0000	1.7
+++ java/awt/LightweightDispatcher.java	18 May 2006 17:26:49 -0000
@@ -173,7 +173,15 @@
                 lastTarget.dispatchEvent(mouseExited);
               }
             
-            if (target != null)
+            // If a target exists dispatch the MOUSE_ENTERED event only if
+            // there is currently no component from which a drag operation
+            // started (dragTarget == null) or the target is that component
+            // (dragTarget == target)
+            // That way a user can click and hold on a button (putting it into
+            // the armed state), move the cursor above other buttons without
+            // affecting their rollover state and get back to the initial
+            // button.
+            if (target != null && (dragTarget == null || dragTarget == target))
               {
                 Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(),
                                                     target);

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to