|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface AccessibleText
在显示器上显示文本信息的所有类都应该实现 AccessibleText 接口。此接口为辅助技术提供了标准机制,以通过文本的内容、属性和空间位置来访问该文本。应用程序通过先获取某个对象的 AccessibleContext(参见 Accessible),然后调用 AccessibleContext 的 AccessibleContext.getAccessibleText() 方法,能够确定该对象是否支持 AccessibleText 接口。如果返回值不为 null,则该对象支持此接口。
Accessible,
Accessible.getAccessibleContext(),
AccessibleContext,
AccessibleContext.getAccessibleText()| 字段摘要 | |
|---|---|
static int |
CHARACTER
用于指示应被检索的文本部分是一个字符的常量。 |
static int |
SENTENCE
用于指示应被检索的文本部分是一个语句的常量。 |
static int |
WORD
用于指示应被检索的文本部分是一个单词的常量。 |
| 方法摘要 | |
|---|---|
String |
getAfterIndex(int part,
int index)
返回给定索引后的 String。 |
String |
getAtIndex(int part,
int index)
返回给定索引处的 String。 |
String |
getBeforeIndex(int part,
int index)
返回给定索引前面的 String。 |
int |
getCaretPosition()
返回从零开始的插入符偏移量。 |
AttributeSet |
getCharacterAttribute(int i)
返回给定索引处给定字符的 AttributeSet |
Rectangle |
getCharacterBounds(int i)
确定字符串中给定索引处的字符的边界框。 |
int |
getCharCount()
返回字符(有效索引)数 |
int |
getIndexAtPoint(Point p)
给定本地坐标中的一点,返回在该 Point 下的字符从零开始的索引。 |
String |
getSelectedText()
返回选中的部分文本。 |
int |
getSelectionEnd()
返回选定文本中的结束偏移量。 |
int |
getSelectionStart()
返回选定文本中的起始偏移量。 |
| 字段详细信息 |
|---|
static final int CHARACTER
static final int WORD
static final int SENTENCE
| 方法详细信息 |
|---|
int getIndexAtPoint(Point p)
p - 本地坐标中的点
Rectangle getCharacterBounds(int i)
i - 对 String 的索引
int getCharCount()
int getCaretPosition()
String getAtIndex(int part, int index)
part - 要检索的 CHARACTER、WORD 或 SENTENCEindex - 文本中的索引
String getAfterIndex(int part, int index)
part - 要检索的 CHARACTER、WORD 或 SENTENCEindex - 文本中的索引
String getBeforeIndex(int part, int index)
part - 要检索的 CHARACTER、WORD 或 SENTENCEindex - 文本中的索引
AttributeSet getCharacterAttribute(int i)
i - 文本中从零开始的索引
int getSelectionStart()
int getSelectionEnd()
String getSelectedText()
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。