📄 abstractbutton.accessibleabstractbutton.html
字号:
getIndexAtPoint</H3><PRE>public int <B>getIndexAtPoint</B>(<A HREF="../../java/awt/Point.html">Point</A> p)</PRE><DL><DD>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. Note: the AbstractButton must have a valid size (e.g. have been added to a parent container whose ancestor container is a valid top-level window) for this method to be able to return a meaningful value.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getIndexAtPoint(java.awt.Point)">getIndexAtPoint</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - the Point in local coordinates<DT><B>Returns:</B><DD>the zero-based index of the character under Point p; if Point is invalid returns -1.</DL></DD></DL><HR><A NAME="getCharacterBounds(int)"><!-- --></A><H3>getCharacterBounds</H3><PRE>public <A HREF="../../java/awt/Rectangle.html">Rectangle</A> <B>getCharacterBounds</B>(int i)</PRE><DL><DD>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. Note: the AbstractButton must have a valid size (e.g. have been added to a parent container whose ancestor container is a valid top-level window) for this method to be able to return a meaningful value.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getCharacterBounds(int)">getCharacterBounds</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>i</CODE> - the index into the String<DT><B>Returns:</B><DD>the screen coordinates of the character's the bounding box, if index is invalid returns an empty rectangle.</DL></DD></DL><HR><A NAME="getCharCount()"><!-- --></A><H3>getCharCount</H3><PRE>public int <B>getCharCount</B>()</PRE><DL><DD>Return the number of characters (valid indicies)<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getCharCount()">getCharCount</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of characters</DL></DD></DL><HR><A NAME="getCaretPosition()"><!-- --></A><H3>getCaretPosition</H3><PRE>public int <B>getCaretPosition</B>()</PRE><DL><DD>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).<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getCaretPosition()">getCaretPosition</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the zero-based offset of the caret.</DL></DD></DL><HR><A NAME="getAtIndex(int, int)"><!-- --></A><H3>getAtIndex</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getAtIndex</B>(int part, int index)</PRE><DL><DD>Returns the String at a given index.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getAtIndex(int, int)">getAtIndex</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>part</CODE> - the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve<DD><CODE>index</CODE> - an index within the text >= 0<DT><B>Returns:</B><DD>the letter, word, or sentence, null for an invalid index or part</DL></DD></DL><HR><A NAME="getAfterIndex(int, int)"><!-- --></A><H3>getAfterIndex</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getAfterIndex</B>(int part, int index)</PRE><DL><DD>Returns the String after a given index.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getAfterIndex(int, int)">getAfterIndex</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>part</CODE> - the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve<DD><CODE>index</CODE> - an index within the text >= 0<DT><B>Returns:</B><DD>the letter, word, or sentence, null for an invalid index or part</DL></DD></DL><HR><A NAME="getBeforeIndex(int, int)"><!-- --></A><H3>getBeforeIndex</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getBeforeIndex</B>(int part, int index)</PRE><DL><DD>Returns the String before a given index.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getBeforeIndex(int, int)">getBeforeIndex</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>part</CODE> - the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve<DD><CODE>index</CODE> - an index within the text >= 0<DT><B>Returns:</B><DD>the letter, word, or sentence, null for an invalid index or part</DL></DD></DL><HR><A NAME="getCharacterAttribute(int)"><!-- --></A><H3>getCharacterAttribute</H3><PRE>public <A HREF="../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>getCharacterAttribute</B>(int i)</PRE><DL><DD>Return the AttributeSet for a given character at a given index<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getCharacterAttribute(int)">getCharacterAttribute</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>i</CODE> - the zero-based index into the text<DT><B>Returns:</B><DD>the AttributeSet of the character</DL></DD></DL><HR><A NAME="getSelectionStart()"><!-- --></A><H3>getSelectionStart</H3><PRE>public int <B>getSelectionStart</B>()</PRE><DL><DD>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.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getSelectionStart()">getSelectionStart</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the index into the text of the start of the selection</DL></DD></DL><HR><A NAME="getSelectionEnd()"><!-- --></A><H3>getSelectionEnd</H3><PRE>public int <B>getSelectionEnd</B>()</PRE><DL><DD>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.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getSelectionEnd()">getSelectionEnd</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the index into teh text of the end of the selection</DL></DD></DL><HR><A NAME="getSelectedText()"><!-- --></A><H3>getSelectedText</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getSelectedText</B>()</PRE><DL><DD>Returns the portion of the text that is selected.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../javax/accessibility/AccessibleText.html#getSelectedText()">getSelectedText</A></CODE> in interface <CODE><A HREF="../../javax/accessibility/AccessibleText.html">AccessibleText</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the String portion of the text that is selected</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AbstractButton.AccessibleAbstractButton.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/swing/AbstractButton.html"><B>PREV CLASS</B></A> <A HREF="../../javax/swing/AbstractButton.ButtonChangeListener.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="AbstractButton.AccessibleAbstractButton.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#inner_classes_inherited_from_class_javax.swing.JComponent.AccessibleJComponent">INNER</A> | <A HREF="#fields_inherited_from_class_javax.swing.JComponent.AccessibleJComponent">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -