Chapter 22. The javax.accessibility PackageThe javax.accessibility package contains classes and interfaces that define the contract between an accessible application and an assistive technology, such as a screen reader for the vision impaired. All accessible GUI components implement the Accessible interface and must be able to return an AccessibleContext object. AccessibleContext is the main entry point for an assistive technology to obtain information about the component. The methods of AccessibleContext return instances of many of the other classes and interfaces in this package. Figure 22-1 shows the class hierarchy of this package, which is new in Java 1.2. Typically, only GUI component developers and developers of assistive technologies need to use this package. Chapter 3, "Swing Programming Topics", contains an overview of accessibility. Figure 22-1. The javax.accessibility package
This interface is the primary point of interaction between assistive technologies and accessible objects. All accessible objects implement the getAccessibleContext() method of this interface, providing a way for an assistive technology to obtain an AccessibleContext object that describes the accessible object. Component developers should implement this interface for their components, but application developers should never have to use it.
Implementations: Too many classes to list. Passed To: AccessibleContext.setAccessibleParent(), javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode.AccessibleJTreeNode() Returned By: Too many methods to list. Type Of: AccessibleContext.accessibleParent
This interface allows an assistive technology to obtain human-readable descriptions of the actions that an accessible object can perform and request that the object perform any one of them. Any accessible object that can perform one or more actions should return an AccessibleAction object from the getAccessibleAction() method of its AccessibleContext object. Applications never need to use or implement this interface.
Implementations: AccessibleHyperlink, javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode Returned By: AccessibleContext.getAccessibleAction(), javax.swing.AbstractButton.AccessibleAbstractButton.getAccessibleAction(), javax.swing.JComboBox.AccessibleJComboBox.getAccessibleAction(), javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleAction(), javax.swing.JTable.AccessibleJTable.AccessibleJTableCell.getAccessibleAction(), javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode.getAccessibleAction(), javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleAction()
This class is the abstract superclass of both AccessibleRole and AccessibleState. It defines the localized toDisplayString() method. Applications never need to use this class.
Subclasses: AccessibleRole, AccessibleState
This interface allows an assistive technology to query and set basic graphical attributes for an accessible object. Any accessible object that displays itself on the screen should return an object of this type from the getAccessibleComponent() method of its AccessibleContext. Applications never need to use or implement this interface.
Implementations: javax.swing.Box.AccessibleBox, javax.swing.Box.Filler.AccessibleBoxFiller, javax.swing.CellRendererPane.AccessibleCellRendererPane, javax.swing.JApplet.AccessibleJApplet, javax.swing.JComponent.AccessibleJComponent, javax.swing.JDialog.AccessibleJDialog, javax.swing.JFrame.AccessibleJFrame, javax.swing.JList.AccessibleJList.AccessibleJListChild, javax.swing.JPopupMenu.WindowPopup.AccessibleWindowPopup, javax.swing.JTable.AccessibleJTable.AccessibleJTableCell, javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode, javax.swing.JWindow.AccessibleJWindow, javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry Returned By: AccessibleContext.getAccessibleComponent(), javax.swing.Box.AccessibleBox.getAccessibleComponent(), javax.swing.Box.Filler.AccessibleBoxFiller.getAccessibleComponent(), javax.swing.CellRendererPane.AccessibleCellRendererPane.getAccessibleComponent(), javax.swing.JApplet.AccessibleJApplet.getAccessibleComponent(), javax.swing.JComponent.AccessibleJComponent.getAccessibleComponent(), javax.swing.JDialog.AccessibleJDialog.getAccessibleComponent(), javax.swing.JFrame.AccessibleJFrame.getAccessibleComponent(), javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleComponent(), javax.swing.JPopupMenu.WindowPopup.AccessibleWindowPopup.getAccessibleComponent(), javax.swing.JTable.AccessibleJTable.AccessibleJTableCell.getAccessibleComponent(), javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode.getAccessibleComponent(), javax.swing.JWindow.AccessibleJWindow.getAccessibleComponent(), javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleComponent()
This abstract class defines methods that provide basic information about an accessible object. Every Accessible object must be able to return an AccessibleContext to describe itself. The methods of AccessibleContext are largely self-explanatory. They allow an assistive technology to query the name, description, role, parent, children, and so on of the accessible object. In addition to this generic accessibility information, a number of AccessibleContext methods return more specialized objects that contain more specialized types of accessibility information. For example, if an accessible object is a GUI component, getAccessibleComponent() returns an AccessibleComponent object that contains further details about the accessible object. Applications never have to use this class.
Subclasses: javax.swing.Box.AccessibleBox, javax.swing.Box.Filler.AccessibleBoxFiller, javax.swing.CellRendererPane.AccessibleCellRendererPane, javax.swing.JApplet.AccessibleJApplet, javax.swing.JComponent.AccessibleJComponent, javax.swing.JDialog.AccessibleJDialog, javax.swing.JFrame.AccessibleJFrame, javax.swing.JList.AccessibleJList.AccessibleJListChild, javax.swing.JPopupMenu.WindowPopup.AccessibleWindowPopup, javax.swing.JTable.AccessibleJTable.AccessibleJTableCell, javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode, javax.swing.JWindow.AccessibleJWindow, javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry Returned By: Too many methods to list. Type Of: javax.swing.Box.accessibleContext, javax.swing.Box.Filler.accessibleContext, javax.swing.CellRendererPane.accessibleContext, javax.swing.JApplet.accessibleContext, javax.swing.JColorChooser.accessibleContext, javax.swing.JComponent.accessibleContext, javax.swing.JDialog.accessibleContext, javax.swing.JFileChooser.accessibleContext, javax.swing.JFrame.accessibleContext, javax.swing.JWindow.accessibleContext
This abstract class is an AccessibleAction that describes a hyperlink or set of hyperlinks, such as those found in an HTML image map. In addition to the AccessibleAction methods, this class defines getAccessibleActionObject(), which should return an object describing the link, typically a java.net.URL object. getAccessibleActionAnchor() should return the object that displays the link. For HTML hypertext, this is the string or image that appears between the HTML <A> and </A> tags. Applications never need to use this class.
Hierarchy: Object-->AccessibleHyperlink(AccessibleAction) Subclasses: javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink Returned By: AccessibleHypertext.getLink(), javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport.getLink()
This interface extends AccessibleText. It allows an assistive technology to query the text of an accessible object and the hyperlinks contained in that text. Accessible components that display hyperlinked text should return an object of this type from the getAccessibleText() method of their AccessibleContext. The getLink() method of the AccessibleHypertext object should return AccessibleHyperlink objects describing the links. Applications never need to use or implement this interface.
Hierarchy: (AccessibleHypertext(AccessibleText)) Implementations: javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport
This class is a java.util.ResourceBundle that contains all the localized strings for the javax.accessibility package. It is used internally by the package and is not intended for use by applications, components, or assistive technologies.
Hierarchy: Object-->java.util.ResourceBundle-->java.util.ListResourceBundle-->AccessibleResourceBundle
This class exists only to provide a type-safe enumeration of constants that may be legally returned by the getAccessibleRole() method of an AccessibleContext object. An AccessibleRole object describes the role or basic function of an accessible object. The predefined AccessibleRole objects describe the roles played by various Swing components. This set of predefined roles should be sufficient for most purposes, although a specialized component that performs a specialized role could create a new role constant for itself by subclassing AccessibleRole. AccessibleRole inherits toDisplayString() from it superclass. This method returns a localized human-readable string describing the role. Applications never need to use this class.
Hierarchy: Object-->AccessibleBundle-->AccessibleRole Returned By: Too many methods to list. Type Of: Too many fields to list.
This interface allows an assistive technology to query and set the selection state of an accessible object that allows selection of items that are themselves accessible objects. An accessible object with selectable children should return an AccessibleSelection object from the getAccessibleSelection() method of its AccessibleContext. It should also be sure to implement Accessible objects to represent each of the selectable children. As an example, note that JTextComponent allows text to be selected, but this is not a selectable child, so it does not support the AccessibleSelection interface. On the other hand, JList allows selection of discrete child list items. It supports the AccessibleSelection interface and defines the JList.AccessibleJList.AccessibleJListChild to provide accessibility support for the individual items in the list. Applications never need to use or implement this interface.
Implementations: javax.swing.JList.AccessibleJList, javax.swing.JMenu.AccessibleJMenu, javax.swing.JMenuBar.AccessibleJMenuBar, javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTable.AccessibleJTable, javax.swing.JTree.AccessibleJTree, javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode Returned By: AccessibleContext.getAccessibleSelection(), javax.swing.JList.AccessibleJList.getAccessibleSelection(), javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleSelection(), javax.swing.JMenu.AccessibleJMenu.getAccessibleSelection(), javax.swing.JMenuBar.AccessibleJMenuBar.getAccessibleSelection(), javax.swing.JTabbedPane.AccessibleJTabbedPane.getAccessibleSelection(), javax.swing.JTable.AccessibleJTable.getAccessibleSelection(), javax.swing.JTable.AccessibleJTable.AccessibleJTableCell.getAccessibleSelection(), javax.swing.JTree.AccessibleJTree.getAccessibleSelection(), javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode.getAccessibleSelection(), javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleSelection()
This class exists to provide a type-safe enumeration of constants that describe the various states that accessible components may exist in. AccessibleState objects are aggregated into AccessibleStateSet objects, which are returned by the getAccessibleStateSet() method of an AccessibleContext. Every accessible object that is capable of existing in more than one state should return an appropriate set of AccessibleState constants from its AccessibleContext object. AccessibleState inherits toDisplayString() from it superclass. This method returns a localized human-readable string describing the role. Applications never need to use this class.
Hierarchy: Object-->AccessibleBundle-->AccessibleState Passed To: AccessibleStateSet.{AccessibleStateSet(), add(), addAll(), contains(), remove()} Returned By: AccessibleStateSet.toArray() Type Of: Too many fields to list.
This class maintains a list of AccessibleState objects. Every accessible object that can exist in more than one state should return an appropriate AccessibleStateSet describing its current state from the getAccessibleStateSet() method of its AccessibleContext. Applications never need to use this class.
Returned By: Too many methods to list.
This interface allows an assistive technology to query the textual contents, textual selection, and text-insertion positions of an accessible object that contains nonstatic text. An accessible object that contains nonstatic text should return an AccessibleText object from the getAccessibleText() method of its AccessibleContext. Note that components such as JButton and JLabel do not support this interface. They display only static text, and their contents are adequately described by the getAccessibleName() and getAccessibleDescription() methods of the AccessibleContext. Applications never need to use or implement this interface.
Implementations: AccessibleHypertext, javax.swing.text.JTextComponent.AccessibleJTextComponent Returned By: AccessibleContext.getAccessibleText(), javax.swing.JEditorPane.AccessibleJEditorPaneHTML.getAccessibleText(), javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleText(), javax.swing.JTable.AccessibleJTable.AccessibleJTableCell.getAccessibleText(), javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode.getAccessibleText(), javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleText(), javax.swing.text.JTextComponent.AccessibleJTextComponent.getAccessibleText()
This interface allows an assistive technology to set and query the numerical value displayed or maintained by an accessible object, such as a JScrollBar. It also allows an assistive technology to query the legal range of values supported by the accessible object. An accessible object that maintains a numerical value should return an AccessibleValue object from the getAccessibleValue() method of its AccessibleContext. Applications never need to use or implement this interface.
Implementations: javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon.AccessibleJDesktopIcon, javax.swing.JProgressBar.AccessibleJProgressBar, javax.swing.JScrollBar.AccessibleJScrollBar, javax.swing.JSlider.AccessibleJSlider, javax.swing.JSplitPane.AccessibleJSplitPane Returned By: AccessibleContext.getAccessibleValue(), javax.swing.AbstractButton.AccessibleAbstractButton.getAccessibleValue(), javax.swing.JInternalFrame.AccessibleJInternalFrame.getAccessibleValue(), javax.swing.JInternalFrame.JDesktopIcon.AccessibleJDesktopIcon.getAccessibleValue(), javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleValue(), javax.swing.JProgressBar.AccessibleJProgressBar.getAccessibleValue(), javax.swing.JScrollBar.AccessibleJScrollBar.getAccessibleValue(), javax.swing.JSlider.AccessibleJSlider.getAccessibleValue(), javax.swing.JSplitPane.AccessibleJSplitPane.getAccessibleValue(), javax.swing.JTable.AccessibleJTable.AccessibleJTableCell.getAccessibleValue(), javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode.getAccessibleValue(), javax.swing.table.JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry.getAccessibleValue() Copyright © 2001 O'Reilly & Associates. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|