|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
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()
返回插入符從 0 開始的偏移量。 |
AttributeSet |
getCharacterAttribute(int i)
返回給定索引處給定字元的 AttributeSet |
Rectangle |
getCharacterBounds(int i)
確定字元串中給定索引處的字元的邊界框。 |
int |
getCharCount()
返回字元(有效索引)數 |
int |
getIndexAtPoint(Point p)
給定本地坐標中的一點,返回在該點下的字元從 0 開始的索引。 |
String |
getSelectedText()
返回選定的部分文本。 |
int |
getSelectionEnd()
返回選定文本中的結束偏移量。 |
int |
getSelectionStart()
返回選定文本中的起始偏移量。 |
| 欄位詳細資訊 |
|---|
static final int CHARACTER
getAtIndex(int, int),
getAfterIndex(int, int),
getBeforeIndex(int, int),
常數欄位值static final int WORD
getAtIndex(int, int),
getAfterIndex(int, int),
getBeforeIndex(int, int),
常數欄位值static final int SENTENCE
getAtIndex(int, int),
getAfterIndex(int, int),
getBeforeIndex(int, int),
常數欄位值| 方法詳細資訊 |
|---|
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 - 文本中從 0 開始的索引
int getSelectionStart()
int getSelectionEnd()
String getSelectedText()
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。