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