Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
protected class JLabel.AccessibleJLabel
extends JComponent.AccessibleJComponent
implements AccessibleText, AccessibleExtendedComponent
JLabel
component.
Nested Class Summary |
Nested classes/interfaces inherited from class javax.swing.JComponent.AccessibleJComponent | |
JComponent.AccessibleJComponent.AccessibleContainerHandler , JComponent.AccessibleJComponent.AccessibleFocusHandler |
Nested classes/interfaces inherited from class java.awt.Container.AccessibleAWTContainer | |
Container.AccessibleAWTContainer.AccessibleContainerHandler |
Nested classes/interfaces inherited from class java.awt.Component.AccessibleAWTComponent | |
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler , Component.AccessibleAWTComponent.AccessibleAWTFocusHandler |
Field Summary |
Fields inherited from class javax.swing.JComponent.AccessibleJComponent | |
accessibleContainerHandler , accessibleFocusHandler |
Fields inherited from class java.awt.Container.AccessibleAWTContainer | |
accessibleContainerHandler |
Fields inherited from class java.awt.Component.AccessibleAWTComponent | |
accessibleAWTComponentHandler , accessibleAWTFocusHandler |
Fields inherited from interface javax.accessibility.AccessibleText | |
CHARACTER , SENTENCE , WORD |
Method Summary | |
String |
|
AccessibleRole |
|
String |
|
String |
|
String |
|
int |
|
int |
|
AttributeSet |
|
Rectangle |
|
int |
|
String |
|
int |
|
int |
|
Methods inherited from class java.awt.Container.AccessibleAWTContainer | |
getAccessibleAt , getAccessibleChild , getAccessibleChildrenCount |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public String getAccessibleName()
Returns the accessible name.
- Overrides:
- getAccessibleName in interface JComponent.AccessibleJComponent
- Returns:
- The accessible name.
public AccessibleRole getAccessibleRole()
Returns the accessible role for theJLabel
component.
- Overrides:
- getAccessibleRole in interface JComponent.AccessibleJComponent
- Returns:
AccessibleRole.LABEL
.
public String getAfterIndex(int part, int index)
Returns the character, word or sentence after the specified index. Thepart
parameter determines what is returned, the character, word or sentence after the index.
- Specified by:
- getAfterIndex in interface AccessibleText
- Parameters:
part
- one ofAccessibleText.CHARACTER
,AccessibleText.WORD
orAccessibleText.SENTENCE
, specifying what is returnedindex
- the index
- Returns:
- the character, word or sentence after
index
public String getAtIndex(int part, int index)
Returns the character, word or sentence at the specified index. Thepart
parameter determines what is returned, the character, word or sentence after the index.
- Specified by:
- getAtIndex in interface AccessibleText
- Parameters:
part
- one ofAccessibleText.CHARACTER
,AccessibleText.WORD
orAccessibleText.SENTENCE
, specifying what is returnedindex
- the index
- Returns:
- the character, word or sentence after
index
public String getBeforeIndex(int part, int index)
Returns the character, word or sentence before the specified index. Thepart
parameter determines what is returned, the character, word or sentence before the index.
- Specified by:
- getBeforeIndex in interface AccessibleText
- Parameters:
part
- one ofAccessibleText.CHARACTER
,AccessibleText.WORD
orAccessibleText.SENTENCE
, specifying what is returnedindex
- the index
- Returns:
- the character, word or sentence before
index
public int getCaretPosition()
Returns the caret position. This method returns -1 because JLabel don't have a caret.
- Specified by:
- getCaretPosition in interface AccessibleText
- Returns:
- the caret position
public int getCharCount()
Returns the number of characters that are displayed by the JLabel.
- Specified by:
- getCharCount in interface AccessibleText
- Returns:
- the number of characters that are displayed by the JLabel
public AttributeSet getCharacterAttribute(int index)
Returns anAttributeSet
that reflects the text attributes of the specified character. We return an emptyAttributeSet
here, because JLabels don't support text attributes (at least not yet).
- Specified by:
- getCharacterAttribute in interface AccessibleText
- Parameters:
index
- the index of the character
- Returns:
- an
AttributeSet
that reflects the text attributes of the specified character
public Rectangle getCharacterBounds(int index)
Returns the bounding box of the character at the specified index.
- Specified by:
- getCharacterBounds in interface AccessibleText
- Parameters:
index
- the index of the character that we return the bounds for
- Returns:
- the bounding box of the character at the specified index
public int getIndexAtPoint(Point point)
Returns the index of the character that is located at the specified point.
- Specified by:
- getIndexAtPoint in interface AccessibleText
- Parameters:
point
- the location that we lookup the character for
- Returns:
- the index of the character that is located at the specified point
public String getSelectedText()
Returns the selected text. This is null since JLabels are not selectable.
- Specified by:
- getSelectedText in interface AccessibleText
- Returns:
null
because JLabels cannot have selected text
public int getSelectionEnd()
Returns the end index of the selected text.
- Specified by:
- getSelectionEnd in interface AccessibleText
- Returns:
- the end index of the selected text
public int getSelectionStart()
Returns the start index of the selected text.
- Specified by:
- getSelectionStart in interface AccessibleText
- Returns:
- the start index of the selected text