textlayout.html

来自「API資料大全」· HTML 代码 · 共 1,381 行 · 第 1/5 页

HTML
1,381
字号
<TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#TextLayout(java.lang.String, java.awt.Font, java.awt.font.FontRenderContext)">TextLayout</A></B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;string,           <A HREF="../../../java/awt/Font.html">Font</A>&nbsp;font,           <A HREF="../../../java/awt/font/FontRenderContext.html">FontRenderContext</A>&nbsp;frc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>TextLayout</code> from a <code>String</code> and a <A HREF="../../../java/awt/Font.html"><CODE>Font</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#TextLayout(java.lang.String, java.util.Map, java.awt.font.FontRenderContext)">TextLayout</A></B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;string,           <A HREF="../../../java/util/Map.html">Map</A>&nbsp;attributes,           <A HREF="../../../java/awt/font/FontRenderContext.html">FontRenderContext</A>&nbsp;frc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>TextLayout</code> from a <code>String</code> and an attribute set.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#clone()">clone</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#draw(java.awt.Graphics2D, float, float)">draw</A></B>(<A HREF="../../../java/awt/Graphics2D.html">Graphics2D</A>&nbsp;g2,     float&nbsp;x,     float&nbsp;y)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Renders this <code>TextLayout</code> at the specified location in  the specified <A HREF="../../../java/awt/Graphics2D.html"><CODE>Graphics2D</CODE></A> context.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../../../java/lang/Object.html">Object</A>&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if the specified <code>Object</code> is a  <code>TextLayout</code> object and if the specified <code>Object</code> equals this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#equals(java.awt.font.TextLayout)">equals</A></B>(<A HREF="../../../java/awt/font/TextLayout.html">TextLayout</A>&nbsp;rhs)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if the two layouts are equal.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getAdvance()">getAdvance</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the advance of this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getAscent()">getAscent</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the ascent of this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getBaseline()">getBaseline</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the baseline for this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;float[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getBaselineOffsets()">getBaselineOffsets</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the offsets array for the baselines used for this  <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getBlackBoxBounds(int, int)">getBlackBoxBounds</A></B>(int&nbsp;firstEndpoint,                  int&nbsp;secondEndpoint)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the black box bounds of the characters in the specified range.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getBounds()">getBounds</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the bounds of this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;float[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCaretInfo(java.awt.font.TextHitInfo)">getCaretInfo</A></B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A>&nbsp;hit)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns information about the caret corresponding to <code>hit</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;float[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCaretInfo(java.awt.font.TextHitInfo, java.awt.geom.Rectangle2D)">getCaretInfo</A></B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A>&nbsp;hit,             <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;bounds)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns information about the caret corresponding to <code>hit</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCaretShape(java.awt.font.TextHitInfo)">getCaretShape</A></B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A>&nbsp;hit)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>Shape</code> representing the caret at the specified hit inside the natural bounds of this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCaretShape(java.awt.font.TextHitInfo, java.awt.geom.Rectangle2D)">getCaretShape</A></B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A>&nbsp;hit,              <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;bounds)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <A HREF="../../../java/awt/Shape.html"><CODE>Shape</CODE></A> representing the caret at the specified  hit inside the specified bounds.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCaretShapes(int)">getCaretShapes</A></B>(int&nbsp;offset)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns two paths corresponding to the strong and weak caret.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCaretShapes(int, java.awt.geom.Rectangle2D)">getCaretShapes</A></B>(int&nbsp;offset,               <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;bounds)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns two paths corresponding to the strong and weak caret.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCaretShapes(int, java.awt.geom.Rectangle2D, java.awt.font.TextLayout.CaretPolicy)">getCaretShapes</A></B>(int&nbsp;offset,               <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;bounds,               <A HREF="../../../java/awt/font/TextLayout.CaretPolicy.html">TextLayout.CaretPolicy</A>&nbsp;policy)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns two paths corresponding to the strong and weak caret.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCharacterCount()">getCharacterCount</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of characters represented by this  <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;byte</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getCharacterLevel(int)">getCharacterLevel</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the level of the character at <code>index</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getDescent()">getDescent</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the descent of this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/font/TextLayout.html">TextLayout</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getJustifiedLayout(float)">getJustifiedLayout</A></B>(float&nbsp;justificationWidth)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of this <code>TextLayout</code> justified to the  specified width.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getLeading()">getLeading</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the leading of the <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getLogicalHighlightShape(int, int)">getLogicalHighlightShape</A></B>(int&nbsp;firstEndpoint,                         int&nbsp;secondEndpoint)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>Shape</code> enclosing the logical selection in the specified range, extended to the natural bounds of this <code>TextLayout</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Shape.html">Shape</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getLogicalHighlightShape(int, int, java.awt.geom.Rectangle2D)">getLogicalHighlightShape</A></B>(int&nbsp;firstEndpoint,                         int&nbsp;secondEndpoint,                         <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A>&nbsp;bounds)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>Shape</code> enclosing the logical selection in the specified range, extended to the specified <code>bounds</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getLogicalRangesForVisualSelection(java.awt.font.TextHitInfo, java.awt.font.TextHitInfo)">getLogicalRangesForVisualSelection</A></B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A>&nbsp;firstEndpoint,                                   <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A>&nbsp;secondEndpoint)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the logical ranges of text corresponding to a visual selection.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getNextLeftHit(int)">getNextLeftHit</A></B>(int&nbsp;offset)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the hit for the next caret to the left (top); if no such hit, returns <code>null</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getNextLeftHit(int, java.awt.font.TextLayout.CaretPolicy)">getNextLeftHit</A></B>(int&nbsp;offset,               <A HREF="../../../java/awt/font/TextLayout.CaretPolicy.html">TextLayout.CaretPolicy</A>&nbsp;policy)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the hit for the next caret to the left (top); if no such hit, returns <code>null</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/font/TextLayout.html#getNextLeftHit(java.awt.font.TextHitInfo)">getNextLeftHit</A></B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A>&nbsp;hit)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the hit for the next caret to the left (top); if no such

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?