[kaffe] CVS kaffe (robilad): resynced with gnu classpath: swing and awt fixes

Kaffe CVS cvs-commits at kaffe.org
Fri Sep 16 15:31:33 PDT 2005


PatchSet 6910 
Date: 2005/09/16 22:25:15
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with gnu classpath: swing and awt fixes

Members: 
	ChangeLog:1.4431->1.4432 
	libraries/clib/fdlibm/mprec.h:1.4->1.5 
	libraries/javalib/Makefile.am:1.393->1.394 
	libraries/javalib/Makefile.in:1.484->1.485 
	libraries/javalib/all.files:1.163->1.164 
	libraries/javalib/java/awt/Color.java:1.20->1.21 
	libraries/javalib/java/awt/Component.java:1.59->1.60 
	libraries/javalib/java/awt/Point.java:1.10->1.11 
	libraries/javalib/java/awt/Rectangle.java:1.13->1.14 
	libraries/javalib/java/awt/Window.java:1.39->1.40 
	libraries/javalib/java/io/PushbackInputStream.java:1.10->1.11 
	libraries/javalib/java/lang/Class.java:1.57->1.58 
	libraries/javalib/java/lang/EnumConstantNotPresentException.java:INITIAL->1.1 
	libraries/javalib/java/net/URLStreamHandler.java:1.22->1.23 
	libraries/javalib/java/nio/charset/Charset.java:1.18->1.19 
	libraries/javalib/java/security/Identity.java:1.3->1.4 
	libraries/javalib/javax/naming/Name.java:1.5->1.6 
	libraries/javalib/javax/swing/JList.java:1.15->1.16 
	libraries/javalib/javax/swing/JOptionPane.java:1.7->1.8 
	libraries/javalib/javax/swing/JRootPane.java:1.14->1.15 
	libraries/javalib/javax/swing/JTextArea.java:1.15->1.16 
	libraries/javalib/javax/swing/SwingUtilities.java:1.20->1.21 
	libraries/javalib/javax/swing/plaf/basic/BasicButtonUI.java:1.12->1.13 
	libraries/javalib/javax/swing/plaf/basic/BasicComboBoxRenderer.java:1.4->1.5 
	libraries/javalib/javax/swing/plaf/basic/BasicComboBoxUI.java:1.10->1.11 
	libraries/javalib/javax/swing/plaf/basic/BasicFileChooserUI.java:1.8->1.9 
	libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java:1.12->1.13 
	libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameUI.java:1.12->1.13 
	libraries/javalib/javax/swing/plaf/basic/BasicOptionPaneUI.java:1.14->1.15 
	libraries/javalib/javax/swing/plaf/metal/MetalBorders.java:1.8->1.9 
	libraries/javalib/javax/swing/plaf/metal/MetalCheckBoxIcon.java:1.1->1.2 
	libraries/javalib/javax/swing/plaf/metal/MetalIconFactory.java:1.8->1.9 
	libraries/javalib/javax/swing/plaf/metal/MetalLookAndFeel.java:1.22->1.23 
	libraries/javalib/javax/swing/plaf/metal/MetalToggleButtonUI.java:1.3->1.4 
	libraries/javalib/javax/swing/text/html/parser/DTD.java:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4431 kaffe/ChangeLog:1.4432
--- kaffe/ChangeLog:1.4431	Fri Sep 16 20:54:38 2005
+++ kaffe/ChangeLog	Fri Sep 16 22:25:15 2005
@@ -1,5 +1,183 @@
 2005-09-16  Dalibor Topic  <robilad at kaffe.org>
 
+	Resynced with GNU Classpath.
+
+	2005-09-16  David Gilbert  <david.gilbert at object-refinery.com>
+
+        * javax/swing/plaf/metal/MetalIconFactory.java
+        (RadioButtonIcon.paintIcon): change color of selection indicator
+        according to component state.
+
+	2005-09-16  David Gilbert  <david.gilbert at object-refinery.com>
+
+        * javax/swing/plaf/metal/MetalCheckBoxIcon.java
+        (drawCheck): change color according to component state.
+
+	2005-09-16  David Gilbert  <david.gilbert at object-refinery.com>
+
+        * javax/swing/plaf/metal/MetalBorders.java
+        (ButtonBorder.paintBorder): draw a different border for a disabled
+        button.
+
+	2005-09-15  Anthony Green  <green at redhat.com>
+
+        * java/awt/Color.java (RGBtoHSB): Don't use integer division when
+        calculating saturation.
+        * java/awt/Rectangle.java (equals): Explain why hashCode() isn't
+        required.
+        * java/awt/Point.java (equals): Ditto.
+
+	2005-09-15  Tom Tromey  <tromey at redhat.com>
+
+        * javax/swing/text/html/parser/DTD.java (FILE_VERSION): Now
+        final.
+
+	2005-09-15  Tom Tromey  <tromey at redhat.com>
+
+        * javax/naming/Name.java: Extends Comparable.
+
+	2005-09-15  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * java/awt/Component.java:
+        (isDisplayable): Don't check the parent's displayability, only return
+        true if peer is non-null and false if peer is null.
+
+	2005-09-15  David Gilbert  <david.gilbert at object-refinery.com>
+
+        * javax/swing/SwingUtilities.java
+        (layoutCompoundLabel): check for empty text string,
+        * javax/swing/plaf/basic/BasicButtonUI.java
+        (paint): check isBorderPainted() when calculating view rect,
+        * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+        (CloseAction): new constructor,
+        (IconifyAction): new constructor,
+        (MaximizeAction): new constructor,
+        (MoveAction): new constructor,
+        (RestoreAction): new constructor,
+        (SizeAction): new constructor,
+        (TitlePaneLayout.layoutContainer): calculate button widths from icon
+        widths,
+        (installDefaults): initialise icon fields,
+        (uninstallDefaults): clear icon fields,
+        (createButtons): set button text to null,
+        (setButtonIcons): use icon fields.
+
+	2005-09-15  Lillian Angel  <langel at redhat.com>
+
+        * javax/swing/plaf/basic/BasicComboBoxRenderer.java
+        (getListCellRendererComponent): Added code in to check if string
+        is larger than comboBox. If it is, the string is truncated and
+        '...' is drawn at the end of it.
+        * javax/swing/plaf/basic/BasicComboBoxUI.java
+        (getDefaultSize): Initially too small, still not fully implemented.
+        (getLargestItemSize): Made private, not in API.
+        (minimumLayoutSize): Implemented properly.
+        (intervalAdded): ComboBox should not be resized with every new
+        component. This is fixed.
+
+	2005-09-15  Tom Tromey  <tromey at redhat.com>
+
+        * java/lang/EnumConstantNotPresentException.java: New file.
+
+	2005-09-15  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * javax/swing/plaf/basic/BasicInternalFrameUI.java:
+        Reformatted file.
+
+	2005-09-15  Lillian Angel  <langel at redhat.com>
+
+        Fixes Bug #23678
+        * javax/swing/plaf/basic/BasicFileChooserUI.java
+        (CBLabelRenderer): Removed. Not in API, and it is really
+        redundant to have.
+        (installComponents): Changed the renderer set for the combo box.
+        Also, added the buttonPanel to the parentsPanel, so they are
+        always painted correctly. Set the FlowLayout to LEFT
+        instead of default being CENTER.
+
+	2005-09-15  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * javax/swing/JRootPane.java:
+        (setContentPane): Remove the old content pane first.  Throw
+        IllegalComponentStateException if the parameter is null.  Added docs.
+
+	2005-09-15  Tom Tromey  <tromey at redhat.com>
+
+        Workaround for PR classpath/23863:
+        * native/fdlibm/mprec.h (MAX_BIGNUM_WDS): Define as 128 on
+        non-Pack_32 platforms.
+
+	2005-09-15  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * java/awt/Component.java:
+        (isDisplayable): Return true if peer != null.
+        * java/awt/Window.java:
+        (isDisplayable): Removed this method. Now inherits from Component.
+
+	2005-09-15  Anthony Green  <green at redhat.com>
+
+        * java/io/PushbackInputStream.java (available, read, skip): Handle
+        closed stream operations gracefully.
+
+	2005-09-15  Anthony Green  <green at redhat.com>
+
+        * java/nio/charset/Charset.java: close() each stream we open.
+        * java/net/URLStreamHandler.java: Remove redundant null pointer
+        check.
+        * java/security/Identity.java (equals, identityEquals): Don't use
+        `==' to compare uninterned Strings.  Use String.equals().
+        * java/lang/Class.java (pd): Mark this field as transient for
+       FindBugs won't complain (although not strictly necessary).
+
+	2005-09-15  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * javax/swing/JTextArea.java:
+        (append): Changed invalidate call to revalidate call.
+        (setRows): Likewise.
+        (setColumns): Likewise.
+
+	2005-09-15  Lillian Angel  <langel at redhat.com>
+
+        Fixes #23873
+        * javax/swing/plaf/basic/BasicOptionPaneUI.java
+        (createMessageArea): Changed orientation of message from EAST to
+        CENTER. Also, fixed empty border values to make message more centered.
+        * javax/swing/JOptionPane.java
+        (showConfirmDialog): Added check for pane.getValue, since clicking on
+        'x' of window does not have an initialized value. Was causing a
+        ClassCastException.
+        (showConfirmDialog): Likewise.
+        (showConfirmDialog): Likewise.
+        (showConfirmDialog): Likewise.
+
+	2005-09-15  David Gilbert  <david.gilbert at object-refinery.com>
+
+        * javax/swing/plaf/basic/BasicButtonUI.java
+        (installDefaults): set font,
+        (uninstallDefaults): clear font,
+        * javax/swing/plaf/metal/MetalLookAndFeel.java
+        (initComponentDefaults): update ToggleButton defaults,
+        * javax/swing/plaf/metal/MetalToggleButtonUI.java
+        (instance): removed field,
+        (createUI): just return new instance every time,
+        (MetalToggleButtonUI): look up defaults directly,
+        (getFocusColor): return value from field initialised in constructor,
+        (getSelectColor): likewise,
+        (getDisabledTextColor): likewise,
+        (installDefaults): override to make public,
+        (paintButtonPressed): implemented,
+        (paintText): implemented,
+        (paintFocus): implemented.
+
+	2005-09-15  David Gilbert  <david.gilbert at object-refinery.com>
+
+        * javax/swing/plaf/metal/MetalBorders.java
+        (toggleButtonBorder): new private field,
+        (ToggleButtonBorder): new class,
+        (getToggleButtonBorder): new method.
+
+2005-09-16  Dalibor Topic  <robilad at kaffe.org>
+
 	FAQ/FAQ.classlibrary-compile: Added information on using
 	for ecj to compile the class library.
 
Index: kaffe/libraries/clib/fdlibm/mprec.h
diff -u kaffe/libraries/clib/fdlibm/mprec.h:1.4 kaffe/libraries/clib/fdlibm/mprec.h:1.5
--- kaffe/libraries/clib/fdlibm/mprec.h:1.4	Fri Jul 15 13:43:05 2005
+++ kaffe/libraries/clib/fdlibm/mprec.h	Fri Sep 16 22:25:16 2005
@@ -269,7 +269,12 @@
 
 
 #define MAX_BIGNUMS 16
+#ifdef Pack_32
 #define MAX_BIGNUM_WDS 32
+#else
+  /* Note that this is a workaround for */
+#define MAX_BIGNUM_WDS 128
+#endif
 
 struct _Jv_Bigint
 {
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.393 kaffe/libraries/javalib/Makefile.am:1.394
--- kaffe/libraries/javalib/Makefile.am:1.393	Fri Sep 16 19:17:49 2005
+++ kaffe/libraries/javalib/Makefile.am	Fri Sep 16 22:25:16 2005
@@ -2643,6 +2643,7 @@
 	java/lang/Comparable.java \
 	java/lang/Compiler.java \
 	java/lang/Double.java \
+	java/lang/EnumConstantNotPresentException.java \
 	java/lang/Error.java \
 	java/lang/Exception.java \
 	java/lang/ExceptionInInitializerError.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.484 kaffe/libraries/javalib/Makefile.in:1.485
--- kaffe/libraries/javalib/Makefile.in:1.484	Fri Sep 16 19:17:51 2005
+++ kaffe/libraries/javalib/Makefile.in	Fri Sep 16 22:25:19 2005
@@ -3165,6 +3165,7 @@
 	java/lang/Comparable.java \
 	java/lang/Compiler.java \
 	java/lang/Double.java \
+	java/lang/EnumConstantNotPresentException.java \
 	java/lang/Error.java \
 	java/lang/Exception.java \
 	java/lang/ExceptionInInitializerError.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.163 kaffe/libraries/javalib/all.files:1.164
--- kaffe/libraries/javalib/all.files:1.163	Fri Sep 16 19:17:55 2005
+++ kaffe/libraries/javalib/all.files	Fri Sep 16 22:25:20 2005
@@ -2092,6 +2092,7 @@
 java/lang/Comparable.java
 java/lang/Compiler.java
 java/lang/Double.java
+java/lang/EnumConstantNotPresentException.java
 java/lang/Error.java
 java/lang/ExceptionInInitializerError.java
 java/lang/Exception.java
Index: kaffe/libraries/javalib/java/awt/Color.java
diff -u kaffe/libraries/javalib/java/awt/Color.java:1.20 kaffe/libraries/javalib/java/awt/Color.java:1.21
--- kaffe/libraries/javalib/java/awt/Color.java:1.20	Mon Jul  4 00:06:01 2005
+++ kaffe/libraries/javalib/java/awt/Color.java	Fri Sep 16 22:25:20 2005
@@ -762,7 +762,7 @@
     if (max == 0)
       array[1] = 0;
     else
-      array[1] = (max - min) / max;
+      array[1] = ((float) (max - min)) / ((float) max);
     // Calculate hue.
     if (array[1] == 0)
       array[0] = 0;
Index: kaffe/libraries/javalib/java/awt/Component.java
diff -u kaffe/libraries/javalib/java/awt/Component.java:1.59 kaffe/libraries/javalib/java/awt/Component.java:1.60
--- kaffe/libraries/javalib/java/awt/Component.java:1.59	Wed Aug 17 22:38:30 2005
+++ kaffe/libraries/javalib/java/awt/Component.java	Fri Sep 16 22:25:20 2005
@@ -720,8 +720,9 @@
 
   /**
    * Tests if the component is displayable. It must be connected to a native
-   * screen resource, and all its ancestors must be displayable. A containment
-   * hierarchy is made displayable when a window is packed or made visible.
+   * screen resource.  This reduces to checking that peer is not null.  A 
+   * containment  hierarchy is made displayable when a window is packed or 
+   * made visible.
    *
    * @return true if the component is displayable
    * @see Container#add(Component)
@@ -733,9 +734,7 @@
    */
   public boolean isDisplayable()
   {
-    if (parent != null)
-      return parent.isDisplayable();
-    return false;
+    return peer != null;
   }
 
   /**
Index: kaffe/libraries/javalib/java/awt/Point.java
diff -u kaffe/libraries/javalib/java/awt/Point.java:1.10 kaffe/libraries/javalib/java/awt/Point.java:1.11
--- kaffe/libraries/javalib/java/awt/Point.java:1.10	Mon Jul  4 00:06:06 2005
+++ kaffe/libraries/javalib/java/awt/Point.java	Fri Sep 16 22:25:21 2005
@@ -226,6 +226,10 @@
   */
   public boolean equals(Object obj)
   {
+    // NOTE: No special hashCode() method is required for this class,
+    // as this equals() implementation is functionally equivalent to
+    // super.equals(), which does define a proper hashCode().
+
     if (! (obj instanceof Point2D))
       return false;
     Point2D p = (Point2D) obj;
Index: kaffe/libraries/javalib/java/awt/Rectangle.java
diff -u kaffe/libraries/javalib/java/awt/Rectangle.java:1.13 kaffe/libraries/javalib/java/awt/Rectangle.java:1.14
--- kaffe/libraries/javalib/java/awt/Rectangle.java:1.13	Mon Jul  4 00:06:06 2005
+++ kaffe/libraries/javalib/java/awt/Rectangle.java	Fri Sep 16 22:25:21 2005
@@ -727,6 +727,10 @@
    */
   public boolean equals(Object obj)
   {
+    // NOTE: No special hashCode() method is required for this class,
+    // as this equals() implementation is functionally equivalent to
+    // super.equals(), which does define a proper hashCode().
+
     if (! (obj instanceof Rectangle2D))
       return false;
     Rectangle2D r = (Rectangle2D) obj;
Index: kaffe/libraries/javalib/java/awt/Window.java
diff -u kaffe/libraries/javalib/java/awt/Window.java:1.39 kaffe/libraries/javalib/java/awt/Window.java:1.40
--- kaffe/libraries/javalib/java/awt/Window.java:1.39	Sun Sep 11 21:16:58 2005
+++ kaffe/libraries/javalib/java/awt/Window.java	Fri Sep 16 22:25:21 2005
@@ -346,11 +346,6 @@
     super.hide();
   }
 
-  public boolean isDisplayable()
-  {
-    return peer != null;
-  }
-
   /**
    * Destroys any resources associated with this window.  This includes
    * all components in the window and all owned top-level windows.
Index: kaffe/libraries/javalib/java/io/PushbackInputStream.java
diff -u kaffe/libraries/javalib/java/io/PushbackInputStream.java:1.10 kaffe/libraries/javalib/java/io/PushbackInputStream.java:1.11
--- kaffe/libraries/javalib/java/io/PushbackInputStream.java:1.10	Mon Jul  4 00:06:40 2005
+++ kaffe/libraries/javalib/java/io/PushbackInputStream.java	Fri Sep 16 22:25:23 2005
@@ -116,7 +116,14 @@
    */
   public int available() throws IOException
   {
-    return (buf.length - pos) + super.available();
+    try 
+      {
+	return (buf.length - pos) + super.available();
+      } 
+    catch (NullPointerException npe) 
+      {
+	throw new IOException ("Stream closed");
+      }
   }
 
   /**
Index: kaffe/libraries/javalib/java/lang/Class.java
diff -u kaffe/libraries/javalib/java/lang/Class.java:1.57 kaffe/libraries/javalib/java/lang/Class.java:1.58
--- kaffe/libraries/javalib/java/lang/Class.java:1.57	Thu Sep 15 02:25:46 2005
+++ kaffe/libraries/javalib/java/lang/Class.java	Fri Sep 16 22:25:23 2005
@@ -101,7 +101,7 @@
   /** The class signers. */
   private Object[] signers = null;
   /** The class protection domain. */
-  private final ProtectionDomain pd;
+  private final transient ProtectionDomain pd;
 
   /* We use an inner class, so that Class doesn't have a static initializer */
   private static final class StaticData
===================================================================
Checking out kaffe/libraries/javalib/java/lang/EnumConstantNotPresentException.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/java/lang/EnumConstantNotPresentException.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/java/lang/EnumConstantNotPresentException.java	Fri Sep 16 22:31:33 2005
@@ -0,0 +1,93 @@
+/* EnumConstantNotPresentException.java -- thrown when enum constant
+   not available
+   Copyright (C) 2005  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang;
+
+/**
+ * An exception of this type is thrown when a symbolic reference is
+ * made to an enum constant which does not exist.
+ *
+ * @author Tom Tromey (tromey at redhat.com)
+ * @since 1.5
+ */
+public class EnumConstantNotPresentException extends RuntimeException
+{
+  /**
+   * The enum's type.  Note that the name is fixed by the
+   * serialization spec.
+   */
+  private Class enumType;
+
+  /**
+   * The name of the missing enum constant.  Note that the name is
+   * fixed by the serialization spec.
+   */
+  private String constantName;
+
+  /**
+   * Create a new EnumConstantNotPresentException with the indicated
+   * enum type and enum constant name.
+   * @param theEnum the enum's class
+   * @param name the name of the missing enum constant
+   */
+  public EnumConstantNotPresentException(Class theEnum, String name)
+  {
+    super("enum " + theEnum + " is missing the constant " + name);
+    enumType = theEnum;
+    constantName = name;
+  }
+
+  /**
+   * Return the name of the missing constant.
+   * @return the name of the missing constant
+   */
+  public String constantName()
+  {
+    return constantName;
+  }
+
+  /**
+   * Return the enum type which is missing a constant.
+   * @return the enum type which is missing a constant
+   */
+  public Class enumType()
+  {
+    return enumType;
+  }
+}
Index: kaffe/libraries/javalib/java/net/URLStreamHandler.java
diff -u kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.22 kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.23
--- kaffe/libraries/javalib/java/net/URLStreamHandler.java:1.22	Mon Jul  4 00:06:58 2005
+++ kaffe/libraries/javalib/java/net/URLStreamHandler.java	Fri Sep 16 22:25:24 2005
@@ -511,7 +511,7 @@
     int size = protocol.length() + authority.length() + file.length() + 24;
     StringBuffer sb = new StringBuffer(size);
 
-    if (protocol != null && protocol.length() > 0)
+    if (protocol.length() > 0)
       {
 	sb.append(protocol);
 	sb.append(":");
Index: kaffe/libraries/javalib/java/nio/charset/Charset.java
diff -u kaffe/libraries/javalib/java/nio/charset/Charset.java:1.18 kaffe/libraries/javalib/java/nio/charset/Charset.java:1.19
--- kaffe/libraries/javalib/java/nio/charset/Charset.java:1.18	Sun Sep 11 21:17:01 2005
+++ kaffe/libraries/javalib/java/nio/charset/Charset.java	Fri Sep 16 22:25:24 2005
@@ -302,6 +302,7 @@
 			 Thread.currentThread().getContextClassLoader())).newInstance());
                     set.add(p);
                   }
+		rdr.close();
                }
 
             providers = new CharsetProvider[set.size()];
Index: kaffe/libraries/javalib/java/security/Identity.java
diff -u kaffe/libraries/javalib/java/security/Identity.java:1.3 kaffe/libraries/javalib/java/security/Identity.java:1.4
--- kaffe/libraries/javalib/java/security/Identity.java:1.3	Mon Jul  4 00:07:14 2005
+++ kaffe/libraries/javalib/java/security/Identity.java	Fri Sep 16 22:25:24 2005
@@ -297,8 +297,8 @@
 	if (identity == this)
 	  return true;
 
-	if ((((Identity) identity).getName() == this.name) &&
-	    (((Identity) identity).getScope() == this.scope))
+	if ((((Identity) identity).getName().equals(this.name)) &&
+	    (((Identity) identity).getScope().equals(this.scope)))
 	  return true;
 
 	return identityEquals((Identity) identity);
@@ -319,8 +319,8 @@
    */
   protected boolean identityEquals(Identity identity)
   {
-    return ((identity.getName() == this.name) &&
-	    (identity.getPublicKey() == this.publicKey));
+    return ((identity.getName().equals(this.name)) &&
+	    (identity.getPublicKey().equals(this.publicKey)));
   }
 
   /**
Index: kaffe/libraries/javalib/javax/naming/Name.java
diff -u kaffe/libraries/javalib/javax/naming/Name.java:1.5 kaffe/libraries/javalib/javax/naming/Name.java:1.6
--- kaffe/libraries/javalib/javax/naming/Name.java:1.5	Mon Jul  4 00:07:41 2005
+++ kaffe/libraries/javalib/javax/naming/Name.java	Fri Sep 16 22:25:25 2005
@@ -1,5 +1,5 @@
 /* Name.java -- Name build up from different components
-   Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -60,7 +60,7 @@
  * @author Anthony Green (green at redhat.com)
  * @author Mark Wielaard (mark at klomp.org)
  */
-public interface Name extends Cloneable, Serializable
+public interface Name extends Cloneable, Serializable, Comparable
 {
   long serialVersionUID = -3617482732056931635L;
 
Index: kaffe/libraries/javalib/javax/swing/JList.java
diff -u kaffe/libraries/javalib/javax/swing/JList.java:1.15 kaffe/libraries/javalib/javax/swing/JList.java:1.16
--- kaffe/libraries/javalib/javax/swing/JList.java:1.15	Sun Sep 11 21:17:04 2005
+++ kaffe/libraries/javalib/javax/swing/JList.java	Fri Sep 16 22:25:25 2005
@@ -41,13 +41,25 @@
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.ComponentOrientation;
+import java.awt.Cursor;
 import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
 import java.awt.Point;
 import java.awt.Rectangle;
+import java.awt.event.FocusListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Locale;
 import java.util.Vector;
 
 import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleComponent;
 import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleSelection;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
 import javax.swing.event.ListDataEvent;
 import javax.swing.event.ListDataListener;
 import javax.swing.event.ListSelectionEvent;
@@ -108,6 +120,728 @@
 
 public class JList extends JComponent implements Accessible, Scrollable
 {
+
+  /**
+   * Provides accessibility support for <code>JList</code>.
+   */
+  protected class AccessibleJList extends AccessibleJComponent
+    implements AccessibleSelection, PropertyChangeListener,
+               ListSelectionListener, ListDataListener
+  {
+
+    /**
+     * Provides accessibility support for list elements in <code>JList</code>s.
+     */
+    protected class AccessibleJListChild extends AccessibleContext
+      implements Accessible, AccessibleComponent
+    {
+
+      /**
+       * The parent list.
+       */
+      JList parent;
+
+      /**
+       * The index in the list for that child.
+       */
+      int listIndex;
+
+      /**
+       * The cursor for this list child.
+       */
+      // TODO: Testcases show that this class somehow stores state about the
+      // cursor. I cannot make up though how that could affect
+      // the actual list.
+      Cursor cursor = Cursor.getDefaultCursor();
+
+      /**
+       * Creates a new instance of <code>AccessibleJListChild</code>.
+       *
+       * @param list the list of which this is an accessible child
+       * @param index the list index for this child
+       */
+      public AccessibleJListChild(JList list, int index)
+      {
+        parent = list;
+        listIndex = index;
+      }
+
+      /**
+       * Returns the accessible context of this object. Returns
+       * <code>this</code> since <code>AccessibleJListChild</code>s are their
+       * own accessible contexts.
+       *
+       * @return the accessible context of this object, <code>this</code>
+       */
+      public AccessibleContext getAccessibleContext()
+      {
+        return this;
+      }
+
+      /**
+       * Returns the background color for this list child. This returns the
+       * background of the <code>JList</code> itself since the background
+       * cannot be set on list children individually
+       *
+       * @return the background color for this list child
+       */
+      public Color getBackground()
+      {
+        return parent.getBackground();
+      }
+
+      /**
+       * Calling this method has no effect, since the background color cannot be
+       * set on list children individually.
+       *
+       * @param color not used here.
+       */
+      public void setBackground(Color color)
+      {
+        // Calling this method has no effect, since the background color cannot
+        // be set on list children individually.
+      }
+
+      /**
+       * Returns the foreground color for this list child. This returns the
+       * background of the <code>JList</code> itself since the foreground
+       * cannot be set on list children individually.
+       *
+       * @return the background color for this list child
+       */
+      public Color getForeground()
+      {
+        return parent.getForeground();
+      }
+
+      /**
+       * Calling this method has no effect, since the foreground color cannot be
+       * set on list children individually.
+       *
+       * @param color not used here.
+       */
+      public void setForeground(Color color)
+      {
+        // Calling this method has no effect, since the foreground color cannot
+        // be set on list children individually.
+      }
+
+      /**
+       * Returns the cursor for this list child.
+       *
+       * @return the cursor for this list child
+       */
+      public Cursor getCursor()
+      {
+        // TODO: Testcases show that this method returns the cursor that has
+        // been set by setCursor. I cannot make up though how that could affect
+        // the actual list.
+        return cursor;
+      }
+
+      /**
+       * Sets the cursor for this list child.
+       */
+      public void setCursor(Cursor cursor)
+      {
+        this.cursor = cursor;
+        // TODO: Testcases show that this method returns the cursor that has
+        // been set by setCursor. I cannot make up though how that could affect
+        // the actual list.
+      }
+
+      /**
+       * Returns the font of the <code>JList</code> since it is not possible to
+       * set fonts for list children individually.
+       *
+       * @return the font of the <code>JList</code>
+       */
+      public Font getFont()
+      {
+        return parent.getFont();
+      }
+
+      /**
+       * Does nothing since it is not possible to set the font on list children
+       * individually.
+       *
+       * @param font not used here
+       */
+      public void setFont(Font font)
+      {
+        // Does nothing since it is not possible to set the font on list
+        // children individually.
+      }
+
+      /**
+       * Returns the font metrics for the specified font. This method forwards
+       * to the parent <code>JList</code>. 
+       *
+       * @param font the font for which the font metrics is queried
+       *
+       * @return the font metrics for the specified font
+       */
+      public FontMetrics getFontMetrics(Font font)
+      {
+        return parent.getFontMetrics(font);
+      }
+
+      /**
+       * Returns <code>true</code> if the parent <code>JList</code> is enabled,
+       * <code>false</code> otherwise. The list children cannot have an enabled
+       * flag set individually.
+       *
+       * @return <code>true</code> if the parent <code>JList</code> is enabled,
+       *         <code>false</code> otherwise
+       */
+      public boolean isEnabled()
+      {
+        return parent.isEnabled();
+      }
+
+      /**
+       * Does nothing since the enabled flag cannot be set for list children
+       * individually.
+       *
+       * @param b not used here
+       */
+      public void setEnabled(boolean b)
+      {
+        // Does nothing since the enabled flag cannot be set for list children
+        // individually.
+      }
+
+      /**
+       * Returns <code>true</code> if this list child is visible,
+       * <code>false</code> otherwise. The value of this property depends
+       * on {@link JList#getFirstVisibleIndex()} and
+       * {@link JList#getLastVisibleIndex()}.
+       *
+       * @return <code>true</code> if this list child is visible,
+       *         <code>false</code> otherwise
+       */
+      public boolean isVisible()
+      {
+        return listIndex >= parent.getFirstVisibleIndex()
+               && listIndex <= parent.getLastVisibleIndex();
+      }
+
+      /**
+       * The value of the visible property cannot be modified, so this method
+       * does nothing.
+       *
+       * @param b not used here
+       */
+      public void setVisible(boolean b)
+      {
+        // The value of the visible property cannot be modified, so this method
+        // does nothing.
+      }
+
+      /**
+       * Returns <code>true</code> if this list child is currently showing on
+       * screen and <code>false</code> otherwise. The list child is showing if
+       * it is visible and if it's parent JList is currently showing.
+       *
+       * @return <code>true</code> if this list child is currently showing on
+       *         screen and <code>false</code> otherwise
+       */
+      public boolean isShowing()
+      {
+        return isVisible() && parent.isShowing();
+      }
+
+      /**
+       * Returns <code>true</code> if this list child covers the screen location
+       * <code>point</code> (relative to the <code>JList</code> coordinate
+       * system, <code>false</code> otherwise.
+       *
+       * @return <code>true</code> if this list child covers the screen location
+       *         <code>point</code> , <code>false</code> otherwise
+       */
+      public boolean contains(Point point)
+      {
+        return getBounds().contains(point);
+      }
+
+      /**
+       * Returns the absolute screen location of this list child.
+       *
+       * @return the absolute screen location of this list child
+       */
+      public Point getLocationOnScreen()
+      {
+        Point loc = getLocation();
+        SwingUtilities.convertPointToScreen(loc, parent);
+        return loc;
+      }
+
+      /**
+       * Returns the screen location of this list child relative to it's parent.
+       *
+       * @return the location of this list child relative to it's parent
+       *
+       * @see JList#indexToLocation(int)
+       */
+      public Point getLocation()
+      {
+        return parent.indexToLocation(listIndex);
+      }
+
+      /**
+       * Does nothing since the screen location cannot be set on list children
+       * explictitly.
+       *
+       * @param point not used here
+       */
+      public void setLocation(Point point)
+      {
+        // Does nothing since the screen location cannot be set on list children
+        // explictitly.
+      }
+
+      /**
+       * Returns the bounds of this list child.
+       *
+       * @return the bounds of this list child
+       *
+       * @see JList#getCellBounds(int, int)
+       */
+      public Rectangle getBounds()
+      {
+        return parent.getCellBounds(listIndex, listIndex);
+      }
+
+      /**
+       * Does nothing since the bounds cannot be set on list children
+       * individually.
+       *
+       * @param rectangle not used here
+       */
+      public void setBounds(Rectangle rectangle)
+      {
+        // Does nothing since the bounds cannot be set on list children
+        // individually.
+      }
+
+      /**
+       * Returns the size of this list child.
+       *
+       * @return the size of this list child
+       */
+      public Dimension getSize()
+      {
+        Rectangle b = getBounds();
+        return b.getSize();
+      }
+
+      /**
+       * Does nothing since the size cannot be set on list children
+       * individually.
+       *
+       * @param dimension not used here
+       */
+      public void setSize(Dimension dimension)
+      {
+        // Does nothing since the size cannot be set on list children
+        // individually.
+      }
+
+      /**
+       * Returns <code>null</code> because list children do not have children
+       * themselves
+       *
+       * @return <code>null</code>
+       */
+      public Accessible getAccessibleAt(Point point)
+      {
+        return null;
+      }
+
+      /**
+       * Returns <code>true</code> since list children are focus traversable.
+       *
+       * @return true
+       */
+      public boolean isFocusTraversable()
+      {
+        // TODO: Is this 100% ok?
+        return true;
+      }
+
+      /**
+       * Requests focus on the parent list. List children cannot request focus
+       * individually.
+       */
+      public void requestFocus()
+      {
+        // TODO: Is this 100% ok?
+        parent.requestFocus();
+      }
+
+      /**
+       * Adds a focus listener to the parent list. List children do not have
+       * their own focus management.
+       *
+       * @param listener the focus listener to add
+       */
+      public void addFocusListener(FocusListener listener)
+      {
+        // TODO: Is this 100% ok?
+        parent.addFocusListener(listener);
+      }
+
+      /**
+       * Removes a focus listener from the parent list. List children do not
+       * have their own focus management.
+       *
+       * @param listener the focus listener to remove
+       */
+      public void removeFocusListener(FocusListener listener)
+      {
+        // TODO: Is this 100%
+        parent.removeFocusListener(listener);
+      }
+
+      /**
+       * Returns the accessible role of this list item, which is
+       * {@link AccessibleRole#LABEL}.
+       *
+       * @return {@link AccessibleRole#LABEL}
+       */

*** Patch too long, truncated ***




More information about the kaffe mailing list