java.awt
protected abstract class MenuComponent.AccessibleAWTMenuComponent extends AccessibleContext implements Serializable, AccessibleComponent, AccessibleSelection
Constructor Summary | |
---|---|
protected | 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. |
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.
Parameters: index the index of the specified child within a zero-based list of the component's children
Parameters: listener the new focus listener
getBounds()
method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
Parameters: point the point to check against this component
Returns: true if the point is within this component
See Also: getBounds
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.
Parameters: point the point at which the returned accessible is located
Returns: null
Accessible
child at the supplied
index within the list of children of this component.
Parameters: index the index of the Accessible
child
to retrieve
Returns: null
Accessible
interface. If
all children of this component are accessible, then
the returned value will be the same as the number of
children.
Returns: 0
AccessibleComponent
associated
with this accessible context and its component. As the
context itself implements AccessibleComponent
,
this is the return value.
Returns: the context itself
setName()
.
Returns: a description of the component. Currently, this is just the contents of the name property
See Also: setName
Returns: -1 as the parent, a MenuContainer
is not Accessible
setName()
.
Returns: a localized name for this component. Currently, this is just the contents of the name property
See Also: setName
Accessible
parent of this component.
As the parent of a MenuComponent
is a
MenuContainer
, which doesn't implement
Accessible
, this method returns null.
Returns: null
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.
Returns: AccessibleRole.AWT_COMPONENT
AccessibleSelection
associated
with this accessible context and its component. As the
context itself implements AccessibleSelection
,
this is the return value.
Returns: the context itself
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.
Parameters: index the index of the selected Accessible
child
Accessible
children of this component which are currently selected.
If there are no children currently selected, 0 is returned.
Returns: 0
PropertyChangeListener
s.
Returns: an empty AccessibleStateSet
Returns: the default system background color for menus
See Also: setBackground
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.
Returns: null
See Also: setBounds
Cursor
displayed when the pointer
is positioned over this component. Alternatively, null
is returned if the component doesn't support the cursor
property.
Returns: the default system cursor
See Also: setCursor
Font
used for text created by this component.
Returns: the current font
See Also: setFont
FontMetrics
. Concrete subclasses may
find it more efficient to invoke their peer class directly, if one
is available.
Parameters: font the font about which to retrieve rendering and metric information
Returns: the metrics of the given font, as provided by the system toolkit
Throws: NullPointerException if the supplied font was null
Returns: the default system text color for menus
See Also: setForeground
Returns: the default locale for this JVM instance
getBounds()
method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
Returns: the location of the component, relative to its parent
See Also: setLocation
Returns: the location of the component, relative to the screen
getBounds()
method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
Returns: the size of the component
See Also: setSize
Parameters: index the index of the accessible child to check for selection
Returns: false
Returns: false
See Also: AccessibleAWTMenuComponent
Returns: false
Returns: false
See Also: isVisible
isShowing()
should be
used.
Returns: false
See Also: isShowing AccessibleAWTMenuComponent
Parameters: index the index of the Accessible
child
Parameters: listener the listener to remove
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.Parameters: color the new color to use for the background
See Also: getBackground
getBounds()
.
Concrete subclasses which handle the drawing of an onscreen
menu component should override this method and provide
the appropriate information.
Parameters: rectangle a rectangle which specifies the new bounds of the component
See Also: getBounds
Cursor
used when the pointer is positioned over the
component. Unspecified behaviour occurs when null is given as the new
cursor.
Parameters: cursor the new cursor to use
See Also: getCursor
Parameters: enabled true if the component should be enabled, false otherwise
See Also: isEnabled
Font
used for text created by this component.
Unspecified behaviour occurs when null is given as the new
font.
Parameters: font the new font to use for text.
See Also: getFont
Parameters: color the new foreground color
See Also: getForeground
getBounds()
method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
Parameters: point the location of the component, relative to its parent
See Also: getLocation
getBounds()
method. Subclasses
must provide the bounding rectangle via getBounds()
in order for this method to work.
Parameters: size the new size of the component
See Also: getSize
isShowing()
should be
used.
Parameters: visibility the new visibility of the component -- true if the component is visible, false if not