|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.accessibility.AccessibleContext
java.awt.MenuComponent.AccessibleAWTMenuComponent
protected abstract class MenuComponent.AccessibleAWTMenuComponent
This class provides a base for the accessibility support of menu components.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
protected |
MenuComponent.AccessibleAWTMenuComponent()
This is the default constructor. |
| Method Summary | |
|---|---|
void |
addAccessibleSelection(int index)
Replaces or supplements the component's selection with the Accessible child at the supplied index. |
void |
addFocusListener(FocusListener listener)
Registers the specified focus listener to receive focus events from this component. |
void |
clearAccessibleSelection()
Clears the component's current selection. |
boolean |
contains(Point point)
Returns true if the specified point lies within the component. |
Accessible |
getAccessibleAt(Point point)
Returns the Accessible child of this component present
at the specified point. |
Accessible |
getAccessibleChild(int index)
Returns the Accessible child at the supplied
index within the list of children of this component. |
int |
getAccessibleChildrenCount()
Returns the number of children of this component which implement the Accessible interface. |
AccessibleComponent |
getAccessibleComponent()
Retrieves the AccessibleComponent associated
with this accessible context and its component. |
String |
getAccessibleDescription()
Returns the accessible name for this menu component. |
int |
getAccessibleIndexInParent()
Retrieves the index of this component within its parent. |
String |
getAccessibleName()
Returns the accessible name of this component. |
Accessible |
getAccessibleParent()
Returns the Accessible parent of this component. |
AccessibleRole |
getAccessibleRole()
Returns the accessible role of this component. |
AccessibleSelection |
getAccessibleSelection()
Retrieves the AccessibleSelection associated
with this accessible context and its component. |
Accessible |
getAccessibleSelection(int index)
Retrieves the Accessible selected child
at the specified index. |
int |
getAccessibleSelectionCount()
Returns a count of the number of Accessible
children of this component which are currently selected. |
AccessibleStateSet |
getAccessibleStateSet()
Retrieves the current state of this component in an accessible form. |
Color |
getBackground()
Returns the background color of the component, or null if this property is unsupported. |
Rectangle |
getBounds()
Returns a Rectangle which represents the
bounds of this component. |
Cursor |
getCursor()
Returns the Cursor displayed when the pointer
is positioned over this component. |
Font |
getFont()
Returns the Font used for text created by this component. |
FontMetrics |
getFontMetrics(Font font)
Retrieves information on the rendering and metrics of the supplied font. |
Color |
getForeground()
Returns the foreground color of the component, or null if this property is unsupported. |
Locale |
getLocale()
Returns the locale currently in use by this component. |
Point |
getLocation()
Returns the location of the component, with co-ordinates relative to the parent component and using the co-ordinate space of the screen. |
Point |
getLocationOnScreen()
Returns the location of the component, with co-ordinates relative to the screen. |
Dimension |
getSize()
Returns the size of the component. |
boolean |
isAccessibleChildSelected(int index)
Returns true if the accessible child specified by the supplied index is currently selected. |
boolean |
isEnabled()
Returns true if this component is currently enabled. |
boolean |
isFocusTraversable()
Returns true if this component is included in the traversal of the current focus from one component to the other. |
boolean |
isShowing()
Returns true if the component is being shown on screen. |
boolean |
isVisible()
Returns true if the component is visible. |
void |
removeAccessibleSelection(int index)
Removes the accessible child specified by the supplied index from the list of currently selected children. |
void |
removeFocusListener(FocusListener listener)
Removes the specified focus listener from the list of registered focus listeners for this component. |
void |
requestFocus()
Requests that this component gains focus. |
void |
selectAllAccessibleSelection()
Selects all Accessible children of this component which
it is possible to select. |
void |
setBackground(Color color)
Sets the background color of the component to that specified. |
void |
setBounds(Rectangle rectangle)
Sets the height and width of the component, and its position relative to this component's parent, to the values specified by the supplied rectangle. |
void |
setCursor(Cursor cursor)
Sets the Cursor used when the pointer is positioned over the
component. |
void |
setEnabled(boolean enabled)
Sets the enabled/disabled state of this component. |
void |
setFont(Font font)
Sets the Font used for text created by this component. |
void |
setForeground(Color color)
Sets the foreground color of the component to that specified. |
void |
setLocation(Point point)
Sets the location of the component, with co-ordinates relative to the parent component and using the co-ordinate space of the screen. |
void |
setSize(Dimension size)
Sets the size of the component. |
void |
setVisible(boolean visibility)
Sets the visibility state of the component. |
| Methods inherited from class javax.accessibility.AccessibleContext |
|---|
addPropertyChangeListener, firePropertyChange, getAccessibleAction, getAccessibleEditableText, getAccessibleIcon, getAccessibleRelationSet, getAccessibleTable, getAccessibleText, getAccessibleValue, removePropertyChangeListener, setAccessibleDescription, setAccessibleName, setAccessibleParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected MenuComponent.AccessibleAWTMenuComponent()
| Method Detail |
|---|
public void addAccessibleSelection(int index)
Accessible child at the supplied index. If
the component supports multiple selection, the child is
added to the current selection. Otherwise, the current
selection becomes the specified child. If the child is
already selected, nothing happens.
addAccessibleSelection in interface AccessibleSelectionindex - the index of the specified child within a
zero-based list of the component's childrenpublic void addFocusListener(FocusListener listener)
addFocusListener in interface AccessibleComponentlistener - the new focus listenerAccessibleComponent.removeFocusListener(FocusListener)public void clearAccessibleSelection()
clearAccessibleSelection in interface AccessibleSelectionpublic boolean contains(Point point)
getBounds() method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
contains in interface AccessibleComponentpoint - the point to check against this component
getBounds()public Accessible getAccessibleAt(Point point)
Accessible child of this component present
at the specified point. The supplied co-ordinates are
assumed to be relative to the co-ordinate system of this
component (the parent of any returned accessible). Thus,
the point (0,0) is the upper left corner of this menu
component.
getAccessibleAt in interface AccessibleComponentpoint - the point at which the returned accessible
is located
public Accessible getAccessibleChild(int index)
Accessible child at the supplied
index within the list of children of this component.
getAccessibleChild in class AccessibleContextindex - the index of the Accessible child
to retrieve
AccessibleContext.getAccessibleChildrenCount()public int getAccessibleChildrenCount()
Accessible interface. If
all children of this component are accessible, then
the returned value will be the same as the number of
children.
getAccessibleChildrenCount in class AccessibleContextAccessibleContext.getAccessibleChild(int)public AccessibleComponent getAccessibleComponent()
AccessibleComponent associated
with this accessible context and its component. As the
context itself implements AccessibleComponent,
this is the return value.
getAccessibleComponent in class AccessibleContextAccessibleComponentpublic String getAccessibleDescription()
setName().
getAccessibleDescription in class AccessibleContextMenuComponent.setName(String)public int getAccessibleIndexInParent()
getAccessibleIndexInParent in class AccessibleContextMenuContainer
is not AccessibleAccessibleContext.getAccessibleParent(),
AccessibleContext.getAccessibleChildrenCount(),
AccessibleContext.getAccessibleChild(int)public String getAccessibleName()
setName().
getAccessibleName in class AccessibleContextMenuComponent.setName(String)public Accessible getAccessibleParent()
Accessible parent of this component.
As the parent of a MenuComponent is a
MenuContainer, which doesn't implement
Accessible, this method returns null.
getAccessibleParent in class AccessibleContextpublic AccessibleRole getAccessibleRole()
AccessibleRole.AWT_COMPONENT,
as the abstract component has no specific role. This
method should be overridden by concrete subclasses, so
as to return an appropriate role for the component.
getAccessibleRole in class AccessibleContextAccessibleRole.AWT_COMPONENTAccessibleRolepublic AccessibleSelection getAccessibleSelection()
AccessibleSelection associated
with this accessible context and its component. As the
context itself implements AccessibleSelection,
this is the return value.
getAccessibleSelection in class AccessibleContextAccessibleSelectionpublic Accessible getAccessibleSelection(int index)
Accessible selected child
at the specified index. If there are no selected children
or the index is outside the range of selected children,
null is returned. Please note that the index refers
to the index of the child in the list of selected
children, and not the index of the child in
the list of all Accessible children.
getAccessibleSelection in interface AccessibleSelectionindex - the index of the selected Accessible
child
AccessibleSelection.getAccessibleSelectionCount()public int getAccessibleSelectionCount()
Accessible
children of this component which are currently selected.
If there are no children currently selected, 0 is returned.
getAccessibleSelectionCount in interface AccessibleSelectionpublic AccessibleStateSet getAccessibleStateSet()
PropertyChangeListeners.
getAccessibleStateSet in class AccessibleContextAccessibleStateSetAccessibleState,
AccessibleStateSet,
AccessibleContext.addPropertyChangeListener(PropertyChangeListener)public Color getBackground()
getBackground in interface AccessibleComponentsetBackground(java.awt.Color)public Rectangle getBounds()
Rectangle which represents the
bounds of this component. The returned rectangle has the
height and width of the component's bounds, and is positioned
at a location relative to this component's parent, the
MenuContainer. null is returned if bounds
are not supported by the component.
getBounds in interface AccessibleComponentsetBounds(java.awt.Rectangle)public Cursor getCursor()
Cursor displayed when the pointer
is positioned over this component. Alternatively, null
is returned if the component doesn't support the cursor
property.
getCursor in interface AccessibleComponentsetCursor(java.awt.Cursor)public Font getFont()
Font used for text created by this component.
getFont in interface AccessibleComponentsetFont(java.awt.Font)public FontMetrics getFontMetrics(Font font)
FontMetrics. Concrete subclasses may
find it more efficient to invoke their peer class directly, if one
is available.
getFontMetrics in interface AccessibleComponentfont - the font about which to retrieve rendering and metric
information
NullPointerException - if the supplied font was nullAccessibleComponent.getFont()public Color getForeground()
getForeground in interface AccessibleComponentsetForeground(java.awt.Color)public Locale getLocale()
getLocale in class AccessibleContextpublic Point getLocation()
getBounds() method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
getLocation in interface AccessibleComponentsetLocation(java.awt.Point)public Point getLocationOnScreen()
getLocationOnScreen in interface AccessibleComponentAccessibleComponent.getBounds(),
AccessibleComponent.getLocation()public Dimension getSize()
getBounds() method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
getSize in interface AccessibleComponentsetSize(java.awt.Dimension)public boolean isAccessibleChildSelected(int index)
isAccessibleChildSelected in interface AccessibleSelectionindex - the index of the accessible child to check for selection
public boolean isEnabled()
isEnabled in interface AccessibleComponentsetEnabled(boolean)public boolean isFocusTraversable()
isFocusTraversable in interface AccessibleComponentAccessibleContext.getAccessibleStateSet(),
AccessibleState.FOCUSABLE,
AccessibleState.FOCUSEDpublic boolean isShowing()
isShowing in interface AccessibleComponentisVisible()public boolean isVisible()
isShowing() should be
used.
isVisible in interface AccessibleComponentisShowing(),
setVisible(boolean)public void removeAccessibleSelection(int index)
removeAccessibleSelection in interface AccessibleSelectionindex - the index of the Accessible childpublic void removeFocusListener(FocusListener listener)
removeFocusListener in interface AccessibleComponentlistener - the listener to removeAccessibleComponent.addFocusListener(FocusListener)public void requestFocus()
requestFocus in interface AccessibleComponentAccessibleComponent.isFocusTraversable(),
AccessibleState.FOCUSEDpublic void selectAllAccessibleSelection()
Accessible children of this component which
it is possible to select. The component needs to support multiple
selections.
addAccessibleSelection to
add each Accessible child to the selection. The last
Accessible component is thus selected for components
which don't support multiple selections. Concrete implementations should
override this with a more appopriate and efficient implementation, which
properly takes into account the ability of the component to support multiple
selections.
selectAllAccessibleSelection in interface AccessibleSelectionpublic void setBackground(Color color)
setBackground in interface AccessibleComponentcolor - the new color to use for the backgroundgetBackground()public void setBounds(Rectangle rectangle)
getBounds().
Concrete subclasses which handle the drawing of an onscreen
menu component should override this method and provide
the appropriate information.
setBounds in interface AccessibleComponentrectangle - a rectangle which specifies the new bounds of
the componentgetBounds()public void setCursor(Cursor cursor)
Cursor used when the pointer is positioned over the
component. Unspecified behaviour occurs when null is given as the new
cursor.
setCursor in interface AccessibleComponentcursor - the new cursor to usegetCursor()public void setEnabled(boolean enabled)
setEnabled in interface AccessibleComponentenabled - true if the component should be enabled,
false otherwiseisEnabled()public void setFont(Font font)
Font used for text created by this component.
Unspecified behaviour occurs when null is given as the new
font.
setFont in interface AccessibleComponentfont - the new font to use for text.getFont()public void setForeground(Color color)
setForeground in interface AccessibleComponentcolor - the new foreground colorgetForeground()public void setLocation(Point point)
getBounds() method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
setLocation in interface AccessibleComponentpoint - the location of the component, relative to its parentgetLocation()public void setSize(Dimension size)
getBounds() method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
setSize in interface AccessibleComponentsize - the new size of the componentgetSize()public void setVisible(boolean visibility)
isShowing() should be
used.
setVisible in interface AccessibleComponentvisibility - the new visibility of the component -- true if
the component is visible, false if notisShowing(),
isVisible()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||