📄 utilities.html
字号:
<TD><CODE><B><A HREF="../../../javax/swing/text/Utilities.html#getRowStart(javax.swing.text.JTextComponent, int)">getRowStart</A></B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs)</CODE><BR> Determines the starting row model position of the row that contains the specified model position.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/Utilities.html#getTabbedTextOffset(javax.swing.text.Segment, java.awt.FontMetrics, int, int, javax.swing.text.TabExpander, int)">getTabbedTextOffset</A></B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> metrics, int x0, int x, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset)</CODE><BR> Determines the relative offset into the given text that best represents the given span in the view coordinate system.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/Utilities.html#getTabbedTextOffset(javax.swing.text.Segment, java.awt.FontMetrics, int, int, javax.swing.text.TabExpander, int, boolean)">getTabbedTextOffset</A></B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> metrics, int x0, int x, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset, boolean round)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/Utilities.html#getTabbedTextWidth(javax.swing.text.Segment, java.awt.FontMetrics, int, javax.swing.text.TabExpander, int)">getTabbedTextWidth</A></B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> metrics, int x, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset)</CODE><BR> Determines the width of the given segment of text taking tabs into consideration.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/Utilities.html#getWordEnd(javax.swing.text.JTextComponent, int)">getWordEnd</A></B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs)</CODE><BR> Determines the end of a word for the given location.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/Utilities.html#getWordStart(javax.swing.text.JTextComponent, int)">getWordStart</A></B>(<A HREF="../../../javax/swing/text/JTextComponent.html">JTextComponent</A> c, int offs)</CODE><BR> Determines the start of a word for the given model location.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <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="Utilities()"><!-- --></A><H3>Utilities</H3><PRE>public <B>Utilities</B>()</PRE><DL></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="drawTabbedText(javax.swing.text.Segment, int, int, java.awt.Graphics, javax.swing.text.TabExpander, int)"><!-- --></A><H3>drawTabbedText</H3><PRE>public static final int <B>drawTabbedText</B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, int x, int y, <A HREF="../../../java/awt/Graphics.html">Graphics</A> g, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset)</PRE><DL><DD>Draws the given text, expanding any tabs that are contained using the given tab expansion technique. This particular implementation renders in a 1.1 style coordinate system where ints are used and 72dpi is assumed.<DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - the source of the text<DD><CODE>x</CODE> - the X origin >= 0<DD><CODE>y</CODE> - the Y origin >= 0<DD><CODE>g</CODE> - the graphics context<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 of the text in the document >= 0</DL></DD></DL><HR><A NAME="getTabbedTextWidth(javax.swing.text.Segment, java.awt.FontMetrics, int, javax.swing.text.TabExpander, int)"><!-- --></A><H3>getTabbedTextWidth</H3><PRE>public static final int <B>getTabbedTextWidth</B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> metrics, int x, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset)</PRE><DL><DD>Determines the width of the given segment of text taking tabs into consideration. This is implemented in a 1.1 style coordinate system where ints are used and 72dpi is assumed.<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>x</CODE> - the X origin >= 0<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 of the text in the document >= 0</DL></DD></DL><HR><A NAME="getTabbedTextOffset(javax.swing.text.Segment, java.awt.FontMetrics, int, int, javax.swing.text.TabExpander, int)"><!-- --></A><H3>getTabbedTextOffset</H3><PRE>public static final int <B>getTabbedTextOffset</B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> metrics, int x0, int x, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset)</PRE><DL><DD>Determines the relative offset into the given text that best represents the given span in the view coordinate system. This is implemented in a 1.1 style coordinate system where ints are used and 72dpi is assumed.<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 >= 0.<DD><CODE>x</CODE> - the target view location to translate to an offset into the text >= 0.<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 of the text in the document >= 0</DL></DD></DL><HR><A NAME="getTabbedTextOffset(javax.swing.text.Segment, java.awt.FontMetrics, int, int, javax.swing.text.TabExpander, int, boolean)"><!-- --></A><H3>getTabbedTextOffset</H3><PRE>public static final int <B>getTabbedTextOffset</B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> metrics, int x0, int x, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset, boolean round)</PRE><DL></DL><HR><A NAME="getBreakLocation(javax.swing.text.Segment, java.awt.FontMetrics, int, int, javax.swing.text.TabExpander, int)"><!-- --></A><H3>getBreakLocation</H3><PRE>public static final int <B>getBreakLocation</B>(<A HREF="../../../javax/swing/text/Segment.html">Segment</A> s, <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> metrics, int x0, int x, <A HREF="../../../javax/swing/text/TabExpander.html">TabExpander</A> e, int startOffset)</PRE><DL><DD>Determine where to break the given text to fit within the the given span. This tries to find a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -