📄 utilities.html
字号:
whitespace boundary.<DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the source of the text<DD><CODE>metrics</CODE> - the font metrics to use for the calculation<DD><CODE>x0</CODE> - the starting view location representing the start of the given text.<DD><CODE>x</CODE> - the target view location to translate to an offset into the text.<DD><CODE>e</CODE> - how to expand the tabs. If this value is null, tabs will be expanded as a space character.<DD><CODE>startOffset</CODE> - starting offset in the document of the text</DL></DD></DL><HR><A NAME="getRowStart(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>getRowStart</H3><PRE>public static final int <B>getRowStart</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determines the starting row model position of the row that contains the specified model position. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DT><B>Returns:</B><DD>the position >= 0 if the request can be computed, otherwise a value of -1 will be returned.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getRowEnd(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>getRowEnd</H3><PRE>public static final int <B>getRowEnd</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determines the ending row model position of the row that contains the specified model position. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DT><B>Returns:</B><DD>the position >= 0 if the request can be computed, otherwise a value of -1 will be returned.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getPositionAbove(javax.swing.text.JTextComponent, int, int)"><!-- --></A><H3>getPositionAbove</H3><PRE>public static final int <B>getPositionAbove</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs, int x) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determines the position in the model that is closest to the given view location in the row above. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DD><CODE>x</CODE> - the X coordinate >= 0<DT><B>Returns:</B><DD>the position >= 0 if the request can be computed, otherwise a value of -1 will be returned.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getPositionBelow(javax.swing.text.JTextComponent, int, int)"><!-- --></A><H3>getPositionBelow</H3><PRE>public static final int <B>getPositionBelow</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs, int x) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determines the position in the model that is closest to the given view location in the row below. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DD><CODE>x</CODE> - the X coordinate >= 0<DT><B>Returns:</B><DD>the position >= 0 if the request can be computed, otherwise a value of -1 will be returned.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getWordStart(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>getWordStart</H3><PRE>public static final int <B>getWordStart</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determines the start of a word for the given model location. Uses BreakIterator.getWordInstance() to actually get the words.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getWordEnd(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>getWordEnd</H3><PRE>public static final int <B>getWordEnd</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determines the end of a word for the given location. Uses BreakIterator.getWordInstance() to actually get the words.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getNextWord(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>getNextWord</H3><PRE>public static final int <B>getNextWord</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determines the start of the next word for the given location. Uses BreakIterator.getWordInstance() to actually get the words.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getPreviousWord(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>getPreviousWord</H3><PRE>public static final int <B>getPreviousWord</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs) throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Determine the start of the prev word for the given location. Uses BreakIterator.getWordInstance() to actually get the words.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the offset in the document >= 0<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the offset is out of range</DL></DD></DL><HR><A NAME="getParagraphElement(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>getParagraphElement</H3><PRE>public static final <A HREF="../../../javax/swing/text/Element.html">Element</A> <B>getParagraphElement</B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs)</PRE><DL><DD>Determines the element to use for a paragraph/line.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor<DD><CODE>offs</CODE> - the starting offset in the document >= 0<DT><B>Returns:</B><DD>the element</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/Utilities.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/text/TextAction.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/swing/text/View.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="Utilities.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <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 + -