java.awt
Class Component.AccessibleAWTComponent
java.lang.Object
|
+--javax.accessibility.AccessibleContext
|
+--java.awt.Component.AccessibleAWTComponent
All Implemented Interfaces:
Serializable, AccessibleComponent
This class provides accessibility support for subclasses of container.
Since:Author:- Eric Blake <ebb9@email.byu.edu>
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.
AccessibleAWTComponent
protected AccessibleAWTComponent()
The default constructor.
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:
- the accessible child at that point
Throws:
getAccessibleChild
public Accessible getAccessibleChild(int i)
Returns the ith accessible child. Subclasses must override this if
they can have children.
Parameters:
Returns:
- the ith accessible child, or null
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:
- the number of accessible children, default 0
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:
- a description of this component
See Also:
getAccessibleIndexInParent
public int getAccessibleIndexInParent()
Returns the index of this component in its accessible parent.
Returns:
- the index, or -1 if the parent is not accessible
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:
- the location relative to screen coordinates, if showing
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:
- true if the component is enabled
See Also:
isFocusTraversable
public boolean isFocusTraversable()
Tests whether this component can accept focus.
Returns:
- true if this is focus traversable
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: