This patch (committed) implements some methods that were stubs in 
AccessibleJSplitPane:

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

        * javax/swing/JSplitPane.java
        (AccessibleJSplitPane.getAccessibleStateSet): Implemented,
        (AccessibleJSplitPane.getAccessibleRole): Implemented,
        (AccessibleJSplitPane.getAccessibleValue): Implemented,
        (AccessibleJSplitPane.getCurrentAccessibleValue): Implemented,
        (AccessibleJSplitPane.setCurrentAccessibleValue): Implemented,
        (AccessibleJSplitPane.getMinimumAccessibleValue): Implemented,
        (AccessibleJSplitPane.getMaximumAccessibleValue): Implemented.

Regards,

Dave
Index: javax/swing/JSplitPane.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JSplitPane.java,v
retrieving revision 1.14
diff -u -r1.14 JSplitPane.java
--- javax/swing/JSplitPane.java 5 Apr 2006 15:10:23 -0000       1.14
+++ javax/swing/JSplitPane.java 13 Apr 2006 23:11:28 -0000
@@ -40,10 +40,12 @@
 
 import java.awt.Component;
 import java.awt.Graphics;
+import java.beans.PropertyChangeEvent;
 
 import javax.accessibility.Accessible;
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
 import javax.accessibility.AccessibleStateSet;
 import javax.accessibility.AccessibleValue;
 import javax.swing.plaf.SplitPaneUI;
@@ -56,18 +58,18 @@
  */
 public class JSplitPane extends JComponent implements Accessible
 {
+
   /**
-   * DOCUMENT ME!
+   * Provides the accessibility features for the <code>JSplitPane</code>
+   * component.
    */
-  // FIXME: This inner class is a complete stub and must be implemented
-  // properly.
   protected class AccessibleJSplitPane extends JComponent.AccessibleJComponent
     implements AccessibleValue
   {
   private static final long serialVersionUID = -1788116871416305366L;
   
     /**
-     * Creates a new AccessibleJSplitPane object.
+     * Creates a new <code>AccessibleJSplitPane</code> instance.
      */
     protected AccessibleJSplitPane()
     {
@@ -75,75 +77,101 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Returns a set containing the current state of the [EMAIL PROTECTED] 
JSplitPane} 
+     * component.
      *
-     * @return DOCUMENT ME!
+     * @return The accessible state set.
      */
     public AccessibleStateSet getAccessibleStateSet()
     {
-      return null;
+      AccessibleStateSet result = super.getAccessibleStateSet();
+      if (getOrientation() == HORIZONTAL_SPLIT)
+        {
+          result.add(AccessibleState.HORIZONTAL);
+        }
+      else if (getOrientation() == VERTICAL_SPLIT)
+        {
+          result.add(AccessibleState.VERTICAL);
+        }
+      return result;
     }
 
     /**
-     * DOCUMENT ME!
+     * Returns the accessible role for the <code>JSplitPane</code> component.
      *
-     * @return DOCUMENT ME!
+     * @return [EMAIL PROTECTED] AccessibleRole#SPLIT_PANE}.
      */
     public AccessibleRole getAccessibleRole()
     {
-      return null;
+      return AccessibleRole.SPLIT_PANE;
     }
 
     /**
-     * DOCUMENT ME!
+     * Returns an object that provides access to the current, minimum and 
+     * maximum values for the [EMAIL PROTECTED] JSlider}.  Since this class 
implements 
+     * [EMAIL PROTECTED] AccessibleValue}, it returns itself.
      *
-     * @return DOCUMENT ME!
+     * @return The accessible value.
      */
     public AccessibleValue getAccessibleValue()
     {
-      return null;
+      return this;
     }
 
     /**
-     * DOCUMENT ME!
+     * Returns the current divider location for the [EMAIL PROTECTED] 
JSplitPane} 
+     * component, as an [EMAIL PROTECTED] Integer}.
      *
-     * @return DOCUMENT ME!
+     * @return The current divider location.
      */
     public Number getCurrentAccessibleValue()
     {
-      return null;
+      return new Integer(getDividerLocation());
     }
 
     /**
-     * DOCUMENT ME!
+     * Sets the divider location for the [EMAIL PROTECTED] JSplitPane} 
component and sends 
+     * a [EMAIL PROTECTED] PropertyChangeEvent} (with the property name 
+     * [EMAIL PROTECTED] AccessibleContext#ACCESSIBLE_VALUE_PROPERTY}) to all 
registered
+     * listeners.  If the supplied value is <code>null</code>, this method 
+     * does nothing and returns <code>false</code>.
      *
-     * @param value0 DOCUMENT ME!
+     * @param value  the new slider value (<code>null</code> permitted).
      *
-     * @return DOCUMENT ME!
+     * @return <code>true</code> if the slider value is updated, and 
+     *     <code>false</code> otherwise.
      */
-    public boolean setCurrentAccessibleValue(Number value0)
+    public boolean setCurrentAccessibleValue(Number value)
     {
-      return false;
+      if (value == null)
+        return false;
+      Number oldValue = getCurrentAccessibleValue();
+      setDividerLocation(value.intValue());
+      firePropertyChange(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, 
oldValue, 
+                         new Integer(value.intValue()));
+      return true;
     }
 
     /**
-     * DOCUMENT ME!
+     * Returns the minimum divider location for the [EMAIL PROTECTED] 
JSplitPane} 
+     * component, as an [EMAIL PROTECTED] Integer}.
      *
-     * @return DOCUMENT ME!
+     * @return The minimum divider location.
      */
     public Number getMinimumAccessibleValue()
     {
-      return null;
+      return new Integer(getMinimumDividerLocation());
     }
 
     /**
-     * DOCUMENT ME!
+     * Returns the maximum divider location for the [EMAIL PROTECTED] 
JSplitPane} 
+     * component, as an [EMAIL PROTECTED] Integer}.
      *
-     * @return DOCUMENT ME!
+     * @return The maximum divider location.
      */
     public Number getMaximumAccessibleValue()
     {
-      return null;
+      return new Integer(getMaximumDividerLocation());
     }
   }
 

Reply via email to