javax.swing

Class JTable.AccessibleJTable.AccessibleJTableCell

Enclosing Class:
JTable.AccessibleJTable
Implemented Interfaces:
Accessible, AccessibleComponent

protected class JTable.AccessibleJTable.AccessibleJTableCell
extends AccessibleContext
implements Accessible, AccessibleComponent

Provides accessibility support for table cells.

Field Summary

Fields inherited from class javax.accessibility.AccessibleContext

ACCESSIBLE_ACTION_PROPERTY, ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_CHILD_PROPERTY, ACCESSIBLE_COMPONENT_BOUNDS_CHANGED, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_HYPERTEXT_OFFSET, ACCESSIBLE_INVALIDATE_CHILDREN, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TABLE_CAPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED, ACCESSIBLE_TABLE_MODEL_CHANGED, ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_ROW_HEADER_CHANGED, ACCESSIBLE_TABLE_SUMMARY_CHANGED, ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY, accessibleDescription, accessibleName, accessibleParent

Constructor Summary

AccessibleJTableCell(JTable t, int r, int c, int i)
Creates a new AccessibleJTableCell.

Method Summary

void
addFocusListener(FocusListener listener)
Adds a focus listener to this cell.
boolean
contains(Point point)
Returns true if this table cell contains the location at point, false otherwise.
Accessible
getAccessibleAt(Point point)
Table cells have no children, so we return null here.
Accessible
getAccessibleChild(int i)
Returns the accessible child at index i.
int
getAccessibleChildrenCount()
Returns the number of children of this object.
AccessibleContext
getAccessibleContext()
Returns the accessible context of this table cell.
int
getAccessibleIndexInParent()
Returns the index of this cell in the parent object.
AccessibleRole
getAccessibleRole()
Returns the accessible row for the table cell.
AccessibleStateSet
getAccessibleStateSet()
Returns the accessible state set of this accessible table cell.
Color
getBackground()
Returns the background color of this cell.
Rectangle
getBounds()
Returns the bounds of the cell relative to its table.
Cursor
getCursor()
Returns the cursor for this table cell.
Font
getFont()
Returns the font of the table cell.
FontMetrics
getFontMetrics(Font font)
Returns the font metrics for a specified font.
Color
getForeground()
Returns the foreground color of the table cell.
Locale
getLocale()
Returns the locale setting for this accessible table cell.
Point
getLocation()
Returns the location of this cell relative to the table's bounds.
Point
getLocationOnScreen()
Returns the screen location of the table cell.
Dimension
getSize()
Returns the size of the table cell.
boolean
isEnabled()
Returns true if this table cell is enabled, false otherwise.
boolean
isFocusTraversable()
Returns true if this table cell is focus traversable, false otherwise.
boolean
isShowing()
Returns true if this table cell is currently showing on screen.
boolean
isVisible()
Returns true if this cell is visible, false otherwise.
void
removeFocusListener(FocusListener listener)
Removes a focus listener from the cell.
void
requestFocus()
Requests that this table cell gets the keyboard focus.
void
setBackground(Color color)
Sets the background of the cell.
void
setBounds(Rectangle rectangle)
The bounds of the table cells cannot be manipulated directly, so this method does nothing.
void
setCursor(Cursor cursor)
Sets the cursor of the cell.
void
setEnabled(boolean b)
Table cells cannot be disabled or enabled individually, so this method does nothing.
void
setFont(Font font)
Sets the font of the cell.
void
setForeground(Color color)
Sets the foreground of the cell.
void
setLocation(Point point)
The location of the table cells cannot be manipulated directly, so this method does nothing.
void
setSize(Dimension dimension)
The size cannot be set on table cells directly, so this method does nothing.
void
setVisible(boolean b)
The visibility cannot be set on individual table cells, so this method does nothing.

Methods inherited from class javax.accessibility.AccessibleContext

addPropertyChangeListener, firePropertyChange, getAccessibleAction, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleEditableText, getAccessibleIcon, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRelationSet, getAccessibleRole, getAccessibleSelection, getAccessibleStateSet, getAccessibleTable, getAccessibleText, getAccessibleValue, getLocale, removePropertyChangeListener, setAccessibleDescription, setAccessibleName, setAccessibleParent

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

AccessibleJTableCell

public AccessibleJTableCell(JTable t,
                            int r,
                            int c,
                            int i)
Creates a new AccessibleJTableCell.
Parameters:
t - the table
r - the row
c - the column
i - the index of this cell inside the accessible table parent

Method Details

addFocusListener

public void addFocusListener(FocusListener listener)
Adds a focus listener to this cell. The focus listener is really added to the table, so there is no way to find out when an individual cell changes the focus.
Specified by:
addFocusListener in interface AccessibleComponent
Parameters:
listener - the focus listener to add

contains

public boolean contains(Point point)
Returns true if this table cell contains the location at point, false otherwise. point is interpreted as relative to the coordinate system of the table cell.
Specified by:
contains in interface AccessibleComponent
Returns:
true if this table cell contains the location at point, false otherwise

getAccessibleAt

public Accessible getAccessibleAt(Point point)
Table cells have no children, so we return null here.
Specified by:
getAccessibleAt in interface AccessibleComponent
Returns:
null

getAccessibleChild

public Accessible getAccessibleChild(int i)
Returns the accessible child at index i. Table cells don't have children, so we return null here.
Overrides:
getAccessibleChild in interface AccessibleContext
Returns:
null

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of children of this object. Table cells cannot have children, so we return 0 here.
Overrides:
getAccessibleChildrenCount in interface AccessibleContext
Returns:
0

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the accessible context of this table cell. Since accessible table cells are their own accessible context, we return this.
Specified by:
getAccessibleContext in interface Accessible
Returns:
the accessible context of this table cell

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
Returns the index of this cell in the parent object.
Overrides:
getAccessibleIndexInParent in interface AccessibleContext
Returns:
the index of this cell in the parent object

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible row for the table cell.
Overrides:
getAccessibleRole in interface AccessibleContext
Returns:
the accessible row for the table cell

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state set of this accessible table cell.
Overrides:
getAccessibleStateSet in interface AccessibleContext
Returns:
the accessible state set of this accessible table cell

getBackground

public Color getBackground()
Returns the background color of this cell.
Specified by:
getBackground in interface AccessibleComponent
Returns:
the background color of this cell

getBounds

public Rectangle getBounds()
Returns the bounds of the cell relative to its table.
Specified by:
getBounds in interface AccessibleComponent
Returns:
the bounds of the cell relative to its table

getCursor

public Cursor getCursor()
Returns the cursor for this table cell.
Specified by:
getCursor in interface AccessibleComponent
Returns:
the cursor for this table cell

getFont

public Font getFont()
Returns the font of the table cell.
Specified by:
getFont in interface AccessibleComponent
Returns:
the font of the table cell

getFontMetrics

public FontMetrics getFontMetrics(Font font)
Returns the font metrics for a specified font.
Specified by:
getFontMetrics in interface AccessibleComponent
Parameters:
font - the font for which we return the metrics
Returns:
the font metrics for a specified font

getForeground

public Color getForeground()
Returns the foreground color of the table cell.
Specified by:
getForeground in interface AccessibleComponent
Returns:
the foreground color of the table cell

getLocale

public Locale getLocale()
Returns the locale setting for this accessible table cell.
Overrides:
getLocale in interface AccessibleContext
Returns:
the locale setting for this accessible table cell

getLocation

public Point getLocation()
Returns the location of this cell relative to the table's bounds.
Specified by:
getLocation in interface AccessibleComponent
Returns:
the location of this cell relative to the table's bounds

getLocationOnScreen

public Point getLocationOnScreen()
Returns the screen location of the table cell.
Specified by:
getLocationOnScreen in interface AccessibleComponent
Returns:
the screen location of the table cell

getSize

public Dimension getSize()
Returns the size of the table cell.
Specified by:
getSize in interface AccessibleComponent
Returns:
the size of the table cell

isEnabled

public boolean isEnabled()
Returns true if this table cell is enabled, false otherwise.
Specified by:
isEnabled in interface AccessibleComponent
Returns:
true if this table cell is enabled, false otherwise

isFocusTraversable

public boolean isFocusTraversable()
Returns true if this table cell is focus traversable, false otherwise.
Specified by:
isFocusTraversable in interface AccessibleComponent
Returns:
true if this table cell is focus traversable, false otherwise

isShowing

public boolean isShowing()
Returns true if this table cell is currently showing on screen.
Specified by:
isShowing in interface AccessibleComponent
Returns:
true if this table cell is currently showing on screen

isVisible

public boolean isVisible()
Returns true if this cell is visible, false otherwise.
Specified by:
isVisible in interface AccessibleComponent
Returns:
true if this cell is visible, false otherwise

removeFocusListener

public void removeFocusListener(FocusListener listener)
Removes a focus listener from the cell. The focus listener is really removed from the table.
Specified by:
removeFocusListener in interface AccessibleComponent
Parameters:
listener - the listener to remove

requestFocus

public void requestFocus()
Requests that this table cell gets the keyboard focus.
Specified by:
requestFocus in interface AccessibleComponent

setBackground

public void setBackground(Color color)
Sets the background of the cell. Since table cells cannot have individual background colors, this method does nothing. Set the background directly on the table instead.
Specified by:
setBackground in interface AccessibleComponent
Parameters:
color - not used

setBounds

public void setBounds(Rectangle rectangle)
The bounds of the table cells cannot be manipulated directly, so this method does nothing.
Specified by:
setBounds in interface AccessibleComponent
Parameters:
rectangle - not used

setCursor

public void setCursor(Cursor cursor)
Sets the cursor of the cell. Since table cells cannot have individual cursors, this method does nothing. Set the cursor directly on the table instead.
Specified by:
setCursor in interface AccessibleComponent
Parameters:
cursor - not used

setEnabled

public void setEnabled(boolean b)
Table cells cannot be disabled or enabled individually, so this method does nothing. Set the enabled flag on the table itself.
Specified by:
setEnabled in interface AccessibleComponent
Parameters:
b - not used here

setFont

public void setFont(Font font)
Sets the font of the cell. Since table cells cannot have individual fonts, this method does nothing. Set the font directly on the table instead.
Specified by:
setFont in interface AccessibleComponent
Parameters:
font - not used

setForeground

public void setForeground(Color color)
Sets the foreground of the cell. Since table cells cannot have individual foreground colors, this method does nothing. Set the foreground directly on the table instead.
Specified by:
setForeground in interface AccessibleComponent
Parameters:
color - not used

setLocation

public void setLocation(Point point)
The location of the table cells cannot be manipulated directly, so this method does nothing.
Specified by:
setLocation in interface AccessibleComponent
Parameters:
point - not used

setSize

public void setSize(Dimension dimension)
The size cannot be set on table cells directly, so this method does nothing.
Specified by:
setSize in interface AccessibleComponent
Parameters:
dimension - not used

setVisible

public void setVisible(boolean b)
The visibility cannot be set on individual table cells, so this method does nothing. Set the visibility on the table itself.
Specified by:
setVisible in interface AccessibleComponent
Parameters:
b - not used

JTable.java -- Copyright (C) 2002, 2004, 2005, 2006 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.