javax.swing

Class JComponent.AccessibleJComponent

Enclosing Class:
JComponent
Implemented Interfaces:
AccessibleComponent, AccessibleExtendedComponent, Serializable
Known Direct Subclasses:
AbstractButton.AccessibleAbstractButton, JColorChooser.AccessibleJColorChooser, JComboBox.AccessibleJComboBox, JDesktopPane.AccessibleJDesktopPane, JFileChooser.AccessibleJFileChooser, JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon.AccessibleJDesktopIcon, JLabel.AccessibleJLabel, JLayeredPane.AccessibleJLayeredPane, JList.AccessibleJList, JMenuBar.AccessibleJMenuBar, JOptionPane.AccessibleJOptionPane, JPanel.AccessibleJPanel, JPopupMenu.AccessibleJPopupMenu, JProgressBar.AccessibleJProgressBar, JRootPane.AccessibleJRootPane, JScrollBar.AccessibleJScrollBar, JScrollPane.AccessibleJScrollPane, JSeparator.AccessibleJSeparator, JSlider.AccessibleJSlider, JSplitPane.AccessibleJSplitPane, JTabbedPane.AccessibleJTabbedPane, JTable.AccessibleJTable, JTableHeader.AccessibleJTableHeader, JTextComponent.AccessibleJTextComponent, JToolBar.AccessibleJToolBar, JToolTip.AccessibleJToolTip, JTree.AccessibleJTree, JViewport.AccessibleJViewport

public abstract class JComponent.AccessibleJComponent
extends Container.AccessibleAWTContainer
implements AccessibleExtendedComponent

Basic accessibility support for JComponent derived widgets.
See Also:
Serialized Form

Nested Class Summary

protected class
JComponent.AccessibleJComponent.AccessibleContainerHandler
Receives notification if there are child components are added or removed from the JComponent and fires appropriate PropertyChangeEvents to interested listeners on the AccessibleJComponent.
protected class
JComponent.AccessibleJComponent.AccessibleFocusHandler
Receives notification if the focus on the JComponent changes and fires appropriate PropertyChangeEvents to listeners registered with the AccessibleJComponent.

Nested classes/interfaces inherited from class java.awt.Container.AccessibleAWTContainer

Container.AccessibleAWTContainer.AccessibleContainerHandler

Nested classes/interfaces inherited from class java.awt.Component.AccessibleAWTComponent

Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler

Field Summary

protected ContainerListener
accessibleContainerHandler
Receives notification when a child component is added to the JComponent and fires a PropertyChangeEvent on listeners registered with the AccessibleJComponent.
protected FocusListener
accessibleFocusHandler
Receives notification if the focus on the JComponent changes and fires appropriate PropertyChangeEvents to listeners registered with the AccessibleJComponent.

Fields inherited from class java.awt.Container.AccessibleAWTContainer

accessibleContainerHandler

Fields inherited from class java.awt.Component.AccessibleAWTComponent

accessibleAWTComponentHandler, accessibleAWTFocusHandler

Fields inherited from class javax.accessibility.AccessibleContext

ACCESSIBLE_ACTION_PROPERTY, ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_CHILD_PROPERTY, ACCESSIBLE_COMPONENT_BOUNDS_CHANGED, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_HYPERTEXT_OFFSET, ACCESSIBLE_INVALIDATE_CHILDREN, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TABLE_CAPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED, ACCESSIBLE_TABLE_MODEL_CHANGED, ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_ROW_HEADER_CHANGED, ACCESSIBLE_TABLE_SUMMARY_CHANGED, ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY, accessibleDescription, accessibleName, accessibleParent

Constructor Summary

AccessibleJComponent()
Creates a new AccessibleJComponent.

Method Summary

void
addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener to the list of registered listeners.
Accessible
getAccessibleChild(int i)
Returns the accessible child component at index i.
int
getAccessibleChildrenCount()
Returns the number of accessible children of this object.
String
getAccessibleDescription()
Returns the localized description of this object.
AccessibleKeyBinding
getAccessibleKeyBinding()
Returns the keybindings associated with this accessible component or null if the component does not support key bindings.
String
getAccessibleName()
Returns the localized name for this object.
AccessibleRole
getAccessibleRole()
Returns the accessible role of this component.
AccessibleStateSet
getAccessibleStateSet()
Returns the accessible state set of this component.
protected String
getBorderTitle(Border border)
Recursivly searches a border hierarchy (starting at border) for a titled border and returns the title if one is found, null otherwise.
String
getTitledBorderText()
Returns the title of the border of this accessible component if this component has a titled border, otherwise returns null.
String
getToolTipText()
Returns the tooltip text for this accessible component.
void
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener from the list of registered listeners.

Methods inherited from class java.awt.Container.AccessibleAWTContainer

getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount

Methods inherited from class java.awt.Component.AccessibleAWTComponent

addFocusListener, addPropertyChangeListener, contains, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRole, getAccessibleStateSet, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocale, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, removePropertyChangeListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible

Methods inherited from class javax.accessibility.AccessibleContext

addPropertyChangeListener, firePropertyChange, getAccessibleAction, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleEditableText, getAccessibleIcon, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRelationSet, getAccessibleRole, getAccessibleSelection, getAccessibleStateSet, getAccessibleTable, getAccessibleText, getAccessibleValue, getLocale, removePropertyChangeListener, setAccessibleDescription, setAccessibleName, setAccessibleParent

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

accessibleContainerHandler

protected ContainerListener accessibleContainerHandler
Receives notification when a child component is added to the JComponent and fires a PropertyChangeEvent on listeners registered with the AccessibleJComponent.

accessibleFocusHandler

protected FocusListener accessibleFocusHandler
Receives notification if the focus on the JComponent changes and fires appropriate PropertyChangeEvents to listeners registered with the AccessibleJComponent.

Constructor Details

AccessibleJComponent

protected AccessibleJComponent()
Creates a new AccessibleJComponent.

Method Details

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener to the list of registered listeners. This sets up the accessibleContainerHandler and accessibleFocusHandler fields and calls super.addPropertyChangeListener(listener).
Overrides:
addPropertyChangeListener in interface Component.AccessibleAWTComponent
Parameters:
listener - the listener to add

getAccessibleChild

public Accessible getAccessibleChild(int i)
Returns the accessible child component at index i.
Overrides:
getAccessibleChild in interface Container.AccessibleAWTContainer
Parameters:
i - the index of the accessible child to return
Returns:
the accessible child component at index i

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children of this object.
Overrides:
getAccessibleChildrenCount in interface Container.AccessibleAWTContainer
Returns:
the number of accessible children of this object

getAccessibleDescription

public String getAccessibleDescription()
Returns the localized description of this object.
Overrides:
getAccessibleDescription in interface Component.AccessibleAWTComponent
Returns:
the localized description of this object or null if this object has no description

getAccessibleKeyBinding

public AccessibleKeyBinding getAccessibleKeyBinding()
Returns the keybindings associated with this accessible component or null if the component does not support key bindings.
Specified by:
getAccessibleKeyBinding in interface AccessibleExtendedComponent
Returns:
the keybindings associated with this accessible component

getAccessibleName

public String getAccessibleName()
Returns the localized name for this object. Generally this should almost never return Component.getName() since that is not a localized name. If the object is some kind of text component (like a menu item), then the value of the object may be returned. Also, if the object has a tooltip, the value of the tooltip may also be appropriate.
Overrides:
getAccessibleName in interface Component.AccessibleAWTComponent
Returns:
the localized name for this object or null if this object has no name

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role of this component.
Overrides:
getAccessibleRole in interface Component.AccessibleAWTComponent
Returns:
the accessible role of this component

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state set of this component.
Overrides:
getAccessibleStateSet in interface Component.AccessibleAWTComponent
Returns:
the accessible state set of this component

getBorderTitle

protected String getBorderTitle(Border border)
Recursivly searches a border hierarchy (starting at border) for a titled border and returns the title if one is found, null otherwise.
Parameters:
border - the border to start search from
Returns:
the border title of a possibly found titled border

getTitledBorderText

public String getTitledBorderText()
Returns the title of the border of this accessible component if this component has a titled border, otherwise returns null.
Specified by:
getTitledBorderText in interface AccessibleExtendedComponent
Returns:
the title of the border of this accessible component if this component has a titled border, otherwise returns null

getToolTipText

public String getToolTipText()
Returns the tooltip text for this accessible component.
Specified by:
getToolTipText in interface AccessibleExtendedComponent
Returns:
the tooltip text for this accessible component

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener from the list of registered listeners. This uninstalls the accessibleContainerHandler and accessibleFocusHandler fields and calls super.removePropertyChangeListener(listener).
Overrides:
removePropertyChangeListener in interface Component.AccessibleAWTComponent
Parameters:
listener - the listener to remove

JComponent.java -- Every component in swing inherits from this class. Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.