[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath and GNU inetlib, fixed build

Kaffe CVS cvs-commits at kaffe.org
Mon Apr 18 14:24:13 PDT 2005


PatchSet 5702 
Date: 2005/04/18 21:19:28
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath and GNU inetlib, fixed build

2005-04-18  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU Classpath.

        2005-04-07  Roman Kennke  <roman at kennke.org>

        * javax/swing/UIDefaults.java:
        Added API documentation for all methods.

        2005-04-06  Roman Kennke  <roman at kennke.org>

        * javax/swing/UIDefaults.java
        (put): Now uses new checkAndPut method instead of checking
        directly.
        (putDefaults): Fixed so that it accepts null-values and
        treats them like remove(key).
        (checkAndPut): Added. This checks for null-values and calls
        put or remove.

2005-04-18  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU inetlib.

        2005-04-06  Chris Burdess  <dog at gnu.org>

        * CRLFInputStream.java: New algorithm, returning CRLF-delimited
        chunks on each read.

        2005-02-17  Chris Burdess  <dog at gnu.org>

        * BASE64.java: Truncate encoded byte array.

Members: 
	ChangeLog:1.3869->1.3870 
	libraries/javalib/Makefile.am:1.337->1.338 
	libraries/javalib/Makefile.in:1.425->1.426 
	libraries/javalib/all.files:1.112->1.113 
	libraries/javalib/gnu/inet/util/BASE64.java:1.7->1.8 
	libraries/javalib/gnu/inet/util/CRLFInputStream.java:1.8->1.9 
	libraries/javalib/javax/swing/UIDefaults.java:1.8->1.9 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3869 kaffe/ChangeLog:1.3870
--- kaffe/ChangeLog:1.3869	Mon Apr 18 19:44:36 2005
+++ kaffe/ChangeLog	Mon Apr 18 21:19:28 2005
@@ -2,6 +2,38 @@
 
         Resynced with GNU Classpath.
 
+	2005-04-07  Roman Kennke  <roman at kennke.org>
+
+        * javax/swing/UIDefaults.java:
+        Added API documentation for all methods.
+
+	2005-04-06  Roman Kennke  <roman at kennke.org>
+
+        * javax/swing/UIDefaults.java
+        (put): Now uses new checkAndPut method instead of checking
+        directly.
+        (putDefaults): Fixed so that it accepts null-values and
+        treats them like remove(key).
+        (checkAndPut): Added. This checks for null-values and calls
+        put or remove.
+
+2005-04-18  Dalibor Topic  <robilad at kaffe.org>
+
+        Resynced with GNU inetlib.
+
+	2005-04-06  Chris Burdess  <dog at gnu.org>
+
+        * CRLFInputStream.java: New algorithm, returning CRLF-delimited
+        chunks on each read.
+
+	2005-02-17  Chris Burdess  <dog at gnu.org>
+
+        * BASE64.java: Truncate encoded byte array.
+
+2005-04-18  Dalibor Topic  <robilad at kaffe.org>
+
+        Resynced with GNU Classpath.
+
 	2005-04-07  Chris Burdess  <dog at gnu.org>
 
         * gnu/java/net/CRLFInputStream.java: Rewrite to return
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.337 kaffe/libraries/javalib/Makefile.am:1.338
--- kaffe/libraries/javalib/Makefile.am:1.337	Mon Apr 18 19:44:44 2005
+++ kaffe/libraries/javalib/Makefile.am	Mon Apr 18 21:19:31 2005
@@ -976,6 +976,7 @@
 	gnu/inet/smtp/SMTPConnection.java
 gnu_inet_util_SRCS = \
 	gnu/inet/util/BASE64.java \
+	gnu/inet/util/CRLFInputStream.java \
 	gnu/inet/util/CRLFOutputStream.java \
 	gnu/inet/util/EmptyX509TrustManager.java \
 	gnu/inet/util/GetLocalHostAction.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.425 kaffe/libraries/javalib/Makefile.in:1.426
--- kaffe/libraries/javalib/Makefile.in:1.425	Mon Apr 18 19:44:45 2005
+++ kaffe/libraries/javalib/Makefile.in	Mon Apr 18 21:19:32 2005
@@ -1395,6 +1395,7 @@
 
 gnu_inet_util_SRCS = \
 	gnu/inet/util/BASE64.java \
+	gnu/inet/util/CRLFInputStream.java \
 	gnu/inet/util/CRLFOutputStream.java \
 	gnu/inet/util/EmptyX509TrustManager.java \
 	gnu/inet/util/GetLocalHostAction.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.112 kaffe/libraries/javalib/all.files:1.113
--- kaffe/libraries/javalib/all.files:1.112	Mon Apr 18 19:44:47 2005
+++ kaffe/libraries/javalib/all.files	Mon Apr 18 21:19:34 2005
@@ -568,6 +568,7 @@
 gnu/inet/smtp/ParameterList.java
 gnu/inet/smtp/SMTPConnection.java
 gnu/inet/util/BASE64.java
+gnu/inet/util/CRLFInputStream.java
 gnu/inet/util/CRLFOutputStream.java
 gnu/inet/util/EmptyX509TrustManager.java
 gnu/inet/util/GetLocalHostAction.java
Index: kaffe/libraries/javalib/gnu/inet/util/BASE64.java
diff -u kaffe/libraries/javalib/gnu/inet/util/BASE64.java:1.7 kaffe/libraries/javalib/gnu/inet/util/BASE64.java:1.8
--- kaffe/libraries/javalib/gnu/inet/util/BASE64.java:1.7	Sat Feb 19 16:14:21 2005
+++ kaffe/libraries/javalib/gnu/inet/util/BASE64.java	Mon Apr 18 21:19:35 2005
@@ -1,5 +1,5 @@
 /*
- * $Id: BASE64.java,v 1.7 2005/02/19 16:14:21 robilad Exp $
+ * BASE64.java
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -42,7 +42,6 @@
  * Encodes and decodes text according to the BASE64 encoding.
  *
  * @author <a href="mailto:dog at gnu.org">Chris Burdess</a>
- * @version $Revision: 1.7 $ $Date: 2005/02/19 16:14:21 $
  */
 public final class BASE64
 {
@@ -71,7 +70,7 @@
       }
   }
 
-  private BASE64 ()
+  private BASE64()
   {
   }
 
@@ -80,7 +79,7 @@
    *
    * @param bs the source byte array
    */
-  public static byte[] encode (byte[] bs)
+  public static byte[] encode(byte[] bs)
   {
     int si = 0, ti = 0;         // source/target array indices
     byte[] bt = new byte[((bs.length + 2) * 4) / 3];     // target byte array
@@ -161,16 +160,16 @@
         len = srclen - si;
       }
     byte[] bt = new byte[buflen];
-    System.arraycopy (buffer, 0, bt, 0, buflen);
+    System.arraycopy(buffer, 0, bt, 0, buflen);
     return bt;
   }
   
-  public static void main (String[] args)
+  public static void main(String[] args)
   {
     boolean decode = false;
     for (int i = 0; i < args.length; i++)
       {
-        if (args[i].equals ("-d"))
+        if (args[i].equals("-d"))
           {
             decode = true;
           }
@@ -178,14 +177,14 @@
           {
             try
               {
-                byte[] in = args[i].getBytes ("US-ASCII");
-                byte[] out = decode ? decode (in) : encode (in);
-                System.out.println (args[i] + " = " +
-                                    new String (out, "US-ASCII"));
+                byte[] in = args[i].getBytes("US-ASCII");
+                byte[] out = decode ? decode(in) : encode(in);
+                System.out.println(args[i] + " = " +
+                                   new String(out, "US-ASCII"));
               }
             catch (java.io.UnsupportedEncodingException e)
               {
-                e.printStackTrace (System.err);
+                e.printStackTrace(System.err);
               }
           }
       }
===================================================================
Checking out kaffe/libraries/javalib/gnu/inet/util/CRLFInputStream.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/inet/util/CRLFInputStream.java,v
VERS: 1.9
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/inet/util/CRLFInputStream.java	Mon Apr 18 21:24:13 2005
@@ -0,0 +1,175 @@
+/*
+ * CRLFInputStream.java
+ * Copyright (C) 2002 The Free Software Foundation
+ * 
+ * This file is part of GNU inetlib, a library.
+ * 
+ * GNU inetlib 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 of the License, or
+ * (at your option) any later version.
+ * 
+ * GNU inetlib 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 this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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
+ * obliged to do so.  If you do not wish to do so, delete this
+ * exception statement from your version.
+ */
+
+package gnu.inet.util;
+
+import java.io.BufferedInputStream;
+import java.io.FilterInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * An input stream that filters out CR/LF pairs into LFs.
+ *
+ * @author <a href="mailto:dog at gnu.org">Chris Burdess</a>
+ */
+public class CRLFInputStream
+  extends FilterInputStream
+{
+
+  /**
+   * The CR octet.
+   */
+  public static final int CR = 13;
+
+  /**
+   * The LF octet.
+   */
+  public static final int LF = 10;
+
+  private boolean doReset;
+
+  /**
+   * Constructs a CR/LF input stream connected to the specified input
+   * stream.
+   */
+  public CRLFInputStream(InputStream in)
+  {
+    super(in.markSupported() ? in : new BufferedInputStream(in));
+  }
+
+  /**
+   * Reads the next byte of data from this input stream.
+   * Returns -1 if the end of the stream has been reached.
+   * @exception IOException if an I/O error occurs
+   */
+  public int read()
+    throws IOException
+  {
+    int c = in.read();
+    if (c == CR)
+      {
+        in.mark(1);
+        int d = in.read();
+        if (d == LF)
+          {
+            c = d;
+          }
+        else
+          {
+            in.reset();
+          }
+      }
+    return c;
+  }
+  
+  /**
+   * Reads up to b.length bytes of data from this input stream into
+   * an array of bytes.
+   * Returns -1 if the end of the stream has been reached.
+   * @exception IOException if an I/O error occurs
+   */
+  public int read(byte[] b)
+    throws IOException
+  {
+    return read(b, 0, b.length);
+  }
+
+  /**
+   * Reads up to len bytes of data from this input stream into an
+   * array of bytes, starting at the specified offset.
+   * Returns -1 if the end of the stream has been reached.
+   * @exception IOException if an I/O error occurs
+   */
+  public int read(byte[] b, int off, int len)
+    throws IOException
+  {
+    in.mark(len + 1);
+    int l = in.read(b, off, len);
+    if (l > 0)
+      {
+        int i = indexOfCRLF(b, off, l);
+        if (doReset)
+          {
+            in.reset();
+            if (i != -1)
+              {
+                l = in.read(b, off, i + 1); // read to CR
+                in.read(); // skip LF
+                b[i] = LF; // fix CR as LF
+              }
+            else
+              {
+                l = in.read(b, off, len); // CR(s) but no LF
+              }
+          }
+      }
+    return l;
+  }
+
+  private int indexOfCRLF(byte[] b, int off, int len)
+    throws IOException
+  {
+    doReset = false;
+    int lm1 = len - 1;
+    for (int i = off; i < len; i++)
+      {
+        if (b[i] == CR)
+          {
+            int d;
+            if (i == lm1)
+              {
+                d = in.read();
+                doReset = true;
+              }
+            else
+              {
+                d = b[i + 1];
+              }
+            if (d == LF)
+              {
+                doReset = true;
+                return i;
+              }
+          }
+      }
+    return -1;
+  }
+
+}
+
Index: kaffe/libraries/javalib/javax/swing/UIDefaults.java
diff -u kaffe/libraries/javalib/javax/swing/UIDefaults.java:1.8 kaffe/libraries/javalib/javax/swing/UIDefaults.java:1.9
--- kaffe/libraries/javalib/javax/swing/UIDefaults.java:1.8	Thu Jan 13 08:59:52 2005
+++ kaffe/libraries/javalib/javax/swing/UIDefaults.java	Mon Apr 18 21:19:35 2005
@@ -64,8 +64,14 @@
  */
 public class UIDefaults extends Hashtable
 {
+
+  /** Our ResourceBundles. */
   private LinkedList bundles;
+
+  /** The default locale. */
   private Locale defaultLocale;
+
+  /** We use this for firing PropertyChangeEvents. */
   private PropertyChangeSupport propertyChangeSupport;
 
   public static interface ActiveValue
@@ -208,8 +214,12 @@
     }
   }
 
+  /** Our serialVersionUID for serialization. */
   private static final long serialVersionUID = 7341222528856548117L;
 
+  /**
+   * Constructs a new empty UIDefaults instance.
+   */
   public UIDefaults()
   {
     bundles = new LinkedList();
@@ -217,6 +227,14 @@
     propertyChangeSupport = new PropertyChangeSupport(this);
   }
 
+  /**
+   * Constructs a new UIDefaults instance and loads the specified entries.
+   * The entries are expected to come in pairs, that means
+   * <code>entries[0]</code> is a key, <code>entries[1]</code> is a value,
+   * <code>entries[2]</code> a key and so forth.
+   *
+   * @param entries the entries to initialize the UIDefaults instance with
+   */
   public UIDefaults(Object[] entries)
   {
     this();
@@ -225,11 +243,24 @@
       put(entries[2 * i], entries[2 * i + 1]);
   }
 
+  /**
+   * Returns the entry for the specified <code>key</code> in the default
+   * locale.
+   *
+   * @return the entry for the specified <code>key</code>
+   */
   public Object get(Object key)
   {
     return this.get(key, getDefaultLocale());
   }
 
+  /**
+   * Returns the entry for the specified <code>key</code> in the Locale
+   * <code>loc</code>.
+   *
+   * @param key the key for which we return the value
+   * @param loc the locale
+   */
   public Object get(Object key, Locale loc)
   {
     Object obj = null;
@@ -284,133 +315,344 @@
     return obj;
   }
 
+  /**
+   * Puts a key and value into this UIDefaults object.<br>
+   * In contrast to
+   * {@link java.util.Hashtable}s <code>null</code>-values are accepted
+   * here and treated like #remove(key).
+   * <br>
+   * This fires a PropertyChangeEvent with key as name and the old and new
+   * values.
+   *
+   * @param key the key to put into the map
+   * @param value the value to put into the map
+   *
+   * @return the old value for key or <code>null</code> if <code>key</code>
+   *     had no value assigned
+   */
   public Object put(Object key, Object value)
   {
-    Object old;
-    if (value != null)
-      old = super.put(key, value);
-    else
-      old = super.remove(key);
+    Object old = checkAndPut(key, value);
+
     if (key instanceof String && old != value)
       firePropertyChange((String) key, old, value);
     return old;
   }
 
+  /**
+   * Puts a set of key-value pairs into the map.
+   * The entries are expected to come in pairs, that means
+   * <code>entries[0]</code> is a key, <code>entries[1]</code> is a value,
+   * <code>entries[2]</code> a key and so forth.
+   * <br>
+   * If a value is <code>null</code> it is treated like #remove(key).
+   * <br>
+   * This unconditionally fires a PropertyChangeEvent with
+   * <code>&apos;UIDefaults&apos;</code> as name and <code>null</code> for
+   * old and new value.
+   *
+   * @param entries the entries to be put into the map
+   */
   public void putDefaults(Object[] entries)
   {
     for (int i = 0; (2 * i + 1) < entries.length; ++i)
   {
-        super.put(entries[2 * i], entries[2 * i + 1]);
+        checkAndPut(entries[2 * i], entries[2 * i + 1]);
       }
     firePropertyChange("UIDefaults", null, null);
   }
 
+  /**
+   * Checks the value for <code>null</code> and put it into the Hashtable, if
+   * it is not <code>null</code>. If the value is <code>null</code> then
+   * remove the corresponding key.
+   *
+   * @param key the key to put into this UIDefauls table
+   * @param value the value to put into this UIDefaults table
+   *
+   * @return the old value for <code>key</code>
+   */
+  private Object checkAndPut(Object key, Object value)
+  {
+    Object old;
+
+    if (value != null)
+      old = super.put(key, value);
+    else
+      old = super.remove(key);
+
+    return old;
+  }
+
+  /**
+   * Returns a font entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the font entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Font getFont(Object key)
   {
     Object o = get(key);
     return o instanceof Font ? (Font) o : null;
   }
 
+  /**
+   * Returns a font entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the font entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Font getFont(Object key, Locale l)
   {
     Object o = get(key, l);
     return o instanceof Font ? (Font) o : null;
   }
 
+  /**
+   * Returns a color entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the color entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Color getColor(Object key)
   {
     Object o = get(key);
     return o instanceof Color ? (Color) o : null;
   }
 
+  /**
+   * Returns a color entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the color entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Color getColor(Object key, Locale l)
   {
     Object o = get(key, l);
     return o instanceof Color ? (Color) o : null;
   }
 
+  /**
+   * Returns an icon entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the icon entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Icon getIcon(Object key)
   {
     Object o = get(key);
     return o instanceof Icon ? (Icon) o : null;
   }
 
+  /**
+   * Returns an icon entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the icon entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Icon getIcon(Object key, Locale l)
   {
     Object o = get(key, l);
     return o instanceof Icon ? (Icon) o : null;
   }
 
+  /**
+   * Returns a border entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the border entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Border getBorder(Object key)
   {
     Object o = get(key);
     return o instanceof Border ? (Border) o : null;
   }
 
+  /**
+   * Returns a border entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the border entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Border getBorder(Object key, Locale l)
   {
     Object o = get(key, l);
     return o instanceof Border ? (Border) o : null;
   }
 
+  /**
+   * Returns a string entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the string entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public String getString(Object key)
   {
     Object o = get(key);
     return o instanceof String ? (String) o : null;
   }
 
+  /**
+   * Returns a string entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the string entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public String getString(Object key, Locale l)
   {
     Object o = get(key, l);
     return o instanceof String ? (String) o : null;
   }
 
+  /**
+   * Returns an integer entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the integer entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public int getInt(Object key)
   {
     Object o = get(key);
     return o instanceof Integer ? ((Integer) o).intValue() : 0;
   }
 
+  /**
+   * Returns an integer entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the integer entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public int getInt(Object key, Locale l)
   {
     Object o = get(key, l);
     return o instanceof Integer ? ((Integer) o).intValue() : 0;
   }
 
+  /**
+   * Returns a boolean entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the boolean entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public boolean getBoolean(Object key)
   {
     return Boolean.TRUE.equals(get(key));
   }
 
+  /**
+   * Returns a boolean entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the boolean entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public boolean getBoolean(Object key, Locale l)
   {
     return Boolean.TRUE.equals(get(key, l));
   }
 
+  /**
+   * Returns an insets entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the insets entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Insets getInsets(Object key) 
   {
     Object o = get(key);
     return o instanceof Insets ? (Insets) o : null;
   }
 
+  /**
+   * Returns an insets entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the boolean entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Insets getInsets(Object key, Locale l) 
   {
     Object o = get(key, l);
     return o instanceof Insets ? (Insets) o : null;
   }
 
+  /**
+   * Returns a dimension entry for the default locale.
+   *
+   * @param key the key to the requested entry
+   *
+   * @return the dimension entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Dimension getDimension(Object key) 
   {
     Object o = get(key);
     return o instanceof Dimension ? (Dimension) o : null;
   }
 
+  /**
+   * Returns a dimension entry for a specic locale.
+   *
+   * @param key the key to the requested entry
+   * @param locale the locale to the requested entry
+   *
+   * @return the boolean entry for <code>key</code> or null if no such entry
+   *     exists
+   */
   public Dimension getDimension(Object key, Locale l) 
   {
     Object o = get(key, l);
     return o instanceof Dimension ? (Dimension) o : null;
   }
 
+  /**
+   * Returns the ComponentUI class that renders a component. <code>id</code>
+   * is the ID for which the String value of the classname is stored in
+   * this UIDefaults map.
+   *
+   * @param id the ID of the UI class
+   * @param loader the ClassLoader to use
+   *
+   * @return the UI class for <code>id</code>
+   */
   public Class getUIClass(String id, ClassLoader loader)
   {
     String className = (String) get (id);
@@ -428,16 +670,38 @@
       }
   }
 
+  /**
+   * Returns the ComponentUI class that renders a component. <code>id</code>
+   * is the ID for which the String value of the classname is stored in
+   * this UIDefaults map.
+   *
+   * @param id the ID of the UI class
+   *
+   * @return the UI class for <code>id</code>
+   */
   public Class getUIClass(String id)
   {
     return getUIClass (id, null);
   }
 
+  /**
+   * If a key is requested in #get(key) that has no value, this method
+   * is called before returning <code>null</code>.
+   *
+   * @param msg the error message
+   */
   protected void getUIError(String msg)
   {
     System.err.println ("UIDefaults.getUIError: " + msg);
   }
 
+  /**
+   * Returns the {@link ComponentUI} for the specified {@link JComponent}.
+   *
+   * @param target the component for which the ComponentUI is requested
+   *
+   * @return the {@link ComponentUI} for the specified {@link JComponent}
+   */
   public ComponentUI getUI(JComponent target)
   {
     String classId = target.getUIClassID ();
@@ -477,42 +741,86 @@
       }
   }
 
+  /**
+   * Adds a {@link PropertyChangeListener} to this UIDefaults map.
+   * Registered PropertyChangeListener are notified when values
+   * are beeing put into this UIDefaults map.
+   *
+   * @param listener the PropertyChangeListener to add
+   */
   public void addPropertyChangeListener(PropertyChangeListener listener)
   {
     propertyChangeSupport.addPropertyChangeListener(listener);
   }
 
+  /**
+   * Removes a PropertyChangeListener from this UIDefaults map.
+   *
+   * @param listener the PropertyChangeListener to remove
+   */
   public void removePropertyChangeListener(PropertyChangeListener listener)
   {
     propertyChangeSupport.removePropertyChangeListener(listener);
   }
 
+  /**
+   * Returns an array of all registered PropertyChangeListeners.
+   *
+   * @return all registered PropertyChangeListeners
+   */
   public PropertyChangeListener[] getPropertyChangeListeners()
   {
     return propertyChangeSupport.getPropertyChangeListeners();
   }
 
+  /**
+   * Fires a PropertyChangeEvent.
+   *
+   * @param property the property name
+   * @param oldValue the old value
+   * @param newValue the new value
+   */
   protected void firePropertyChange(String property,
 				    Object oldValue, Object newValue)
   {
     propertyChangeSupport.firePropertyChange(property, oldValue, newValue);
   }
 
+  /**
+   * Adds a ResourceBundle for localized values.
+   *
+   * @param name the name of the ResourceBundle to add
+   */
   public void addResourceBundle(String name)
   {
     bundles.addFirst(name);
   }
 
+  /**
+   * Removes a ResourceBundle.
+   *
+   * @param name the name of the ResourceBundle to remove
+   */
   public void removeResourceBundle(String name)
   {
     bundles.remove(name);
   }
 
+  /**
+   * Sets the current locale to <code>loc</code>.
+   *
+   * @param loc the Locale to be set
+   */
   public void setDefaultLocale(Locale loc)
   {
     defaultLocale = loc;
   }
 
+  /**
+   * Returns the current default locale.
+   *
+   * @return the current default locale
+   */
   public Locale getDefaultLocale()
   {
     return defaultLocale;




More information about the kaffe mailing list