javax.accessibility
Interface AccessibleComponent
- AccessibleExtendedComponent
- AbstractButton.AccessibleAbstractButton, Applet.AccessibleApplet, Box.AccessibleBox, Box.Filler.AccessibleBoxFiller, Button.AccessibleAWTButton, Canvas.AccessibleAWTCanvas, CellRendererPane.AccessibleCellRendererPane, Checkbox.AccessibleAWTCheckbox, CheckboxMenuItem.AccessibleAWTCheckboxMenuItem, Choice.AccessibleAWTChoice, Component.AccessibleAWTComponent, Container.AccessibleAWTContainer, Dialog.AccessibleAWTDialog, Frame.AccessibleAWTFrame, JApplet.AccessibleJApplet, JButton.AccessibleJButton, JCheckBox.AccessibleJCheckBox, JCheckBoxMenuItem.AccessibleJCheckBoxMenuItem, JColorChooser.AccessibleJColorChooser, JComboBox.AccessibleJComboBox, JComponent.AccessibleJComponent, JDesktopPane.AccessibleJDesktopPane, JDialog.AccessibleJDialog, JEditorPane.AccessibleJEditorPane, JEditorPane.AccessibleJEditorPaneHTML, JEditorPane.JEditorPaneAccessibleHypertextSupport, JFileChooser.AccessibleJFileChooser, JFrame.AccessibleJFrame, JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon.AccessibleJDesktopIcon, JLabel.AccessibleJLabel, JLayeredPane.AccessibleJLayeredPane, JList.AccessibleJList, JList.AccessibleJList.AccessibleJListChild, JMenu.AccessibleJMenu, JMenuBar.AccessibleJMenuBar, JMenuItem.AccessibleJMenuItem, JOptionPane.AccessibleJOptionPane, JPanel.AccessibleJPanel, JPasswordField.AccessibleJPasswordField, JPopupMenu.AccessibleJPopupMenu, JProgressBar.AccessibleJProgressBar, JRadioButton.AccessibleJRadioButton, JRadioButtonMenuItem.AccessibleJRadioButtonMenuItem, JRootPane.AccessibleJRootPane, JScrollBar.AccessibleJScrollBar, JScrollPane.AccessibleJScrollPane, JSeparator.AccessibleJSeparator, JSlider.AccessibleJSlider, JSplitPane.AccessibleJSplitPane, JTabbedPane.AccessibleJTabbedPane, JTable.AccessibleJTable, JTable.AccessibleJTable.AccessibleJTableCell, JTableHeader.AccessibleJTableHeader, JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry, JTextArea.AccessibleJTextArea, JTextComponent.AccessibleJTextComponent, JTextField.AccessibleJTextField, JToggleButton.AccessibleJToggleButton, JToolBar.AccessibleJToolBar, JToolTip.AccessibleJToolTip, JTree.AccessibleJTree, JTree.AccessibleJTree.AccessibleJTreeNode, JViewport.AccessibleJViewport, JWindow.AccessibleJWindow, Label.AccessibleAWTLabel, List.AccessibleAWTList, List.AccessibleAWTList.AccessibleAWTListChild, Menu.AccessibleAWTMenu, MenuBar.AccessibleAWTMenuBar, MenuComponent.AccessibleAWTMenuComponent, MenuItem.AccessibleAWTMenuItem, Panel.AccessibleAWTPanel, PopupMenu.AccessibleAWTPopupMenu, Scrollbar.AccessibleAWTScrollBar, ScrollPane.AccessibleAWTScrollPane, TextArea.AccessibleAWTTextArea, TextComponent.AccessibleAWTTextComponent, TextField.AccessibleAWTTextField, Window.AccessibleAWTWindow
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.
void | addFocusListener(FocusListener listener) - Adds the specified listener to this component.
|
boolean | contains(Point point) - Tests whether or not the specified point is contained within
this component.
|
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.
|
Color | getBackground() - Get the background color of this component.
|
Rectangle | getBounds() - Get the bounds of this component relative to its parent - it's width,
height, and relative location to its parent.
|
Cursor | getCursor() - Get the cursor of this component.
|
Font | getFont() - Get the font of this component
|
FontMetrics | getFontMetrics(Font font) - Get the
FontMetrics of the specified font in this component.
|
Color | getForeground() - Get the foreground color of this component.
|
Point | getLocation() - Get the location of this component in the parent's coordinate system.
|
Point | getLocationOnScreen() - Get the location of this component in the screen's coordinate space.
|
Dimension | getSize() - Get the size of this component - it's width and height.
|
boolean | isEnabled() - Indicates whether or not this component is enabled.
|
boolean | isFocusTraversable() - Indicates whether or not this component can accept focus.
|
boolean | isShowing() - Indicates whether or not this component is visible by checking
the visibility of this component and its ancestors.
|
boolean | isVisible() - Indicates whether or not this component is visible or intends to be
visible although one of its ancestors may not be.
|
void | removeFocusListener(FocusListener listener) - Removes the specified listener from this component.
|
void | requestFocus() - If this method is called this component will attempt to gain focus,
but if it cannot accept focus nothing happens.
|
void | setBackground(Color color) - Set the background color of this component to the specified color.
|
void | setBounds(Rectangle rectangle) - Set the bounds of this component to the specified height and width, and
relative location to its parent.
|
void | setCursor(Cursor cursor) - Set the cursor of the component.
|
void | setEnabled(boolean b) - Set this component to an enabled or disabled state.
|
void | setFont(Font font) - Set the font of this component.
|
void | setForeground(Color color) - Set the foreground color of this component.
|
void | setLocation(Point point) - Set the location of this component relative to its parent.
|
void | setSize(Dimension dimension) - Set the size of this component to the given dimensions.
|
void | setVisible(boolean b) - Set the visible state of this component.
|
addFocusListener
public void addFocusListener(FocusListener listener)
Adds the specified listener to this component.
listener
- the listener to add to this component
contains
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.
point
- the Point to locate
- true if the point is within this component
getAccessibleAt
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.
point
- the location within this component's coordinate system
- the accessible child object at that point, or null
getBackground
public Color getBackground()
Get the background color of this component.
- the background color of this component, or null if not supported
getBounds
public Rectangle getBounds()
Get the bounds of this component relative to its parent - it's width,
height, and relative location to its parent.
- the bounds of this component, or null if not on screen
getCursor
public Cursor getCursor()
Get the cursor of this component.
- the Cursor of this component, or null if not supported
getFont
public Font getFont()
Get the font of this component
- the font of the component, or null if not supported
getFontMetrics
public FontMetrics getFontMetrics(Font font)
Get the FontMetrics
of the specified font in this component.
font
- the specified font
- the metrics for the specified font, or null if not supported
getForeground
public Color getForeground()
Get the foreground color of this component.
- the foreground color of this component, or null if not supported
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.
- the location in the parent on screen, or null if off-screen
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.
- the location on screen, or null if off-screen
getSize
public Dimension getSize()
Get the size of this component - it's width and height.
- the dimensions of this component, or null if not on screen
isEnabled
public boolean isEnabled()
Indicates whether or not this component is enabled. An object which is
enabled also has AccessibleState.ENABLED in its StateSet.
- true if the component is enabled
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.
- true if the component can accept focus
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.
- true if component and ancestors are visible
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.
- true if the component is visible
removeFocusListener
public void removeFocusListener(FocusListener listener)
Removes the specified listener from this component.
listener
- the listener to remove
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
setBackground
public void setBackground(Color color)
Set the background color of this component to the specified color.
color
- the color to set the background to
setBounds
public void setBounds(Rectangle rectangle)
Set the bounds of this component to the specified height and width, and
relative location to its parent.
rectangle
- the new height, width, and relative location
setCursor
public void setCursor(Cursor cursor)
Set the cursor of the component.
cursor
- the graphical representation of the cursor to use
setEnabled
public void setEnabled(boolean b)
Set this component to an enabled or disabled state.
b
- true to enable the component, else disable it
setFont
public void setFont(Font font)
Set the font of this component.
setForeground
public void setForeground(Color color)
Set the foreground color of this component.
color
- the color to set the foreground to
setLocation
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.
point
- the top-left corner of this component relative to the parent
setSize
public void setSize(Dimension dimension)
Set the size of this component to the given dimensions.
dimension
- the new size of the component
setVisible
public void setVisible(boolean b)
Set the visible state of this component.
b
- true to make the component visible, else hide it
AccessibleComponent.java -- aids in accessibly rendering Java components
Copyright (C) 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.