textmeasurer.html

来自「API資料大全」· HTML 代码 · 共 361 行 · 第 1/2 页

HTML
361
字号
&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="TextMeasurer(java.text.AttributedCharacterIterator, java.awt.font.FontRenderContext)"><!-- --></A><H3>TextMeasurer</H3><PRE>public <B>TextMeasurer</B>(<A HREF="../../../java/text/AttributedCharacterIterator.html">AttributedCharacterIterator</A>&nbsp;text,                    <A HREF="../../../java/awt/font/FontRenderContext.html">FontRenderContext</A>&nbsp;frc)</PRE><DL><DD>Constructs a <code>TextMeasurer</code> from the source text.   The source text should be a single entire paragraph.<DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - the source paragraph.  Cannot be null.<DD><CODE>frc</CODE> - the information about a graphics device which is needed        to measure the text correctly.  Cannot be null.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getLineBreakIndex(int, float)"><!-- --></A><H3>getLineBreakIndex</H3><PRE>public int <B>getLineBreakIndex</B>(int&nbsp;start,                             float&nbsp;maxAdvance)</PRE><DL><DD>Returns the index of the first character which will not fit on on a line which begins at <code>start</code> and may be up to <code>maxAdvance</code> in graphical width.<DD><DL><DT><B>Parameters:</B><DD><CODE>start</CODE> - the character index at which to start measuring.  <code>start</code> is an absolute index, not relative to the  start of the paragraph<DD><CODE>maxAdvance</CODE> - the graphical width in which the line must fit<DT><B>Returns:</B><DD>the index after the last character which will fit  on a line beginning at <code>start</code>, which is not longer  than <code>maxAdvance</code> in graphical width</DL></DD></DL><HR><A NAME="getAdvanceBetween(int, int)"><!-- --></A><H3>getAdvanceBetween</H3><PRE>public float <B>getAdvanceBetween</B>(int&nbsp;start,                               int&nbsp;limit)</PRE><DL><DD>Returns the graphical width of a line beginning at <code>start</code> and including characters up to <code>limit</code>. <code>start</code> and <code>limit</code> are absolute indices, not relative to the start of the paragraph.<DD><DL><DT><B>Parameters:</B><DD><CODE>start</CODE> - the character index at which to start measuring<DD><CODE>limit</CODE> - the character index at which to stop measuring<DT><B>Returns:</B><DD>the graphical width of a line beginning at <code>start</code>   and including characters up to <code>limit</code></DL></DD></DL><HR><A NAME="getLayout(int, int)"><!-- --></A><H3>getLayout</H3><PRE>public <A HREF="../../../java/awt/font/TextLayout.html">TextLayout</A> <B>getLayout</B>(int&nbsp;start,                            int&nbsp;limit)</PRE><DL><DD>Returns a <code>TextLayout</code> on the given character range.<DD><DL><DT><B>Parameters:</B><DD><CODE>start</CODE> - the index of the first character<DD><CODE>limit</CODE> - the index after the last character.  Must be greater   than <code>start</code><DT><B>Returns:</B><DD>a <code>TextLayout</code> for the characters beginning at  <code>start</code> up to (but not including) <code>limit</code></DL></DD></DL><HR><A NAME="insertChar(java.text.AttributedCharacterIterator, int)"><!-- --></A><H3>insertChar</H3><PRE>public void <B>insertChar</B>(<A HREF="../../../java/text/AttributedCharacterIterator.html">AttributedCharacterIterator</A>&nbsp;newParagraph,                       int&nbsp;insertPos)</PRE><DL><DD>Updates the <code>TextMeasurer</code> after a single character has  been inserted into the paragraph currently represented by this <code>TextMeasurer</code>.  After this call, this <code>TextMeasurer</code> is equivalent to a new <code>TextMeasurer</code> created from the text;  however, it will usually be more efficient to update an existing <code>TextMeasurer</code> than to create a new one from scratch.<DD><DL><DT><B>Parameters:</B><DD><CODE>newParagraph</CODE> - the text of the paragraph after performing the insertion.  Cannot be null.<DD><CODE>insertPos</CODE> - the position in the text where the character was inserted.   Must not be less than the start of <code>newParagraph</code>, and must be less than the end of <code>newParagraph</code>.</DL></DD></DL><HR><A NAME="deleteChar(java.text.AttributedCharacterIterator, int)"><!-- --></A><H3>deleteChar</H3><PRE>public void <B>deleteChar</B>(<A HREF="../../../java/text/AttributedCharacterIterator.html">AttributedCharacterIterator</A>&nbsp;newParagraph,                       int&nbsp;deletePos)</PRE><DL><DD>Updates the <code>TextMeasurer</code> after a single character has  been deleted from the paragraph currently represented by this <code>TextMeasurer</code>.  After this call, this <code>TextMeasurer</code> is equivalent to a new <code>TextMeasurer</code> created from the text;  however, it will usually be more efficient to update an existing <code>TextMeasurer</code> than to create a new one from scratch.<DD><DL><DT><B>Parameters:</B><DD><CODE>newParagraph</CODE> - the text of the paragraph after performing the deletion.  Cannot be null.<DD><CODE>deletePos</CODE> - the position in the text where the character was removed.   Must not be less than the start of <code>newParagraph</code>, and must not be greater than the end of <code>newParagraph</code>.</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/TextMeasurer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../java/awt/font/TextLayout.CaretPolicy.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../java/awt/font/TransformAttribute.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>  &nbsp;&nbsp;<A HREF="TextMeasurer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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 + =
减小字号Ctrl + -
显示快捷键?