summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2002-03-18 22:22:44 +0000
committerEric Blake <ebb9@byu.net>2002-03-18 22:22:44 +0000
commit520b3e7425b5596d6c5dac561fad1b3bdc42f879 (patch)
treebf1cf0a37556e5be2b2740a93763d9c4ed40d6e3
parent6f7f409dd59337b6b6703458f1a6c9b624b8da35 (diff)
downloadclasspath-520b3e7425b5596d6c5dac561fad1b3bdc42f879.tar.gz
2002-03-18 Eric Blake <ebb9@email.byu.edu>
* javax/Makefile.am (SUBDIRS): Visit accessibility subdir. * javax/accessibility/Makefile.am: New file. * javax/accessibility/.cvsignore: New file. * javax/accessibility/Accessible.java: Update to 1.4. * javax/accessibility/AccessibleAction.java: Update to 1.4. * javax/accessibility/AccessibleBundle.java: Implement. * javax/accessibility/AccessibleComponent.java: Update to 1.4. * javax/accessibility/AccessibleContext.java: Implement. * javax/accessibility/AccessibleEditableText.java: New file. * javax/accessibility/AccessibleExtendedComponent.java: New file. * javax/accessibility/AccessibleExtendedTable.java: New file. * javax/accessibility/AccessibleHyperlink.java: Implement. * javax/accessibility/AccessibleHypertext.java: Update to 1.4. * javax/accessibility/AccessibleIcon.java: New file. * javax/accessibility/AccessibleKeyBinding.java: New file. * javax/accessibility/AccessibleRelation.java: New file. * javax/accessibility/AccessibleRelationSet.java: New file. * javax/accessibility/AccessibleResourceBundle.java: Implement. * javax/accessibility/AccessibleRole.java: Implement. * javax/accessibility/AccessibleSelection.java: Update to 1.4. * javax/accessibility/AccessibleState.java: Implement. * javax/accessibility/AccessibleStateSet.java: Implement. * javax/accessibility/AccessibleTable.java: New file. * javax/accessibility/AccessibleTableModelChange.java: New file. * javax/accessibility/AccessibleText.java: Update to 1.4. * javax/accessibility/AccessibleValue.java: Update to 1.4.
-rw-r--r--ChangeLog29
-rw-r--r--javax/Makefile.am2
-rw-r--r--javax/accessibility/.cvsignore1
-rw-r--r--javax/accessibility/Accessible.java32
-rw-r--r--javax/accessibility/AccessibleAction.java76
-rw-r--r--javax/accessibility/AccessibleBundle.java120
-rw-r--r--javax/accessibility/AccessibleComponent.java532
-rw-r--r--javax/accessibility/AccessibleContext.java588
-rw-r--r--javax/accessibility/AccessibleEditableText.java144
-rw-r--r--javax/accessibility/AccessibleExtendedComponent.java78
-rw-r--r--javax/accessibility/AccessibleExtendedTable.java81
-rw-r--r--javax/accessibility/AccessibleHyperlink.java139
-rw-r--r--javax/accessibility/AccessibleHypertext.java86
-rw-r--r--javax/accessibility/AccessibleIcon.java85
-rw-r--r--javax/accessibility/AccessibleKeyBinding.java78
-rw-r--r--javax/accessibility/AccessibleRelation.java220
-rw-r--r--javax/accessibility/AccessibleRelationSet.java222
-rw-r--r--javax/accessibility/AccessibleResourceBundle.java74
-rw-r--r--javax/accessibility/AccessibleRole.java478
-rw-r--r--javax/accessibility/AccessibleSelection.java136
-rw-r--r--javax/accessibility/AccessibleState.java315
-rw-r--r--javax/accessibility/AccessibleStateSet.java172
-rw-r--r--javax/accessibility/AccessibleTable.java236
-rw-r--r--javax/accessibility/AccessibleTableModelChange.java102
-rw-r--r--javax/accessibility/AccessibleText.java168
-rw-r--r--javax/accessibility/AccessibleValue.java98
-rw-r--r--javax/accessibility/Makefile.am26
27 files changed, 3876 insertions, 442 deletions
diff --git a/ChangeLog b/ChangeLog
index a82c846e6..ce75cf361 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2002-03-18 Eric Blake <ebb9@email.byu.edu>
+
+ * javax/Makefile.am (SUBDIRS): Visit accessibility subdir.
+ * javax/accessibility/Makefile.am: New file.
+ * javax/accessibility/.cvsignore: New file.
+ * javax/accessibility/Accessible.java: Update to 1.4.
+ * javax/accessibility/AccessibleAction.java: Update to 1.4.
+ * javax/accessibility/AccessibleBundle.java: Implement.
+ * javax/accessibility/AccessibleComponent.java: Update to 1.4.
+ * javax/accessibility/AccessibleContext.java: Implement.
+ * javax/accessibility/AccessibleEditableText.java: New file.
+ * javax/accessibility/AccessibleExtendedComponent.java: New file.
+ * javax/accessibility/AccessibleExtendedTable.java: New file.
+ * javax/accessibility/AccessibleHyperlink.java: Implement.
+ * javax/accessibility/AccessibleHypertext.java: Update to 1.4.
+ * javax/accessibility/AccessibleIcon.java: New file.
+ * javax/accessibility/AccessibleKeyBinding.java: New file.
+ * javax/accessibility/AccessibleRelation.java: New file.
+ * javax/accessibility/AccessibleRelationSet.java: New file.
+ * javax/accessibility/AccessibleResourceBundle.java: Implement.
+ * javax/accessibility/AccessibleRole.java: Implement.
+ * javax/accessibility/AccessibleSelection.java: Update to 1.4.
+ * javax/accessibility/AccessibleState.java: Implement.
+ * javax/accessibility/AccessibleStateSet.java: Implement.
+ * javax/accessibility/AccessibleTable.java: New file.
+ * javax/accessibility/AccessibleTableModelChange.java: New file.
+ * javax/accessibility/AccessibleText.java: Update to 1.4.
+ * javax/accessibility/AccessibleValue.java: Update to 1.4.
+
2002-03-17 C. Brian Jones <cbj@gnu.org>
* java/net/URLStreamHandler.java (parseURL): incorporate patch from
diff --git a/javax/Makefile.am b/javax/Makefile.am
index 2ffefe474..3dc089d5f 100644
--- a/javax/Makefile.am
+++ b/javax/Makefile.am
@@ -1,3 +1,3 @@
## Input file for automake to generate the Makefile.in used by configure
-SUBDIRS = naming
+SUBDIRS = accessibility naming
diff --git a/javax/accessibility/.cvsignore b/javax/accessibility/.cvsignore
new file mode 100644
index 000000000..70845e08e
--- /dev/null
+++ b/javax/accessibility/.cvsignore
@@ -0,0 +1 @@
+Makefile.in
diff --git a/javax/accessibility/Accessible.java b/javax/accessibility/Accessible.java
index 94baebc22..1c407a682 100644
--- a/javax/accessibility/Accessible.java
+++ b/javax/accessibility/Accessible.java
@@ -1,5 +1,5 @@
-/* Accessible.java -- Primary Java accessibility interface
- Copyright (C) 2000 Free Software Foundation, Inc.
+/* Accessible.java -- primary Java accessibility interface
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ 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
@@ -35,19 +35,27 @@ 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 javax.accessibility;
/**
* Implementing the Accessibility API must start with implementation
- * of this interface at a bare minimum. This is the major interface
+ * of this interface at a bare minimum. This is the major interface
* for the Accessibility API which must be implemented by all user
* interface components.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @since 1.2
+ * @status updated to 1.4
*/
-public interface Accessible {
-
- /**
- * If a component supports the Accessibility API then this
- * method should not return <code>null</code>.
- */
- public abstract AccessibleContext getAccessibleContext();
-}
+public interface Accessible
+{
+ /**
+ * If a component supports the Accessibility API then this method should
+ * not return <code>null</code>. Only classes which must extend an accessible
+ * class, but must not itself be accessible, may return null.
+ *
+ * @return the context associated with this accessible object
+ */
+ AccessibleContext getAccessibleContext();
+} // interface Accessible
diff --git a/javax/accessibility/AccessibleAction.java b/javax/accessibility/AccessibleAction.java
index 6bf9b8042..b05883aa9 100644
--- a/javax/accessibility/AccessibleAction.java
+++ b/javax/accessibility/AccessibleAction.java
@@ -1,6 +1,5 @@
-/* AccessibleAction.java -- Java interface for aiding in accessibly determining
- what actions an object can perform
- Copyright (C) 2000 Free Software Foundation, Inc.
+/* AccessibleAction.java -- aids in accessibly performing actions
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -8,7 +7,7 @@ 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
@@ -36,41 +35,48 @@ 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 javax.accessibility;
/**
- * If an object implements this interface then it must be able to
- * perform one or more actions. By implementing the interface it
- * is possible to discover what those actions are and perform those
- * actions.
- * <p>
- * The <code>AccessibleContext.getAccessibleAction()</code> method
- * should return <code>null</code> if an object does not implement
- * this interface.
- *
+ * If an object implements this interface then it must be able to perform one
+ * or more actions. Accessibility software can use the implementations of this
+ * interface to discover and perform actions on an object.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleAction()</code> method should
+ * return <code>null</code> if an object does not implement this interface.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
* @see AccessibleContext#getAccessibleAction()
+ * @since 1.2
+ * @status updated to 1.4
*/
-public interface AccessibleAction {
-
- /**
- * Perform the specified action.
- *
- * @param i the action to perform. Actions are counted starting with zero.
- * @return false if the action was not performed and true if was performed
- */
- public abstract boolean doAccessibleAction(int i);
+public interface AccessibleAction
+{
+ /**
+ * Get the number possible actions for this object, with the zeroth
+ * representing the default action.
+ *
+ * @return the 0-based number of actions
+ */
+ int getAccessibleActionCount();
- /**
- * Get the number possible actions for this object with the first
- * representing the default action.
- */
- public abstract int getAccessibleActionCount();
+ /**
+ * Get a description for the specified action. Returns null if out of
+ * bounds.
+ *
+ * @param i the action to describe, 0-based
+ * @return description of the action
+ */
+ String getAccessibleActionDescription(int i);
- /**
- * Get a description for the specified action.
- *
- * @param i the action to describe. Actions are counted starting with zero.
- * @return description of the action
- */
- public abstract String getAccessibleActionDescription(int i);
-}
+ /**
+ * Perform the specified action. Does nothing if out of bounds.
+ *
+ * @param i the action to perform, 0-based
+ * @return true if the action was performed
+ */
+ boolean doAccessibleAction(int i);
+} // interface AccessibleAction
diff --git a/javax/accessibility/AccessibleBundle.java b/javax/accessibility/AccessibleBundle.java
index e69de29bb..11b9cb38e 100644
--- a/javax/accessibility/AccessibleBundle.java
+++ b/javax/accessibility/AccessibleBundle.java
@@ -0,0 +1,120 @@
+/* AccessibleBundle.java -- base class for accessibility "enumerations"
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+import java.util.Locale;
+
+/**
+ * This serves as a base class for accessibility "enumerations". These
+ * objects are strongly typed; to make up for the lack of true enums in Java.
+ * Display should be locale dependent.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see AccessibleRole
+ * @see AccessibleState
+ * @since 1.2
+ * @status updated to 1.4, but missing Locale support
+ */
+public abstract class AccessibleBundle
+{
+ /**
+ * The locale independent name of the object. This is for the computer, not
+ * necessarily for humans; changing it in subclasses is frowned upon.
+ *
+ * @see #toDisplayString(String, Locale)
+ */
+ protected String key;
+
+ /**
+ * Default constructor.
+ */
+ public AccessibleBundle()
+ {
+ }
+
+ /**
+ * Obtains the key as a localized string, falling back to the
+ * locale-independent version if necessary.
+ *
+ * @param resourceBundle the resource to use for lookup
+ * @param locale the locale to translate to
+ * @return the translated name
+ * @throws NullPointerException if resourceBundle or locale is null
+ * @XXX For now, no transformation is done.
+ */
+ protected String toDisplayString(String resourceBundle, Locale locale)
+ {
+ return key;
+ }
+
+ /**
+ * Obtains the key as a localized string, falling back to the
+ * locale-independent version if necessary.
+ *
+ * @param locale the locale to translate to
+ * @return the translated name
+ * @throws NullPointerException if locale is null
+ * @XXX For now, no transformation is done.
+ */
+ public String toDisplayString(Locale locale)
+ {
+ return key;
+ }
+
+ /**
+ * Obtains the key as a localized string, using the default locale.
+ *
+ * @return the translated name
+ * @XXX For now, no transformation is done.
+ */
+ public String toDisplayString()
+ {
+ return toDisplayString(Locale.getDefault());
+ }
+
+ /**
+ * Obtains the key as a localized string, using the default locale.
+ *
+ * @return the translated name
+ * @XXX For now, no transformation is done.
+ */
+ public String toString()
+ {
+ return toDisplayString(Locale.getDefault());
+ }
+} // class AccessibleBundle
diff --git a/javax/accessibility/AccessibleComponent.java b/javax/accessibility/AccessibleComponent.java
index e64bc19db..c580ce1e0 100644
--- a/javax/accessibility/AccessibleComponent.java
+++ b/javax/accessibility/AccessibleComponent.java
@@ -1,6 +1,5 @@
-/* AccessibleComponent.java -- Java interface for aiding in accessibly rendering
- other Java components
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* AccessibleComponent.java -- aids in accessibly rendering Java components
+ Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -8,7 +7,7 @@ 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
@@ -38,268 +37,285 @@ exception statement from your version. */
package javax.accessibility;
-import java.awt.event.FocusListener;
-import java.awt.Point;
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
-import java.awt.Color;
+import java.awt.Point;
import java.awt.Rectangle;
-import java.awt.Dimension;
-import java.awt.Cursor;
+import java.awt.event.FocusListener;
/**
* Objects which are to be rendered to a screen as part of a graphical
- * user interface should implement this interface. Accessibility
- * software can use the implementations of this interface to determine
+ * user interface should implement this interface. Accessibility
+ * software can use the implementations of this interface to determine
* and set the screen representation for an object.
- * <p>
- * The <code>AccessibleContext.getAccessibleComponent()</code> method
+ *
+ * <p>The <code>AccessibleContext.getAccessibleComponent()</code> method
* should return <code>null</code> if an object does not implement this
* interface.
*
- * @see AccessibleContext#getAccessibleComponent()
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleComponent()
+ * @since 1.2
+ * @status updated to 1.4
*/
-public interface AccessibleComponent {
-
- /**
- * Adds the specified listener to this component.
- *
- * @param listener the listener to add to this component
- */
- public abstract void addFocusListener(FocusListener listener);
-
- /**
- * Tests whether or not the specified point is contained within
- * this component. The coordinates are specified relative to this
- * component's coordinate system.
- *
- * @param point the <code>Point</code> specifying the location within
- * this component
- *
- * @return <code>true</code> if the point is within this component,
- * <code>false</code> otherwise
- */
- public abstract boolean contains(Point point);
-
- /**
- * If a object exists which is a child of this parent component at
- * the specified point which implements the Accessible interface then
- * that object is returned.
- *
- * @param point the <code>Point</code> specifying the location within
- * this component
- *
- * @return <code>null</code> if no <code>Accessible</code> child exists
- * at the given point
- */
- public abstract Accessible getAccessibleAt(Point point);
-
- /**
- * Get the background color of this component.
- *
- * @return the background color of this component if supported,
- * else <code>null</code>
- */
- public abstract Color getBackground();
-
- /**
- * Get the bounds of this component relative to its parent.
- *
- * @return the <code>Rectangle</code> representing the bounds of this component
- * if it is visible on the screen, else <code>null</code>
- */
- public abstract Rectangle getBounds();
-
- /**
- * Get the cursor of this component.
- *
- * @return the <code>Cursor</code> representing the mouse cursor if supported,
- * else <code>null</code>
- */
- public abstract Cursor getCursor();
-
- /**
- * Get the font of this component
- *
- * @return the <code>Font</code> of the component if supported,
- * else <code>null</code>
- */
- public abstract Font getFont();
-
- /**
- * Get the <code>FontMetrics</code> of the specified font in this component.
- *
- * @param font the specified font
- * @return the <code>FontMetrics</code> for the specified font if supported,
- * else <code>null</code>
- */
- public abstract FontMetrics getFontMetrics(Font font);
-
- /**
- * Get the foreground color of this component
- *
- * @return the foreground color of this component if supported,
- * else <code>null</code>
- */
- public abstract Color getForeground();
-
- /**
- * Get the location of this component in the screen's coordinate system.
- * The point specified is the top-left corner of this component.
- * <p>
- * <i>FIXME - Sun indicates this location is relative to the parent, but in the
- * screen's coordinate space I am not sure how this is possible yet. What
- * makes the most sense is that this location is truly relative to the
- * parent and the coordinates are in the parent's coordinate system.</i>
- */
- public abstract Point getLocation();
-
- /**
- * Get the location of this component in the screen's coordinate space.
- * The point specified is the top-left corner of this component.
- */
- public abstract Point getLocationOnScreen();
-
- /**
- * Get the size of this component.
- *
- * @return the <code>Dimension</code> giving the height and width of this
- * component, <code>null</code> if the component is not on the screen
- */
- public abstract Dimension getSize();
-
- /**
- * Indicates whether or not this component is enabled.
- *
- * @return <code>true</code> if the component is enabled,
- * else <code>false</code>
- *
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#ENABLED
- */
- public abstract boolean isEnabled();
-
- /**
- * Indicates whether or not this component can accept focus.
- *
- * @return <code>true</code> if the component accepts focus,
- * else <code>false</code>
- *
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#FOCUSABLE
- * @see AccessibleState#FOCUSED
- */
- public abstract boolean isFocusTraversable();
-
- /**
- * Indicates whether or not this component is visible by checking
- * the visibility of this component and its ancestors.
- * <p>
- * The component may be hidden on screen by another component like
- * pop-up help.
- *
- * @return <code>true</code> if component and ancestors are visible,
- * else <code>false</code>
- *
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#SHOWING
- */
- public abstract boolean isShowing();
-
- /**
- * Indicates whether or not this component is visible or intends to be
- * visible although one of its ancestors may not be.
- *
- * @return <code>true</code> if the component is visible,
- * else <code>false</code>
- *
- * @see AccessibleContext#getAccessibleStateSet()
- * @see AccessibleState#VISIBLE
- */
- public abstract boolean isVisible();
-
- /**
- * Removes the specified listener from this component.
- *
- * @param listener the listener to remove
- */
- public abstract void removeFocusListener(FocusListener listener);
-
- /**
- * If this method is called this component will attempt to gain focus,
- * but if it cannot accept focus nothing happens.
- */
- public abstract void requestFocus();
-
- /**
- * Set the background color of this component to the specified color.
- *
- * @param color the color to set the background to
- */
- public abstract void setBackground(Color color);
-
- /**
- * Set the bounds of this component to the specified height and width.
- *
- * @param rectangle the object representing the height, width, and location
- * of this component relative to its parent.
- */
- public abstract void setBounds(Rectangle rectangle);
-
- /**
- * Set the cursor of the component.
- *
- * @param cursor the graphical representation of the cursor to use
- */
- public abstract void setCursor(Cursor cursor);
-
- /**
- * Set this component to an enabled or disabled state.
- *
- * @param b if <code>true</code> enable the component, else disable it
- *
- * @see #isEnabled()
- */
- public abstract void setEnabled(boolean b);
-
- /**
- * Set the font of this component.
- *
- * @param font the font to use
- */
- public abstract void setFont(Font font);
-
- /**
- * Set the foreground color of this component.
- *
- * @param color the color to set the foreground to
- */
- public abstract void setForeground(Color color);
-
- /**
- * Set the location of this component relative to its parent. The point
- * specified represents the top-left corner of this component.
- *
- * @param point the top-left corner of this component relative to the parent
- */
- public abstract void setLocation(Point point);
-
- /**
- * Set the size of this component to the given dimensions.
- *
- * @param dimension the new size of the component
- *
- * @see #getSize()
- */
- public abstract void setSize(Dimension dimension);
-
- /**
- * Set the visible state of this component.
- *
- * @param b if <code>true</code> make the component visible, else make
- * it invisible
- *
- * @see #isVisible()
- */
- public abstract void setVisible(boolean b);
-}
+public interface AccessibleComponent
+{
+ /**
+ * Get the background color of this component.
+ *
+ * @return the background color of this component, or null if not supported
+ * @see #setBackground(Color)
+ */
+ Color getBackground();
+
+ /**
+ * Set the background color of this component to the specified color.
+ *
+ * @param color the color to set the background to
+ * @see #getBackground()
+ */
+ void setBackground(Color color);
+
+ /**
+ * Get the foreground color of this component.
+ *
+ * @return the foreground color of this component, or null if not supported
+ * @see #setForeground(Color)
+ */
+ Color getForeground();
+
+ /**
+ * Set the foreground color of this component.
+ *
+ * @param color the color to set the foreground to
+ * @see #getForeground()
+ */
+ void setForeground(Color color);
+
+ /**
+ * Get the cursor of this component.
+ *
+ * @return the Cursor of this component, or null if not supported
+ * @see #setCursor(Cursor)
+ */
+ Cursor getCursor();
+
+ /**
+ * Set the cursor of the component.
+ *
+ * @param cursor the graphical representation of the cursor to use
+ * @see #getCursor()
+ */
+ void setCursor(Cursor cursor);
+
+ /**
+ * Get the font of this component
+ *
+ * @return the font of the component, or null if not supported
+ * @see setFont(Font)
+ */
+ Font getFont();
+
+ /**
+ * Set the font of this component.
+ *
+ * @param font the font to use
+ * @see #getFont()
+ */
+ void setFont(Font font);
+
+ /**
+ * Get the <code>FontMetrics</code> of the specified font in this component.
+ *
+ * @param font the specified font
+ * @return the metrics for the specified font, or null if not supported
+ * @see #getFont()
+ */
+ // XXX What happens if font is null?
+ FontMetrics getFontMetrics(Font font);
+
+ /**
+ * Indicates whether or not this component is enabled. An object which is
+ * enabled also has AccessibleState.ENABLED in its StateSet.
+ *
+ * @return true if the component is enabled
+ * @see #setEnabled(boolean)
+ * @see AccessibleContext#getAccessibleStateSet()
+ * @see AccessibleState#ENABLED
+ */
+ boolean isEnabled();
+
+ /**
+ * Set this component to an enabled or disabled state.
+ *
+ * @param b true to enable the component, else disable it
+ * @see #isEnabled()
+ */
+ void setEnabled(boolean b);
+
+ /**
+ * Indicates whether or not this component is visible or intends to be
+ * visible although one of its ancestors may not be. An object which is
+ * visible also has AccessibleState.VISIBLE in its StateSet. Check
+ * <code>isShowing()</code> to see if the object is on screen.
+ *
+ * @return true if the component is visible
+ * @see #setVisible(boolean)
+ * @see AccessibleContext#getAccessibleStateSet()
+ * @see AccessibleState#VISIBLE
+ */
+ boolean isVisible();
+
+ /**
+ * Set the visible state of this component.
+ *
+ * @param b true to make the component visible, else hide it
+ * @see #isVisible()
+ */
+ void setVisible(boolean b);
+
+ /**
+ * Indicates whether or not this component is visible by checking
+ * the visibility of this component and its ancestors. The component may
+ * be hidden on screen by another component like pop-up help. An object
+ * which is showing on screen also has AccessibleState.SHOWING in its
+ * StateSet.
+ *
+ * @return true if component and ancestors are visible
+ * @see #isVisible()
+ * @see #setVisible(boolean)
+ * @see AccessibleContext#getAccessibleStateSet()
+ * @see AccessibleState#SHOWING
+ */
+ boolean isShowing();
+
+ /**
+ * Tests whether or not the specified point is contained within
+ * this component. The coordinates are specified relative to this
+ * component's coordinate system.
+ *
+ * @param point the Point to locate
+ * @return true if the point is within this component
+ * @see #getBounds()
+ */
+ // XXX What happens if point is null?
+ boolean contains(Point point);
+
+ /**
+ * Get the location of this component in the screen's coordinate space.
+ * The point specified is the top-left corner of this component.
+ *
+ * @return the location on screen, or null if off-screen
+ * @see #getBounds()
+ * @see #getLocation()
+ */
+ Point getLocationOnScreen();
+
+ /**
+ * Get the location of this component in the parent's coordinate system.
+ * The point specified is the top-left corner of this component.
+ *
+ * @return the location in the parent on screen, or null if off-screen
+ * @see #getBounds()
+ * @see #getLocationOnScreen()
+ * @see #setLocation(Point)
+ */
+ Point getLocation();
+
+ /**
+ * Set the location of this component relative to its parent. The point
+ * specified represents the top-left corner of this component.
+ *
+ * @param point the top-left corner of this component relative to the parent
+ * @see #getLocation()
+ */
+ // XXX What happens if point is null?
+ void setLocation(Point point);
+
+ /**
+ * Get the bounds of this component relative to its parent - it's width,
+ * height, and relative location to its parent.
+ *
+ * @return the bounds of this component, or null if not on screen
+ * @see #contains(Point)
+ */
+ Rectangle getBounds();
+
+ /**
+ * Set the bounds of this component to the specified height and width, and
+ * relative location to its parent.
+ *
+ * @param rectangle the new height, width, and relative location
+ */
+ // XXX What happens if rectangle is null?
+ void setBounds(Rectangle rectangle);
+
+ /**
+ * Get the size of this component - it's width and height.
+ *
+ * @return the dimensions of this component, or null if not on screen
+ * @see #setSize(Dimension)
+ */
+ Dimension getSize();
+
+ /**
+ * Set the size of this component to the given dimensions.
+ *
+ * @param dimension the new size of the component
+ * @see #getSize()
+ */
+ // XXX What happens if dimension is null?
+ void setSize(Dimension dimension);
+
+ /**
+ * If a object exists at the specified point which is a child of this
+ * parent component, and it is accessible, then it is returned.
+ *
+ * @param point the location within this component's coordinate system
+ * @return the accessible child object at that point, or null
+ */
+ Accessible getAccessibleAt(Point point);
+
+ /**
+ * Indicates whether or not this component can accept focus. An object
+ * which can accept focus also has AccessibleState.FOCUSABLE in its
+ * StateSet.
+ *
+ * @return true if the component can accept focus
+ * @see AccessibleContext#getAccessibleStateSet()
+ * @see AccessibleState#FOCUSABLE
+ * @see AccessibleState#FOCUSED
+ */
+ boolean isFocusTraversable();
+
+ /**
+ * If this method is called this component will attempt to gain focus,
+ * but if it cannot accept focus nothing happens. On success, the StateSet
+ * will contain AccessibleState.FOCUSED
+ *
+ * @see #isFocusTraversable()
+ * @see AccessibleState#FOCUSED
+ */
+ void requestFocus();
+
+ /**
+ * Adds the specified listener to this component.
+ *
+ * @param listener the listener to add to this component
+ * @see #removeFocusListener(FocusListener)
+ */
+ void addFocusListener(FocusListener listener);
+
+ /**
+ * Removes the specified listener from this component.
+ *
+ * @param listener the listener to remove
+ * @see #addFocusListener(FocusListener)
+ */
+ void removeFocusListener(FocusListener listener);
+} // interface AccessibleComponent
diff --git a/javax/accessibility/AccessibleContext.java b/javax/accessibility/AccessibleContext.java
index e69de29bb..aeffe341a 100644
--- a/javax/accessibility/AccessibleContext.java
+++ b/javax/accessibility/AccessibleContext.java
@@ -0,0 +1,588 @@
+/* AccessibleContext.java -- the context of an accessible object
+ Copyright (C) 2002 Free Software Foundation
+
+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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.Locale;
+
+/**
+ * The minimum information that all accessible objects return. This includes
+ * name, description, role, and state of the object, parents and children,
+ * and any other useful information. If a component supports further details,
+ * it should implement one of the following:<ul>
+ * <li>{@link AccessibleAction} - the object can perform actions</li>
+ * <li>{@link AccessibleComponent} - the object has a graphical
+ * representation</li>
+ * <li>{@link AccessibleSelection} - the object allows its children to be
+ * selected</li>
+ * <li>{@link AccessibleText} - the object represents editable text</li>
+ * <li>{@link AccessibleValue} - the object represents a numerical value</li>
+ * </ul>
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public abstract class AccessibleContext
+{
+ /**
+ * Constant used when the accessible name has changed. Both the old and new
+ * values are listed in the event.
+ *
+ * @see #getAccessibleName()
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_NAME_PROPERTY
+ = "AccessibleName";
+
+ /**
+ * Constanat used when the accessible description has changed. Both the old
+ * and new values are listed in the event.
+ *
+ * @see #getAccessibleDescription()
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_DESCRIPTION_PROPERTY
+ = "AccessibleDescription";
+
+ /**
+ * Constant used when the accessibleStateSet has changed. Both the old and
+ * new values are listed in the event, although either may be null if a
+ * state was disabled at that time.
+ *
+ * @see #getAccessibleStateSet()
+ * @see AccessibleState
+ * @see AccessibleStateSet
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_STATE_PROPERTY
+ = "AccessibleState";
+
+ /**
+ * Constant used when the accessibleValue has changed. Both the old and new
+ * values are listed in the event.
+ *
+ * @see #getAccessibleValue()
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_VALUE_PROPERTY
+ = "AccessibleValue";
+
+ /**
+ * Constant used when the accessibleSelection has changed. Both the old and
+ * new values of the event are reserved for future use.
+ *
+ * @see #getAccessibleSelection()
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_SELECTION_PROPERTY
+ = "AccessibleSelection";
+
+ /**
+ * Constant used when the accessibleText has changed. Both the old and new
+ * values of the event are reserved for future use.
+ *
+ * @see #getAccessibleText()
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_TEXT_PROPERTY
+ = "AccessibleText";
+
+ /**
+ * Constant used when the accessibleText caret has changed. Both the old and
+ * new values are listed in the event.
+ *
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_CARET_PROPERTY
+ = "AccessibleCaret";
+
+ /**
+ * Constant used when the visible data has changed. Both the old and new
+ * values of the event are reserved for future use.
+ *
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY
+ = "AccessibleVisibleData";
+
+ /**
+ * Constant used when children are added or removed. On addition, the new
+ * value of the event holds the new child; on removal, the old value holds
+ * the removed child.
+ *
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_CHILD_PROPERTY
+ = "AccessibleChild";
+
+ /**
+ * Constant used when active descendent of a component has changed. Both
+ * the old and new values are listed in the event.
+ *
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY
+ = "AccessibleActiveDescendant";
+
+ /**
+ * Constant used when the accessible table caption has changed. Both the
+ * old and new values are listed in the event.
+ *
+ * @see Accessible
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_CAPTION_CHANGED
+ = "accessibleTableCaptionChanged";
+
+ /**
+ * Constant used when the accessible table summary has changed. Both the
+ * old and new values are listed in the event.
+ *
+ * @see Accessible
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_SUMMARY_CHANGED
+ = "accessibleTableSummaryChanged";
+
+ /**
+ * Constant used when the accessible table model has changed. Only the new
+ * value of the event has meaning.
+ *
+ * @see AccessibleTable
+ * @see AccessibleTableModelChange
+ */
+ public static final String ACCESSIBLE_TABLE_MODEL_CHANGED
+ = "accessibleTableModelChanged";
+
+ /**
+ * Constant used when the accessible table row header has changed. Only the
+ * new value of the event has meaning.
+ *
+ * @see AccessibleTable
+ * @see AccessibleTableModelChange
+ */
+ public static final String ACCESSIBLE_TABLE_ROW_HEADER_CHANGED
+ = "accessibleTableRowHeaderChanged";
+
+ /**
+ * Constant used when the accessible table row description has changed. Only
+ * the new value of the event has meaning.
+ *
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED
+ = "accessibleTableRowDescriptionChanged";
+
+ /**
+ * Constant used when the accessible table column header has changed. Only
+ * the new value of the event has meaning.
+ *
+ * @see AccessibleTable
+ * @see AccessibleTableModelChange
+ */
+ public static final String ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED
+ = "accessibleTableColumnHeaderChanged";
+
+ /**
+ * Constant used when the accessible table column description has changed.
+ * Only the new value of the event has meaning.
+ *
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED
+ = "accessibleTableColumnDescriptionChanged";
+
+ /**
+ * Constant used when supported set of actions has changed. Both the old
+ * and new values are listed in the event.
+ *
+ * @see AccessibleAction
+ */
+ public static final String ACCESSIBLE_ACTION_PROPERTY
+ = "accessibleActionProperty";
+
+ /**
+ * Constant used when a hypertext element received focus. Both the old
+ * and new values are listed in the event, with -1 indicating that no link
+ * had focus.
+ *
+ * @see AccessibleHyperlink
+ */
+ public static final String ACCESSIBLE_HYPERTEXT_OFFSET
+ = "AccessibleHypertextOffset";
+
+ /**
+ * The accessible parent of this object.
+ *
+ * @see #getAccessibleParent()
+ * @see #setAccessibleParent(Accessible)
+ */
+ protected Accessible accessibleParent;
+
+ /**
+ * A localized string naming this object.
+ *
+ * @see #getAccessibleName()
+ * @see #setAccessibleName(String)
+ */
+ protected String accessibleName;
+
+ /**
+ * A localized string describing this object.
+ *
+ * @see #getAccessibleDescription()
+ * @see #setAccessibleDescription(String)
+ */
+ protected String accessibleDescription;
+
+ /**
+ * The listener tool.
+ *
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ * @see #removePropertyChangeListener(PropertyChangeListener)
+ * @see #firePropertyChange(String, Object, Object)
+ */
+ private final PropertyChangeSupport listeners
+ = new PropertyChangeSupport(this);
+
+ /**
+ * Default constructor.
+ */
+ public AccessibleContext()
+ {
+ }
+
+ /**
+ * Get the localized name of the object. For example, a label may just
+ * return the text of the label, while an entry field for city may return
+ * "city" in en_US.
+ *
+ * @return the accessible object's name, or null if it is unnamed
+ * @see #setAccessibleName(String)
+ */
+ public String getAccessibleName()
+ {
+ return accessibleName;
+ }
+
+ /**
+ * Set the localized name of the object. This will fire a
+ * PropertyChangeEvent with ACCESSIBLE_NAME_PROPERTY.
+ *
+ * @param s the new name
+ * @see #getAccessibleName()
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void setAccessibleName(String s)
+ {
+ listeners.firePropertyChange(ACCESSIBLE_NAME_PROPERTY, accessibleName, s);
+ accessibleName = s;
+ }
+
+ /**
+ * Get the localized description of the object. For example, a 'Cancel'
+ * button may be described as "Ignore changes and close dialog box" in
+ * en_US.
+ *
+ * @return the accessible object's description, or null if there is none
+ * @see #setAccessibleDescription(String)
+ */
+ public String getAccessibleDescription()
+ {
+ return accessibleDescription;
+ }
+
+ /**
+ * Set the localized name of the object. This will fire a
+ * PropertyChangeEvent with ACCESSIBLE_DESCRIPTION_PROPERTY.
+ *
+ * @param s the new description
+ * @see #getAccessibleDescription()
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void setAccessibleDescription(String s)
+ {
+ listeners.firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY,
+ accessibleDescription, s);
+ accessibleDescription = s;
+ }
+
+ /**
+ * Gets the role of this object. For example, a button serves the role of
+ * AccessibleRole.PUSH_BUTTON. This allows assistive technologies to funnel
+ * similar objects into the same assistance classes. Note that the class
+ * is extensible, to define new roles if necessary.
+ *
+ * @return the role of the object
+ * @see AccessibleRole
+ */
+ public abstract AccessibleRole getAccessibleRole();
+
+ /**
+ * Gets the state set of this object. A change in the state of the object
+ * will fire a PropertyChangeEvent for ACCESSIBLE_STATE_PROPERTY.
+ *
+ * @return the current state of the object
+ * @see AccessibleState
+ * @see AccessibleStateSet
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public abstract AccessibleStateSet getAccessibleStateSet();
+
+ /**
+ * Return the accessible parent of this object.
+ *
+ * @return the accessible parent, or null if there is none
+ */
+ public Accessible getAccessibleParent()
+ {
+ return accessibleParent;
+ }
+
+ /**
+ * Sets the accessible parent of this object. This should only be used when
+ * the current parent object should not be the accessible parent; only the
+ * parent of the accessible child should call this method.
+ *
+ * @param a the new parent
+ */
+ public void setAccessibleParent(Accessible a)
+ {
+ accessibleParent = a;
+ }
+
+ /**
+ * Gets the index of this object within its accessible parent.
+ *
+ * @return the 0-based index, or -1 if there is no accessible parent
+ * @see #getAccessibleParent()
+ * @see #getAccessibleChildrenCount()
+ * @see #getAccessibleChild(int)
+ */
+ public abstract int getAccessibleIndexInParent();
+
+ /**
+ * Returns the number of accessible children of this object.
+ *
+ * @return the number of accessible children
+ * @see #getAccessibleChild(int)
+ */
+ public abstract int getAccessibleChildrenCount();
+
+ /**
+ * Returns the specified accessible chile.
+ *
+ * @param i the 0-based index to get
+ * @return the child, or null if out of bounds
+ * @see #getAccessibleChildrenCount()
+ */
+ public abstract Accessible getAccessibleChild(int i);
+
+ /**
+ * Gets the component locale, deferring to the parent if one is not declared.
+ *
+ * @return the locale
+ * @throws IllegalComponentStateException if there is no locale or parent
+ */
+ public abstract Locale getLocale();
+
+ /**
+ * Add a PropertyChangeListener to the listener list. This listener will
+ * be notified of all property changes to the accessible object.
+ *
+ * @param l the listener to add
+ * @see #ACCESSIBLE_NAME_PROPERTY
+ * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
+ * @see #ACCESSIBLE_STATE_PROPERTY
+ * @see #ACCESSIBLE_VALUE_PROPERTY
+ * @see #ACCESSIBLE_SELECTION_PROPERTY
+ * @see #ACCESSIBLE_TEXT_PROPERTY
+ * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
+ * @see #removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(PropertyChangeListener l)
+ {
+ listeners.addPropertyChangeListener(l);
+ }
+
+ /**
+ * Remove a PropertyChangeListener from the listener list.
+ *
+ * @param l the listener to remove
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(PropertyChangeListener l)
+ {
+ listeners.removePropertyChangeListener(l);
+ }
+
+ /**
+ * Get any supported accessible actions. The default implementation returns
+ * null.
+ *
+ * @return the supported action, or null
+ * @see AccessibleAction
+ */
+ public AccessibleAction getAccessibleAction()
+ {
+ return null;
+ }
+
+ /**
+ * Get any supported accessible compoent. The default implementation returns
+ * null.
+ *
+ * @return the supported component, or null
+ * @see AccessibleComponent
+ */
+ public AccessibleComponent getAccessibleComponent()
+ {
+ return null;
+ }
+
+ /**
+ * Get any supported accessible selection. The default implementation returns
+ * null.
+ *
+ * @return the supported selection, or null
+ * @see AccessibleSelection
+ */
+ public AccessibleSelection getAccessibleSelection()
+ {
+ return null;
+ }
+
+ /**
+ * Get any supported accessible text. The default implementation returns
+ * null.
+ *
+ * @return the supported text, or null
+ * @see AccessibleText
+ */
+ public AccessibleText getAccessibleText()
+ {
+ return null;
+ }
+
+ /**
+ * Get any supported accessible editable text. The default implementation
+ * returns null.
+ *
+ * @return the supported editable text, or null
+ * @see AccessibleEditableText
+ */
+ public AccessibleEditableText getAccessibleEditableText()
+ {
+ return null;
+ }
+
+ /**
+ * Get any supported accessible value. The default implementation returns
+ * null.
+ *
+ * @return the supported value, or null
+ * @see AccessibleValue
+ */
+ public AccessibleValue getAccessibleValue()
+ {
+ return null;
+ }
+
+ /**
+ * Get all supported accessible icons. The default implementation returns
+ * null.
+ *
+ * @return the supported icons, or null
+ * @see AccessibleIcon
+ */
+ public AccessibleIcon[] getAccessibleIcon()
+ {
+ return null;
+ }
+
+ /**
+ * Get any supported accessible relation set. The default implementation
+ * returns null.
+ *
+ * @return the supported relation set, or null
+ * @see AccessibleRelationSet
+ */
+ public AccessibleRelationSet getAccessibleRelationSet()
+ {
+ return null;
+ }
+
+ /**
+ * Get any supported accessible table. The default implementation returns
+ * null.
+ *
+ * @return the supported table, or null
+ * @see AccessibleTable
+ */
+ public AccessibleTable getAccessibleTable()
+ {
+ return null;
+ }
+
+ /**
+ * Fire an event to report property changes. This is intended for use by
+ * the accessible objects, not general application programs. If oldValue and
+ * newValue differ, and the listenter list is not empty, a PropertyChange
+ * event is fired to each listener.
+ *
+ * @param name the property name
+ * @param oldValue the prior value
+ * @param newValue the updated value
+ * @see PropertyChangeSupport
+ * @see #addPropertyChangeListener(PropertyChangeListener)
+ * @see #removePropertyChangeListener(PropertyChangeListener)
+ * @see #ACCESSIBLE_NAME_PROPERTY
+ * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
+ * @see #ACCESSIBLE_STATE_PROPERTY
+ * @see #ACCESSIBLE_VALUE_PROPERTY
+ * @see #ACCESSIBLE_SELECTION_PROPERTY
+ * @see #ACCESSIBLE_TEXT_PROPERTY
+ * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
+ */
+ public void firePropertyChange(String name, Object oldValue, Object newValue)
+ {
+ listeners.firePropertyChange(name, oldValue, newValue);
+ }
+} // class AccessibleContext
diff --git a/javax/accessibility/AccessibleEditableText.java b/javax/accessibility/AccessibleEditableText.java
new file mode 100644
index 000000000..28d07452d
--- /dev/null
+++ b/javax/accessibility/AccessibleEditableText.java
@@ -0,0 +1,144 @@
+/* AccessibleEditableText.java -- aids in accessibly for editable text
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+// XXX Waiting on javax.swing support.
+// import javax.swing.test.AttributeSet;
+
+/**
+ * Objects which present editable textual information on the display should
+ * implement this interface. Accessibility software can use the
+ * implementations of this interface to change the content, attributes,
+ * and spacial location of the text.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleEditableText()</code> method
+ * should return <code>null</code> if an object does not implement this
+ * interface.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleText()
+ * @see AccessibleContext#getAccessibleEditableText()
+ * @since 1.2
+ * @status updated to 1.4, except for javax.swing support
+ */
+public interface AccessibleEditableText extends AccessibleText
+{
+ /**
+ * Set the text contents to the given string.
+ *
+ * @param s the new text
+ */
+ // XXX What happens if s is null?
+ void setTextContents(String s);
+
+ /**
+ * Inserts the given string at the specified location.
+ *
+ * @param index the index for insertion
+ * @param s the new text
+ */
+ // XXX What happens if index is out of bounds, or s is null?
+ void insertTextAtIndex(int index, String s);
+
+ /**
+ * Return the text between two points.
+ *
+ * @param start the start position, inclusive
+ * @param end the end position, exclusive
+ */
+ // XXX What happens if indices are out of bounds?
+ String getTextRange(int start, int end);
+
+ /**
+ * Delete the text between two points.
+ *
+ * @param start the start position, inclusive
+ * @param end the end position, exclusive
+ */
+ // XXX What happens if indices are out of bounds?
+ String delete(int start, int end);
+
+ /**
+ * Cut the text between two points to the system clipboard.
+ *
+ * @param start the start position, inclusive
+ * @param end the end position, exclusive
+ */
+ // XXX What happens if indices are out of bounds?
+ String cut(int start, int end);
+
+ /**
+ * Paste the text from the system clipboard at the given index.
+ *
+ * @param start the start position
+ */
+ // XXX What happens if start is out of bounds?
+ void paste(int start);
+
+ /**
+ * Replace the text between two points with the given string.
+ *
+ * @param start the start position, inclusive
+ * @param end the end position, exclusive
+ * @param s the string to paste
+ */
+ // XXX What happens if indices are out of bounds, or s is null?
+ void replaceText(int start, int end, String s);
+
+ /**
+ * Select the text between two points.
+ *
+ * @param start the start position, inclusive
+ * @param end the end position, exclusive
+ */
+ // XXX What happens if indices are out of bounds?
+ void selectText(int start, int stop);
+
+ /**
+ * Set the attributes of text between two points.
+ *
+ * @param start the start position, inclusive
+ * @param end the end position, exclusive
+ * @param s the new attribute set for the range
+ */
+ // XXX What happens if indices are out of bounds, or s is null?
+ // XXX Waiting on javax.swing support.
+ // void setAttributes(int start, int end, AttributeSet s);
+} // interface AccessibleEditableText
diff --git a/javax/accessibility/AccessibleExtendedComponent.java b/javax/accessibility/AccessibleExtendedComponent.java
new file mode 100644
index 000000000..3538c2af9
--- /dev/null
+++ b/javax/accessibility/AccessibleExtendedComponent.java
@@ -0,0 +1,78 @@
+/* AccessibleExtendedComponent.java -- aids in extended component access
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+/**
+ * Objects which present graphical components with extensions such as key
+ * bindings or tool-tips should implement this interface. Accessibility
+ * software can use the implementations of this interface to display the
+ * extended information of the component.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleComponent()</code> method
+ * should return an instance of this interface only when it is supported.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleComponent()
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public interface AccessibleExtendedComponent extends AccessibleComponent
+{
+ /**
+ * Returns the tool-tip text for this component.
+ *
+ * @return the tool-tip, or null if not supported
+ */
+ String getToolTipText();
+
+ /**
+ * Returns the title border text for this component.
+ *
+ * @return the titled border text, or null if not supported
+ */
+ String getTitledBorderText();
+
+ /**
+ * Returns the accessibility key bindings for this component.
+ *
+ * @return the key bindings, or null if not supported
+ */
+ AccessibilityKeyBinding getAccessibilityKeyBinding();
+} // interface AccessibleExtendedComponent
diff --git a/javax/accessibility/AccessibleExtendedTable.java b/javax/accessibility/AccessibleExtendedTable.java
new file mode 100644
index 000000000..5633e7b69
--- /dev/null
+++ b/javax/accessibility/AccessibleExtendedTable.java
@@ -0,0 +1,81 @@
+/* AccessibleExtendedTable.java -- aids in extended table access
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+/**
+ * Objects which present 2-D tables with the extension of a flat address
+ * space should implement this interface. Accessibility software can use the
+ * implementations of this interface to better manipulate the table.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleTable()</code> method
+ * should return an instance of this interface only when it is supported.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleTable()
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public interface AccessibleExtendedTable extends AccessibleTable
+{
+ /**
+ * Returns the row number of an index in the table.
+ *
+ * @param index the cell index, in row-major form from (0,0)
+ * @return the row number, or -1 if out of bounds
+ */
+ int getAccessibleRow(int index)
+
+ /**
+ * Returns the column number of an index in the table.
+ *
+ * @param index the cell index, in row-major form from (0,0)
+ * @return the column number, or -1 if out of bounds
+ */
+ int getAccessibleColumn(int index)
+
+ /**
+ * Returns the cell number for a row-major address from (0,0).
+ *
+ * @param r the row
+ * @param c the column
+ * @return the cell index
+ */
+ int getAccessibleIndex(int r, int c);
+} // interface AccessibleExtendedTable
diff --git a/javax/accessibility/AccessibleHyperlink.java b/javax/accessibility/AccessibleHyperlink.java
index e69de29bb..a587e9908 100644
--- a/javax/accessibility/AccessibleHyperlink.java
+++ b/javax/accessibility/AccessibleHyperlink.java
@@ -0,0 +1,139 @@
+/* AccessibleHyperlink.java -- aids in accessibly navigating hypertext
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+/**
+ * This object encapsulates actions associated with navigating hypertext.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleText
+ * @see AccessibleContext#getAccessibleText()
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public abstract class AccessibleHyperlink implements AccessibleAction
+{
+ /**
+ * The default constructor.
+ */
+ public AccessibleHyperlink()
+ {
+ }
+
+ /**
+ * Returns whether the document the link references is still valid, as the
+ * association may have changed with a text edit.
+ *
+ * @return true if the link is valid with respect to the AccessibleHypertext
+ */
+ public abstract boolean isValid();
+
+ /**
+ * Get the number possible actions for this object, starting from 0. In
+ * general, a hypertext link has only one action, except for an image map,
+ * so there isn't really a default action.
+ *
+ * @return the 0-based number of actions
+ */
+ public abstract int getAccessibleActionCount();
+
+ /**
+ * Perform the specified action. Does nothing if out of bounds.
+ *
+ * @param i the action to perform, 0-based
+ * @return true if the action was performed
+ * @see #getAccessibleActionCount()
+ */
+ public abstract boolean doAccessibleAction(int i);
+
+ /**
+ * Get the anchor text of the link, or null if the index is out of bounds.
+ * For example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page&lt;/a&gt;
+ * would return "GNU Home Page", while &lt;a HREF="#top"&gt;
+ * &lt;img src="top-hat.png" alt="top hat"&gt;&lt;/a&gt; would return
+ * "top hat".
+ *
+ * @param i the link to retrieve, 0-based
+ * @return the link anchor text
+ * @see #getAccessibleActionCount()
+ */
+ String getAccessibleActionDescription(int i);
+
+ /**
+ * Get the link location, or null if the index is out of bounds. For
+ * example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page&lt;/a&gt;
+ * would return a java.net.URL("http://www.gnu.org/").
+ *
+ * @param i the link to retrieve, 0-based
+ * @return the link location
+ * @see #getAccessibleActionCount()
+ */
+ public abstract String getAccessibleActionObject(int i);
+
+ /**
+ * Get the anchor appropriate for the link, or null if the index is out of
+ * bounds. For example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page
+ * &lt;/a&gt; would return "GNU Home Page", while &lt;a HREF="#top"&gt;
+ * &lt;img src="top-hat.png" alt="top hat"&gt;&lt;/a&gt; would return
+ * an ImageIcon("top-hat.png", "top hat").
+ *
+ * @param i the link to retrieve, 0-based
+ * @return the link anchor object
+ * @see #getAccessibleActionCount()
+ */
+ public abstract String getAccessibleActionAnchor(int i);
+
+ /**
+ * Gets the character index where this link starts in the parent hypertext
+ * document.
+ *
+ * @return the starting index
+ */
+ public abstract int getStartIndex();
+
+ /**
+ * Gets the character index where this link ends in the parent hypertext
+ * document.
+ *
+ * @return the ending index
+ */
+ public abstract int getEndIndex();
+} // class AccessibleAction
diff --git a/javax/accessibility/AccessibleHypertext.java b/javax/accessibility/AccessibleHypertext.java
index 891d0d59b..ae0d150bd 100644
--- a/javax/accessibility/AccessibleHypertext.java
+++ b/javax/accessibility/AccessibleHypertext.java
@@ -1,6 +1,5 @@
-/* AccessibleHypertext.java -- Java interface for aiding in accessibly rendering
- other Java components
- Copyright (C) 2000 Free Software Foundation, Inc.
+/* AccessibleHypertext.java -- aids in accessibly rendering hypertext
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -8,7 +7,7 @@ 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
@@ -36,45 +35,50 @@ 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 javax.accessibility;
/**
- * Allows an application to determine a set of hyperlinks for a
- * document and manipulate them.
- * <p>
- * The <code>AccessibleContext.getAccessibleText()</code> method
- * should return an object which extends <code>AccessibleHypertext</code>
- * if it supports this interface.
- *.
- * @see AccessibleContext.getAccessibleText()
+ * Objects which present hyperlinks in a document should implement this
+ * interface. Accessibility software can use the implementations of this
+ * interface to aid the user in navigating the links.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleText()</code> method
+ * should return an instance of this interface only when it is supported.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleText
+ * @see AccessibleContext#getAccessibleText()
+ * @since 1.2
+ * @status updated to 1.4
*/
-public interface AccessibleHypertext extends AccessibleText {
+public interface AccessibleHypertext extends AccessibleText
+{
+ /**
+ * Returns the number of links in the document, if any exist.
+ *
+ * @return the number of links, or -1
+ */
+ int getLinkCount();
+
+ /**
+ * Returns link object denoted by the number <code>i</code> in this
+ * document, or null if i is out of bounds.
+ *
+ * @param i the ith hyperlink of the document
+ * @return link object denoted by <code>i</code>
+ */
+ AccessibleHyperlink getLink(int i);
- /**
- * Returns link object denoted by the number <code>i</code> in this
- * document.
- *
- * @param i the ith hyperlink of the document
- * @return link object denoted by <code>i</code>
- */
- public abstract AccessibleHyperlink getLink(int i);
-
- /**
- * Returns the number of links in the document if any exist. When
- * no links exist, returns -1.
- *
- * @return the number of links
- */
- public abstract int getLinkCount();
-
- /**
- * Returns the link index for this character index into the
- * document if a hyperlink is associated with the character
- * specified by the given index. When no association exists,
- * returns -1.
- *
- * @param c the character index
- * @return the link index
- */
- public abstract int getLinkIndex(int c);
-}
+ /**
+ * Returns the link index for this character index if it resides within
+ * one of the hyperlinks of the document. If no association exists at that
+ * character, or c is out of bounds, returns -1.
+ *
+ * @param c the character index
+ * @return the link index, or -1
+ */
+ int getLinkIndex(int c);
+} // interface AccessibleHypertext
diff --git a/javax/accessibility/AccessibleIcon.java b/javax/accessibility/AccessibleIcon.java
new file mode 100644
index 000000000..c13b14009
--- /dev/null
+++ b/javax/accessibility/AccessibleIcon.java
@@ -0,0 +1,85 @@
+/* AccessibleIcon.java -- aids in accessibly rendering icons
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+/**
+ * Objects which have an associated icon, such as buttons, should implement
+ * this interface. Accessibility software can use the implementations of this
+ * interface to aid the user in navigating the links.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleIcon()</code> method should
+ * return <code>null</code> if an object does not implement this interface.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleIcon()
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public interface AccessibleIcon
+{
+ /**
+ * Returns a textual description of the icon and its purpose.
+ *
+ * @return the description, or null if there is none
+ */
+ String getAccessibleIconDescription();
+
+ /**
+ * Modify the textual description of the icon and its purpose.
+ *
+ * @param s the new descrption string
+ */
+ void setAccessibleIconDescription(String s);
+
+ /**
+ * Get the icon width.
+ *
+ * @return the width
+ */
+ int getAccessibleIconWidth();
+
+ /**
+ * Get the icon height.
+ *
+ * @return the height
+ */
+ int getAccessibleIconHeight();
+} // interface AccessibleIcon
diff --git a/javax/accessibility/AccessibleKeyBinding.java b/javax/accessibility/AccessibleKeyBinding.java
new file mode 100644
index 000000000..777f8b734
--- /dev/null
+++ b/javax/accessibility/AccessibleKeyBinding.java
@@ -0,0 +1,78 @@
+/* AccessibleKeyBinding.java -- aids in using keyboard navigation
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+/**
+ * Objects which have keyboard bindings for mneumonics or shortcuts should
+ * implement this interface. Accessibility software can use the
+ * implementations of this interface to aid the user in using the key
+ * bindings.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleKeyBinding()</code> method
+ * should return <code>null</code> if an object does not implement this
+ * interface.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleKeyBinding()
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public interface AccessibleKeyBinding
+{
+ /**
+ * Returns the count of key bindings for this object.
+ *
+ * @return the 0-based count, or -1 if there are none
+ */
+ int getAccessibleKeyBindingCount();
+
+ /**
+ * Return the numbered key binding, which can then be cast in an
+ * implementation dependent way to the appropriate object type. For example,
+ * swing uses <code>javax.swing.KeyStroke</code>. This returns null if i
+ * is out of bounds.
+ *
+ * @param i the 0-based index of key bindings
+ * @return the key binding
+ * @see #getAccessibleKeyBindingCount()
+ */
+ Object getAccessibleKeyBinding(int i);
+} // interface AccessibleKeyBinding
diff --git a/javax/accessibility/AccessibleRelation.java b/javax/accessibility/AccessibleRelation.java
new file mode 100644
index 000000000..68f1f646a
--- /dev/null
+++ b/javax/accessibility/AccessibleRelation.java
@@ -0,0 +1,220 @@
+/* AccessibleRelation.java -- the relation between accessible objects
+ Copyright (C) 2002 Free Software Foundation
+
+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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+/**
+ * The relation between one accessible object and one or more other objects.
+ * For example, a button may control an action. An AccessibleRelationSet
+ * summarizes all relations of the object. This strongly typed "enumeration"
+ * supports localized strings. If the constants of this class are not
+ * adequate, new ones may be added in a similar matter.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public class AccessibleRelation extends AccessibleBundle
+{
+ /**
+ * Indicates the object labels other objects.
+ *
+ * @see #getTarget()
+ * @see #CONTROLLER_FOR
+ * @see #CONTROLLED_BY
+ * @see #LABELED_BY
+ * @see #MEMBER_OF
+ */
+ public static final String LABEL_FOR = "labelFor";
+
+ /**
+ * Indicates the object is labeled by other objects.
+ *
+ * @see #getTarget()
+ * @see #CONTROLLER_FOR
+ * @see #CONTROLLED_BY
+ * @see #LABEL_FOR
+ * @see #MEMBER_OF
+ */
+ public static final String LABELED_BY = "labeledBy";
+
+ /**
+ * Indicates an object is a member of a group of target objects.
+ *
+ * @see #getTarget()
+ * @see #CONTROLLER_FOR
+ * @see #CONTROLLED_BY
+ * @see #LABEL_FOR
+ * @see #LABELED_BY
+ */
+ public static final String MEMBER_OF = "memberOf";
+
+ /**
+ * Indicates an object is a controller for other objects.
+ *
+ * @see #getTarget()
+ * @see #CONTROLLED_BY
+ * @see #LABEL_FOR
+ * @see #LABELED_BY
+ * @see #MEMBER_OF
+ */
+ public static final String CONTROLLER_FOR = "controllerFor";
+
+ /**
+ * Indicates an object is controlled by other objects.
+ *
+ * @see #getTarget()
+ * @see #CONTROLLER_FOR
+ * @see #LABEL_FOR
+ * @see #LABELED_BY
+ * @see #MEMBER_OF
+ */
+ public static final String CONTROLLED_BY = "controlledBy";
+
+ /** Indicates that the label target group has changed. */
+ public static final String LABEL_FOR_PROPERTY = "labelForProperty";
+
+ /** Indicates that the labelling objects have changed. */
+ public static final String LABELED_BY_PROPERTY = "labeledByProperty";
+
+ /** Indicates that group membership has changed. */
+ public static final String MEMBER_OF_PROPERTY = "memberOfProperty";
+
+ /** Indicates that the controller target group has changed. */
+ public static final String CONTROLLER_FOR_PROPERTY = "controllerForProperty";
+
+ /** Indicates that the controlling objects have changed. */
+ public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty";
+
+ /** An empty set of targets. */
+ private static final Object[] EMPTY_TARGETS = { };
+
+ /**
+ * The related objects.
+ *
+ * @see #getTarget()
+ * @see #setTarget(Object)
+ * @see #setTarget(Object[])
+ */
+ Object[] targets;
+
+ /**
+ * Create a new relation with a locale independent key, and no related
+ * objects.
+ *
+ * @param key the name of the role
+ * @see #toDisplayString(String, Locale)
+ */
+ public AccessibleRelation(String key)
+ {
+ this.key = key;
+ targets = EMPTY_TARGETS;
+ }
+
+ /**
+ * Create a new relation with a locale independent key, and a single related
+ * object.
+ *
+ * @param key the name of the role
+ * @param target the related object
+ * @see #toDisplayString(String, Locale)
+ */
+ public AccessibleRelation(String key, Object target)
+ {
+ this.key = key;
+ targets = new Object[] { target };
+ }
+
+ /**
+ * Create a new relation with a locale independent key, and the given
+ * related objects.
+ *
+ * @param key the name of the role
+ * @param targets the related objects
+ * @see #toDisplayString(String, Locale)
+ */
+ public AccessibleRelation(String key, Object[] targets)
+ {
+ this.key = key;
+ this.targets = targets == null ? EMPTY_TARGETS : targets;
+ }
+
+ /**
+ * Return the key for this relation.
+ *
+ * @return the key
+ * @see #CONTROLLER_FOR
+ * @see #CONTROLLED_BY
+ * @see #LABEL_FOR
+ * @see #LABELED_BY
+ * @see #MEMBER_OF
+ */
+ public String getKey()
+ {
+ return key;
+ }
+
+ /**
+ * Return the targets of this relation.
+ *
+ * @return the targets, may be empty, but never null
+ */
+ public Object[] getTarget()
+ {
+ return targets;
+ }
+
+ /**
+ * Set the target to a single object.
+ *
+ * @param target the new target
+ */
+ public void setTarget(Object target)
+ {
+ targets = new Object[] { target };
+ }
+
+ /**
+ * Set the target to an array of objects.
+ *
+ * @param targets the new targets
+ */
+ public void setTarget(Object[] targets)
+ {
+ this.targets = targets == null ? EMPTY_TARGETS : targets;
+ }
+} // class AccessibleRelation
diff --git a/javax/accessibility/AccessibleRelationSet.java b/javax/accessibility/AccessibleRelationSet.java
new file mode 100644
index 000000000..27dc58da3
--- /dev/null
+++ b/javax/accessibility/AccessibleRelationSet.java
@@ -0,0 +1,222 @@
+/* AccessibleRelationSet.java -- the combined relations of an accessible object
+ Copyright (C) 2002 Free Software Foundation
+
+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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+import java.util.Vector;
+
+/**
+ * Describes all relations of an accessible object. For example, an object
+ * by labeled by one object and control another.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see AccessibleRelation
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public class AccessibleRelationSet
+{
+ /**
+ * The list of relations, should be instances of AccessibleRelation. Don't
+ * set this to null.
+ *
+ * @see #add(AccessibleRelation)
+ * @see #addAll(AccessibleRelation[])
+ * @see #remove(AccessibleRelation)
+ * @see #contains(String)
+ * @see #get(String)
+ * @see #size()
+ * @see #toArray()
+ * @see #clear()
+ */
+ protected Vector relations = new Vector();
+
+ /**
+ * Create an empty relation set.
+ */
+ public AccessibleRelationSet()
+ {
+ }
+
+ /**
+ * Create a relation set initialized with the given relations, duplicates are
+ * ignored.
+ *
+ * @param relations the relations to insert
+ * @throws NullPointerException if relations is null
+ */
+ public AccessibleRelationSet(AccessibleRelation[] relations)
+ {
+ addAll(relations);
+ }
+
+ /**
+ * Add a new relation to the current set. If the relation is already in
+ * the set, the targets are merged with the existing relation, possibly
+ * resulting in an object being in the target list more than once. Do not
+ * add a relation with a null key, as it will cause problems later.
+ *
+ * @param relation the relation to add
+ * @return true if the set was modified, which is always the case
+ * @throws NullPointerException if relation is null
+ */
+ public boolean add(AccessibleRelation relation)
+ {
+ AccessibleRelation old = get(relation.key);
+ if (old == null)
+ return relations.add(relation);
+ if (old.targets.length == 0)
+ old.targets = relation.targets;
+ else if (relation.targets.length != 0)
+ {
+ Object[] t = new Object[old.targets.length + relation.targets.length];
+ System.arraycopy(old.targets, 0, t, 0, old.targets.length);
+ System.arraycopy(relation.targets, 0, t, old.targets.length,
+ relation.targets.length);
+ old.targets = t;
+ }
+ return true;
+ }
+
+ /**
+ * Add all of the relations to the current set. Duplicates are ignored.
+ *
+ * @param array the array of relations to add
+ * @throws NullPointerException if array is null or has null entries
+ */
+ public void addAll(AccessibleRelation[] array)
+ {
+ int i = array.length;
+ while (--i >= 0)
+ add(array[i]);
+ }
+
+ /**
+ * Remove a relation from the set. If a relation was removed, return true.
+ * Note that this uses AccessibleRelation.equals, which defaults to ==, so a
+ * relation with the same key may still exist in the set afterwords.
+ *
+ * @param relation the state to remove
+ * @return true if the set changed
+ */
+ public boolean remove(AccessibleRelation relation)
+ {
+ return relations.remove(relation);
+ }
+
+ /**
+ * Clear all relations in the set.
+ */
+ public void clear()
+ {
+ relations.clear();
+ }
+
+ /**
+ * Return the number of relations in the set.
+ *
+ * @return the set size
+ */
+ public int size()
+ {
+ return relations.size();
+ }
+
+ /**
+ * Check if the relation key is in the set.
+ *
+ * @param relation the relation to locate
+ * @return true if it is in the set
+ */
+ public boolean contains(String key)
+ {
+ int i = relations.size();
+ while (--i >= 0)
+ if (((AccessibleRelation) relations.get(i)).key.equals(key))
+ return true;
+ return false;
+ }
+
+ /**
+ * Get the relation that matches the key.
+ *
+ * @param relation the relation to locate
+ * @return the relation in the set, or null
+ */
+ public AccessibleRelation get(String key)
+ {
+ int i = relations.size();
+ while (--i >= 0)
+ {
+ AccessibleRelation r = (AccessibleRelation) relations.get(i);
+ if (r.key.equals(key))
+ return r;
+ }
+ return null;
+ }
+
+ /**
+ * Return the relation set as an array.
+ *
+ * @return an array of the current relations
+ */
+ public AccessibleRelation[] toArray()
+ {
+ AccessibleRelation[] result = new AccessibleRelation[relations.size()];
+ relations.toArray(result);
+ return result;
+ }
+
+ /**
+ * Return a localized, comma-separated string representing all relations
+ * in the set. This is in arbitrary order.
+ *
+ * @return the string representation
+ * @see AccessibleBundle#toDisplayString(String, Locale)
+ */
+ public String toString()
+ {
+ int i = relations.size();
+ if (i == 0)
+ return "";
+ // Pre-allocate an average of 10 chars per state.
+ StringBuffer b = new StringBuffer(i * 10);
+ while (--i >= 0)
+ b.append(relations.get(i)).append(',');
+ return b.substring(0, b.length() - 1);
+ }
+} // class AccessibleRelationSet
diff --git a/javax/accessibility/AccessibleResourceBundle.java b/javax/accessibility/AccessibleResourceBundle.java
index e69de29bb..01c2bcfdf 100644
--- a/javax/accessibility/AccessibleResourceBundle.java
+++ b/javax/accessibility/AccessibleResourceBundle.java
@@ -0,0 +1,74 @@
+/* AccessibleResourceBundle.java -- deprecated class
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+import java.util.ListResourceBundle;
+
+/**
+ * This class is deprecated. It once was used for localizing accessibility
+ * strings, and was never meant for external use anyway.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see AccessibleBundle.toDisplayString(String, Locale)
+ * @since 1.2
+ * @deprecated this class is no longer used
+ * @status updated to 1.4
+ */
+public class AccessibleResourceBundle extends ListResourceBundle
+{
+ /**
+ * Default constructor.
+ *
+ * @deprecated do not use this class
+ */
+ public AccessibleResourceBundle()
+ {
+ }
+
+ /**
+ * Returns the mapping between keys and display strings.
+ *
+ * @return null
+ * @deprecated do not use this class
+ */
+ public Object[][] getContents()
+ {
+ return null;
+ }
+} // class AccessibleResourceBundle
diff --git a/javax/accessibility/AccessibleRole.java b/javax/accessibility/AccessibleRole.java
index e69de29bb..86bfa6d38 100644
--- a/javax/accessibility/AccessibleRole.java
+++ b/javax/accessibility/AccessibleRole.java
@@ -0,0 +1,478 @@
+/* AccessibleRole.java -- the primary role of an accessible object
+ Copyright (C) 2002 Free Software Foundation
+
+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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+/**
+ * The role of an accessible object. For example, this could be "button" or
+ * "table". This strongly typed "enumeration" supports localized strings. If
+ * the constants of this class are not adequate, new ones may be added in a
+ * similar matter, while avoiding a public constructor.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public class AccessibleRole extends AccessibleBundle
+{
+ /** The object alerts the user about something. */
+ public static final AccessibleRole ALERT
+ = new AccessibleRole("alert");
+
+ /** The header for a column of data. */
+ public static final AccessibleRole COLUMN_HEADER
+ = new AccessibleRole("column header");
+
+ /**
+ * The object can be drawn into, and traps events.
+ *
+ * @see #FRAME
+ * @see #GLASS_PANE
+ * @see #LAYERED_PANE
+ */
+ public static final AccessibleRole CANVAS
+ = new AccessibleRole("canvas");
+
+ /**
+ * A list of choices, which may optionally allow the user to create a new
+ * choice.
+ */
+ public static final AccessibleRole COMBO_BOX
+ = new AccessibleRole("combo box");
+
+ /**
+ * An iconified frame in a desktop.
+ *
+ * @see #DESKTOP_PANE
+ * @see #INTERNAL_FRAME
+ */
+ public static final AccessibleRole DESKTOP_ICON
+ = new AccessibleRole("desktop icon");
+
+ /**
+ * A frame-like object clipped by a desktop pane.
+ *
+ * @see #DESKTOP_ICON
+ * @see #DESKTOP_PANE
+ * @see #FRAME
+ */
+ public static final AccessibleRole INTERNAL_FRAME
+ = new AccessibleRole("internal frame");
+
+ /**
+ * A pane which supports internal frames and their icons.
+ *
+ * @see #DESKTOP_ICON
+ * @see #INTERNAL_FRAME
+ */
+ public static final AccessibleRole DESKTOP_PANE
+ = new AccessibleRole("desktop pane");
+
+ /**
+ * A specialized pane for use in a dialog.
+ *
+ * @see #DIALOG
+ */
+ public static final AccessibleRole OPTION_PANE
+ = new AccessibleRole("option pane");
+
+ /**
+ * A top level window with no title or border.
+ *
+ * @see #FRAME
+ * @see #DIALOG
+ */
+ public static final AccessibleRole WINDOW
+ = new AccessibleRole("window");
+
+ /**
+ * A top level window with title, menu bar, border, and so forth. It is
+ * often the primary window of an application.
+ *
+ * @see #DIALOG
+ * @see #CANVAS
+ * @see #WINDOW
+ */
+ public static final AccessibleRole FRAME
+ = new AccessibleRole("frame");
+
+ /**
+ * A top level window title bar and border. It is limited compared to a
+ * frame, and is often a secondary window.
+ *
+ * @see #FRAME
+ * @see #WINDOW
+ */
+ public static final AccessibleRole DIALOG
+ = new AccessibleRole("dialog");
+
+ /** A specialized dialog for choosing a color. */
+ public static final AccessibleRole COLOR_CHOOSER
+ = new AccessibleRole("color chooser");
+
+ /**
+ * A pane for navigating through directories.
+ *
+ * @see #FILE_CHOOSER
+ */
+ public static final AccessibleRole DIRECTORY_PANE
+ = new AccessibleRole("directory pane");
+
+ /**
+ * A specialized dialog that allows a user to select a file.
+ *
+ * @see #DIRECTORY_PANE
+ */
+ public static final AccessibleRole FILE_CHOOSER
+ = new AccessibleRole("file chooser");
+
+ /** An object to fill space between other components. */
+ public static final AccessibleRole FILLER
+ = new AccessibleRole("filler");
+
+ /** A hypertext anchor. */
+ public static final AccessibleRole HYPERLINK
+ = new AccessibleRole("hyperlink");
+
+ /** A small picture to decorate components. */
+ public static final AccessibleRole ICON
+ = new AccessibleRole("icon");
+
+ /** An object to label something in a graphic interface. */
+ public static final AccessibleRole LABEL
+ = new AccessibleRole("label");
+
+ /**
+ * A specialized pane with a glass pane and layered pane as children.
+ *
+ * @see #GLASS_PANE
+ * @see #LAYERED_PANE
+ */
+ public static final AccessibleRole ROOT_PANE
+ = new AccessibleRole("root pane");
+
+ /**
+ * A pane guaranteed to be painted on top of panes beneath it.
+ *
+ * @see #ROOT_PANE
+ * @see #LAYERED_PANE
+ */
+ public static final AccessibleRole GLASS_PANE
+ = new AccessibleRole("glass pane");
+
+ /**
+ * A specialized pane that allows drawing children in layers. This is often
+ * used in menus and other visual components.
+ *
+ * @see #ROOT_PANE
+ * @see #GLASS_PANE
+ */
+ public static final AccessibleRole LAYERED_PANE
+ = new AccessibleRole("layered pane");
+
+ /**
+ * An object which presents a list of items for selection. Often contained
+ * in a scroll pane.
+ *
+ * @see #SCROLL_PANE
+ * @see #LIST_ITEM
+ */
+ public static final AccessibleRole LIST
+ = new AccessibleRole("list");
+
+ /**
+ * An object which represents an item in a list. Often contained in a scroll
+ * pane.
+ *
+ * @see #SCROLL_PANE
+ * @see #LIST
+ */
+ public static final AccessibleRole LIST_ITEM
+ = new AccessibleRole("list item");
+
+ /**
+ * An object usually at the top of a frame to list available menus.
+ *
+ * @see #MENU
+ * @see #POPUP_MENU
+ * @see #LAYERED_PANE
+ */
+ public static final AccessibleRole MENU_BAR
+ = new AccessibleRole("menu bar");
+
+ /**
+ * A temporary window with a menu of options, which hides on selection.
+ *
+ * @see #MENU
+ * @see #MENU_ITEM
+ */
+ public static final AccessibleRole POPUP_MENU
+ = new AccessibleRole("popup menu");
+
+ /**
+ * An object usually in a menu bar which contains a list of actions to
+ * perform. Such actions are usually associated with menu items or submenus.
+ *
+ * @see #MENU_BAR
+ * @see #MENU_ITEM
+ * @see #SEPARATOR
+ * @see #RADIO_BUTTON
+ * @see #CHECK_BOX
+ * @see #POPUP_MENU
+ */
+ public static final AccessibleRole MENU
+ = new AccessibleRole("menu");
+
+ /**
+ * An object usually in a menu with an action available for the user.
+ *
+ * @see #MENU_BAR
+ * @see #SEPARATOR
+ * @see #POPUP_MENU
+ */
+ public static final AccessibleRole MENU_ITEM
+ = new AccessibleRole("menu item");
+
+ /**
+ * An object usually in a menu which separates logical sections of items.
+ *
+ * @see #MENU
+ * @see #MENU_ITEM
+ */
+ public static final AccessibleRole SEPARATOR
+ = new AccessibleRole("separator");
+
+ /**
+ * An object which presents a series of panels, usually via tabs along the
+ * top. Children are all page tabs.
+ *
+ * @see #PAGE_TAB
+ */
+ public static final AccessibleRole PAGE_TAB_LIST
+ = new AccessibleRole("page tab list");
+
+ /**
+ * An object in a page tab list, which contains the panel to display when
+ * selected from the list.
+ *
+ * @see #PAGE_TAB_LIST
+ */
+ public static final AccessibleRole PAGE_TAB
+ = new AccessibleRole("page tab");
+
+ /** A generic container to group objects. */
+ public static final AccessibleRole PANEL
+ = new AccessibleRole("panel");
+
+ /** An object used to track amount of a task that has completed. */
+ public static final AccessibleRole PROGRESS_BAR
+ = new AccessibleRole("progress bar");
+
+ /** An object for passwords which should not be shown to the user. */
+ public static final AccessibleRole PASSWORD_TEXT
+ = new AccessibleRole("password text");
+
+ /**
+ * An object that can be manipulated to do something.
+ *
+ * @see #CHECK_BOX
+ * @see #TOGGLE_BUTTON
+ * @see #RADIO_BUTTON
+ */
+ public static final AccessibleRole PUSH_BUTTON
+ = new AccessibleRole("push button");
+
+ /**
+ * A specialized button which can be on or off, with no separate indicator.
+ *
+ * @see #PUSH_BUTTON
+ * @see #CHECK_BOX
+ * @see #RADIO_BUTTON
+ */
+ public static final AccessibleRole TOGGLE_BUTTON
+ = new AccessibleRole("toggle button");
+
+ /**
+ * A choice which can be on or off, and has a separate indicator.
+ *
+ * @see #PUSH_BUTTON
+ * @see #TOGGLE_BUTTON
+ * @see #RADIO_BUTTON
+ */
+ public static final AccessibleRole CHECK_BOX
+ = new AccessibleRole("check box");
+
+ /**
+ * A specialized choice which toggles radio buttons in the group when it
+ * is selected.
+ *
+ * @see #PUSH_BUTTON
+ * @see #TOGGLE_BUTTON
+ * @see #CHECK_BOX
+ */
+ public static final AccessibleRole RADIO_BUTTON
+ = new AccessibleRole("radio button");
+
+ /** The header for a row of data. */
+ public static final AccessibleRole ROW_HEADER
+ = new AccessibleRole("row header");
+
+ /**
+ * An object which allows an incremental view of a larger pane.
+ *
+ * @see #SCROLL_BAR
+ * @see #VIEWPORT
+ */
+ public static final AccessibleRole SCROLL_PANE
+ = new AccessibleRole("scroll pane");
+
+ /**
+ * An object which allows selection of the view in a scroll pane.
+ *
+ * @see #SCROLL_PANE
+ */
+ public static final AccessibleRole SCROLL_BAR
+ = new AccessibleRole("scroll bar");
+
+ /**
+ * An object which represents the visual section in a scroll pane.
+ *
+ * @see #SCROLL_PANE
+ */
+ public static final AccessibleRole VIEWPORT
+ = new AccessibleRole("viewport");
+
+ /** An object which allows selection in a bounded range. */
+ public static final AccessibleRole SLIDER
+ = new AccessibleRole("slider");
+
+ /**
+ * A specialized pane which presents two other panels, and can often adjust
+ * the divider between them.
+ */
+ public static final AccessibleRole SPLIT_PANE
+ = new AccessibleRole("split pane");
+
+ /** An object for presenting data in rows and columns. */
+ public static final AccessibleRole TABLE
+ = new AccessibleRole("table");
+
+ /**
+ * An object which represents text, usually editable by the user.
+ *
+ * @see #LABEL
+ */
+ public static final AccessibleRole TEXT
+ = new AccessibleRole("text");
+
+ /**
+ * An object which represents a hierachical view of data. Subnodes can
+ * often be expanded or collapsed.
+ */
+ public static final AccessibleRole TREE
+ = new AccessibleRole("tree");
+
+ /** A bar or pallete with buttons for common actions in an application. */
+ public static final AccessibleRole TOOL_BAR
+ = new AccessibleRole("tool bar");
+
+ /**
+ * An object which provides information about another object. This is often
+ * displayed as a "help bubble" when a mouse hovers over the other object.
+ */
+ public static final AccessibleRole TOOL_TIP
+ = new AccessibleRole("tool tip");
+
+ /**
+ * An AWT component with nothing else known about it.
+ *
+ * @see #SWING_COMPONENT
+ * @see #UNKNOWN
+ */
+ public static final AccessibleRole AWT_COMPONENT
+ = new AccessibleRole("AWT component");
+
+ /**
+ * A swing component with nothing else known about it.
+ *
+ * @see #AWT_COMPONENT
+ * @see #UNKNOWN
+ */
+ public static final AccessibleRole SWING_COMPONENT
+ = new AccessibleRole("SWING component");
+
+ /**
+ * An accessible object whose role is unknown.
+ *
+ * @see #AWT_COMPONENT
+ * @see #SWING_COMPONENT
+ */
+ public static final AccessibleRole UNKNOWN
+ = new AccessibleRole("unknown");
+
+ /** A component with multiple labels of status information. */
+ public static final AccessibleRole STATUS_BAR
+ = new AccessibleRole("statusbar");
+
+ /** A component which allows editing of Date and Time objects. */
+ public static final AccessibleRole DATE_EDITOR
+ = new AccessibleRole("dateeditor");
+
+ /** A component with spinner arrows for simple numbers. */
+ public static final AccessibleRole SPIN_BOX
+ = new AccessibleRole("spinbox");
+
+ /** A component for choosing fonts and their attributes. */
+ public static final AccessibleRole FONT_CHOOSER
+ = new AccessibleRole("fontchooser");
+
+ /** A component with a border to group other components. */
+ public static final AccessibleRole GROUP_BOX
+ = new AccessibleRole("groupbox");
+
+ /**
+ * Create a new constant with a locale independent key. Follow the example,
+ * keep the constructor private and make public constants instead.
+ *
+ * @param key the name of the role
+ * @see #toDisplayString(String, Locale)
+ */
+ protected AccessibleRole(String key)
+ {
+ this.key = key;
+ }
+} // class AccessibleRole
diff --git a/javax/accessibility/AccessibleSelection.java b/javax/accessibility/AccessibleSelection.java
index 1cf70b683..d1e8c7c2a 100644
--- a/javax/accessibility/AccessibleSelection.java
+++ b/javax/accessibility/AccessibleSelection.java
@@ -1,6 +1,5 @@
-/* AccessibleSelection.java -- Java interface for aiding in accessibly rendering
- other Java components
- Copyright (C) 2000 Free Software Foundation, Inc.
+/* AccessibleSelection.java -- aids in accessibly selecting components
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -8,7 +7,7 @@ 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
@@ -36,78 +35,79 @@ 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 javax.accessibility;
/**
- * Proper implementation of the methods of this interface should
- * allow an application to determine the currently selected children
- * and modify the selection set. If an object has children which are
- * selectable then it should implement this interface.
- * <p>
- * The <code>AccessibleContext.getAccessibleSelection()</code> method
- * should return an object which extends <code>AccessibleSelection</code>
- * if it supports this interface. If the method returns <code>null</code>
- * the object does not support this interface.
+ * If an object implements this interface then it must be able to control
+ * the selection of its children. Accessibility software can use the
+ * implementations of this interface to change the selection set of children.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleSelection()</code> method should
+ * return <code>null</code> if an object does not implement this interface.
*
- * @see AccessibleContext.getAccessibleText()
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleSelection()
+ * @since 1.2
+ * @status updated to 1.4
*/
-public interface AccessibleSelection {
-
- /**
- * Select the specified child if it is not already
- * selected, placing it in the objects current selection.
- * If the object does not support multiple selections
- * then the specified child placed in a new selection
- * replacing the old selection. If the specified
- * child is already selected, this method does nothing.
- *
- * @param i zero-based index of child objects
- */
- public abstract void addAccessibleSelection(int i);
-
- /**
- * Unselect all children of this Accessible object.
- */
- public abstract void clearAccessibleSelection();
+public interface AccessibleSelection
+{
+ /**
+ * Returns the number of currently selected Accessible children, which may
+ * be 0 if nothing is selected.
+ *
+ * @return the number of selected children
+ */
+ int getAccessibleSelectionCount();
- /**
- * Returns the Accessible child specified of this
- * Accessible object.
- *
- * @param i zero-based index of child objects
- * @return the Accessible child
- */
- public abstract Accessible getAccessibleSelection(int i);
+ /**
+ * Returns the i-th selected child (not necessarily the overall i-th child)
+ * of this Accessible object. If i is out of bounds, null is returned.
+ *
+ * @param i zero-based index of selected child objects
+ * @return the Accessible child, or null
+ * @see #getAccessibleSelectionCount()
+ */
+ Accessible getAccessibleSelection(int i);
- /**
- * Returns the number of currently selected Accessible
- * children if any, else 0.
- *
- * @return the number of selected children
- */
- public abstract int getAccessibleSelectionCount();
+ /**
+ * Determine if i-th overall child of this accessible object is selected.
+ * If i is out of bounds, false is returned.
+ *
+ * @param i zero-based index of child objects
+ * @return true if specified child exists and is selected
+ */
+ boolean isAccessibleChildSelected(int i);
- /**
- * Determine if the specified child of this Accessible
- * object is selected.
- *
- * @param i zero-based index of child objects
- * @return true if specified child exists and is selected, else false
- */
- public abstract boolean isAccessibleChildSelected(int i);
+ /**
+ * Select the specified child if it is not already selected, placing it in
+ * the object's current selection. If the object does not support multiple
+ * selections then the new selection replaces the old. If the specified
+ * child is already selected, or is out of bounds, this method does nothing.
+ *
+ * @param i zero-based index of child objects
+ */
+ void addAccessibleSelection(int i);
- /**
- * Unselect the specified child of this Accessible object
- * if it is currently selected.
- *
- * @param i the zero-based index of the child objects
- */
- public abstract void removeAccessibleSelection(int i);
+ /**
+ * Unselect the specified child of this Accessible object. If the specified
+ * child is not selected, or is out of bounds, this method does nothing.
+ *
+ * @param i the zero-based index of the child objects
+ */
+ void removeAccessibleSelection(int i);
- /**
- * Select all children of this Accessible object
- * if the object supports multiple selections.
- */
- public abstract void selectAllAccessibleSelection();
-}
+ /**
+ * Unselect all children of this Accessible object.
+ */
+ void clearAccessibleSelection();
+ /**
+ * Select all children of this Accessible object if the object supports
+ * multiple selections or has a single child. Otherwise this does nothing.
+ */
+ void selectAllAccessibleSelection();
+} // interface AccessibleSelection
diff --git a/javax/accessibility/AccessibleState.java b/javax/accessibility/AccessibleState.java
index e69de29bb..24005ae9a 100644
--- a/javax/accessibility/AccessibleState.java
+++ b/javax/accessibility/AccessibleState.java
@@ -0,0 +1,315 @@
+/* AccessibleState.java -- a state of an accessible object
+ Copyright (C) 2002 Free Software Foundation
+
+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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+/**
+ * A state portion of an accessible object. A combination of states represent
+ * the entire object state, in an AccessibleStateSet. For example, this could
+ * be "active" or "selected". This strongly typed "enumeration" supports
+ * localized strings. If the constants of this class are not adequate, new
+ * ones may be added in a similar matter, while avoiding a public constructor.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public class AccessibleState extends AccessibleBundle
+{
+ /**
+ * Indicates an active window, as well as an active child in a list or other
+ * collection.
+ *
+ * @see AccessibleRole#WINDOW
+ * @see AccessibleRole#FRAME
+ * @see AccessibleRole#DIALOG
+ */
+ public static final AccessibleState ACTIVE
+ = new AccessibleState("active");
+
+ /**
+ * Indicates a pushed button, usually when the mouse has been pressed but
+ * not released.
+ *
+ * @see AccessibleRole#PUSH_BUTTON
+ */
+ public static final AccessibleState PRESSED
+ = new AccessibleState("pressed");
+
+ /**
+ * Indicates an armed object, usually a button which has been pushed and
+ * the mouse has not left the button area.
+ *
+ * @see AccessibleRole#PUSH_BUTTON
+ */
+ public static final AccessibleState ARMED
+ = new AccessibleState("armed");
+
+ /**
+ * Indicates an object is busy, such as a slider, scroll bar, or progress
+ * bar in transition.
+ *
+ * @see AccessibleRole#PROGRESS_BAR
+ * @see AccessibleRole#SCROLL_BAR
+ * @see AccessibleRole#SLIDER
+ */
+ public static final AccessibleState BUSY
+ = new AccessibleState("busy");
+
+ /**
+ * Indicates an object is checked.
+ *
+ * @see AccessibleRole#TOGGLE_BUTTON
+ * @see AccessibleRole#RADIO_BUTTON
+ * @see AccessibleRole#CHECK_BOX
+ */
+ public static final AccessibleState CHECKED
+ = new AccessibleState("checked");
+
+ /**
+ * Indicates the user can edit the component contents. This is usually for
+ * text, as other objects like scroll bars are automatically editable.
+ *
+ * @see #ENABLED
+ */
+ public static final AccessibleState EDITABLE
+ = new AccessibleState("editable");
+
+ /**
+ * Indicates the object allows progressive disclosure of its children,
+ * usually in a collapsible tree or other hierachical object.
+ *
+ * @see #EXPANDED
+ * @see #COLLAPSED
+ * @see AccessibleRole#TREE
+ */
+ public static final AccessibleState EXPANDABLE
+ = new AccessibleState("expandable");
+
+ /**
+ * Indicates that the object is collapsed, usually in a tree.
+ *
+ * @see #EXPANDABLE
+ * @see #EXPANDED
+ * @see AccessibleRole#TREE
+ */
+ public static final AccessibleState COLLAPSED
+ = new AccessibleState("collapsed");
+
+ /**
+ * Indicates that the object is expanded, usually in a tree.
+ *
+ * @see #EXPANDABLE
+ * @see #COLLAPSED
+ * @see AccessibleRole#TREE
+ */
+ public static final AccessibleState EXPANDED
+ = new AccessibleState("expanded");
+
+ /**
+ * Indicates that an object is enabled. In the absence of this state,
+ * graphics are often grayed out, and cannot be manipulated.
+ */
+ public static final AccessibleState ENABLED
+ = new AccessibleState("enabled");
+
+ /**
+ * Indicates that an object can accept focus, which means it will process
+ * keyboard events when focused.
+ *
+ * @see #FOCUSED
+ */
+ public static final AccessibleState FOCUSABLE
+ = new AccessibleState("focusable");
+
+ /**
+ * Indicates that an object has keyboard focus.
+ *
+ * @see #FOCUSABLE
+ */
+ public static final AccessibleState FOCUSED
+ = new AccessibleState("focused");
+
+ /**
+ * Indicates that an object is minimized to an icon.
+ *
+ * @see AccessibleRole#FRAME
+ * @see AccessibleRole#INTERNAL_FRAME
+ */
+ public static final AccessibleState ICONIFIED
+ = new AccessibleState("iconified");
+
+ /**
+ * Indicates that something must be done in the current object before
+ * interaction is allowed on other windows, usually for dialogs.
+ *
+ * @see AccessibleRole#DIALOG
+ */
+ public static final AccessibleState MODAL
+ = new AccessibleState("modal");
+
+ /**
+ * Indicates that all pixels in the object are painted. If this state is not
+ * present, then the object has some degree of transparency, letting lower
+ * panes show through.
+ *
+ * @see Accessible#getAccessibleContext()
+ * @see AccessibleContext#getAccessibleComponent()
+ * @see AccessibleComponent#getBounds()
+ */
+ public static final AccessibleState OPAQUE
+ = new AccessibleState("opaque");
+
+ /**
+ * Indicates the size of this object is not fixed.
+ *
+ * @see Accessible#getAccessibleContext()
+ * @see AccessibleContext#getAccessibleComponent()
+ * @see AccessibleComponent#getSize()
+ * @see AccessibleComponent#setSize(Dimension)
+ */
+ public static final AccessibleState RESIZABLE
+ = new AccessibleState("resizable");
+
+ /**
+ * Indicates that multiple children can be selected at once.
+ *
+ * @see Accessible#getAccessibleContext()
+ * @see AccessibleContext#getAccessibleSelection()
+ * @see AccessibleSelection
+ */
+ public static final AccessibleState MULTISELECTABLE
+ = new AccessibleState("multiselectable");
+
+ /**
+ * Indicates that this child is one which can be selected from its parent.
+ *
+ * @see #SELECTED
+ * @see Accessible#getAccessibleContext()
+ * @see AccessibleContext#getAccessibleSelection()
+ * @see AccessibleSelection
+ */
+ public static final AccessibleState SELECTABLE
+ = new AccessibleState("selectable");
+
+ /**
+ * Indicates that this child has been selected from its parent.
+ *
+ * @see #SELECTABLE
+ * @see Accessible#getAccessibleContext()
+ * @see AccessibleContext#getAccessibleSelection()
+ * @see AccessibleSelection
+ */
+ public static final AccessibleState SELECTED
+ = new AccessibleState("selected");
+
+ /**
+ * Indicates that this object and all its parents are visible, so that it
+ * is on the screen. However, something opaque may be on top of it.
+ *
+ * @see #VISIBLE
+ */
+ public static final AccessibleState SHOWING
+ = new AccessibleState("showing");
+
+ /**
+ * Indicates that this object intends to be visible. However, if its
+ * parent is invisible, this object is as well.
+ *
+ * @see #SHOWING
+ */
+ public static final AccessibleState VISIBLE
+ = new AccessibleState("visible");
+
+ /**
+ * Indicates that an object has vertical orientation.
+ *
+ * @see #HORIZONTAL
+ * @see AccessibleRole#SCROLL_BAR
+ * @see AccessibleRole#SLIDER
+ * @see AccessibleRole#PROGRESS_BAR
+ */
+ public static final AccessibleState VERTICAL
+ = new AccessibleState("vertical");
+
+ /**
+ * Indicates that an object has horizontal orientation.
+ *
+ * @see #VERTICAL
+ * @see AccessibleRole#SCROLL_BAR
+ * @see AccessibleRole#SLIDER
+ * @see AccessibleRole#PROGRESS_BAR
+ */
+ public static final AccessibleState HORIZONTAL
+ = new AccessibleState("horizontal");
+
+ /**
+ * Indicates that this text object can only hold a single line.
+ *
+ * @see #MULTI_LINE
+ */
+ public static final AccessibleState SINGLE_LINE
+ = new AccessibleState("single line");
+
+ /**
+ * Indicates that this text object can hold multiple lines.
+ *
+ * @see #SINGLE_LINE
+ */
+ public static final AccessibleState MULTI_LINE
+ = new AccessibleState("multiple line");
+
+ /**
+ * Indicates that this object is transient. This means the object is
+ * generated for method queries, but will never generate events, because
+ * its container (such as a tree, list, or table) does all the work.
+ */
+ public static final AccessibleState TRANSIENT
+ = new AccessibleState("transient");
+
+ /**
+ * Create a new constant with a locale independent key. Follow the example,
+ * keep the constructor private and make public constants instead.
+ *
+ * @param key the name of the state
+ * @see #toDisplayString(String, Locale)
+ */
+ protected AccessibleState(String key)
+ {
+ this.key = key;
+ }
+} // class AccessibleState
diff --git a/javax/accessibility/AccessibleStateSet.java b/javax/accessibility/AccessibleStateSet.java
index e69de29bb..e1b112abf 100644
--- a/javax/accessibility/AccessibleStateSet.java
+++ b/javax/accessibility/AccessibleStateSet.java
@@ -0,0 +1,172 @@
+/* AccessibleStateSet.java -- the combined state of an accessible object
+ Copyright (C) 2002 Free Software Foundation
+
+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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.accessibility;
+
+import java.util.Vector;
+
+/**
+ * Describes all elements of an accessible object's state. For example, an
+ * object may be enabled and have focus.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see AccessibleState
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public class AccessibleStateSet
+{
+ /**
+ * The list of states, should be instances of AccessibleState. Don't set
+ * this to null.
+ *
+ * @see #add(AccessibleState)
+ * @see #addAll(AccessibleState[])
+ * @see #remove(AccessibleState)
+ * @see #contains(AccessibleState)
+ * @see #toArray()
+ * @see #clear()
+ */
+ protected Vector states = new Vector();
+
+ /**
+ * Create an empty state set.
+ */
+ public AccessibleStateSet()
+ {
+ }
+
+ /**
+ * Create a state set initialized with the given states, duplicates are
+ * ignored.
+ *
+ * @param states the states to insert
+ * @throws NullPointerException if states is null
+ */
+ public AccessibleStateSet(AccessibleState[] states)
+ {
+ addAll(states);
+ }
+
+ /**
+ * Add a new state to the current set. Return true if the state was added,
+ * as duplicates are ignored. Entering a null state will cause problems
+ * later, so don't do it.
+ *
+ * @param state the state to add
+ * @return true if the state was added
+ */
+ public boolean add(AccessibleState state)
+ {
+ return states.contains(state) ? false : states.add(state);
+ }
+
+ /**
+ * Add all of the states to the current set. Duplicates are ignored.
+ * Entering a null state will cause problems later, so don't do it.
+ *
+ * @param array the array of states to add
+ * @throws NullPointerException if array is null
+ */
+ public void addAll(AccessibleState[] array)
+ {
+ int i = array.length;
+ while (--i >= 0)
+ add(array[i]);
+ }
+
+ /**
+ * Remove a state from the set. If a state was removed, return true.
+ *
+ * @param state the state to remove
+ * @return true if the set changed
+ */
+ public boolean remove(AccessibleState state)
+ {
+ return states.remove(state);
+ }
+
+ /**
+ * Clear all states in the set.
+ */
+ public void clear()
+ {
+ states.clear();
+ }
+
+ /**
+ * Check if the current state is in the set.
+ *
+ * @param state the state to locate
+ * @return true if it is in the set
+ */
+ public boolean contains(AccessibleState state)
+ {
+ return states.contains(state);
+ }
+
+ /**
+ * Return the state set as an array.
+ *
+ * @return an array of the current states
+ */
+ public AccessibleState[] toArray()
+ {
+ AccessibleState[] result = new AccessibleState[states.size()];
+ states.toArray(result);
+ return result;
+ }
+
+ /**
+ * Return a localized, comma-separated string representing all states
+ * in the set. This is in arbitrary order.
+ *
+ * @return the string representation
+ * @see AccessibleBundle#toDisplayString(String, Locale)
+ */
+ public String toString()
+ {
+ int i = states.size();
+ if (i == 0)
+ return "";
+ // Pre-allocate an average of 10 chars per state.
+ StringBuffer b = new StringBuffer(i * 10);
+ while (--i >= 0)
+ b.append(states.get(i)).append(',');
+ return b.substring(0, b.length() - 1);
+ }
+} // class AccessibleStateSet
diff --git a/javax/accessibility/AccessibleTable.java b/javax/accessibility/AccessibleTable.java
new file mode 100644
index 000000000..4fd58c5a2
--- /dev/null
+++ b/javax/accessibility/AccessibleTable.java
@@ -0,0 +1,236 @@
+/* AccessibleTable.java -- aids in accessibly manipulating tables
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+/**
+ * Objects which present information in a 2-dimensional table should implement
+ * this interface. Accessibility software can use the implementations of
+ * this interface to navigate and change the attributes of the table.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleTable()</code> method
+ * should return <code>null</code> if an object does not implement this
+ * interface.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleTable()
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public interface AccessibleTable
+{
+ /**
+ * Return the caption for the table, or null if unknown.
+ *
+ * @return the table caption
+ */
+ Accessible getAccessibleCaption();
+
+ /**
+ * Set the table caption.
+ *
+ * @param caption the new caption
+ */
+ void setAccessibleCaption(Accessible caption);
+
+ /**
+ * Return the summary description of the table, or null if unknown.
+ *
+ * @return the summary description
+ */
+ Accessible getAccessibleSummary();
+
+ /**
+ * Set the table summary description.
+ *
+ * @param summary the new summary
+ */
+ void setAccessibleSummary(Accessible summary);
+
+ /**
+ * Return the number of rows in the table.
+ *
+ * @return the row count
+ */
+ int getAccessibleRowCount();
+
+ /**
+ * Return the number of columns in the table.
+ *
+ * @return the column count
+ */
+ int getAccessibleColumnCount();
+
+ /**
+ * Return the cell at the specified row and column, or null if out of bounds.
+ *
+ * @param r the 0-based row index
+ * @param c the 0-based column index
+ * @return the cell at (r,c)
+ */
+ Accessible getAccessibleAt(int r, int c);
+
+ /**
+ * Returns the number of merged rows occupied at the specified row and
+ * column, or 0 if out of bounds.
+ *
+ * @param r the 0-based row index
+ * @param c the 0-based column index
+ * @return the row extent at (r,c)
+ */
+ int getAccessibleRowExtentAt(int r, int c);
+
+ /**
+ * Returns the number of merged columns occupied at the specified row and
+ * column, or 0 if out of bounds.
+ *
+ * @param r the 0-based row index
+ * @param c the 0-based column index
+ * @return the column extent at (r,c)
+ */
+ int getAccessibleColumnExtentAt(int r, int c);
+
+ /**
+ * Return the row headers as a table.
+ *
+ * @return the row headers, or null if there are none
+ */
+ AccessibleTable getAccessibleRowHeader();
+
+ /**
+ * Set the row headers.
+ *
+ * @param header the new row header
+ */
+ // XXX What happens if header is incompatible size?
+ void setAccessibleRowHeader(AccessibleTable header);
+
+ /**
+ * Return the column headers as a table.
+ *
+ * @return the column headers, or null if there are none
+ */
+ AccessibleTable getAccessibleColumnHeader();
+
+ /**
+ * Set the column headers.
+ *
+ * @param header the new column header
+ */
+ // XXX What happens if header is incompatible size?
+ void setAccessibleColumnHeader(AccessibleTable header);
+
+ /**
+ * Return the description of a row, or null if there is none or the index
+ * is out of bounds.
+ *
+ * @param r the 0-based row index
+ * @return the description
+ */
+ Accessible getAccessibleRowDescription(int r);
+
+ /**
+ * Set the description of a row. Does nothing if the index is invalid.
+ *
+ * @param r the 0-based row index
+ * @param description the new description
+ */
+ void setAccessibleRowDescription(int r, Accessible description);
+
+ /**
+ * Return the description of a column, or null if there is none or the index
+ * is out of bounds.
+ *
+ * @param c the 0-based column index
+ * @return the description
+ */
+ Accessible getAccessibleColumnDescription(int c);
+
+ /**
+ * Set the description of a column. Does nothing if the index is invalid.
+ *
+ * @param c the 0-based column index
+ * @param description the new description
+ */
+ void setAccessibleColumnDescription(int c, Accessible description);
+
+ /**
+ * Return whether the cell at the specified location is selected. Returns
+ * false if the index is out of bounds.
+ *
+ * @param r the 0-based row index
+ * @param c the 0-based column index
+ * @return true if that cell is selected
+ */
+ boolean isAccessibleSelected(int r, int c);
+
+ /**
+ * Return whether the specified row is selected. Returns false if the
+ * index is out of bounds.
+ *
+ * @param r the 0-based row index
+ * @return true if that row is selected
+ */
+ boolean isAccessibleRowSelected(int r);
+
+ /**
+ * Return whether the specified column is selected. Returns false if the
+ * index is out of bounds.
+ *
+ * @param c the 0-based column index
+ * @return true if that column is selected
+ */
+ boolean isAccessibleColumnSelected(int c);
+
+ /**
+ * Return the selected rows. May be null or empty if there is no selection.
+ *
+ * @return the indices of selected rows
+ */
+ int[] getSelectedAccessibleRows();
+
+ /**
+ * Return the selected columns. May be null or empty if there is no
+ * selection.
+ *
+ * @return the indices of selected columns
+ */
+ int[] getSelectedAccessibleColumns();
+} // interface AccessibleTable
diff --git a/javax/accessibility/AccessibleTableModelChange.java b/javax/accessibility/AccessibleTableModelChange.java
new file mode 100644
index 000000000..9cff7bfa7
--- /dev/null
+++ b/javax/accessibility/AccessibleTableModelChange.java
@@ -0,0 +1,102 @@
+/* AccessibleTableModelChange.java -- describes change to an accessible table
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+/**
+ * Describes a change to an accessible table. Accessibility software can use
+ * the implementations of this interface to update their state after a
+ * change to a table.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleTable()
+ * @see AccessibleTable
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public interface AccessibleTableModelChange
+{
+ /** Identifies insertion of rows or columns. */
+ int INSERT = 1;
+
+ /** Identifies change to existing data. */
+ int UPDATE = 0;
+
+ /** Identifies deletion of rows or columns. */
+ int DELETE = -1;
+
+ /**
+ * Returns the change type.
+ *
+ * @return the type
+ * @see #INSERT
+ * @see #UPDATE
+ * @see #DELETE
+ */
+ int getType();
+
+ /**
+ * Returns the first row that changed.
+ *
+ * @return the 0-based index of the first row to change
+ */
+ int getFirstRow();
+
+ /**
+ * Returns the last row that changed.
+ *
+ * @return the 0-based index of the last row to change
+ */
+ int getLastRow();
+
+ /**
+ * Returns the first column that changed.
+ *
+ * @return the 0-based index of the first column to change
+ */
+ int getFirstColumn();
+
+ /**
+ * Returns the last column that changed.
+ *
+ * @return the 0-based index of the last column to change
+ */
+ int getLastColumn();
+} // interface AccessibleTableModelChange
diff --git a/javax/accessibility/AccessibleText.java b/javax/accessibility/AccessibleText.java
index ca9b31589..5370ec1f2 100644
--- a/javax/accessibility/AccessibleText.java
+++ b/javax/accessibility/AccessibleText.java
@@ -1,6 +1,5 @@
-/* AccessibleText.java -- Java interface for aiding in accessibly rendering
- other Java components
- Copyright (C) 2000 Free Software Foundation, Inc.
+/* AccessibleText.java -- aids in accessibly manipulating text
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -8,7 +7,7 @@ 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
@@ -36,25 +35,152 @@ 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 javax.accessibility;
-import javax.swing.text.AttributeSet;
import java.awt.Rectangle;
import java.awt.Point;
+// XXX Waiting on javax.swing support.
+// import javax.swing.text.AttributeSet;
+
+/**
+ * Objects which present textual information on the display should implement
+ * this interface. Accessibility software can use the implementations of
+ * this interface to change the attributes and spacial location of the text.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleText()</code> method
+ * should return <code>null</code> if an object does not implement this
+ * interface.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleText()
+ * @since 1.2
+ * @status updated to 1.4, except for javax.swing support
+ */
+public interface AccessibleText
+{
+ /**
+ * Constant designating that the next selection should be a character.
+ *
+ * @see #getAtIndex(int, int)
+ * @see #getAfterIndex(int, int)
+ * @see #getBeforeIndex(int, int)
+ */
+ int CHARACTER = 1;
+
+ /**
+ * Constant designating that the next selection should be a word.
+ *
+ * @see #getAtIndex(int, int)
+ * @see #getAfterIndex(int, int)
+ * @see #getBeforeIndex(int, int)
+ */
+ int WORD = 2;
+
+ /**
+ * Constant designating that the next selection should be a sentence.
+ *
+ * @see #getAtIndex(int, int)
+ * @see #getAfterIndex(int, int)
+ * @see #getBeforeIndex(int, int)
+ */
+ int SENTENCE = 3;
+
+ /**
+ * Given a point in the coordinate system of this object, return the
+ * 0-based index of the character at that point, or -1 if there is none.
+ *
+ * @param p the point to look at
+ * @return the character index, or -1
+ */
+ int getIndexAtPoint(Point point);
+
+ /**
+ * Determines the bounding box of the indexed character. Returns an empty
+ * rectangle if the index is out of bounds.
+ *
+ * @param index the 0-based character index
+ * @return the bounding box, may be empty
+ */
+ Rectangle getCharacterBounds(int index);
+
+ /**
+ * Return the number of characters.
+ *
+ * @return the character count
+ */
+ int getCharCount();
+
+ /**
+ * Return the offset of the character. The offset matches the index of the
+ * character to the right, since the carat lies between characters.
+ *
+ * @return the 0-based caret position
+ */
+ int getCaretPosition();
+
+ /**
+ * Returns the section of text at the index, or null if the index or part
+ * is invalid.
+ *
+ * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE}
+ * @param index the 0-based character index
+ * @return the selection of text at that index, or null
+ */
+ String getAtIndex(int part, int index);
+
+ /**
+ * Returns the section of text after the index, or null if the index or part
+ * is invalid.
+ *
+ * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE}
+ * @param index the 0-based character index
+ * @return the selection of text after that index, or null
+ */
+ String getAfterIndex(int part, int index);
+
+ /**
+ * Returns the section of text before the index, or null if the index or part
+ * is invalid.
+ *
+ * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE}
+ * @param index the 0-based character index
+ * @return the selection of text before that index, or null
+ */
+ String getBeforeIndex(int part, int index);
+
+ /**
+ * Returns the attributes of a character at an index, or null if the index
+ * is out of bounds.
+ *
+ * @param index the 0-based character index
+ * @return the character's attributes
+ */
+ // XXX Waiting on javax.swing support.
+ // AttributeSet getCharacterAttribute(int index);
+
+ /**
+ * Returns the start index of the selection. If there is no selection, this
+ * is the same as the caret location.
+ *
+ * @return the 0-based character index of the selection start
+ */
+ int getSelectionStart();
+
+ /**
+ * Returns the end index of the selection. If there is no selection, this
+ * is the same as the caret location.
+ *
+ * @return the 0-based character index of the selection end
+ */
+ int getSelectionEnd();
-public interface AccessibleText {
- public static final int CHARACTER = 1;
- public static final int WORD = 2;
- public static final int SENTENCE = 3;
- public abstract String getAfterIndex(int part, int index);
- public abstract String getAtIndex(int part, int index);
- public abstract String getBeforeIndex(int part, int index);
- public abstract int getCaretPosition();
- public abstract int getCharCount();
- public abstract AttributeSet getCharacterAttribute(int index);
- public abstract Rectangle getCharacterBounds(int index);
- public abstract int getIndexAtPoint(Point point);
- public abstract String getSelectedText();
- public abstract int getSelectionEnd();
- public abstract int getSelectionStart();
-}
+ /**
+ * Returns the selected text. This may be null or "" if no text is selected.
+ *
+ * @return the selected text
+ */
+ String getSelectedText();
+} // interface AccessibleText
diff --git a/javax/accessibility/AccessibleValue.java b/javax/accessibility/AccessibleValue.java
index f89cd2a5e..69da5c8a4 100644
--- a/javax/accessibility/AccessibleValue.java
+++ b/javax/accessibility/AccessibleValue.java
@@ -1,8 +1,94 @@
+/* AccessibleValue.java -- aids in accessibly controlling values
+ Copyright (C) 2002 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., 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
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
package javax.accessibility;
-public interface AccessibleValue {
- public abstract Number getCurrentAccessibleValue();
- public abstract Number getMaximumAccessibleValue();
- public abstract Number getMinimumAccessibleValue();
- public abstract boolean setCurrentAccessibleValue(Number number);
-}
+/**
+ * If an object implements this interface then it must be able to control
+ * a numerical value. For example, a scroll bar has a position represented
+ * by a number. Accessibility software can use the implementations of this
+ * interface to change the associated value.
+ *
+ * <p>The <code>AccessibleContext.getAccessibleValue()</code> method should
+ * return <code>null</code> if an object does not implement this interface.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Accessible
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleValue()
+ * @since 1.2
+ * @status updated to 1.4
+ */
+public interface AccessibleValue
+{
+ /**
+ * Gets the current value of this object, or null if it has not been set.
+ *
+ * @return the current value, or null
+ * @see #setCurrentAccessibleValue(Number)
+ */
+ Number getCurrentAccessibleValue();
+
+ /**
+ * Sets the current value of this object. Returns true if the number
+ * successfully changed.
+ *
+ * @param number the new value
+ * @return true on success
+ */
+ // XXX What happens if number is null?
+ boolean setCurrentAccessibleValue(Number number);
+
+ /**
+ * Gets the minimum value in the range of this object, or null if there is
+ * no minimum.
+ *
+ * @return the minimum
+ * @see #getMaximumAccessibleValue()
+ */
+ Number getMinimumAccessibleValue();
+
+ /**
+ * Gets the maximum value in the range of this object, or null if there is
+ * no maximum.
+ *
+ * @return the maximum
+ * @see #getMinimumAccessibleValue()
+ */
+ Number getMaximumAccessibleValue();
+} // interface AccessibleValue
diff --git a/javax/accessibility/Makefile.am b/javax/accessibility/Makefile.am
new file mode 100644
index 000000000..fbd2b0ebd
--- /dev/null
+++ b/javax/accessibility/Makefile.am
@@ -0,0 +1,26 @@
+## Input file for automake
+
+EXTRA_DIST = \
+Accessible.java \
+AccessibleAction.java \
+AccessibleBundle.java \
+AccessibleComponent.java \
+AccessibleContext.java \
+AccessibleEditableText.java \
+AccessibleExtendedComponent.java \
+AccessibleExtendedTable.java \
+AccessibleHyperlink.java \
+AccessibleHypertext.java \
+AccessibleIcon.java \
+AccessibleKeyBinding.java \
+AccessibleRelation.java \
+AccessibleRelationSet.java \
+AccessibleResourceBundle.java \
+AccessibleRole.java \
+AccessibleSelection.java \
+AccessibleState.java \
+AccessibleStateSet.java \
+AccessibleTable.java \
+AccessibleTableModelChange.java \
+AccessibleText.java \
+AccessibleValue.java