Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
javax.accessibility

Interface AccessibleComponent

java.lang.Object
|
+--javax.accessibility.AccessibleComponent


public interface AccessibleComponent

Objects which are to be rendered to a screen as part of a graphical user interface should implement this interface. Accessibility software can use the implementations of this interface to determine and set the screen representation for an object.

The AccessibleContext.getAccessibleComponent() method should return null if an object does not implement this interface.

Since:Author:See Also:

Method Summary

voidaddFocusListener(java.awt.event.FocusListener listener)

Adds the specified listener to this component.
booleancontains(java.awt.Point point)

Tests whether or not the specified point is contained within this component.
javax.accessibility.AccessiblegetAccessibleAt(java.awt.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.
java.awt.ColorgetBackground()

Get the background color of this component.
java.awt.RectanglegetBounds()

Get the bounds of this component relative to its parent - it's width, height, and relative location to its parent.
java.awt.CursorgetCursor()

Get the cursor of this component.
java.awt.FontgetFont()

Get the font of this component
java.awt.FontMetricsgetFontMetrics(java.awt.Font font)

Get the FontMetrics of the specified font in this component.
java.awt.ColorgetForeground()

Get the foreground color of this component.
java.awt.PointgetLocation()

Get the location of this component in the parent's coordinate system.
java.awt.PointgetLocationOnScreen()

Get the location of this component in the screen's coordinate space.
java.awt.DimensiongetSize()

Get the size of this component - it's width and height.
booleanisEnabled()

Indicates whether or not this component is enabled.
booleanisFocusTraversable()

Indicates whether or not this component can accept focus.
booleanisShowing()

Indicates whether or not this component is visible by checking the visibility of this component and its ancestors.
booleanisVisible()

Indicates whether or not this component is visible or intends to be visible although one of its ancestors may not be.
voidremoveFocusListener(java.awt.event.FocusListener listener)

Removes the specified listener from this component.
voidrequestFocus()

If this method is called this component will attempt to gain focus, but if it cannot accept focus nothing happens.
voidsetBackground(java.awt.Color color)

Set the background color of this component to the specified color.
voidsetBounds(java.awt.Rectangle rectangle)

Set the bounds of this component to the specified height and width, and relative location to its parent.
voidsetCursor(java.awt.Cursor cursor)

Set the cursor of the component.
voidsetEnabled(boolean b)

Set this component to an enabled or disabled state.
voidsetFont(java.awt.Font font)

Set the font of this component.
voidsetForeground(java.awt.Color color)

Set the foreground color of this component.
voidsetLocation(java.awt.Point point)

Set the location of this component relative to its parent.
voidsetSize(java.awt.Dimension dimension)

Set the size of this component to the given dimensions.
voidsetVisible(boolean b)

Set the visible state of this component.

Method Details

addFocusListener

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

Adds the specified listener to this component.

Parameters:

See Also:


contains

public boolean contains(java.awt.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:

Returns:

Throws:

See Also:


getAccessibleAt

public Accessible getAccessibleAt(java.awt.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:

Returns:


getBackground

public Color getBackground()

Get the background color of this component.

Returns:

See Also:


getBounds

public Rectangle getBounds()

Get the bounds of this component relative to its parent - it's width, height, and relative location to its parent.

Returns:

See Also:


getCursor

public Cursor getCursor()

Get the cursor of this component.

Returns:

See Also:


getFont

public Font getFont()

Get the font of this component

Returns:

See Also:


getFontMetrics

public FontMetrics getFontMetrics(java.awt.Font font)

Get the FontMetrics of the specified font in this component.

Parameters:

Returns:

Throws:

See Also:


getForeground

public Color getForeground()

Get the foreground color of this component.

Returns:

See Also:


getLocation

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:

See Also:


getLocationOnScreen

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:

See Also:


getSize

public Dimension getSize()

Get the size of this component - it's width and height.

Returns:

See Also:


isEnabled

public boolean isEnabled()

Indicates whether or not this component is enabled. An object which is enabled also has AccessibleState.ENABLED in its StateSet.

Returns:

See Also:


isFocusTraversable

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:

See Also:


isShowing

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:

See Also:


isVisible

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. Check isShowing() to see if the object is on screen.

Returns:

See Also:


removeFocusListener

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

Removes the specified listener from this component.

Parameters:

See Also:


requestFocus

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:


setBackground

public void setBackground(java.awt.Color color)

Set the background color of this component to the specified color.

Parameters:

See Also:


setBounds

public void setBounds(java.awt.Rectangle rectangle)

Set the bounds of this component to the specified height and width, and relative location to its parent.

Parameters:

Throws:


setCursor

public void setCursor(java.awt.Cursor cursor)

Set the cursor of the component.

Parameters:

See Also:


setEnabled

public void setEnabled(boolean b)

Set this component to an enabled or disabled state.

Parameters:

See Also:


setFont

public void setFont(java.awt.Font font)

Set the font of this component.

Parameters:

See Also:


setForeground

public void setForeground(java.awt.Color color)

Set the foreground color of this component.

Parameters:

See Also:


setLocation

public void setLocation(java.awt.Point point)

Set the location of this component relative to its parent. The point specified represents the top-left corner of this component.

Parameters:

Throws:

See Also:


setSize

public void setSize(java.awt.Dimension dimension)

Set the size of this component to the given dimensions.

Parameters:

Throws:

See Also:


setVisible

public void setVisible(boolean b)

Set the visible state of this component.

Parameters:

See Also: