This patch (committed) reimplements the paramString() method, updates the setResizeWeight() method with argument checking and event notification and adds API docs to a couple of other methods. The paramString() method contains a FIXME that can be removed once bug report 27208 is fixed:

2006-04-19  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/JSplitPane.java
        (getAccessibleContext): Added API docs,
        (paramString): Reimplemented,
        (setOrientation): Updated API docs,
        (setResizeWeight): Added argument checking and event notification.

Regards,

Dave
Index: javax/swing/JSplitPane.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JSplitPane.java,v
retrieving revision 1.15
diff -u -r1.15 JSplitPane.java
--- javax/swing/JSplitPane.java 13 Apr 2006 23:17:46 -0000      1.15
+++ javax/swing/JSplitPane.java 19 Apr 2006 08:57:38 -0000
@@ -1,5 +1,5 @@
 /* JSplitPane.java -- 
-   Copyright (C) 2004  Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006,  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -399,9 +399,11 @@
   }
 
   /**
-   * DOCUMENT ME!
+   * Returns the object that provides accessibility features for this
+   * <code>JSplitPane</code> component.
    *
-   * @return DOCUMENT ME!
+   * @return The accessible context (an instance of 
+   *     [EMAIL PROTECTED] AccessibleJSplitPane}).
    */
   public AccessibleContext getAccessibleContext()
   {
@@ -587,14 +589,27 @@
   }
 
   /**
-   * This method returns a String that describes this JSplitPane. The string
-   * is primarily used for debugging purposes.
+   * Returns an implementation-dependent string describing the attributes of
+   * this <code>JSplitPane</code>.
    *
-   * @return A String used for debugging purposes.
+   * @return A string describing the attributes of this <code>JSplitPane</code>
+   *         (never <code>null</code>).
    */
   protected String paramString()
   {
-    return "JSplitPane";
+    // FIXME: the next line can be restored once PR27208 is fixed
+    String superParamStr = ""; //super.paramString();
+    StringBuffer sb = new StringBuffer();
+    sb.append(",continuousLayout=").append(isContinuousLayout());
+    sb.append(",dividerSize=").append(getDividerSize());
+    sb.append(",lastDividerLocation=").append(getLastDividerLocation());
+    sb.append(",oneTouchExpandable=").append(isOneTouchExpandable());
+    sb.append(",orientation=");
+    if (orientation == HORIZONTAL_SPLIT)
+      sb.append("HORIZONTAL_SPLIT");
+    else
+      sb.append("VERTICAL_SPLIT");
+    return superParamStr + sb.toString();
   }
 
   /**
@@ -781,11 +796,15 @@
   }
 
   /**
-   * This method sets the orientation of the JSplitPane.
+   * Sets the orientation for the <code>JSplitPane</code> and sends a 
+   * [EMAIL PROTECTED] PropertyChangeEvent} (with the property name 
+   * [EMAIL PROTECTED] #ORIENTATION_PROPERTY}) to all registered listeners.
    *
-   * @param orientation The orientation of the JSplitPane.
+   * @param orientation  the orientation (either [EMAIL PROTECTED] 
#HORIZONTAL_SPLIT}
+   * or [EMAIL PROTECTED] #VERTICAL_SPLIT}).
    *
-   * @throws IllegalArgumentException DOCUMENT ME!
+   * @throws IllegalArgumentException if <code>orientation</code> is not one of
+   *     the listed values.
    */
   public void setOrientation(int orientation)
   {
@@ -812,7 +831,14 @@
    */
   public void setResizeWeight(double value)
   {
-    resizeWeight = value;
+    if (value < 0.0 || value > 1.0)
+      throw new IllegalArgumentException("Value outside permitted range.");
+    if (this.resizeWeight != value)
+      { 
+        double old = resizeWeight;
+        resizeWeight = value;
+        firePropertyChange(RESIZE_WEIGHT_PROPERTY, old, value);
+      }
   }
 
   /**

Reply via email to