blob: 79e09b3477ddb55fb2ca362e2463e8f9529adbf3 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001<HTML>
2<HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
4 <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (WinNT; I) [Netscape]">
5<!--
6Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
7DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8
9This code is free software; you can redistribute it and/or modify it
10under the terms of the GNU General Public License version 2 only, as
11published by the Free Software Foundation. Sun designates this
12particular file as subject to the "Classpath" exception as provided
13by Sun in the LICENSE file that accompanied this code.
14
15This code is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18version 2 for more details (a copy is included in the LICENSE file that
19accompanied this code).
20
21You should have received a copy of the GNU General Public License version
222 along with this work; if not, write to the Free Software Foundation,
23Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24
25Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
26CA 95054 USA or visit www.sun.com if you need additional information or
27have any questions.
28-->
29</HEAD>
30<BODY BGCOLOR="#FFFFFF">
31Defines a contract between user-interface components and an assistive technology
32that provides access to those components. If a Java application fully supports
33the Java Accessibility API, then it should be compatible with, and friendly
34toward, assistive technologies such as screen readers, screen magnifiers,
35etc. With a Java application that fully supports the Java Accessibility
36API, no screen reader off screen model would be necessary because the API
37provides all of the information normally contained in an off screen model.
38
39<P>The Java Accessibility API package consists of 8 Java programming language
40interfaces, and 6 Java programming language classes. These are described
41below.
42<H3>
43<A NAME="Accessible"></A><A HREF="Accessible.html">Interface Accessible</A></H3>
44<A HREF="Accessible.html">Interface Accessible</A> is the main interface
45of the Java Accessibility API. All components that support the Java Accessibility
46API must implement this interface. It contains a single method, <TT>getAccessibleContext</TT>,
47that returns an instance of the class <A HREF="#AccessibleContext">AccessibleContext</A>.
48Sun thinks that implementing this interface is the absolute minimum requirement
49of every object that is part of the user interface of a Java application,
50if that program is to be compatible with assistive technologies.
51<H3>
52<A NAME="AccessibleContext"></A><A HREF="AccessibleContext.html">Class
53AccessibleContext</A></H3>
54<A HREF="AccessibleContext.html">AccessibleContext</A> represents the minimum
55information all accessible objects return and is obtained by calling the
56<TT>getAccessibleContext</TT> method on an object that implements the <A HREF="#Accessible">Accessible</A>
57interface. This information includes the accessible name, description,
58<A HREF="#AccessibleRole">role</A>, and <A HREF="#AccessibleState">state</A>
59of the object, as well as information about the parent and children of
60the object.&nbsp; In addition, JavaBeans <SUP><FONT SIZE=-2>TM</FONT></SUP>
61property change support is also included to allow assisitive technologies
62learn when the values of the accessible properties change. AccessibleContext
63also contains methods for obtaining more specific accessibility information
64about a component. If the component supports it, these methods will return
65an object that implements one or more of the following interfaces:
66<UL>
67<LI>
68<B><A HREF="#AccessibleAction">AccessibleAction</A></B> - the object can
69perform one or more actions. This interface provides the standard mechanism
70for an assistive technology to determine what those actions are and tell
71the object to perform those actions. Any object that can be manipulated
72should return an object that implements this interface when the <TT>getAccessibleAction</TT>
73method is called on an AccessibleContext.</LI>
74
75<LI>
76<B><A HREF="#AccessibleComponent">AccessibleComponent</A></B> - the object
77has a graphical representation. This interface provides the standard mechanism
78for an assistive technology to determine and set the graphical representation
79of the object. Any object that is rendered on the screen should return
80an object that implements this interface when the <TT>getAccessibleComponent</TT>
81method is called on an AccessibleContext.</LI>
82
83<LI>
84<B><A HREF="#AccessibleSelection">AccessibleSelection</A></B> - the object
85allows its children to be selected. This interface provides the standard
86mechanism for an assistive technology to determine the currently selected
87children as well as modify the selection set. Any object that has children
88that can be selected should return an object that implements this interface
89when the <TT>getAccessibleSelection</TT> method is called on an AccessibleContext.</LI>
90
91<LI>
92<B><A HREF="#AccessibleText">AccessibleText</A></B> - the object presents
93editable textual information on the display. This interface provides the
94standard mechanism for an assistive technology to access that text via
95its content, attributes, and spatial location. Any object that contains
96editable text should return an object that implements this interface when
97the <TT>getAccessibleText</TT> method is called on an AccessibleContext.</LI>
98
99<LI>
100<B><A HREF="#AccessibleHypertext">AccessibleHypertext</A></B> - the object
101presents hypertext information on the display. This interface provides
102the standard mechanism for an assistive technology to access that hypertext
103via its content, attributes, and spatial location. Any object that contains
104hypertext should return an object that implements this interface when the
105<TT>getAccessibleText</TT> method is called on an AccessibleContext.</LI>
106
107<LI>
108<B><A HREF="#AccessibleValue">AccessibleValue</A></B> - the object supports
109a numerical value. This interface provides the standard mechanism for an
110assistive technology to determine and set the current value of the object,
111as well as the minimum and maximum values. Any object that supports a numerical
112value should return an object that implements this interface when the <TT>getAccessibleValue</TT>
113method is called on an AccessibleContext.</LI>
114</UL>
115
116<H3>
117<A NAME="AccessibleRole"></A><A HREF="AccessibleRole.html">Class AccessibleRole</A></H3>
118This class encapsulates the Accessible object's role in the user interface
119and is obtained by calling the <TT>getAccessibleRole</TT> method on an
120<A HREF="#AccessibleContext">AccessibleContext</A>. Accessible roles include
121"Check box", "Menu Item", "Panel", etc. These roles are identified by the
122constants in this class such as <TT>AccessibleRole.CHECK_BOX, AccessibleRole.MENU_ITEM,</TT>
123and <TT>AccessibleRole.PANEL</TT>. The constants in this class present
124a strongly typed enumeration of common object roles. A public constructor
125for this class has been purposely omitted and applications should use one
126of the constants from this class. Although this class pre-defines a large
127list of standard roles, it is extensible so additional programmer-defined
128roles can be added in the future without needing to modify the base class.
129
130<H3>
131<A NAME="AccessibleState"></A><A HREF="AccessibleState.html">Class AccessibleState</A></H3>
132This class encapsulates a particular state of the Accessible object. Accessible
133states include things like "Armed", "Busy", "Checked", "Focused", etc.
134These roles are identified by the constants in this class such as <TT>AccessibleState.ARMED,
135AccessibleState.BUSY, AccessibleState.CHECKED,</TT> and <TT>AccessibleState.FOCUSED</TT>.
136The sum of all the states of an Accessible object is called the <A HREF="#AccessibleStateSet">AccessibleStateSet</A>,
137and can be obtained by calling the <TT>getAccessibleStateSet</TT> method
138on an <A HREF="#AccessibleContext">AccessibleContext</A>.
139
140<P>The constants in this class present a strongly typed enumeration of
141common object roles. A public constructor for this class has been purposely
142omitted and applications should use one of the constants from this class.
143Although this class pre-defines a large list of standard roles, it is extensible
144so additional, programmer-defined roles can be added in the future without
145needing to modify the base class.
146
147<H3>
148<A NAME="AccessibleStateSet"></A><A HREF="AccessibleStateSet.html">Class
149AccessibleStateSet</A></H3>
150This class encapsulates a collection of states of the Accessible object
151and is obtained by calling the <TT>getAccessibleStateSet</TT> method on
152an <A HREF="#AccessibleContext">AccessibleContext</A>. Since an object
153might have multiple states (e.g. it might be both "Checked" and "Focused"),
154this class is needed to encapsulate a collection of these states. Methods
155in the class provide for retrieving the individual <A HREF="#AccessibleState">AccessibleStates</A>
156on the state set.
157<H3>
158<A NAME="AccessibleBundle"></A><A HREF="AccessibleBundle.html">Class AccessibleBundle</A></H3>
159This class is used to maintain a strongly typed enumeration. It is the
160super class of both the <A HREF="#AccessibleRole">AccessibleRole</A> and
161<A HREF="#AccessibleState">AccessibleState</A> classes. Programmers normally
162do not interact with this class directly, but will instead use the <A HREF="#AccessibleRole">AccessibleRole</A>
163and <A HREF="#AccessibleState">AccessibleState</A> classes.
164
165<H3>
166<A NAME="AccessibleAction"></A><A HREF="AccessibleAction.html">Interface
167AccessibleAction</A></H3>
168The <A HREF="AccessibleAction.html">AccessibleAction</A> interface should
169be supported by any object that can perform one or more actions. This interface
170provides the standard mechanism for an assistive technology to determine
171what those actions are as well as tell the object to perform those actions.
172Any object that can be manipulated should support this interface.
173
174<P>Applications can determine if an object supports the AccessibleAction
175interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
176(see <A HREF="#Accessible">Accessible</A>) and then calling the <TT>getAccessibleAction</TT>
177method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
178value is not null, the object supports this interface.
179<H3>
180<A NAME="AccessibleComponent"></A><A HREF="AccessibleComponent.html">Interface
181AccessibleComponent</A></H3>
182The <A HREF="AccessibleComponent.html">AccessibleComponent</A> interface
183should be supported by any object that is rendered on the screen. This
184interface provides the standard mechanism for an assistive technology to
185determine and set the graphical representation of an object.
186
187<P>Applications can determine if an object supports the AccessibleComponent
188interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
189(see <A HREF="#Accessible">Accessible</A>) and then calling the <TT>getAccessibleComponent</TT>
190method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
191value is not null, the object supports this interface.
192<H3>
193<A NAME="AccessibleSelection"></A><A HREF="AccessibleSelection.html">Interface
194AccessibleSelection</A></H3>
195The <A HREF="AccessibleSelection.html">AccessibleSelection</A> interface
196provides the standard mechanism for an assistive technology to determine
197what the current selected children are, as well as modify the selection
198set. Any object that has children that can be selected should support this
199the AccessibleSelection interface.
200
201<P>Applications can determine if an object supports the AccessibleSelection
202interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
203(see <A HREF="#Accessible">Accessible</A>) and then calling the <TT>getAccessibleSelection</TT>
204method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
205value is not null, the object supports this interface.
206<H3>
207<A NAME="AccessibleText"></A><A HREF="AccessibleText.html">Interface AccessibleText</A></H3>
208Interface <A HREF="AccessibleText.html">AccessibleText</A> is the contract
209for making rich, editable text Accessible. Not all text displayed on the
210screen is rich and editable (e.g. text contained in buttons, labels, menus,
211etc., which users aren't expected to manipulate). However, objects containing
212editable text must implement interface AccessibleText if they are to interoperate
213with assistive technologies.
214
215<P>This interface provides support for going between pixel coordinates
216and the text at a given pixel coordinate, for retrieving the letter, word,
217and sentence at, before, or after a given position in the text. This interface
218provides support for retrieving the attributes of the character at a given
219position in the text (font, font size, style, etc.), as well as getting
220the selected text (if any), the length of the text, and the location of
221the text caret.
222
223<P>Applications can determine if an object supports the AccessibleText
224interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
225(see <A HREF="#Accessible">Accessible</A>) and then calling the <TT>getAccessibleText</TT>
226method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
227value is not null, the object supports this interface.
228<H3><A NAME="AccessibleHypertext"></A>
229<A HREF="AccessibleHypertext.html">Interface AccessibleHypertext</A></H3>
230The <A HREF="AccessibleHypertext.html">AccessibleHypertext</A> interface
231should be supported by any object that presents hypertext information on
232the display. This interface provides the standard mechanism for an assistive
233technology to access that text via its content, attributes, and spatial
234location. It also provides standard mechanisms for manipulating <A HREF="#AccessibleHyperlink">hyperlinks</A>.
235Applications can determine if an object supports the AccessibleHypertext
236interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
237(see <A HREF="#Accessible">Accessible</A>) and then calling the AccessibleContext.getAccessibleText()
238method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
239value is a class which extends AccessibleHypertext, then that object supports
240AccessibleHypertext.
241<H3>
242<A NAME="AccessibleHyperlink"></A><A HREF="AccessibleHyperlink.html">Interface
243AccessibleHyperlink</A></H3>
244An object that is a hyperlink should support the <A HREF="AccessibleHyperlink.html">AccessibleHyperlink</A>
245interface.&nbsp; An object that implements this interface will be returned
246by calling the getLink method on an <A HREF="#AccessibleHypertext">AccessibleHypertext</A>
247object.
248<H3>
249<A NAME="AccessibleValue"></A><A HREF="AccessibleValue.html">Interface
250AccessibleValue</A></H3>
251The <A HREF="AccessibleValue.html">AccessibleValue</A> interface should
252be supported by any object that supports a numerical value (e.g., a scroll
253bar). This interface provides the standard mechanism for an assistive technology
254to determine and set the numerical value as well as get the minimum and
255maximum values.
256
257<P>Applications can determine if an object supports the AccessibleValue
258interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
259(see <A HREF="#Accessible">Accessible</A>) and then calling the <TT>getAccessibleValue</TT>
260method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
261value is not null, the object supports this interface.
262
263@since 1.2
264</BODY>
265</HTML>
266