linebreakmeasurer.html
来自「API資料大全」· HTML 代码 · 共 649 行 · 第 1/3 页
HTML
649 行
<A NAME="LineBreakMeasurer(java.text.AttributedCharacterIterator, java.text.BreakIterator, java.awt.font.FontRenderContext)"><!-- --></A><H3>LineBreakMeasurer</H3><PRE>public <B>LineBreakMeasurer</B>(<A HREF="../../../java/text/AttributedCharacterIterator.html">AttributedCharacterIterator</A> text, <A HREF="../../../java/text/BreakIterator.html">BreakIterator</A> breakIter, <A HREF="../../../java/awt/font/FontRenderContext.html">FontRenderContext</A> frc)</PRE><DL><DD>Constructs a <code>LineBreakMeasurer</code> for the specified text.<DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - the text for which this <code>LineBreakMeasurer</code> produces <code>TextLayout</code> objects. The text must contain at least one character. If the text available through <code>iter</code> changes, further calls to this <code>LineBreakMeasurer</code> instance are undefined (except, in some cases, when <code>insertChar</code> or <code>deleteChar</code> are invoked afterward - see below).<DD><CODE>breakIter</CODE> - the <A HREF="../../../java/text/BreakIterator.html"><CODE>BreakIterator</CODE></A> which defines line breaks<DD><CODE>frc</CODE> - contains information about a graphics device which is needed to measure the text correctly. Text measurements can vary slightly depending on the device resolution, and attributes such as antialiasing. This parameter does not specify a translation between the <code>LineBreakMeasurer</code> and user space.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/font/LineBreakMeasurer.html#insertChar(java.text.AttributedCharacterIterator, int)"><CODE>insertChar(java.text.AttributedCharacterIterator, int)</CODE></A>, <A HREF="../../../java/awt/font/LineBreakMeasurer.html#deleteChar(java.text.AttributedCharacterIterator, int)"><CODE>deleteChar(java.text.AttributedCharacterIterator, int)</CODE></A></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="nextOffset(float)"><!-- --></A><H3>nextOffset</H3><PRE>public int <B>nextOffset</B>(float wrappingWidth)</PRE><DL><DD>Returns the position at the end of the next layout. Does NOT update the current position of this <code>LineBreakMeasurer</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>wrappingWidth</CODE> - the maximum visible advance permitted for the text in the next layout<DT><B>Returns:</B><DD>an offset in the text representing the limit of the next <code>TextLayout</code>.</DL></DD></DL><HR><A NAME="nextOffset(float, int, boolean)"><!-- --></A><H3>nextOffset</H3><PRE>public int <B>nextOffset</B>(float wrappingWidth, int offsetLimit, boolean requireNextWord)</PRE><DL><DD>Returns the position at the end of the next layout. Does NOT update the current position of this <code>LineBreakMeasurer</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>wrappingWidth</CODE> - the maximum visible advance permitted for the text in the next layout<DD><CODE>offsetLimit</CODE> - the first character that can not be included in the next layout, even if the text after the limit would fit within the wrapping width. <code>offsetLimit</code> must be greater than the current position.<DD><CODE>requireNextWord</CODE> - if <code>true</code>, the current position that is returned if the entire next word does not fit within <code>wrappingWidth</code>. If <code>false</code>, the offset returned is at least one greater than the current position.<DT><B>Returns:</B><DD>an offset in the text representing the limit of the next <code>TextLayout</code>.</DL></DD></DL><HR><A NAME="nextLayout(float)"><!-- --></A><H3>nextLayout</H3><PRE>public <A HREF="../../../java/awt/font/TextLayout.html">TextLayout</A> <B>nextLayout</B>(float wrappingWidth)</PRE><DL><DD>Returns the next layout, and updates the current position.<DD><DL><DT><B>Parameters:</B><DD><CODE>wrappingWidth</CODE> - the maximum visible advance permitted for the text in the next layout<DT><B>Returns:</B><DD>a <code>TextLayout</code>, beginning at the current position, which represents the next line fitting within <code>wrappingWidth</code>.</DL></DD></DL><HR><A NAME="nextLayout(float, int, boolean)"><!-- --></A><H3>nextLayout</H3><PRE>public <A HREF="../../../java/awt/font/TextLayout.html">TextLayout</A> <B>nextLayout</B>(float wrappingWidth, int offsetLimit, boolean requireNextWord)</PRE><DL><DD>Returns the next layout, and updates the current position.<DD><DL><DT><B>Parameters:</B><DD><CODE>wrappingWidth</CODE> - the maximum visible advance permitted for the text in the next layout<DD><CODE>offsetLimit</CODE> - the first character that can not be included in the next layout, even if the text after the limit would fit within the wrapping width. <code>offsetLimit</code> must be greater than the current position.<DD><CODE>requireNextWord</CODE> - if <code>true</code>, and if the entire word at the current position does not fit within the wrapping width, <code>null</code> is returned. If <code>false</code>, a valid layout is returned that includes at least the character at the current position.<DT><B>Returns:</B><DD>a <code>TextLayout</code>, beginning at the current position, that represents the next line fitting within <code>wrappingWidth</code>. If the current position is at the end of the text used by this <code>LineBreakMeasurer</code>, <code>null</code> is returned.</DL></DD></DL><HR><A NAME="getPosition()"><!-- --></A><H3>getPosition</H3><PRE>public int <B>getPosition</B>()</PRE><DL><DD>Returns the current position of this <code>LineBreakMeasurer</code>.<DD><DL><DT><B>Returns:</B><DD>the current position of this <code>LineBreakMeasurer</code>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/font/LineBreakMeasurer.html#setPosition(int)"><CODE>setPosition(int)</CODE></A></DL></DD></DL><HR><A NAME="setPosition(int)"><!-- --></A><H3>setPosition</H3><PRE>public void <B>setPosition</B>(int newPosition)</PRE><DL><DD>Sets the current position of this <code>LineBreakMeasurer</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>newPosition</CODE> - the current position of this <code>LineBreakMeasurer</code>. The position should be within the text used to construct this <code>LineBreakMeasurer</code> (or in the text most recently passed to <code>insertChar</code> or <code>deleteChar</code>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/font/LineBreakMeasurer.html#getPosition()"><CODE>getPosition()</CODE></A></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> newParagraph, int insertPos)</PRE><DL><DD>Updates this <code>LineBreakMeasurer</code> after a single character is inserted into the text, and sets the current position to the beginning of the paragraph.<DD><DL><DT><B>Parameters:</B><DD><CODE>newParagraph</CODE> - the text after the insertion<DD><CODE>insertPos</CODE> - the position in the text at which the character is inserted<DT><B>See Also: </B><DD><A HREF="../../../java/awt/font/LineBreakMeasurer.html#deleteChar(java.text.AttributedCharacterIterator, int)"><CODE>deleteChar(java.text.AttributedCharacterIterator, int)</CODE></A></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> newParagraph, int deletePos)</PRE><DL><DD>Updates this <code>LineBreakMeasurer</code> after a single character is deleted from the text, and sets the current position to the beginning of the paragraph.<DD><DL><DT><B>Parameters:</B><DD><CODE>newParagraph</CODE> - the text after the deletion<DD><CODE>deletePos</CODE> - the position in the text at which the character is deleted<DT><B>See Also: </B><DD><A HREF="../../../java/awt/font/LineBreakMeasurer.html#insertChar(java.text.AttributedCharacterIterator, int)"><CODE>insertChar(java.text.AttributedCharacterIterator, int)</CODE></A></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/LineBreakMeasurer.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="../../../java/awt/font/ImageGraphicAttribute.html"><B>PREV CLASS</B></A> <A HREF="../../../java/awt/font/LineMetrics.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="LineBreakMeasurer.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 + =
减小字号Ctrl + -
显示快捷键?