Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.swing.text.JTextComponent.AccessibleJTextComponent

java.lang.Object
    |
    +----java.awt.accessibility.AccessibleContext
            |
            +----java.awt.swing.JComponent.AccessibleJComponent
                    |
                    +----java.awt.swing.text.JTextComponent.AccessibleJTextComponent
Subclasses:
JEditorPane.AccessibleJEditorPane, JTextArea.AccessibleJTextArea, JTextField.AccessibleJTextField

public class JTextComponent.AccessibleJTextComponent
extends JComponent.AccessibleJComponent
implements AccessibleText, CaretListener, DocumentListener
Accessibility implementation for JTextComponent

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 Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.


Fields inherited from class java.awt.accessibility.AccessibleContext
 ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY, accessibleDescription, accessibleName, accessibleParent
 

Constructor Summary
 JTextComponent.AccessibleJTextComponent(JTextComponent this$0)
Construct an AccessibleJTextComponent
 

Method Summary
void  caretUpdate(CaretEvent e)
Handle caret updates (fire appropriate property change event)
void  changedUpdate(DocumentEvent e)
Handle document remove (fire appropriate property change event)
AccessibleRole  getAccessibleRole()
Gets the role of this object.
AccessibleStateSet  getAccessibleStateSet()
Get the state set of the JTextComponent.
AccessibleText  getAccessibleText()
Gets the AccessibleText interface associated with this object
String  getAfterIndex(int part, int index)
Return the String after a given index.
String  getAtIndex(int part, int index)
Return the String at a given index.
String  getBeforeIndex(int part, int index)
Return the String before a given index.
int  getCaretPosition()
Return the zero-based offset of the caret.
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.
int  getCharCount()
Return the number of characters (valid indicies)
int  getIndexAtPoint(Point p)
Given a point in local coordinates, return the zero-based index of the character under that Point.
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.
void  insertUpdate(DocumentEvent e)
Handle document insert (fire appropriate property change event)
void  removeUpdate(DocumentEvent e)
Handle document remove (fire appropriate property change event)
 
Methods inherited from class java.awt.swing.JComponent.AccessibleJComponent
 addFocusListener, contains, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRole, getAccessibleStateSet, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocale, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible
 
Methods inherited from class java.awt.accessibility.AccessibleContext
 addPropertyChangeListener, firePropertyChange, getAccessibleAction, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRole, getAccessibleSelection, getAccessibleStateSet, getAccessibleText, getAccessibleValue, getLocale, removePropertyChangeListener, setAccessibleDescription, setAccessibleName, setAccessibleParent
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTextComponent.AccessibleJTextComponent

public JTextComponent.AccessibleJTextComponent(JTextComponent this$0)
Construct an AccessibleJTextComponent
Method Detail

caretUpdate

public void caretUpdate(CaretEvent e)
Handle caret updates (fire appropriate property change event)
Implements:
caretUpdate in interface CaretListener
Parameters:
e - the CaretEvent

insertUpdate

public void insertUpdate(DocumentEvent e)
Handle document insert (fire appropriate property change event)
Implements:
insertUpdate in interface DocumentListener
Parameters:
e - the DocumentEvent

removeUpdate

public void removeUpdate(DocumentEvent e)
Handle document remove (fire appropriate property change event)
Implements:
removeUpdate in interface DocumentListener
Parameters:
e - the DocumentEvent

changedUpdate

public void changedUpdate(DocumentEvent e)
Handle document remove (fire appropriate property change event)
Implements:
changedUpdate in interface DocumentListener
Parameters:
e - the DocumentEvent

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Get the state set of the JTextComponent. The AccessibleStateSet of an object is composed of a set of unique AccessibleState's. A change in the AccessibleStateSet of an object will cause a PropertyChangeEvent to be fired for the ACCESSIBLE_STATE_PROPERTY property.
Returns:
an instance of AccessibleStateSet containing the current state set of the object
Overrides:
getAccessibleStateSet in class JComponent.AccessibleJComponent
See Also:
AccessibleStateSet, AccessibleState, addPropertyChangeListener

getAccessibleRole

public AccessibleRole getAccessibleRole()
Gets the role of this object.
Returns:
an instance of AccessibleRole describing the role of the object
Overrides:
getAccessibleRole in class JComponent.AccessibleJComponent
See Also:
AccessibleRole

getAccessibleText

public AccessibleText getAccessibleText()
Gets the AccessibleText interface associated with this object
Returns:
an instance of AccessibleText
Overrides:
getAccessibleText in class AccessibleContext

getIndexAtPoint

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.
Implements:
getIndexAtPoint in interface AccessibleText
Parameters:
p - the Point in local coordinates
Returns:
the zero-based index of the character under Point p.

getCharacterBounds

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.
Implements:
getCharacterBounds in interface AccessibleText
Parameters:
i - the index into the String
Returns:
the screen coordinates of the character's the bounding box

getCharCount

public int getCharCount()
Return the number of characters (valid indicies)
Implements:
getCharCount in interface AccessibleText
Returns:
the number of characters

getCaretPosition

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).
Implements:
getCaretPosition in interface AccessibleText
Returns:
the zero-based offset of the caret.

getCharacterAttribute

public AttributeSet getCharacterAttribute(int i)
Return the AttributeSet for a given character (at a given index)
Implements:
getCharacterAttribute in interface AccessibleText
Parameters:
i - the zero-based index into the text
Returns:
the AttributeSet of the character

getSelectionStart

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.
Implements:
getSelectionStart in interface AccessibleText
Returns:
the index into the text of the start of the selection

getSelectionEnd

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.
Implements:
getSelectionEnd in interface AccessibleText
Returns:
the index into teh text of the end of the selection

getSelectedText

public String getSelectedText()
Returns the portion of the text that is selected.
Implements:
getSelectedText in interface AccessibleText
Returns:
the portion of the text that is selected

getAtIndex

public String getAtIndex(int part,
                         int index)
Return the String at a given index.
Implements:
getAtIndex in interface AccessibleText
Parameters:
part - the CHARACTER, WORD, or SENTENCE to retrieve
index - an index within the text
Returns:
the letter, word, or sentence

getAfterIndex

public String getAfterIndex(int part,
                            int index)
Return the String after a given index.
Implements:
getAfterIndex in interface AccessibleText
Parameters:
part - the CHARACTER, WORD, or SENTENCE to retrieve
index - an index within the text
Returns:
the letter, word, or sentence

getBeforeIndex

public String getBeforeIndex(int part,
                             int index)
Return the String before a given index.
Implements:
getBeforeIndex in interface AccessibleText
Parameters:
part - the CHARACTER, WORD, or SENTENCE to retrieve
index - an index within the text
Returns:
the letter, word, or sentence

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.