Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt

Class Component.AccessibleAWTComponent

java.lang.Object
|
+--javax.accessibility.AccessibleContext
   |
   +--java.awt.Component.AccessibleAWTComponent

All Implemented Interfaces:

Serializable, AccessibleComponent


protected abstract class Component.AccessibleAWTComponent

extends AccessibleContext

implements Serializable, AccessibleComponent

This class provides accessibility support for subclasses of container.

Since:Author:

Field Summary

java.awt.event.ComponentListeneraccessibleAWTComponentHandler

Converts show/hide events to PropertyChange events, and is registered as a component listener on this component.
java.awt.event.FocusListeneraccessibleAWTFocusHandler

Converts focus events to PropertyChange events, and is registered as a focus listener on this component.

Constructor Summary

AccessibleAWTComponent()

The default constructor.

Method Summary

voidaddFocusListener(java.awt.event.FocusListener l)

Adds a focus listener.
voidaddPropertyChangeListener(java.beans.PropertyChangeListener l)

Adds a global property change listener to the accessible component.
booleancontains(java.awt.Point p)

Tests if the point is contained in this component.
javax.accessibility.AccessiblegetAccessibleAt(java.awt.Point p)

Returns the Accessible child at a point relative to the coordinate system of this component, if one exists, or null.
javax.accessibility.AccessiblegetAccessibleChild(int i)

Returns the ith accessible child.
intgetAccessibleChildrenCount()

Returns the number of children of this component which implement Accessible.
javax.accessibility.AccessibleComponentgetAccessibleComponent()

Returns this, since it is an accessible component.
java.lang.StringgetAccessibleDescription()

Returns a brief description of this accessible context.
intgetAccessibleIndexInParent()

Returns the index of this component in its accessible parent.
java.lang.StringgetAccessibleName()

Returns the accessible name of this component.
javax.accessibility.AccessiblegetAccessibleParent()

Returns the parent of this component, if it is accessible.
javax.accessibility.AccessibleRolegetAccessibleRole()

Returns the role of this component.
javax.accessibility.AccessibleStateSetgetAccessibleStateSet()

Returns a state set describing this component's state.
java.awt.ColorgetBackground()

Gets the background color.
java.awt.RectanglegetBounds()

Gets the bounds of this component, or null if it is not on screen.
java.awt.CursorgetCursor()

Gets the cursor.
java.awt.FontgetFont()

Gets the font.
java.awt.FontMetricsgetFontMetrics(java.awt.Font f)

Gets the font metrics for a font.
java.awt.ColorgetForeground()

Gets the foreground color.
java.util.LocalegetLocale()

Returns the locale of this component.
java.awt.PointgetLocation()

Returns the location of this object relative to its parent's coordinate system, or null if it is not showing.
java.awt.PointgetLocationOnScreen()

Returns the location of this object on the screen, or null if it is not showing.
java.awt.DimensiongetSize()

Gets the size of this component, or null if it is not showing.
booleanisEnabled()

Tests if the component is enabled.
booleanisFocusTraversable()

Tests whether this component can accept focus.
booleanisShowing()

Tests if the component is showing.
booleanisVisible()

Test whether the component is visible (not necesarily showing).
voidremoveFocusListener(java.awt.event.FocusListener l)

Removes a focus listener.
voidremovePropertyChangeListener(java.beans.PropertyChangeListener l)

Removes a global property change listener from this accessible component.
voidrequestFocus()

Requests focus for this component.
voidsetBackground(java.awt.Color c)

Sets the background color.
voidsetBounds(java.awt.Rectangle r)

Sets the bounds of this component.
voidsetCursor(java.awt.Cursor cursor)

Sets the cursor.
voidsetEnabled(boolean b)

Set whether the component is enabled.
voidsetFont(java.awt.Font f)

Sets the font.
voidsetForeground(java.awt.Color c)

Sets the foreground color.
voidsetLocation(java.awt.Point p)

Sets the location of this relative to its parent's coordinate system.
voidsetSize(java.awt.Dimension d)

Sets the size of this component.
voidsetVisible(boolean b)

Sets the visibility of this component.

Field Details

accessibleAWTComponentHandler

protected ComponentListener accessibleAWTComponentHandler

Converts show/hide events to PropertyChange events, and is registered as a component listener on this component.


accessibleAWTFocusHandler

protected FocusListener accessibleAWTFocusHandler

Converts focus events to PropertyChange events, and is registered as a focus listener on this component.


Constructor Details

AccessibleAWTComponent

protected AccessibleAWTComponent()

The default constructor.


Method Details

addFocusListener

public void addFocusListener(java.awt.event.FocusListener l)

Adds a focus listener.

Parameters:


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

Adds a global property change listener to the accessible component.

Parameters:

See Also:


contains

public boolean contains(java.awt.Point p)

Tests if the point is contained in this component.

Parameters:

Returns:

Throws:


getAccessibleAt

public Accessible getAccessibleAt(java.awt.Point p)

Returns the Accessible child at a point relative to the coordinate system of this component, if one exists, or null. Since components have no children, subclasses must override this to get anything besides null.

Parameters:

Returns:

Throws:


getAccessibleChild

public Accessible getAccessibleChild(int i)

Returns the ith accessible child. Subclasses must override this if they can have children.

Parameters:

Returns:

See Also:


getAccessibleChildrenCount

public int getAccessibleChildrenCount()

Returns the number of children of this component which implement Accessible. Subclasses must override this if they can have children.

Returns:


getAccessibleComponent

public AccessibleComponent getAccessibleComponent()

Returns this, since it is an accessible component.

Returns:


getAccessibleDescription

public String getAccessibleDescription()

Returns a brief description of this accessible context. This should be localized.

Returns:

See Also:


getAccessibleIndexInParent

public int getAccessibleIndexInParent()

Returns the index of this component in its accessible parent.

Returns:

See Also:


getAccessibleName

public String getAccessibleName()

Returns the accessible name of this component. It is almost always wrong to return getName(), since it is not localized. In fact, for things like buttons, this should be the text of the button, not the name of the object. The tooltip text might also be appropriate.

Returns:

See Also:


getAccessibleParent

public Accessible getAccessibleParent()

Returns the parent of this component, if it is accessible.

Returns:


getAccessibleRole

public AccessibleRole getAccessibleRole()

Returns the role of this component.

Returns:


getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()

Returns a state set describing this component's state.

Returns:

See Also:


getBackground

public Color getBackground()

Gets the background color.

Returns:

See Also:


getBounds

public Rectangle getBounds()

Gets the bounds of this component, or null if it is not on screen.

Returns:

See Also:


getCursor

public Cursor getCursor()

Gets the cursor.

Returns:

See Also:


getFont

public Font getFont()

Gets the font.

Returns:

See Also:


getFontMetrics

public FontMetrics getFontMetrics(java.awt.Font f)

Gets the font metrics for a font.

Parameters:

Returns:

Throws:

See Also:


getForeground

public Color getForeground()

Gets the foreground color.

Returns:

See Also:


getLocale

public Locale getLocale()

Returns the locale of this component.

Returns:

Throws:


getLocation

public Point getLocation()

Returns the location of this object relative to its parent's coordinate system, or null if it is not showing.

Returns:

See Also:


getLocationOnScreen

public Point getLocationOnScreen()

Returns the location of this object on the screen, or null if it is not showing.

Returns:

See Also:


getSize

public Dimension getSize()

Gets the size of this component, or null if it is not showing.

Returns:

See Also:


isEnabled

public boolean isEnabled()

Tests if the component is enabled.

Returns:

See Also:


isFocusTraversable

public boolean isFocusTraversable()

Tests whether this component can accept focus.

Returns:

See Also:


isShowing

public boolean isShowing()

Tests if the component is showing.

Returns:


isVisible

public boolean isVisible()

Test whether the component is visible (not necesarily showing).

Returns:

See Also:


removeFocusListener

public void removeFocusListener(java.awt.event.FocusListener l)

Removes a focus listener.

Parameters:


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

Removes a global property change listener from this accessible component.

Parameters:


requestFocus

public void requestFocus()

Requests focus for this component.

See Also:


setBackground

public void setBackground(java.awt.Color c)

Sets the background color.

Parameters:

See Also:


setBounds

public void setBounds(java.awt.Rectangle r)

Sets the bounds of this component.

Parameters:

Throws:

See Also:


setCursor

public void setCursor(java.awt.Cursor cursor)

Sets the cursor.

Parameters:

See Also:


setEnabled

public void setEnabled(boolean b)

Set whether the component is enabled.

Parameters:

See Also:


setFont

public void setFont(java.awt.Font f)

Sets the font.

Parameters:

See Also:


setForeground

public void setForeground(java.awt.Color c)

Sets the foreground color.

Parameters:

See Also:


setLocation

public void setLocation(java.awt.Point p)

Sets the location of this relative to its parent's coordinate system.

Parameters:

Throws:

See Also:


setSize

public void setSize(java.awt.Dimension d)

Sets the size of this component.

Parameters:

Throws:

See Also:


setVisible

public void setVisible(boolean b)

Sets the visibility of this component.

Parameters:

See Also: