Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface AccessibleComponent
The AccessibleContext.getAccessibleComponent()
method
should return null
if an object does not implement this
interface.
Method Summary | |
void |
|
boolean | |
Accessible |
|
Color |
|
Rectangle |
|
Cursor |
|
Font |
|
FontMetrics |
|
Color |
|
Point |
|
Point |
|
Dimension |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void | |
void | |
void |
|
void | |
void |
|
void |
|
void | |
void |
|
public void addFocusListener(FocusListener listener)
Adds the specified listener to this component.
- Parameters:
listener
- the listener to add to this component
- See Also:
removeFocusListener(FocusListener)
public boolean contains(Point point)
Tests whether or not the specified point is contained within this component. The coordinates are specified relative to this component's coordinate system.
- Parameters:
point
- the Point to locate
- Returns:
- true if the point is within this component
- Throws:
NullPointerException
- if point is null
- See Also:
getBounds()
public Accessible getAccessibleAt(Point point)
If an object exists at the specified point which is a child of this parent component, and it is accessible, then it is returned.
- Parameters:
point
- the location within this component's coordinate system
- Returns:
- the accessible child object at that point, or null
public Color getBackground()
Get the background color of this component.
- Returns:
- the background color of this component, or null if not supported
- See Also:
setBackground(Color)
public Rectangle getBounds()
Get the bounds of this component relative to its parent - it's width, height, and relative location to its parent.
- Returns:
- the bounds of this component, or null if not on screen
- See Also:
contains(Point)
public Cursor getCursor()
Get the cursor of this component.
- Returns:
- the Cursor of this component, or null if not supported
- See Also:
setCursor(Cursor)
public Font getFont()
Get the font of this component
- Returns:
- the font of the component, or null if not supported
- See Also:
setFont(Font)
public FontMetrics getFontMetrics(Font font)
Get theFontMetrics
of the specified font in this component.
- Parameters:
font
- the specified font
- Returns:
- the metrics for the specified font, or null if not supported
- Throws:
NullPointerException
- if font is null
- See Also:
getFont()
public Color getForeground()
Get the foreground color of this component.
- Returns:
- the foreground color of this component, or null if not supported
- See Also:
setForeground(Color)
public Point getLocation()
Get the location of this component in the parent's coordinate system. The point specified is the top-left corner of this component.
- Returns:
- the location in the parent on screen, or null if off-screen
- See Also:
getBounds()
,getLocationOnScreen()
,setLocation(Point)
public Point getLocationOnScreen()
Get the location of this component in the screen's coordinate space. The point specified is the top-left corner of this component.
- Returns:
- the location on screen, or null if off-screen
- See Also:
getBounds()
,getLocation()
public Dimension getSize()
Get the size of this component - it's width and height.
- Returns:
- the dimensions of this component, or null if not on screen
- See Also:
setSize(Dimension)
public boolean isEnabled()
Indicates whether or not this component is enabled. An object which is enabled also has AccessibleState.ENABLED in its StateSet.
- Returns:
- true if the component is enabled
public boolean isFocusTraversable()
Indicates whether or not this component can accept focus. An object which can accept focus also has AccessibleState.FOCUSABLE in its StateSet.
- Returns:
- true if the component can accept focus
public boolean isShowing()
Indicates whether or not this component is visible by checking the visibility of this component and its ancestors. The component may be hidden on screen by another component like pop-up help. An object which is showing on screen also has AccessibleState.SHOWING in its StateSet.
- Returns:
- true if component and ancestors are visible
public boolean isVisible()
Indicates whether or not this component is visible or intends to be visible although one of its ancestors may not be. An object which is visible also has AccessibleState.VISIBLE in its StateSet. CheckisShowing()
to see if the object is on screen.
- Returns:
- true if the component is visible
public void removeFocusListener(FocusListener listener)
Removes the specified listener from this component.
- Parameters:
listener
- the listener to remove
- See Also:
addFocusListener(FocusListener)
public void requestFocus()
If this method is called this component will attempt to gain focus, but if it cannot accept focus nothing happens. On success, the StateSet will contain AccessibleState.FOCUSED
- See Also:
isFocusTraversable()
,AccessibleState.FOCUSED
public void setBackground(Color color)
Set the background color of this component to the specified color.
- Parameters:
color
- the color to set the background to
- See Also:
getBackground()
public void setBounds(Rectangle rectangle)
Set the bounds of this component to the specified height and width, and relative location to its parent.
- Parameters:
rectangle
- the new height, width, and relative location
- Throws:
NullPointerException
- if rectangle is null
public void setCursor(Cursor cursor)
Set the cursor of the component.
- Parameters:
cursor
- the graphical representation of the cursor to use
- See Also:
getCursor()
public void setEnabled(boolean b)
Set this component to an enabled or disabled state.
- Parameters:
b
- true to enable the component, else disable it
- See Also:
isEnabled()
public void setFont(Font font)
Set the font of this component.
- Parameters:
font
- the font to use
- See Also:
getFont()
public void setForeground(Color color)
Set the foreground color of this component.
- Parameters:
color
- the color to set the foreground to
- See Also:
getForeground()
public void setLocation(Point point)
Set the location of this component relative to its parent. The point specified represents the top-left corner of this component.
- Parameters:
point
- the top-left corner of this component relative to the parent
- Throws:
NullPointerException
- if point is null
- See Also:
getLocation()
public void setSize(Dimension dimension)
Set the size of this component to the given dimensions.
- Parameters:
dimension
- the new size of the component
- Throws:
NullPointerException
- if dimension is null
- See Also:
getSize()
public void setVisible(boolean b)
Set the visible state of this component.
- Parameters:
b
- true to make the component visible, else hide it
- See Also:
isVisible()