站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

Java Accessibility - Overview - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

 
Java 

Java Accessibility Overview


Java Accessibility provides the technology that allows assistive technologies to obtain accessible information about the user interface objects in the Java Virtual Machine. Java Accessibility supports JDK 1.1 and up and is provided in three ways:

  1. The accessible design of the Java Foundation Classes include the ability to "plug in" an alternative look and feel for an application without requiring changes to be made in the application. More information on this design can be found in The Swing Connection.
  2. An independent Java Accessibility API toolkit that provides "boiler plate" interfaces for UI components. Included are interface Accessible, AccessibleContext,  AccessibleComponent, AccessibleLayout, AccessibleSelection, AccessibleText and interface AccessibleValue. More information about the interfaces and classes can be found in the API documentation for the javax.accessibility package.
  3. Utilities that support assistive technologies.
Explanation of API Interfaces and Classes 
Interface Accessible
Interface Accessible is the main interface in for the Accessibility package.  It contains a method that return an object which contains where accessible information can be retrieved by implementing ithe AccessibleContext interface.  Sun feels this interface should be implemented on every applications UI component, so that the application will be "compatible" with Assistive technologies.
Interface AccessibleContext
Interface AccessibleContext represents the minimum information all accessible objects return. This information includes the accessible name, description, role, and state of the object, as well as information about the parent and children of the object. AccessibleContext also contains methods for obtaining more specific accessibility information about a component.
Interface AccessibleAction
The AccessibleAction interface provides the standard mechanism for an assistive technology to determine what those actions are as well as tell the object to perform those actions. Any object that can be manipulated should support this interface.
Interface AccessibleComponent
The AccessibleComponent interface provides the standard mechanism for an assistive technology to determine and set the graphical representation of an object.
Interface AccessibleLayout
Interface AccessibleLayout is a standard way for assistive technologies,or any other interested product, to navigate through UI components which contain other UI "Containers". These "containers" may be instances of a java.awt.Container, or they may simply be instances of "*.accessibility.Accessible". The idea here is to provide a standard contract for navigating through components in the UI. Sun will provide a default implementation of this interface. It simply defines the contract for doing the query. As long as an application uses either java.awt.container or *.accessibility.Accessible to hold UI components, they will can be navigated via the interface AccessibleLayout, and thus "compatible" with Assistive Technologies.
Interface AccessibleSelection
Interface AccessibleSelection interface provides the standard mechanism for an assistive technology to determine what the current selected children are, as well as modify the selection set. Any object that has children that can be selected should support this the AccessibleSelection interface.
Interface AccessibleText
Interface AccessibleText is the rich text portion of the Java Accessibility interface. It contains new methods for querying and manipulating text (getIndexAtPoint, getAtIndex, getAfterIndex, getCharacterAttribute, etc.). The multiple methods in this interface have no parallel in AAJ. Without this interface text rendered with Java2D would be completely inaccessible when Java2D bypass's the screen readers' Off-Screen-Model. Sun feels this interface should be implemented on every applications UI component, so that the application will be "compatible" with Assistive technologies.
Interface AccessibleValue
Interface AccessibleValue contains methods that can set and retrieve a  numerical representation of objects.  By numerical  representating an inherently numerical obect with a minimum and maximum value, comparisons of objects can be done easier.
Class AbstractAccessible
The vast majority of UI components in Java are extensions of the class java.awt.Component. The java.awt.Component contains public methods for retrieving accessibility information needed to be "compatible" in Assistive Technologies. Interface Accessible contains methods from java.awt.Component that most UI components don't need to do anything special with, so by extending java.awt.component they have everything they need.

class AbstractAccessible contains a default implementation of many of the Accessibility methods in java.awt.Component. It's provided as a convenience to application developers who are creating UI components that do not extend java.awt.component so that they can easily support interface Accessible on those UI components by making them extend AbstractAccessible. The Swing component JTabbedPane uses this class for one of it's inner classes, class Page, which is a very lightweight class for implementing the individual tabs of the JTabbedPane. By having Page extend AbstractAccessible, Page only needed to have add a few methods from interface Accessible in order to provide the necessary accessibility support to be "compatible" with Assistive Technologies.

Class AccessibleBundle
Class AccessibleBundle contains the base class from which the classes AccessibleRole and AccessibleState extend.  It is a simple class that provides methods that  allow you to obtain the localized string for a locale independent key from a predefined ResourceBundle.
It provides the underlying support for making Role and State localizable, extensible, and yet very fast in runtime use for the commonly defined set of roles and states.
Class AccessibleResourceBundle
Class AccessibleResourceBundle contains the set of standard named properties, which should be localized in every language that the application runs in. Any property on the list will be retrievable via the toDisplayString() method in AccessibleEnumeration, AccessibleRole and AccessibleState very efficiently and quickly. Properties not on this list will also be retrievable fully localized via toDisplayString(), but will incur a bit more overhead (the price paid for extensibility).
Class AccessibleRole
Class AccessibleRole extends class AccessibleEnumeration and provides methods for encoding and retrieving the role of a UI component.
Class AccessibleState
Class AccessibleState extends class AccessibleEnumeration and provides methods for encoding and retrieving a single state of a set of possible states of a UI component.
Class AccessibleStateSet
Class AccessibleStateSet provides methods for encoding and retrieving the full set of possible states of a UI component, by collecting and managing a set of AccessibleState objects.

Copyright © 1995-98 Sun Microsystems, Inc. All Rights Reserved. 
Please send comments to: access@sun.com 
Sun 
JavaSoft