javax.swing

Class JList.AccessibleJList.AccessibleJListChild

protected class JList.AccessibleJList.AccessibleJListChild extends AccessibleContext implements Accessible, AccessibleComponent

Provides accessibility support for list elements in JLists.
Constructor Summary
AccessibleJListChild(JList list, int index)
Creates a new instance of AccessibleJListChild.
Method Summary
voidaddFocusListener(FocusListener listener)
Adds a focus listener to the parent list.
voidaddPropertyChangeListener(PropertyChangeListener l)
This method does nothing, list children are transient accessible objects which means that they don't fire property change events.
booleancontains(Point point)
Returns true if this list child covers the screen location point (relative to the JList coordinate system, false otherwise.
AccessiblegetAccessibleAt(Point point)
Returns null because list children do not have children themselves
AccessiblegetAccessibleChild(int i)
Returns null since list children don't have children themselves.
intgetAccessibleChildrenCount()
Returns 0 since list children don't have children themselves.
AccessibleContextgetAccessibleContext()
Returns the accessible context of this object.
intgetAccessibleIndexInParent()
Returns the index of this list child within it's parent list.
AccessibleRolegetAccessibleRole()
Returns the accessible role of this list item, which is {@link AccessibleRole#LABEL}.
AccessibleStateSetgetAccessibleStateSet()
Returns the accessible state set of this list item.
ColorgetBackground()
Returns the background color for this list child.
RectanglegetBounds()
Returns the bounds of this list child.
CursorgetCursor()
Returns the cursor for this list child.
FontgetFont()
Returns the font of the JList since it is not possible to set fonts for list children individually.
FontMetricsgetFontMetrics(Font font)
Returns the font metrics for the specified font.
ColorgetForeground()
Returns the foreground color for this list child.
LocalegetLocale()
Returns the locale of this component.
PointgetLocation()
Returns the screen location of this list child relative to it's parent.
PointgetLocationOnScreen()
Returns the absolute screen location of this list child.
DimensiongetSize()
Returns the size of this list child.
booleanisEnabled()
Returns true if the parent JList is enabled, false otherwise.
booleanisFocusTraversable()
Returns true since list children are focus traversable.
booleanisShowing()
Returns true if this list child is currently showing on screen and false otherwise.
booleanisVisible()
Returns true if this list child is visible, false otherwise.
voidremoveFocusListener(FocusListener listener)
Removes a focus listener from the parent list.
voidremovePropertyChangeListener(PropertyChangeListener l)
This method does nothing, list children are transient accessible objects which means that they don't fire property change events.
voidrequestFocus()
Requests focus on the parent list.
voidsetBackground(Color color)
Calling this method has no effect, since the background color cannot be set on list children individually.
voidsetBounds(Rectangle rectangle)
Does nothing since the bounds cannot be set on list children individually.
voidsetCursor(Cursor cursor)
Sets the cursor for this list child.
voidsetEnabled(boolean b)
Does nothing since the enabled flag cannot be set for list children individually.
voidsetFont(Font font)
Does nothing since it is not possible to set the font on list children individually.
voidsetForeground(Color color)
Calling this method has no effect, since the foreground color cannot be set on list children individually.
voidsetLocation(Point point)
Does nothing since the screen location cannot be set on list children explictitly.
voidsetSize(Dimension dimension)
Does nothing since the size cannot be set on list children individually.
voidsetVisible(boolean b)
The value of the visible property cannot be modified, so this method does nothing.

Constructor Detail

AccessibleJListChild

public AccessibleJListChild(JList list, int index)
Creates a new instance of AccessibleJListChild.

Parameters: list the list of which this is an accessible child index the list index for this child

Method Detail

addFocusListener

public void addFocusListener(FocusListener listener)
Adds a focus listener to the parent list. List children do not have their own focus management.

Parameters: listener the focus listener to add

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
This method does nothing, list children are transient accessible objects which means that they don't fire property change events.

Parameters: l not used here

contains

public boolean contains(Point point)
Returns true if this list child covers the screen location point (relative to the JList coordinate system, false otherwise.

Returns: true if this list child covers the screen location point , false otherwise

getAccessibleAt

public Accessible getAccessibleAt(Point point)
Returns null because list children do not have children themselves

Returns: null

getAccessibleChild

public Accessible getAccessibleChild(int i)
Returns null since list children don't have children themselves.

Returns: null

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns 0 since list children don't have children themselves.

Returns: 0

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the accessible context of this object. Returns this since AccessibleJListChilds are their own accessible contexts.

Returns: the accessible context of this object, this

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
Returns the index of this list child within it's parent list.

Returns: the index of this list child within it's parent list

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role of this list item, which is {@link AccessibleRole#LABEL}.

Returns: {@link AccessibleRole#LABEL}

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state set of this list item.

Returns: the accessible state set of this list item

getBackground

public Color getBackground()
Returns the background color for this list child. This returns the background of the JList itself since the background cannot be set on list children individually

Returns: the background color for this list child

getBounds

public Rectangle getBounds()
Returns the bounds of this list child.

Returns: the bounds of this list child

See Also: JList

getCursor

public Cursor getCursor()
Returns the cursor for this list child.

Returns: the cursor for this list child

getFont

public Font getFont()
Returns the font of the JList since it is not possible to set fonts for list children individually.

Returns: the font of the JList

getFontMetrics

public FontMetrics getFontMetrics(Font font)
Returns the font metrics for the specified font. This method forwards to the parent JList.

Parameters: font the font for which the font metrics is queried

Returns: the font metrics for the specified font

getForeground

public Color getForeground()
Returns the foreground color for this list child. This returns the background of the JList itself since the foreground cannot be set on list children individually.

Returns: the background color for this list child

getLocale

public Locale getLocale()
Returns the locale of this component. This call is forwarded to the parent list since list children don't have a separate locale setting.

Returns: the locale of this component

getLocation

public Point getLocation()
Returns the screen location of this list child relative to it's parent.

Returns: the location of this list child relative to it's parent

See Also: JList

getLocationOnScreen

public Point getLocationOnScreen()
Returns the absolute screen location of this list child.

Returns: the absolute screen location of this list child

getSize

public Dimension getSize()
Returns the size of this list child.

Returns: the size of this list child

isEnabled

public boolean isEnabled()
Returns true if the parent JList is enabled, false otherwise. The list children cannot have an enabled flag set individually.

Returns: true if the parent JList is enabled, false otherwise

isFocusTraversable

public boolean isFocusTraversable()
Returns true since list children are focus traversable.

Returns: true

isShowing

public boolean isShowing()
Returns true if this list child is currently showing on screen and false otherwise. The list child is showing if it is visible and if it's parent JList is currently showing.

Returns: true if this list child is currently showing on screen and false otherwise

isVisible

public boolean isVisible()
Returns true if this list child is visible, false otherwise. The value of this property depends on {@link JList#getFirstVisibleIndex()} and {@link JList#getLastVisibleIndex()}.

Returns: true if this list child is visible, false otherwise

removeFocusListener

public void removeFocusListener(FocusListener listener)
Removes a focus listener from the parent list. List children do not have their own focus management.

Parameters: listener the focus listener to remove

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
This method does nothing, list children are transient accessible objects which means that they don't fire property change events.

Parameters: l not used here

requestFocus

public void requestFocus()
Requests focus on the parent list. List children cannot request focus individually.

setBackground

public void setBackground(Color color)
Calling this method has no effect, since the background color cannot be set on list children individually.

Parameters: color not used here.

setBounds

public void setBounds(Rectangle rectangle)
Does nothing since the bounds cannot be set on list children individually.

Parameters: rectangle not used here

setCursor

public void setCursor(Cursor cursor)
Sets the cursor for this list child.

setEnabled

public void setEnabled(boolean b)
Does nothing since the enabled flag cannot be set for list children individually.

Parameters: b not used here

setFont

public void setFont(Font font)
Does nothing since it is not possible to set the font on list children individually.

Parameters: font not used here

setForeground

public void setForeground(Color color)
Calling this method has no effect, since the foreground color cannot be set on list children individually.

Parameters: color not used here.

setLocation

public void setLocation(Point point)
Does nothing since the screen location cannot be set on list children explictitly.

Parameters: point not used here

setSize

public void setSize(Dimension dimension)
Does nothing since the size cannot be set on list children individually.

Parameters: dimension not used here

setVisible

public void setVisible(boolean b)
The value of the visible property cannot be modified, so this method does nothing.

Parameters: b not used here