javax.swing

Class JTable.AccessibleJTable.AccessibleJTableCell

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

Provides accessibility support for table cells.
Constructor Summary
AccessibleJTableCell(JTable t, int r, int c, int i)
Creates a new AccessibleJTableCell.
Method Summary
voidaddFocusListener(FocusListener listener)
Adds a focus listener to this cell.
booleancontains(Point point)
Returns true if this table cell contains the location at point, false otherwise.
AccessiblegetAccessibleAt(Point point)
Table cells have no children, so we return null here.
AccessiblegetAccessibleChild(int i)
Returns the accessible child at index i.
intgetAccessibleChildrenCount()
Returns the number of children of this object.
AccessibleContextgetAccessibleContext()
Returns the accessible context of this table cell.
intgetAccessibleIndexInParent()
Returns the index of this cell in the parent object.
AccessibleRolegetAccessibleRole()
Returns the accessible row for the table cell.
AccessibleStateSetgetAccessibleStateSet()
Returns the accessible state set of this accessible table cell.
ColorgetBackground()
Returns the background color of this cell.
RectanglegetBounds()
Returns the bounds of the cell relative to its table.
CursorgetCursor()
Returns the cursor for this table cell.
FontgetFont()
Returns the font of the table cell.
FontMetricsgetFontMetrics(Font font)
Returns the font metrics for a specified font.
ColorgetForeground()
Returns the foreground color of the table cell.
LocalegetLocale()
Returns the locale setting for this accessible table cell.
PointgetLocation()
Returns the location of this cell relative to the table's bounds.
PointgetLocationOnScreen()
Returns the screen location of the table cell.
DimensiongetSize()
Returns the size of the table cell.
booleanisEnabled()
Returns true if this table cell is enabled, false otherwise.
booleanisFocusTraversable()
Returns true if this table cell is focus traversable, false otherwise.
booleanisShowing()
Returns true if this table cell is currently showing on screen.
booleanisVisible()
Returns true if this cell is visible, false otherwise.
voidremoveFocusListener(FocusListener listener)
Removes a focus listener from the cell.
voidrequestFocus()
Requests that this table cell gets the keyboard focus.
voidsetBackground(Color color)
Sets the background of the cell.
voidsetBounds(Rectangle rectangle)
The bounds of the table cells cannot be manipulated directly, so this method does nothing.
voidsetCursor(Cursor cursor)
Sets the cursor of the cell.
voidsetEnabled(boolean b)
Table cells cannot be disabled or enabled individually, so this method does nothing.
voidsetFont(Font font)
Sets the font of the cell.
voidsetForeground(Color color)
Sets the foreground of the cell.
voidsetLocation(Point point)
The location of the table cells cannot be manipulated directly, so this method does nothing.
voidsetSize(Dimension dimension)
The size cannot be set on table cells directly, so this method does nothing.
voidsetVisible(boolean b)
The visibility cannot be set on individual table cells, so this method does nothing.

Constructor Detail

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 Detail

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.

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.

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.

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.

Returns: null

getAccessibleChildrenCount

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

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.

Returns: the accessible context of this table cell

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
Returns the index of this cell in the parent object.

Returns: the index of this cell in the parent object

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible row for the table cell.

Returns: the accessible row for the table cell

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state set of this accessible table cell.

Returns: the accessible state set of this accessible table cell

getBackground

public Color getBackground()
Returns the background color of this cell.

Returns: the background color of this cell

getBounds

public Rectangle getBounds()
Returns the bounds of the cell relative to its table.

Returns: the bounds of the cell relative to its table

getCursor

public Cursor getCursor()
Returns the cursor for this table cell.

Returns: the cursor for this table cell

getFont

public Font getFont()
Returns the font of the table cell.

Returns: the font of the table cell

getFontMetrics

public FontMetrics getFontMetrics(Font font)
Returns the font metrics for a specified font.

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.

Returns: the foreground color of the table cell

getLocale

public Locale getLocale()
Returns the locale setting for this accessible table cell.

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.

Returns: the location of this cell relative to the table's bounds

getLocationOnScreen

public Point getLocationOnScreen()
Returns the screen location of the table cell.

Returns: the screen location of the table cell

getSize

public Dimension getSize()
Returns the size of the table cell.

Returns: the size of the table cell

isEnabled

public boolean isEnabled()
Returns true if this table cell is enabled, false otherwise.

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.

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.

Returns: true if this table cell is currently showing on screen

isVisible

public boolean isVisible()
Returns true if this cell is visible, false otherwise.

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.

Parameters: listener the listener to remove

requestFocus

public void requestFocus()
Requests that this table cell gets the keyboard focus.

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.

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.

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.

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.

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.

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.

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.

Parameters: point not used

setSize

public void setSize(Dimension dimension)
The size cannot be set on table cells directly, so this method does nothing.

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.

Parameters: b not used