[kaffe] CVS kaffe (robilad): resynced with GNU Classpath: Checkbox acessibility fixes

Kaffe CVS cvs-commits at kaffe.org
Sat Jan 22 10:53:45 PST 2005


PatchSet 5889 
Date: 2005/01/22 18:40:37
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with GNU Classpath: Checkbox acessibility fixes

2005-01-22  Dalibor Topic  <robilad at kaffe.org>

Resynced with GNU Classpath.

2005-01-20  Andrew John Hughes  <gnu_andrew at member.fsf.org>

* java/awt/Checkbox.java:
(AccessibleAWTCheckbox): name capitalization corrected
and serialization UID added.
(AccessibleAWTCheckbox.itemStateChanged(java.awt.event.ItemEvent)):
documented.
(AccessibleAWTCheckbox.getAccessibleAction()): likewise
(AccessibleAWTCheckbox.getAccessibleValue()): likewise
(AccessibleAWTCheckbox.getAccessibleActionCount()): likewise
(AccessibleAWTCheckbox.getAccessibleActionDescription(int)): likewise
(AccessibleAWTCheckbox.doAccessibleAction(int)): likewise
(AccessibleAWTCheckbox.getCurrentAccessibleValue()): likewise
(AccessibleAWTCheckbox.setCurrentAccessibleValue(java.lang.Number)): likewise
(AccessibleAWTCheckbox.getMinimumAccessibleValue()): likewise
(AccessibleAWTCheckbox.getMaximumAccessibleValue()): likewise
(AccessibleAWTCheckbox.getAccessibleRole()): likewise
(AccessibleAWTCheckbox.getAccessibleStateSet()): implemented and
documented
(getAccessibleContext()): name of accessible class corrected

Members: 
	ChangeLog:1.3429->1.3430 
	libraries/javalib/java/awt/Checkbox.java:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3429 kaffe/ChangeLog:1.3430
--- kaffe/ChangeLog:1.3429	Sat Jan 22 18:34:43 2005
+++ kaffe/ChangeLog	Sat Jan 22 18:40:37 2005
@@ -1,6 +1,31 @@
 2005-01-22  Dalibor Topic  <robilad at kaffe.org>
 
 	Resynced with GNU Classpath.
+	
+	2005-01-20  Andrew John Hughes  <gnu_andrew at member.fsf.org>
+
+	* java/awt/Checkbox.java:
+	(AccessibleAWTCheckbox): name capitalization corrected
+	and serialization UID added.
+	(AccessibleAWTCheckbox.itemStateChanged(java.awt.event.ItemEvent)):
+	documented.
+	(AccessibleAWTCheckbox.getAccessibleAction()): likewise
+	(AccessibleAWTCheckbox.getAccessibleValue()): likewise
+	(AccessibleAWTCheckbox.getAccessibleActionCount()): likewise
+	(AccessibleAWTCheckbox.getAccessibleActionDescription(int)): likewise
+	(AccessibleAWTCheckbox.doAccessibleAction(int)): likewise
+	(AccessibleAWTCheckbox.getCurrentAccessibleValue()): likewise
+	(AccessibleAWTCheckbox.setCurrentAccessibleValue(java.lang.Number)): likewise
+	(AccessibleAWTCheckbox.getMinimumAccessibleValue()): likewise
+	(AccessibleAWTCheckbox.getMaximumAccessibleValue()): likewise
+	(AccessibleAWTCheckbox.getAccessibleRole()): likewise
+	(AccessibleAWTCheckbox.getAccessibleStateSet()): implemented and
+	documented
+	(getAccessibleContext()): name of accessible class corrected
+	
+2005-01-22  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
 
 	2005-01-19  Andrew John Hughes  <gnu_andrew at member.fsf.org>
 
Index: kaffe/libraries/javalib/java/awt/Checkbox.java
diff -u kaffe/libraries/javalib/java/awt/Checkbox.java:1.4 kaffe/libraries/javalib/java/awt/Checkbox.java:1.5
--- kaffe/libraries/javalib/java/awt/Checkbox.java:1.4	Thu Jan  6 00:22:46 2005
+++ kaffe/libraries/javalib/java/awt/Checkbox.java	Sat Jan 22 18:40:43 2005
@@ -48,6 +48,7 @@
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
 import javax.accessibility.AccessibleValue;
 
 /**
@@ -55,7 +56,7 @@
  * or more Checkboxes can be grouped by a CheckboxGroup.
  *
  * @author Aaron M. Renn (arenn at urbanophile.com)
- * @author Tom Tromey <tromey at redhat.com>
+ * @author Tom Tromey (tromey at redhat.com)
  */
 public class Checkbox extends Component
   implements ItemSelectable, Accessible, Serializable
@@ -94,13 +95,21 @@
 // The list of listeners for this object.
 private transient ItemListener item_listeners;
 
-protected class AccessibleAWTCheckBox
+protected class AccessibleAWTCheckbox
   extends AccessibleAWTComponent
   implements ItemListener, AccessibleAction, AccessibleValue
 {
-  
 
-  /* (non-Javadoc)
+  /**
+   * Serialization constant to match JDK 1.5
+   */
+  private static final long serialVersionUID = 7881579233144754107L;
+
+  /**
+   * Captures changes to the state of the checkbox and
+   * fires appropriate accessible property change events.
+   *
+   * @param event the event fired.
    * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
    */
   public void itemStateChanged(ItemEvent event)
@@ -110,58 +119,121 @@
                        state ? AccessibleState.CHECKED : null);
   }
   
+  /**
+   * Returns an implementation of the <code>AccessibleAction</code>
+   * interface for this accessible object.  In this case, the
+   * current instance is simply returned (with a more appropriate
+   * type), as it also implements the accessible action as well as
+   * the context.
+   *
+   * @return the accessible action associated with this context.
+   * @see javax.accessibility.AccessibleAction
+   */
   public AccessibleAction getAccessibleAction()
   {
     return this;
   }
   
+  /**
+   * Returns an implementation of the <code>AccessibleValue</code>
+   * interface for this accessible object.  In this case, the
+   * current instance is simply returned (with a more appropriate
+   * type), as it also implements the accessible value as well as
+   * the context.
+   *
+   * @return the accessible value associated with this context.
+   * @see javax.accessibility.AccessibleValue
+   */
   public AccessibleValue getAccessibleValue()
   {
     return this;
   }
   
-  /* (non-Javadoc)
+  /* 
+   * The following methods are implemented in the JDK (up to
+   * 1.5) as stubs.  We do likewise here.
+   */
+
+  /**
+   * Returns the number of actions associated with this accessible
+   * object.  This default implementation returns 0.
+   *
+   * @return the number of accessible actions available.
    * @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
    */
   public int getAccessibleActionCount()
   {
-    // 1.4.1 does this
+    // 1.4.1 and 1.5 do this
     return 0;
   }
 
-  /* (non-Javadoc)
+  /**
+   * Returns a description of the action with the supplied id.
+   * This default implementation always returns null.
+   *
+   * @param i the id of the action whose description should be
+   *          retrieved.
+   * @return a <code>String</code> describing the action.
    * @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
    */
   public String getAccessibleActionDescription(int i)
   {
+    // 1.5 does this
     return null;
   }
 
-  /* (non-Javadoc)
+  /**
+   * Executes the action with the specified id.  This
+   * default implementation simply returns false.
+   *
+   * @param i the id of the action to perform.
+   * @return true if the action was performed.
    * @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
    */
   public boolean doAccessibleAction(int i)
   {
+    // 1.5 does this
     return false;
   }
 
-  /* (non-Javadoc)
+  /**
+   * Returns the current value of this accessible object.
+   * If no value has been set, null is returned.  This
+   * default implementation always returns null, regardless.
+   *
+   * @return the numeric value of this object, or null if
+   *         no value has been set.
    * @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
    */
   public Number getCurrentAccessibleValue()
   {
+    // 1.5 does this
     return null;
   }
 
-  /* (non-Javadoc)
+  /**
+   * Sets the current value of this accessible object
+   * to that supplied.  In this default implementation,
+   * the value is never set and the method always returns
+   * false.
+   *
+   * @param number the new accessible value.
+   * @return true if the value was set.
    * @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
    */
   public boolean setCurrentAccessibleValue(Number number)
   {
+    // 1.5 does this
     return false;
   }
 
-  /* (non-Javadoc)
+  /**
+   * Returns the minimum acceptable accessible value used
+   * by this object, or null if no minimum value exists.
+   * This default implementation always returns null.
+   *
+   * @return the minimum acceptable accessible value, or null
+   *         if there is no minimum.
    * @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
    */
   public Number getMinimumAccessibleValue()
@@ -169,7 +241,13 @@
     return null;
   }
 
-  /* (non-Javadoc)
+  /**
+   * Returns the maximum acceptable accessible value used
+   * by this object, or null if no maximum value exists.
+   * This default implementation always returns null.
+   *
+   * @return the maximum acceptable accessible value, or null
+   *         if there is no maximum.
    * @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
    */
   public Number getMaximumAccessibleValue()
@@ -177,11 +255,35 @@
     return null;
   }
   
+  /**
+   * Returns the role of this accessible object.
+   *
+   * @return the instance of <code>AccessibleRole</code>,
+   *         which describes this object.
+   * @see javax.accessibility.AccessibleRole
+   */
   public AccessibleRole getAccessibleRole() 
   {
     return AccessibleRole.CHECK_BOX;
   }
   
+  /**
+   * Returns the state set of this accessible object.
+   *
+   * @return a set of <code>AccessibleState</code>s
+   *         which represent the current state of the
+   *         accessible object.
+   * @see javax.accessibility.AccessibleState
+   * @see javax.accessibility.AccessibleStateSet
+   */
+  public AccessibleStateSet getAccessibleStateSet()
+  {
+    AccessibleStateSet set = super.getAccessibleStateSet();
+    if (state)
+      set.add(AccessibleState.CHECKED);
+    return set;
+  }
+
 }
 
 /*************************************************************************/
@@ -491,7 +593,7 @@
 }
 
 /**
- * Gets the AccessibleContext associated with this <code>CheckBox</code>.
+ * Gets the AccessibleContext associated with this <code>Checkbox</code>.
  * The context is created, if necessary.
  *
  * @return the associated context
@@ -501,7 +603,7 @@
   /* Create the context if this is the first request */
   if (accessibleContext == null)
   {
-    AccessibleAWTCheckBox ac = new AccessibleAWTCheckBox();
+    AccessibleAWTCheckbox ac = new AccessibleAWTCheckbox();
     accessibleContext = ac;
     addItemListener(ac);
   }




More information about the kaffe mailing list