textlayout.html
来自「API資料大全」· HTML 代码 · 共 1,381 行 · 第 1/5 页
HTML
1,381 行
<A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A> bounds)</PRE><DL><DD>Returns information about the caret corresponding to <code>hit</code>. The first element of the array is the intersection of the caret with the baseline. The second element of the array is the inverse slope (run/rise) of the caret. <p> This method is meant for informational use. To display carets, it is better to use <code>getCaretShapes</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hit</CODE> - a hit on a character in this <code>TextLayout</code><DD><CODE>bounds</CODE> - the bounds to which the caret info is constructed<DT><B>Returns:</B><DD>a two-element array containing the position and slope of the caret.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/font/TextLayout.html#getCaretShapes(int, java.awt.geom.Rectangle2D, java.awt.font.TextLayout.CaretPolicy)"><CODE>getCaretShapes(int, Rectangle2D, TextLayout.CaretPolicy)</CODE></A>, <A HREF="../../../java/awt/Font.html#getItalicAngle()"><CODE>Font.getItalicAngle()</CODE></A></DL></DD></DL><HR><A NAME="getCaretInfo(java.awt.font.TextHitInfo)"><!-- --></A><H3>getCaretInfo</H3><PRE>public float[] <B>getCaretInfo</B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> hit)</PRE><DL><DD>Returns information about the caret corresponding to <code>hit</code>. This method is a convenience overload of <code>getCaretInfo</code> and uses the natural bounds of this <code>TextLayout</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hit</CODE> - a hit on a character in this <code>TextLayout</code><DT><B>Returns:</B><DD>the information about a caret corresponding to a hit.</DL></DD></DL><HR><A NAME="getNextRightHit(java.awt.font.TextHitInfo)"><!-- --></A><H3>getNextRightHit</H3><PRE>public <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> <B>getNextRightHit</B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> hit)</PRE><DL><DD>Returns the hit for the next caret to the right (bottom); if there is no such hit, returns <code>null</code>. If the hit character index is out of bounds, an <A HREF="../../../java/lang/IllegalArgumentException.html"><CODE>IllegalArgumentException</CODE></A> is thrown.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hit</CODE> - a hit on a character in this layout<DT><B>Returns:</B><DD>a hit whose caret appears at the next position to the right (bottom) of the caret of the provided hit or <code>null</code>.</DL></DD></DL><HR><A NAME="getNextRightHit(int, java.awt.font.TextLayout.CaretPolicy)"><!-- --></A><H3>getNextRightHit</H3><PRE>public <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> <B>getNextRightHit</B>(int offset, <A HREF="../../../java/awt/font/TextLayout.CaretPolicy.html">TextLayout.CaretPolicy</A> policy)</PRE><DL><DD>Returns the hit for the next caret to the right (bottom); if no such hit, returns <code>null</code>. The hit is to the right of the strong caret at the specified offset, as determined by the specified policy. The returned hit is the stronger of the two possible hits, as determined by the specified policy.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - an insertion offset in this <code>TextLayout</code>. Cannot be less than 0 or greater than this <code>TextLayout</code> object's character count.<DD><CODE>policy</CODE> - the policy used to select the strong caret<DT><B>Returns:</B><DD>a hit whose caret appears at the next position to the right (bottom) of the caret of the provided hit, or <code>null</code>.</DL></DD></DL><HR><A NAME="getNextRightHit(int)"><!-- --></A><H3>getNextRightHit</H3><PRE>public <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> <B>getNextRightHit</B>(int offset)</PRE><DL><DD>Returns the hit for the next caret to the right (bottom); if no such hit, returns <code>null</code>. The hit is to the right of the strong caret at the specified offset, as determined by the default policy. The returned hit is the stronger of the two possible hits, as determined by the default policy.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - an insertion offset in this <code>TextLayout</code>. Cannot be less than 0 or greater than the <code>TextLayout</code> object's character count.<DT><B>Returns:</B><DD>a hit whose caret appears at the next position to the right (bottom) of the caret of the provided hit, or <code>null</code>.</DL></DD></DL><HR><A NAME="getNextLeftHit(java.awt.font.TextHitInfo)"><!-- --></A><H3>getNextLeftHit</H3><PRE>public <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> <B>getNextLeftHit</B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> hit)</PRE><DL><DD>Returns the hit for the next caret to the left (top); if no such hit, returns <code>null</code>. If the hit character index is out of bounds, an <code>IllegalArgumentException</code> is thrown.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hit</CODE> - a hit on a character in this <code>TextLayout</code>.<DT><B>Returns:</B><DD>a hit whose caret appears at the next position to the left (top) of the caret of the provided hit, or <code>null</code>.</DL></DD></DL><HR><A NAME="getNextLeftHit(int, java.awt.font.TextLayout.CaretPolicy)"><!-- --></A><H3>getNextLeftHit</H3><PRE>public <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> <B>getNextLeftHit</B>(int offset, <A HREF="../../../java/awt/font/TextLayout.CaretPolicy.html">TextLayout.CaretPolicy</A> policy)</PRE><DL><DD>Returns the hit for the next caret to the left (top); if no such hit, returns <code>null</code>. The hit is to the left of the strong caret at the specified offset, as determined by the specified policy. The returned hit is the stronger of the two possible hits, as determined by the specified policy.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - an insertion offset in this <code>TextLayout</code>. Cannot be less than 0 or greater than this <code>TextLayout</code> object's character count.<DD><CODE>policy</CODE> - the policy used to select the strong caret<DT><B>Returns:</B><DD>a hit whose caret appears at the next position to the left (top) of the caret of the provided hit, or <code>null</code>.</DL></DD></DL><HR><A NAME="getNextLeftHit(int)"><!-- --></A><H3>getNextLeftHit</H3><PRE>public <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> <B>getNextLeftHit</B>(int offset)</PRE><DL><DD>Returns the hit for the next caret to the left (top); if no such hit, returns <code>null</code>. The hit is to the left of the strong caret at the specified offset, as determined by the default policy. The returned hit is the stronger of the two possible hits, as determined by the default policy.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - an insertion offset in this <code>TextLayout</code>. Cannot be less than 0 or greater than this <code>TextLayout</code> object's character count.<DT><B>Returns:</B><DD>a hit whose caret appears at the next position to the left (top) of the caret of the provided hit, or <code>null</code>.</DL></DD></DL><HR><A NAME="getVisualOtherHit(java.awt.font.TextHitInfo)"><!-- --></A><H3>getVisualOtherHit</H3><PRE>public <A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> <B>getVisualOtherHit</B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> hit)</PRE><DL><DD>Returns the hit on the opposite side of the specified hit's caret.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hit</CODE> - the specified hit<DT><B>Returns:</B><DD>a hit that is on the opposite side of the specified hit's caret.</DL></DD></DL><HR><A NAME="getCaretShape(java.awt.font.TextHitInfo, java.awt.geom.Rectangle2D)"><!-- --></A><H3>getCaretShape</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A> <B>getCaretShape</B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> hit, <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A> bounds)</PRE><DL><DD>Returns a <A HREF="../../../java/awt/Shape.html"><CODE>Shape</CODE></A> representing the caret at the specified hit inside the specified bounds.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hit</CODE> - the hit at which to generate the caret<DD><CODE>bounds</CODE> - the bounds of the <code>TextLayout</code> to use in generating the caret.<DT><B>Returns:</B><DD>a <code>Shape</code> representing the caret.</DL></DD></DL><HR><A NAME="getCaretShape(java.awt.font.TextHitInfo)"><!-- --></A><H3>getCaretShape</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A> <B>getCaretShape</B>(<A HREF="../../../java/awt/font/TextHitInfo.html">TextHitInfo</A> hit)</PRE><DL><DD>Returns a <code>Shape</code> representing the caret at the specified hit inside the natural bounds of this <code>TextLayout</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>hit</CODE> - the hit at which to generate the caret<DT><B>Returns:</B><DD>a <code>Shape</code> representing the caret.</DL></DD></DL><HR><A NAME="getCharacterLevel(int)"><!-- --></A><H3>getCharacterLevel</H3><PRE>public byte <B>getCharacterLevel</B>(int index)</PRE><DL><DD>Returns the level of the character at <code>index</code>. Indices -1 and <code>characterCount</code> are assigned the base level of this <code>TextLayout</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the character from which to get the level<DT><B>Returns:</B><DD>the level of the character at the specified index.</DL></DD></DL><HR><A NAME="getCaretShapes(int, java.awt.geom.Rectangle2D, java.awt.font.TextLayout.CaretPolicy)"><!-- --></A><H3>getCaretShapes</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A>[] <B>getCaretShapes</B>(int offset, <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A> bounds, <A HREF="../../../java/awt/font/TextLayout.CaretPolicy.html">TextLayout.CaretPolicy</A> policy)</PRE><DL><DD>Returns two paths corresponding to the strong and weak caret.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - an offset in this <code>TextLayout</code><DD><CODE>bounds</CODE> - the bounds to which to extend the carets<DD><CODE>policy</CODE> - the specified <code>CaretPolicy</code><DT><B>Returns:</B><DD>an array of two paths. Element zero is the strong caret. If there are two carets, element one is the weak caret, otherwise it is <code>null</code>.</DL></DD></DL><HR><A NAME="getCaretShapes(int, java.awt.geom.Rectangle2D)"><!-- --></A><H3>getCaretShapes</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A>[] <B>getCaretShapes</B>(int offset, <A HREF="../../../java/awt/geom/Rectangle2D.html">Rectangle2D</A> bounds)</PRE><DL><DD>Returns two paths corresponding to the strong and weak caret. This method is a convenience overload of <code>getCaretShapes</code> that uses the default caret policy.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - an offset in this <code>TextLayout</code><DD><CODE>bounds</CODE> - the bounds to which to extend the carets<DT><B>Returns:</B><DD>two paths corresponding to the strong and weak caret as defined by the <code>DEFAULT_CARET_POLICY</code></DL></DD></DL><HR><A NAME="getCaretShapes(int)"><!-- --></A><H3>getCaretShapes</H3><PRE>public <A HREF="../../../java/awt/Shape.html">Shape</A>[] <B>getCaretShapes</B>(int offset)</PRE><DL><DD>Returns two paths corresponding to the strong and weak caret. This method is a convenience overload of <code>getCaretShapes</code> that uses the default caret policy and this <code>TextLayout</code> object's natural bounds.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - an offset in this <code>T
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?