[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: fixes for event handling

Kaffe CVS cvs-commits at kaffe.org
Thu Dec 2 16:02:36 PST 2004


PatchSet 5511 
Date: 2004/12/02 23:58:09
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: fixes for event handling

2004-12-02  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/awt/Component.java,
        libraries/javalib/javax/swing/text/JTextComponent.java:
        Resynced with GNU Classpath.

        2004-11-23  Michael Koch  <konqueror at gmx.de>

        * java/awt/Component.java:
        Fixed argument names to match javadocs.
        (setFont): Rewritten set property first and then fire event.
        (setLocale): Likewise.
        * javax/swing/text/JTextComponent.java
        (setEditable): Likewise.

Members: 
	ChangeLog:1.3057->1.3058 
	libraries/javalib/java/awt/Component.java:1.42->1.43 
	libraries/javalib/javax/swing/text/JTextComponent.java:1.6->1.7 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3057 kaffe/ChangeLog:1.3058
--- kaffe/ChangeLog:1.3057	Thu Dec  2 22:39:39 2004
+++ kaffe/ChangeLog	Thu Dec  2 23:58:09 2004
@@ -1,5 +1,20 @@
 2004-12-02  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/awt/Component.java,
+	libraries/javalib/javax/swing/text/JTextComponent.java:
+	Resynced with GNU Classpath.
+
+	2004-11-23  Michael Koch  <konqueror at gmx.de>
+
+        * java/awt/Component.java:
+        Fixed argument names to match javadocs.
+        (setFont): Rewritten set property first and then fire event.
+        (setLocale): Likewise.
+        * javax/swing/text/JTextComponent.java
+        (setEditable): Likewise.
+
+2004-12-02  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/util/zip/InflaterInputStream.java:
 	Resynced with GNU Classpath.
 
Index: kaffe/libraries/javalib/java/awt/Component.java
diff -u kaffe/libraries/javalib/java/awt/Component.java:1.42 kaffe/libraries/javalib/java/awt/Component.java:1.43
--- kaffe/libraries/javalib/java/awt/Component.java:1.42	Fri Nov 26 18:08:54 2004
+++ kaffe/libraries/javalib/java/awt/Component.java	Thu Dec  2 23:58:14 2004
@@ -1046,16 +1046,21 @@
    * Sets the font for this component to the specified font. This is a bound
    * property.
    *
-   * @param font the new font for this component
+   * @param newFont the new font for this component
+   *
    * @see #getFont()
    */
-  public void setFont(Font f)
+  public void setFont(Font newFont)
   {
-    firePropertyChange("font", font, f);
+    if (font == newFont)
+      return;
+
+    Font oldFont = font;
+    font = newFont;
     if (peer != null)
-      peer.setFont(f);
+      peer.setFont(font);
+    firePropertyChange("font", oldFont, newFont);
     invalidate();
-    font = f;
   }
 
   /**
@@ -1092,12 +1097,16 @@
    * Sets the locale for this component to the specified locale. This is a
    * bound property.
    *
-   * @param locale the new locale for this component
+   * @param newLocale the new locale for this component
    */
-  public void setLocale(Locale l)
+  public void setLocale(Locale newLocale)
   {
-    firePropertyChange("locale", locale, l);
-    locale = l;
+    if (locale == newLocale)
+      return;
+
+    Locale oldLocale = locale;
+    locale = newLocale;
+    firePropertyChange("locale", oldLocale, newLocale);
     // New writing/layout direction or more/less room for localized labels.
     invalidate();
   }
@@ -2298,9 +2307,9 @@
    * @see #getComponentListeners()
    * @since 1.1
    */
-  public synchronized void addComponentListener(ComponentListener l)
+  public synchronized void addComponentListener(ComponentListener listener)
   {
-    componentListener = AWTEventMulticaster.add(componentListener, l);
+    componentListener = AWTEventMulticaster.add(componentListener, listener);
     if (componentListener != null)
       enableEvents(AWTEvent.COMPONENT_EVENT_MASK);
   }
@@ -2315,9 +2324,9 @@
    * @see #getComponentListeners()
    * @since 1.1
    */
-  public synchronized void removeComponentListener(ComponentListener l)
+  public synchronized void removeComponentListener(ComponentListener listener)
   {
-    componentListener = AWTEventMulticaster.remove(componentListener, l);
+    componentListener = AWTEventMulticaster.remove(componentListener, listener);
   }
 
   /**
@@ -2346,9 +2355,9 @@
    * @see #getFocusListeners()
    * @since 1.1
    */
-  public synchronized void addFocusListener(FocusListener l)
+  public synchronized void addFocusListener(FocusListener listener)
   {
-    focusListener = AWTEventMulticaster.add(focusListener, l);
+    focusListener = AWTEventMulticaster.add(focusListener, listener);
     if (focusListener != null)
       enableEvents(AWTEvent.FOCUS_EVENT_MASK);
   }
@@ -2363,9 +2372,9 @@
    * @see #getFocusListeners()
    * @since 1.1
    */
-  public synchronized void removeFocusListener(FocusListener l)
+  public synchronized void removeFocusListener(FocusListener listener)
   {
-    focusListener = AWTEventMulticaster.remove(focusListener, l);
+    focusListener = AWTEventMulticaster.remove(focusListener, listener);
   }
 
   /**
@@ -2393,9 +2402,9 @@
    * @see #getHierarchyListeners()
    * @since 1.3
    */
-  public synchronized void addHierarchyListener(HierarchyListener l)
+  public synchronized void addHierarchyListener(HierarchyListener listener)
   {
-    hierarchyListener = AWTEventMulticaster.add(hierarchyListener, l);
+    hierarchyListener = AWTEventMulticaster.add(hierarchyListener, listener);
     if (hierarchyListener != null)
       enableEvents(AWTEvent.HIERARCHY_EVENT_MASK);
   }
@@ -2410,9 +2419,9 @@
    * @see #getHierarchyListeners()
    * @since 1.3
    */
-  public synchronized void removeHierarchyListener(HierarchyListener l)
+  public synchronized void removeHierarchyListener(HierarchyListener listener)
   {
-    hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l);
+    hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, listener);
   }
 
   /**
@@ -2442,10 +2451,10 @@
    * @since 1.3
    */
   public synchronized void
-    addHierarchyBoundsListener(HierarchyBoundsListener l)
+    addHierarchyBoundsListener(HierarchyBoundsListener listener)
   {
     hierarchyBoundsListener =
-      AWTEventMulticaster.add(hierarchyBoundsListener, l);
+      AWTEventMulticaster.add(hierarchyBoundsListener, listener);
     if (hierarchyBoundsListener != null)
       enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
   }
@@ -2461,10 +2470,10 @@
    * @since 1.3
    */
   public synchronized void
-    removeHierarchyBoundsListener(HierarchyBoundsListener l)
+    removeHierarchyBoundsListener(HierarchyBoundsListener listener)
   {
     hierarchyBoundsListener =
-      AWTEventMulticaster.remove(hierarchyBoundsListener, l);
+      AWTEventMulticaster.remove(hierarchyBoundsListener, listener);
   }
 
   /**
@@ -2493,9 +2502,9 @@
    * @see #getKeyListeners()
    * @since 1.1
    */
-  public synchronized void addKeyListener(KeyListener l)
+  public synchronized void addKeyListener(KeyListener listener)
   {
-    keyListener = AWTEventMulticaster.add(keyListener, l);
+    keyListener = AWTEventMulticaster.add(keyListener, listener);
     if (keyListener != null)
       enableEvents(AWTEvent.KEY_EVENT_MASK);
   }
@@ -2510,9 +2519,9 @@
    * @see #getKeyListeners()
    * @since 1.1
    */
-  public synchronized void removeKeyListener(KeyListener l)
+  public synchronized void removeKeyListener(KeyListener listener)
   {
-    keyListener = AWTEventMulticaster.remove(keyListener, l);
+    keyListener = AWTEventMulticaster.remove(keyListener, listener);
   }
 
   /**
@@ -2540,9 +2549,9 @@
    * @see #getMouseListeners()
    * @since 1.1
    */
-  public synchronized void addMouseListener(MouseListener l)
+  public synchronized void addMouseListener(MouseListener listener)
   {
-    mouseListener = AWTEventMulticaster.add(mouseListener, l);
+    mouseListener = AWTEventMulticaster.add(mouseListener, listener);
     if (mouseListener != null)
       enableEvents(AWTEvent.MOUSE_EVENT_MASK);
   }
@@ -2557,9 +2566,9 @@
    * @see #getMouseListeners()
    * @since 1.1
    */
-  public synchronized void removeMouseListener(MouseListener l)
+  public synchronized void removeMouseListener(MouseListener listener)
   {
-    mouseListener = AWTEventMulticaster.remove(mouseListener, l);
+    mouseListener = AWTEventMulticaster.remove(mouseListener, listener);
   }
 
   /**
@@ -2587,9 +2596,9 @@
    * @see #getMouseMotionListeners()
    * @since 1.1
    */
-  public synchronized void addMouseMotionListener(MouseMotionListener l)
+  public synchronized void addMouseMotionListener(MouseMotionListener listener)
   {
-    mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l);
+    mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener);
     if (mouseMotionListener != null)
       enableEvents(AWTEvent.MOUSE_EVENT_MASK);
   }
@@ -2604,9 +2613,9 @@
    * @see #getMouseMotionListeners()
    * @since 1.1
    */
-  public synchronized void removeMouseMotionListener(MouseMotionListener l)
+  public synchronized void removeMouseMotionListener(MouseMotionListener listener)
   {
-    mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l);
+    mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, listener);
   }
 
   /**
@@ -2636,9 +2645,9 @@
    * @see #getMouseWheelListeners()
    * @since 1.4
    */
-  public synchronized void addMouseWheelListener(MouseWheelListener l)
+  public synchronized void addMouseWheelListener(MouseWheelListener listener)
   {
-    mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, l);
+    mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, listener);
     if (mouseWheelListener != null)
       enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
   }
@@ -2654,9 +2663,9 @@
    * @see #getMouseWheelListeners()
    * @since 1.4
    */
-  public synchronized void removeMouseWheelListener(MouseWheelListener l)
+  public synchronized void removeMouseWheelListener(MouseWheelListener listener)
   {
-    mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l);
+    mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, listener);
   }
 
   /**
@@ -2686,9 +2695,9 @@
    * @see #getInputMethodRequests()
    * @since 1.2
    */
-  public synchronized void addInputMethodListener(InputMethodListener l)
+  public synchronized void addInputMethodListener(InputMethodListener listener)
   {
-    inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l);
+    inputMethodListener = AWTEventMulticaster.add(inputMethodListener, listener);
     if (inputMethodListener != null)
       enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK);
   }
@@ -2703,9 +2712,9 @@
    * @see #getInputMethodRequests()
    * @since 1.2
    */
-  public synchronized void removeInputMethodListener(InputMethodListener l)
+  public synchronized void removeInputMethodListener(InputMethodListener listener)
   {
-    inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l);
+    inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, listener);
   }
 
   /**
Index: kaffe/libraries/javalib/javax/swing/text/JTextComponent.java
diff -u kaffe/libraries/javalib/javax/swing/text/JTextComponent.java:1.6 kaffe/libraries/javalib/javax/swing/text/JTextComponent.java:1.7
--- kaffe/libraries/javalib/javax/swing/text/JTextComponent.java:1.6	Thu Dec  2 19:10:17 2004
+++ kaffe/libraries/javalib/javax/swing/text/JTextComponent.java	Thu Dec  2 23:58:16 2004
@@ -1015,12 +1015,16 @@
   /**
    * Enables/disabled this text component's editability.
    *
-   * @param editable true to make it editable, false otherwise.
+   * @param newValue true to make it editable, false otherwise.
    */
-  public void setEditable(boolean editable)
+  public void setEditable(boolean newValue)
   {
-    firePropertyChange("editable", this.editable, editable);
-    this.editable = editable;
+    if (editable == newValue)
+      return;
+
+    boolean oldValue = editable;
+    editable = newValue;
+    firePropertyChange("editable", oldValue, newValue);
   }
 
   /**




More information about the kaffe mailing list