Path: blob/master/src/java.desktop/share/classes/javax/accessibility/package-info.java
41153 views
/*1* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/**26* Defines a contract between user-interface components and an assistive27* technology that provides access to those components. If a Java application28* fully supports the Java Accessibility API, then it should be compatible with,29* and friendly toward, assistive technologies such as screen readers, screen30* magnifiers, etc. With a Java application that fully supports the Java31* Accessibility API, no screen reader off screen model would be necessary32* because the API provides all of the information normally contained in an off33* screen model.34* <p>35* The Java Accessibility API package consists of 8 Java programming language36* interfaces, and 6 Java programming language classes. These are described37* below.38*39* <h2><a id="Accessible"></a><a href="Accessible.html">Interface40* Accessible</a></h2>41* <a href="Accessible.html">Interface Accessible</a> is the main interface of42* the Java Accessibility API. All components that support the Java43* Accessibility API must implement this interface. It contains a single method,44* {@code getAccessibleContext}, that returns an instance of the class45* <a href="#AccessibleContext">AccessibleContext</a>. Sun thinks that46* implementing this interface is the absolute minimum requirement of every47* object that is part of the user interface of a Java application, if that48* program is to be compatible with assistive technologies.49*50* <h2><a id="AccessibleContext"></a><a href="AccessibleContext.html">Class51* AccessibleContext</a></h2>52* <a href="AccessibleContext.html">AccessibleContext</a> represents the minimum53* information all accessible objects return and is obtained by calling the54* {@code getAccessibleContext} method on an object that implements the55* <a href="#Accessible">Accessible</a> interface. This information includes the56* accessible name, description, <a href="#AccessibleRole">role</a>, and57* <a href="#AccessibleState">state</a> of the object, as well as information58* about the parent and children of the object. In addition,59* JavaBeans property change support is also included to allow assistive60* technologies learn when the values of the accessible properties change.61* AccessibleContext also contains methods for obtaining more specific62* accessibility information about a component. If the component supports it,63* these methods will return an object that implements one or more of the64* following interfaces:65* <ul>66* <li><b><a href="#AccessibleAction">AccessibleAction</a></b> - the object67* can perform one or more actions. This interface provides the standard68* mechanism for an assistive technology to determine what those actions are69* and tell the object to perform those actions. Any object that can be70* manipulated should return an object that implements this interface when71* the {@code getAccessibleAction} method is called on an AccessibleContext.72* </li>73* <li><b><a href="#AccessibleComponent">AccessibleComponent</a></b> - the74* object has a graphical representation. This interface provides the75* standard mechanism for an assistive technology to determine and set the76* graphical representation of the object. Any object that is rendered on77* the screen should return an object that implements this interface when78* the {@code getAccessibleComponent} method is called on an79* AccessibleContext.</li>80* <li><b><a href="#AccessibleSelection">AccessibleSelection</a></b> - the81* object allows its children to be selected. This interface provides the82* standard mechanism for an assistive technology to determine the currently83* selected children as well as modify the selection set. Any object that84* has children that can be selected should return an object that implements85* this interface when the {@code getAccessibleSelection} method is called86* on an AccessibleContext.</li>87* <li><b><a href="#AccessibleText">AccessibleText</a></b> - the object88* presents editable textual information on the display. This interface89* provides the standard mechanism for an assistive technology to access90* that text via its content, attributes, and spatial location. Any object91* that contains editable text should return an object that implements this92* interface when the {@code getAccessibleText} method is called on an93* AccessibleContext.</li>94* <li><b><a href="#AccessibleHypertext">AccessibleHypertext</a></b> - the95* object presents hypertext information on the display. This interface96* provides the standard mechanism for an assistive technology to access that97* hypertext via its content, attributes, and spatial location. Any object98* that contains hypertext should return an object that implements this99* interface when the {@code getAccessibleText} method is called on an100* AccessibleContext.</li>101* <li><b><a href="#AccessibleValue">AccessibleValue</a></b> - the object102* supports a numerical value. This interface provides the standard103* mechanism for an assistive technology to determine and set the current104* value of the object, as well as the minimum and maximum values. Any105* object that supports a numerical value should return an object that106* implements this interface when the {@code getAccessibleValue} method is107* called on an AccessibleContext.</li>108* </ul>109*110* <h2><a id="AccessibleRole"></a><a href="AccessibleRole.html">Class111* AccessibleRole</a></h2>112* This class encapsulates the Accessible object's role in the user interface113* and is obtained by calling the {@code getAccessibleRole} method on an114* <a href="#AccessibleContext">AccessibleContext</a>. Accessible roles include115* "Check box", "Menu Item", "Panel", etc. These roles are identified by the116* constants in this class such as {@code AccessibleRole.CHECK_BOX,117* AccessibleRole.MENU_ITEM,} and {@code AccessibleRole.PANEL}. The constants in118* this class present a strongly typed enumeration of common object roles. A119* public constructor for this class has been purposely omitted and applications120* should use one of the constants from this class. Although this class121* pre-defines a large list of standard roles, it is extensible so additional122* programmer-defined roles can be added in the future without needing to modify123* the base class.124*125* <h2><a id="AccessibleState"></a><a href="AccessibleState.html">Class126* AccessibleState</a></h2>127* This class encapsulates a particular state of the Accessible object.128* Accessible states include things like "Armed", "Busy", "Checked", "Focused",129* etc. These roles are identified by the constants in this class such as130* {@code AccessibleState.ARMED, AccessibleState.BUSY, AccessibleState.CHECKED,}131* and {@code AccessibleState.FOCUSED}. The sum of all the states of an132* Accessible object is called the133* <a href="#AccessibleStateSet">AccessibleStateSet</a>, and can be obtained by134* calling the {@code getAccessibleStateSet} method on an135* <a href="#AccessibleContext">AccessibleContext</a>.136* <p>137* The constants in this class present a strongly typed enumeration of common138* object roles. A public constructor for this class has been purposely omitted139* and applications should use one of the constants from this class. Although140* this class pre-defines a large list of standard roles, it is extensible so141* additional, programmer-defined roles can be added in the future without142* needing to modify the base class.143*144* <h2><a id="AccessibleStateSet"></a><a href="AccessibleStateSet.html">Class145* AccessibleStateSet</a></h2>146* This class encapsulates a collection of states of the Accessible object and147* is obtained by calling the {@code getAccessibleStateSet} method on an148* <a href="#AccessibleContext">AccessibleContext</a>. Since an object might149* have multiple states (e.g. it might be both "Checked" and "Focused"), this150* class is needed to encapsulate a collection of these states. Methods in the151* class provide for retrieving the individual152* <a href="#AccessibleState">AccessibleStates</a> on the state set.153*154* <h2><a id="AccessibleBundle"></a><a href="AccessibleBundle.html">Class155* AccessibleBundle</a></h2>156* This class is used to maintain a strongly typed enumeration. It is the super157* class of both the <a href="#AccessibleRole">AccessibleRole</a> and158* <a href="#AccessibleState">AccessibleState</a> classes. Programmers normally159* do not interact with this class directly, but will instead use the160* <a href="#AccessibleRole">AccessibleRole</a> and161* <a href="#AccessibleState">AccessibleState</a> classes.162*163* <h2><a id="AccessibleAction"></a><a href="AccessibleAction.html">Interface164* AccessibleAction</a></h2>165* The <a href="AccessibleAction.html">AccessibleAction</a> interface should be166* supported by any object that can perform one or more actions. This interface167* provides the standard mechanism for an assistive technology to determine what168* those actions are as well as tell the object to perform those actions. Any169* object that can be manipulated should support this interface.170* <p>171* Applications can determine if an object supports the AccessibleAction172* interface by first obtaining its173* <a href="#AccessibleContext">AccessibleContext</a> (see174* <a href="#Accessible">Accessible</a>) and then calling the175* {@code getAccessibleAction} method of176* <a href="#AccessibleContext">AccessibleContext</a>. If the return value is177* not {@code null}, the object supports this interface.178*179* <h2> <a id="AccessibleComponent"></a><a href="AccessibleComponent.html">180* Interface AccessibleComponent</a></h2>181* The <a href="AccessibleComponent.html">AccessibleComponent</a> interface182* should be supported by any object that is rendered on the screen. This183* interface provides the standard mechanism for an assistive technology to184* determine and set the graphical representation of an object. <p>Applications185* can determine if an object supports the AccessibleComponent interface by186* first obtaining its <a href="#AccessibleContext">AccessibleContext</a> (see187* <a href="#Accessible">Accessible</a>) and then calling the188* {@code getAccessibleComponent} method of189* <a href="#AccessibleContext">AccessibleContext</a>. If the return value is190* not {@code null}, the object supports this interface.191*192* <h2><a id="AccessibleSelection"></a><a href="AccessibleSelection.html">193* Interface AccessibleSelection</a></h2>194* The <a href="AccessibleSelection.html">AccessibleSelection</a> interface195* provides the standard mechanism for an assistive technology to determine what196* the current selected children are, as well as modify the selection set. Any197* object that has children that can be selected should support this the198* AccessibleSelection interface.199* <p>200* Applications can determine if an object supports the AccessibleSelection201* interface by first obtaining its202* <a href="#AccessibleContext">AccessibleContext</a> (see203* <a href="#Accessible">Accessible</a>) and then calling the204* {@code getAccessibleSelection} method of205* <a href="#AccessibleContext">AccessibleContext</a>. If the return value is206* not {@code null}, the object supports this interface.207*208* <h2><a id="AccessibleText"></a><a href="AccessibleText.html">Interface209* AccessibleText</a></h2>210* Interface <a href="AccessibleText.html">AccessibleText</a> is the contract211* for making rich, editable text Accessible. Not all text displayed on the212* screen is rich and editable (e.g. text contained in buttons, labels, menus,213* etc., which users aren't expected to manipulate). However, objects containing214* editable text must implement interface AccessibleText if they are to215* interoperate with assistive technologies.216* <p>217* This interface provides support for going between pixel coordinates and the218* text at a given pixel coordinate, for retrieving the letter, word, and219* sentence at, before, or after a given position in the text. This interface220* provides support for retrieving the attributes of the character at a given221* position in the text (font, font size, style, etc.), as well as getting the222* selected text (if any), the length of the text, and the location of the text223* caret.224* <p>225* Applications can determine if an object supports the AccessibleText interface226* by first obtaining its <a href="#AccessibleContext">AccessibleContext</a>227* (see <a href="#Accessible">Accessible</a>) and then calling the228* {@code getAccessibleText} method of229* <a href="#AccessibleContext">AccessibleContext</a>. If the return value is230* not {@code null}, the object supports this interface.231*232* <h2><a id="AccessibleHypertext"></a> <a href="AccessibleHypertext.html">233* Interface AccessibleHypertext</a></h2>234* The <a href="AccessibleHypertext.html">AccessibleHypertext</a> interface235* should be supported by any object that presents hypertext information on the236* display. This interface provides the standard mechanism for an assistive237* technology to access that text via its content, attributes, and spatial238* location. It also provides standard mechanisms for manipulating239* <a href="#AccessibleHyperlink">hyperlinks</a>. Applications can determine if240* an object supports the AccessibleHypertext interface by first obtaining its241* <a href="#AccessibleContext">AccessibleContext</a> (see242* <a href="#Accessible">Accessible</a>) and then calling the243* AccessibleContext.getAccessibleText() method of244* <a href="#AccessibleContext">AccessibleContext</a>. If the return value is a245* class which extends AccessibleHypertext, then that object supports246* AccessibleHypertext.247*248* <h2><a id="AccessibleHyperlink"></a><a href="AccessibleHyperlink.html">249* Interface AccessibleHyperlink</a></h2>250* An object that is a hyperlink should support the251* <a href="AccessibleHyperlink.html">AccessibleHyperlink</a> interface. 252* An object that implements this interface will be returned by calling the253* getLink method on an <a href="#AccessibleHypertext">AccessibleHypertext</a>254* object.255*256* <h2><a id="AccessibleValue"></a><a href="AccessibleValue.html">Interface257* AccessibleValue</a></h2>258* The <a href="AccessibleValue.html">AccessibleValue</a> interface should be259* supported by any object that supports a numerical value (e.g., a scroll bar).260* This interface provides the standard mechanism for an assistive technology to261* determine and set the numerical value as well as get the minimum and maximum262* values.263* <p>264* Applications can determine if an object supports the AccessibleValue265* interface by first obtaining its266* <a href="#AccessibleContext">AccessibleContext</a> (see267* <a href="#Accessible">Accessible</a>) and then calling the268* {@code getAccessibleValue} method of269* <a href="#AccessibleContext">AccessibleContext</a>. If the return value is270* not {@code null}, the object supports this interface.271*272* @since 1.2273*/274package javax.accessibility;275276277