protected abstract class

AbstractButton.AccessibleAbstractButton

extends JComponent.AccessibleJComponent
implements AccessibleAction AccessibleExtendedComponent AccessibleText AccessibleValue
java.lang.Object
   ↳ javax.accessibility.AccessibleContext
     ↳ java.awt.Component.AccessibleAWTComponent
       ↳ java.awt.Container.AccessibleAWTContainer
         ↳ javax.swing.JComponent.AccessibleJComponent
           ↳ javax.swing.AbstractButton.AccessibleAbstractButton
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

This class implements accessibility support for the AbstractButton class. It provides an implementation of the Java Accessibility API appropriate to button and menu item user-interface elements.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

Summary

[Expand]
Inherited Constants
From class javax.accessibility.AccessibleContext
From interface javax.accessibility.AccessibleText
[Expand]
Inherited Fields
From class javax.swing.JComponent.AccessibleJComponent
From class java.awt.Container.AccessibleAWTContainer
From class java.awt.Component.AccessibleAWTComponent
From class javax.accessibility.AccessibleContext
From interface javax.accessibility.AccessibleAction
Protected Constructors
AbstractButton.AccessibleAbstractButton()
Public Methods
boolean doAccessibleAction(int i)
Perform the specified Action on the object
AccessibleAction getAccessibleAction()
Get the AccessibleAction associated with this object.
int getAccessibleActionCount()
Returns the number of Actions available in this object.
String getAccessibleActionDescription(int i)
Return a description of the specified action of the object.
AccessibleIcon[] getAccessibleIcon()
Get the AccessibleIcons associated with this object if one or more exist.
AccessibleKeyBinding getAccessibleKeyBinding()
Returns key bindings associated with this object
String getAccessibleName()
Returns the accessible name of this object.
AccessibleRelationSet getAccessibleRelationSet()
Get the AccessibleRelationSet associated with this object if one exists.
AccessibleStateSet getAccessibleStateSet()
Get the state set of this object.
AccessibleText getAccessibleText()
Gets the AccessibleText associated with this object presenting text on the display.
AccessibleValue getAccessibleValue()
Get the AccessibleValue associated with this object.
String getAfterIndex(int part, int index)
Returns the String after a given index.
String getAtIndex(int part, int index)
Returns the String at a given index.
String getBeforeIndex(int part, int index)
Returns the String before a given index.
int getCaretPosition()
Return the zero-based offset of the caret.
int getCharCount()
Return the number of characters (valid indicies)
AttributeSet getCharacterAttribute(int i)
Return the AttributeSet for a given character at a given index
Rectangle getCharacterBounds(int i)
Determine the bounding box of the character at the given index into the string.
Number getCurrentAccessibleValue()
Get the value of this object as a Number.
int getIndexAtPoint(Point p)
Given a point in local coordinates, return the zero-based index of the character under that Point.
Number getMaximumAccessibleValue()
Get the maximum value of this object as a Number.
Number getMinimumAccessibleValue()
Get the minimum value of this object as a Number.
String getSelectedText()
Returns the portion of the text that is selected.
int getSelectionEnd()
Returns the end offset within the selected text.
int getSelectionStart()
Returns the start offset within the selected text.
String getTitledBorderText()
Returns the titled border text
String getToolTipText()
Returns the tool tip text
boolean setCurrentAccessibleValue(Number n)
Set the value of this object as a Number.
[Expand]
Inherited Methods
From class javax.swing.JComponent.AccessibleJComponent
From class java.awt.Container.AccessibleAWTContainer
From class java.awt.Component.AccessibleAWTComponent
From class javax.accessibility.AccessibleContext
From class java.lang.Object
From interface javax.accessibility.AccessibleAction
From interface javax.accessibility.AccessibleComponent
From interface javax.accessibility.AccessibleExtendedComponent
From interface javax.accessibility.AccessibleText
From interface javax.accessibility.AccessibleValue

Protected Constructors

protected AbstractButton.AccessibleAbstractButton ()

Public Methods

public boolean doAccessibleAction (int i)

Perform the specified Action on the object

Parameters
i zero-based index of actions
Returns
  • true if the the action was performed; else false.

public AccessibleAction getAccessibleAction ()

Get the AccessibleAction associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleAction interface on behalf of itself.

Returns
  • this object

public int getAccessibleActionCount ()

Returns the number of Actions available in this object. The default behavior of a button is to have one action - toggle the button.

Returns
  • 1, the number of Actions in this object

public String getAccessibleActionDescription (int i)

Return a description of the specified action of the object.

Parameters
i zero-based index of the actions
Returns
  • a String description of the action

public AccessibleIcon[] getAccessibleIcon ()

Get the AccessibleIcons associated with this object if one or more exist. Otherwise return null.

Returns
  • an array of AccessibleIcon if supported by object; otherwise return null

public AccessibleKeyBinding getAccessibleKeyBinding ()

Returns key bindings associated with this object

Returns
  • the key bindings, if supported, of the object; otherwise, null

public String getAccessibleName ()

Returns the accessible name of this object.

Returns
  • the localized name of the object -- can be null if this object does not have a name

public AccessibleRelationSet getAccessibleRelationSet ()

Get the AccessibleRelationSet associated with this object if one exists. Otherwise return null.

Returns
  • an AccessibleRelationSet if supported by object; otherwise return null

public AccessibleStateSet getAccessibleStateSet ()

Get the state set of this object.

Returns
  • an instance of AccessibleState containing the current state of the object
See Also

public AccessibleText getAccessibleText ()

Gets the AccessibleText associated with this object presenting text on the display.

Returns
  • AccessibleText if supported by object; else return null

public AccessibleValue getAccessibleValue ()

Get the AccessibleValue associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleValue interface on behalf of itself.

Returns
  • this object

public String getAfterIndex (int part, int index)

Returns the String after a given index.

Parameters
part the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve
index an index within the text >= 0
Returns
  • the letter, word, or sentence, null for an invalid index or part

public String getAtIndex (int part, int index)

Returns the String at a given index.

Parameters
part the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve
index an index within the text >= 0
Returns
  • the letter, word, or sentence, null for an invalid index or part

public String getBeforeIndex (int part, int index)

Returns the String before a given index.

Parameters
part the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve
index an index within the text >= 0
Returns
  • the letter, word, or sentence, null for an invalid index or part

public int getCaretPosition ()

Return the zero-based offset of the caret. Note: That to the right of the caret will have the same index value as the offset (the caret is between two characters).

Returns
  • the zero-based offset of the caret.

public int getCharCount ()

Return the number of characters (valid indicies)

Returns
  • the number of characters

public AttributeSet getCharacterAttribute (int i)

Return the AttributeSet for a given character at a given index

Parameters
i the zero-based index into the text
Returns
  • the AttributeSet of the character

public Rectangle getCharacterBounds (int i)

Determine the bounding box of the character at the given index into the string. The bounds are returned in local coordinates. If the index is invalid an empty rectangle is returned. Note: the AbstractButton must have a valid size (e.g. have been added to a parent container whose ancestor container is a valid top-level window) for this method to be able to return a meaningful value.

Parameters
i the index into the String
Returns
  • the screen coordinates of the character's the bounding box, if index is invalid returns an empty rectangle.

public Number getCurrentAccessibleValue ()

Get the value of this object as a Number.

Returns
  • An Integer of 0 if this isn't selected or an Integer of 1 if this is selected.
See Also

public int getIndexAtPoint (Point p)

Given a point in local coordinates, return the zero-based index of the character under that Point. If the point is invalid, this method returns -1. Note: the AbstractButton must have a valid size (e.g. have been added to a parent container whose ancestor container is a valid top-level window) for this method to be able to return a meaningful value.

Parameters
p the Point in local coordinates
Returns
  • the zero-based index of the character under Point p; if Point is invalid returns -1.

public Number getMaximumAccessibleValue ()

Get the maximum value of this object as a Number.

Returns
  • An Integer of 1.

public Number getMinimumAccessibleValue ()

Get the minimum value of this object as a Number.

Returns
  • an Integer of 0.

public String getSelectedText ()

Returns the portion of the text that is selected.

Returns
  • the String portion of the text that is selected

public int getSelectionEnd ()

Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same.

Returns
  • the index into teh text of the end of the selection

public int getSelectionStart ()

Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same.

Returns
  • the index into the text of the start of the selection

public String getTitledBorderText ()

Returns the titled border text

Returns
  • the titled border text, if supported, of the object; otherwise, null

public String getToolTipText ()

Returns the tool tip text

Returns
  • the tool tip text, if supported, of the object; otherwise, null

public boolean setCurrentAccessibleValue (Number n)

Set the value of this object as a Number.

Returns
  • True if the value was set.