JAVA ACCESSIBILITY
Retrieving Text
Version 0.5
08 October 1997
[Home]
[What is it?] [Overview
of API Features] [API
Reference]
[FAQ] [Tutorial]
[Tools] [Changes]
[JFC Home Page]
Techniques for retrieving text information in Java
Every accessible object that renders text in Java either implements interface
Accessible, or has a Translator
which does so on it's behalf (creating an object which speaks interface
Accessible for that object). Using the methods in interface
Accessible, you can get the object's name, description, and if it has
one, the object's AccessibleText.
Via AccessibleText,
you can get detailed text information, broken down by letter, word and
sentence, as well as character attribute information.
In addition to getting the text of an accessible object, every accessible
object, whether it renders text or not, whether it has an AccessibleText
or not, has certain graphics settings which can be retrieved via the Accessible
interface. These settings include foreground and background color,
as well as the selected font, and font settings.
Specific recipies/techniques for getting information about text:
Getting text letter-by-letter,
in sync with the screen coordinates
Getting text word-by-word, in sync
with the screen coordinates
Getting text sentence-by-sentence,
in sync with the screen coordinates
Tracking the insertion point within text, and relative to screen coordinates
Getting the name of the font of a partcular character
Getting the size of the font of a particular character
Getting the attributes of a partcular character
Getting the letter/word/sentence at a particular point on the screen
...
Copyright©
1995-97 Sun Microsystems, Inc. All Rights
Reserved.
To submit comments or suggestions about Java
Accessibility, please send mail to access@sun.com.