javax.swing

Class ImageIcon.AccessibleImageIcon

protected class ImageIcon.AccessibleImageIcon extends AccessibleContext implements AccessibleIcon, Serializable

Provides the accessibility features for the ImageIcon class.
Constructor Summary
protected AccessibleImageIcon()
Creates a new instance of AccessibleImageIcon.
Method Summary
AccessiblegetAccessibleChild(int i)
Returns the accessible child at index i, which is null in this case because an {@link ImageIcon} has no children.
intgetAccessibleChildrenCount()
Returns the number of accessible children of this component, which is 0, because an {@link ImageIcon} has no children.
StringgetAccessibleIconDescription()
Returns the accessible icon description.
intgetAccessibleIconHeight()
Returns the icon height.
intgetAccessibleIconWidth()
Returns the icon width.
intgetAccessibleIndexInParent()
Returns the index of this object in its accessible parent.
AccessiblegetAccessibleParent()
Returns the accessible parent of this object.
AccessibleRolegetAccessibleRole()
Returns the accessible role for the ImageIcon.
AccessibleStateSetgetAccessibleStateSet()
Returns the accessible state for the ImageIcon.
LocalegetLocale()
Returns the locale of this object.
voidsetAccessibleIconDescription(String newDescr)
Sets the accessible icon description.

Constructor Detail

AccessibleImageIcon

protected AccessibleImageIcon()
Creates a new instance of AccessibleImageIcon.

Method Detail

getAccessibleChild

public Accessible getAccessibleChild(int i)
Returns the accessible child at index i, which is null in this case because an {@link ImageIcon} has no children.

Parameters: i the index of the child to be fetched

Returns: null.

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children of this component, which is 0, because an {@link ImageIcon} has no children.

Returns: 0.

getAccessibleIconDescription

public String getAccessibleIconDescription()
Returns the accessible icon description. This returns the description property of the underlying {@link ImageIcon}.

Returns: The description (possibly null).

See Also: setAccessibleIconDescription

getAccessibleIconHeight

public int getAccessibleIconHeight()
Returns the icon height. This returns the iconHeight property of the underlying {@link ImageIcon}.

Returns: The icon height.

getAccessibleIconWidth

public int getAccessibleIconWidth()
Returns the icon width. This returns the iconWidth property of the underlying {@link ImageIcon}.

Returns: The icon width.

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
Returns the index of this object in its accessible parent. To match the reference implementation, this method always returns -1.

Returns: -1.

getAccessibleParent

public Accessible getAccessibleParent()
Returns the accessible parent of this object. To match the reference implementation, this method always returns null.

Returns: null.

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role for the ImageIcon.

Returns: {@link AccessibleRole#ICON}.

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state for the ImageIcon. To match the reference implementation, this method always returns null.

Returns: null.

getLocale

public Locale getLocale()
Returns the locale of this object. To match the reference implementation, this method always returns null.

Returns: null.

setAccessibleIconDescription

public void setAccessibleIconDescription(String newDescr)
Sets the accessible icon description. This sets the description property of the underlying {@link ImageIcon}.

Parameters: newDescr the description (null permitted).

See Also: getAccessibleIconDescription