classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Two small swing fixes


From: Mark Wielaard
Subject: [cp-patches] FYI: Two small swing fixes
Date: Sat, 04 Sep 2004 22:51:34 +0200

Hi,

These fixes come from the gcj gui branch.

2004-09-04  Graydon Hoare  <address@hidden>

        * javax/swing/DefaultButtonModel.java:
        Skip group notification when no group is set. 
2004-09-04  Graydon Hoare  <address@hidden>

        * javax/swing/JComponent.java
        (resetKeyboardActions): Add null checks. 

Committed,

Mark


? javax/swing/colorchooser/DefaultHSBChooserPanel.java
? javax/swing/colorchooser/DefaultPreviewPanel.java
? javax/swing/colorchooser/DefaultRGBChooserPanel.java
? javax/swing/colorchooser/DefaultSwatchChooserPanel.java
? javax/swing/plaf/basic/BasicColorChooserUI.java
Index: javax/swing/DefaultButtonModel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/DefaultButtonModel.java,v
retrieving revision 1.11
diff -u -r1.11 DefaultButtonModel.java
--- javax/swing/DefaultButtonModel.java 4 Sep 2004 20:31:20 -0000       1.11
+++ javax/swing/DefaultButtonModel.java 4 Sep 2004 20:51:03 -0000
@@ -339,14 +339,16 @@
       {
        fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
                                           null, ItemEvent.SELECTED));
-       group.setSelected(this, true);
+        if (group != null)
+         group.setSelected(this, true);
       }
 
     else if ((oldstate & SELECTED) == SELECTED && (newstate & SELECTED) == 0)
       {
        fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
                                           null, ItemEvent.DESELECTED));
-       group.setSelected(this, false);
+        if (group != null)
+         group.setSelected(this, false);
       }
 
     else if (((oldstate & ARMED) == ARMED && (oldstate & PRESSED) == PRESSED)
Index: javax/swing/JComponent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v
retrieving revision 1.21
diff -u -r1.21 JComponent.java
--- javax/swing/JComponent.java 4 Sep 2004 17:14:01 -0000       1.21
+++ javax/swing/JComponent.java 4 Sep 2004 20:51:03 -0000
@@ -1771,10 +1771,14 @@
    */
   public void resetKeyboardActions()
   {
-    inputMap_whenFocused.clear();
-    inputMap_whenAncestorOfFocused.clear();
-    inputMap_whenInFocusedWindow.clear();
-    actionMap.clear();
+    if (inputMap_whenFocused != null)
+      inputMap_whenFocused.clear();
+    if (inputMap_whenAncestorOfFocused != null)
+      inputMap_whenAncestorOfFocused.clear();
+    if (inputMap_whenInFocusedWindow != null)
+      inputMap_whenInFocusedWindow.clear();
+    if (actionMap != null)
+      actionMap.clear();
   }
 
 

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]