javax.swing

Class JList.AccessibleJList.AccessibleJListChild

Enclosing Class:
JList.AccessibleJList
Implemented Interfaces:
Accessible, AccessibleComponent

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

Provides accessibility support for list elements in JLists.

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

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

Method Summary

void
addFocusListener(FocusListener listener)
Adds a focus listener to the parent list.
void
addPropertyChangeListener(PropertyChangeListener l)
This method does nothing, list children are transient accessible objects which means that they don't fire property change events.
boolean
contains(Point point)
Returns true if this list child covers the screen location point (relative to the JList coordinate system, false otherwise.
Accessible
getAccessibleAt(Point point)
Returns null because list children do not have children themselves
Accessible
getAccessibleChild(int i)
Returns null since list children don't have children themselves.
int
getAccessibleChildrenCount()
Returns 0 since list children don't have children themselves.
AccessibleContext
getAccessibleContext()
Returns the accessible context of this object.
int
getAccessibleIndexInParent()
Returns the index of this list child within it's parent list.
AccessibleRole
getAccessibleRole()
Returns the accessible role of this list item, which is AccessibleRole.LABEL.
AccessibleStateSet
getAccessibleStateSet()
Returns the accessible state set of this list item.
Color
getBackground()
Returns the background color for this list child.
Rectangle
getBounds()
Returns the bounds of this list child.
Cursor
getCursor()
Returns the cursor for this list child.
Font
getFont()
Returns the font of the JList since it is not possible to set fonts for list children individually.
FontMetrics
getFontMetrics(Font font)
Returns the font metrics for the specified font.
Color
getForeground()
Returns the foreground color for this list child.
Locale
getLocale()
Returns the locale of this component.
Point
getLocation()
Returns the screen location of this list child relative to it's parent.
Point
getLocationOnScreen()
Returns the absolute screen location of this list child.
Dimension
getSize()
Returns the size of this list child.
boolean
isEnabled()
Returns true if the parent JList is enabled, false otherwise.
boolean
isFocusTraversable()
Returns true since list children are focus traversable.
boolean
isShowing()
Returns true if this list child is currently showing on screen and false otherwise.
boolean
isVisible()
Returns true if this list child is visible, false otherwise.
void
removeFocusListener(FocusListener listener)
Removes a focus listener from the parent list.
void
removePropertyChangeListener(PropertyChangeListener l)
This method does nothing, list children are transient accessible objects which means that they don't fire property change events.
void
requestFocus()
Requests focus on the parent list.
void
setBackground(Color color)
Calling this method has no effect, since the background color cannot be set on list children individually.
void
setBounds(Rectangle rectangle)
Does nothing since the bounds cannot be set on list children individually.
void
setCursor(Cursor cursor)
Sets the cursor for this list child.
void
setEnabled(boolean b)
Does nothing since the enabled flag cannot be set for list children individually.
void
setFont(Font font)
Does nothing since it is not possible to set the font on list children individually.
void
setForeground(Color color)
Calling this method has no effect, since the foreground color cannot be set on list children individually.
void
setLocation(Point point)
Does nothing since the screen location cannot be set on list children explictitly.
void
setSize(Dimension dimension)
Does nothing since the size cannot be set on list children individually.
void
setVisible(boolean b)
The value of the visible property cannot be modified, 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

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 Details

addFocusListener

public void addFocusListener(FocusListener listener)
Adds a focus listener to the parent list. List children do not have their own focus management.
Specified by:
addFocusListener in interface AccessibleComponent
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.
Overrides:
addPropertyChangeListener in interface AccessibleContext
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.
Specified by:
contains in interface AccessibleComponent
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
Specified by:
getAccessibleAt in interface AccessibleComponent
Returns:
null

getAccessibleChild

public Accessible getAccessibleChild(int i)
Returns null since list children don't have children themselves.
Overrides:
getAccessibleChild in interface AccessibleContext
Returns:
null

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns 0 since list children don't have children themselves.
Overrides:
getAccessibleChildrenCount in interface AccessibleContext
Returns:
0

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the accessible context of this object. Returns this since AccessibleJListChilds are their own accessible contexts.
Specified by:
getAccessibleContext in interface Accessible
Returns:
the accessible context of this object, this

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
Returns the index of this list child within it's parent list.
Overrides:
getAccessibleIndexInParent in interface AccessibleContext
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 AccessibleRole.LABEL.
Overrides:
getAccessibleRole in interface AccessibleContext

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state set of this list item.
Overrides:
getAccessibleStateSet in interface AccessibleContext
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
Specified by:
getBackground in interface AccessibleComponent
Returns:
the background color for this list child

getBounds

public Rectangle getBounds()
Returns the bounds of this list child.
Specified by:
getBounds in interface AccessibleComponent
Returns:
the bounds of this list child

getCursor

public Cursor getCursor()
Returns the cursor for this list child.
Specified by:
getCursor in interface AccessibleComponent
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.
Specified by:
getFont in interface AccessibleComponent
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.
Specified by:
getFontMetrics in interface AccessibleComponent
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.
Specified by:
getForeground in interface AccessibleComponent
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.
Overrides:
getLocale in interface AccessibleContext
Returns:
the locale of this component

getLocation

public Point getLocation()
Returns the screen location of this list child relative to it's parent.
Specified by:
getLocation in interface AccessibleComponent
Returns:
the location of this list child relative to it's parent

getLocationOnScreen

public Point getLocationOnScreen()
Returns the absolute screen location of this list child.
Specified by:
getLocationOnScreen in interface AccessibleComponent
Returns:
the absolute screen location of this list child

getSize

public Dimension getSize()
Returns the size of this list child.
Specified by:
getSize in interface AccessibleComponent
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.
Specified by:
isEnabled in interface AccessibleComponent
Returns:
true if the parent JList is enabled, false otherwise

isFocusTraversable

public boolean isFocusTraversable()
Returns true since list children are focus traversable.
Specified by:
isFocusTraversable in interface AccessibleComponent
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.
Specified by:
isShowing in interface AccessibleComponent
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 JList.getFirstVisibleIndex() and JList.getLastVisibleIndex().
Specified by:
isVisible in interface AccessibleComponent
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.
Specified by:
removeFocusListener in interface AccessibleComponent
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.
Overrides:
removePropertyChangeListener in interface AccessibleContext
Parameters:
l - not used here

requestFocus

public void requestFocus()
Requests focus on the parent list. List children cannot request focus individually.
Specified by:
requestFocus in interface AccessibleComponent

setBackground

public void setBackground(Color color)
Calling this method has no effect, since the background color cannot be set on list children individually.
Specified by:
setBackground in interface AccessibleComponent
Parameters:
color - not used here.

setBounds

public void setBounds(Rectangle rectangle)
Does nothing since the bounds cannot be set on list children individually.
Specified by:
setBounds in interface AccessibleComponent
Parameters:
rectangle - not used here

setCursor

public void setCursor(Cursor cursor)
Sets the cursor for this list child.
Specified by:
setCursor in interface AccessibleComponent

setEnabled

public void setEnabled(boolean b)
Does nothing since the enabled flag cannot be set for list children individually.
Specified by:
setEnabled in interface AccessibleComponent
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.
Specified by:
setFont in interface AccessibleComponent
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.
Specified by:
setForeground in interface AccessibleComponent
Parameters:
color - not used here.

setLocation

public void setLocation(Point point)
Does nothing since the screen location cannot be set on list children explictitly.
Specified by:
setLocation in interface AccessibleComponent
Parameters:
point - not used here

setSize

public void setSize(Dimension dimension)
Does nothing since the size cannot be set on list children individually.
Specified by:
setSize in interface AccessibleComponent
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.
Specified by:
setVisible in interface AccessibleComponent
Parameters:
b - not used here

JList.java -- Copyright (C) 2002, 2003, 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.