⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basictextui.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 called if isOpaque() on the associated component is true.  The default is to paint the background color  of the component.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the graphics context</DL></DD></DL><HR><A NAME="getComponent()"><!-- --></A><H3>getComponent</H3><PRE>protected final <A HREF="../../../../javax/swing/text/JTextComponent.html">JTextComponent</A> <B>getComponent</B>()</PRE><DL><DD>Fetches the text component associated with this UI implementation.  This will be null until the ui has been installed.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the editor component</DL></DD></DL><HR><A NAME="modelChanged()"><!-- --></A><H3>modelChanged</H3><PRE>protected void <B>modelChanged</B>()</PRE><DL><DD>Flags model changes. This is called whenever the model has changed. It is implemented to rebuild the view hierarchy to represent the default root element of the associated model.<DD><DL></DL></DD></DL><HR><A NAME="setView(javax.swing.text.View)"><!-- --></A><H3>setView</H3><PRE>protected final void <B>setView</B>(<A HREF="../../../../javax/swing/text/View.html">View</A>&nbsp;v)</PRE><DL><DD>Sets the current root of the view hierarchy and calls invalidate(). If there were any child components, they will be removed (i.e. there are assumed to have come from components embedded in views).<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - the root view</DL></DD></DL><HR><A NAME="paintSafely(java.awt.Graphics)"><!-- --></A><H3>paintSafely</H3><PRE>protected void <B>paintSafely</B>(<A HREF="../../../../java/awt/Graphics.html">Graphics</A>&nbsp;g)</PRE><DL><DD>Paints the interface safely with a guarantee that the model won't change from the view of this thread.   This does the following things, rendering from  back to front. <ol> <li> If the component is marked as opaque, the background is painted in the current background color of the component. <li> The highlights (if any) are painted. <li> The view hierarchy is painted. <li> The caret is painted. </ol><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the graphics context</DL></DD></DL><HR><A NAME="installUI(javax.swing.JComponent)"><!-- --></A><H3>installUI</H3><PRE>public void <B>installUI</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Installs the UI for a component.  This does the following things. <ol> <li> Set the associated component to opaque (can be changed easily by a subclass or on JTextComponent directly), which is the most common case.  This will cause the component's background color to be painted. <li> Install the default caret and highlighter into the  associated component. <li> Attach to the editor and model.  If there is no  model, a default one is created. <li> create the view factory and the view hierarchy used to represent the model. </ol><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#installUI(javax.swing.JComponent)">installUI</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor component<DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/ComponentUI.html#installUI(javax.swing.JComponent)"><CODE>ComponentUI.installUI(javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="uninstallUI(javax.swing.JComponent)"><!-- --></A><H3>uninstallUI</H3><PRE>public void <B>uninstallUI</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Deinstalls the UI for a component.  This removes the listeners, uninstalls the highlighter, removes views, and nulls out the keymap.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#uninstallUI(javax.swing.JComponent)">uninstallUI</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor component<DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/ComponentUI.html#uninstallUI(javax.swing.JComponent)"><CODE>ComponentUI.uninstallUI(javax.swing.JComponent)</CODE></A></DL></DD></DL><HR><A NAME="update(java.awt.Graphics, javax.swing.JComponent)"><!-- --></A><H3>update</H3><PRE>public void <B>update</B>(<A HREF="../../../../java/awt/Graphics.html">Graphics</A>&nbsp;g,                   <A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Superclass paints background in an uncontrollable way (i.e. one might want an image tiled into the background). To prevent this from happening twice, this method is reimplemented to simply paint. <p> <em>NOTE:</em> Superclass is also not thread-safe in  it's rendering of the background, although that's not an issue with the default rendering.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#update(java.awt.Graphics, javax.swing.JComponent)">update</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD></DL><HR><A NAME="paint(java.awt.Graphics, javax.swing.JComponent)"><!-- --></A><H3>paint</H3><PRE>public final void <B>paint</B>(<A HREF="../../../../java/awt/Graphics.html">Graphics</A>&nbsp;g,                        <A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Paints the interface.  This is routed to the paintSafely method under the guarantee that the model won't change from the view of this thread while it's rendering (if the associated model is derived from AbstractDocument).  This enables the  model to potentially be updated asynchronously.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#paint(java.awt.Graphics, javax.swing.JComponent)">paint</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the graphics context<DD><CODE>c</CODE> - the editor component</DL></DD></DL><HR><A NAME="getPreferredSize(javax.swing.JComponent)"><!-- --></A><H3>getPreferredSize</H3><PRE>public <A HREF="../../../../java/awt/Dimension.html">Dimension</A> <B>getPreferredSize</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Gets the preferred size for the editor component.  If the component has been given a size prior to receiving this request, it will set the size of the view hierarchy to reflect the size of the component before requesting the preferred size of the view hierarchy.  This allows formatted views to format to the current component size before answering the request.  Other views don't care about currently formatted size and give the same answer either way.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#getPreferredSize(javax.swing.JComponent)">getPreferredSize</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor component<DT><B>Returns:</B><DD>the size</DL></DD></DL><HR><A NAME="getMinimumSize(javax.swing.JComponent)"><!-- --></A><H3>getMinimumSize</H3><PRE>public <A HREF="../../../../java/awt/Dimension.html">Dimension</A> <B>getMinimumSize</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Gets the minimum size for the editor component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#getMinimumSize(javax.swing.JComponent)">getMinimumSize</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor component<DT><B>Returns:</B><DD>the size</DL></DD></DL><HR><A NAME="getMaximumSize(javax.swing.JComponent)"><!-- --></A><H3>getMaximumSize</H3><PRE>public <A HREF="../../../../java/awt/Dimension.html">Dimension</A> <B>getMaximumSize</B>(<A HREF="../../../../javax/swing/JComponent.html">JComponent</A>&nbsp;c)</PRE><DL><DD>Gets the maximum size for the editor component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html#getMaximumSize(javax.swing.JComponent)">getMaximumSize</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/ComponentUI.html">ComponentUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the editor component<DT><B>Returns:</B><DD>the size</DL></DD></DL><HR><A NAME="getVisibleEditorRect()"><!-- --></A><H3>getVisibleEditorRect</H3><PRE>protected <A HREF="../../../../java/awt/Rectangle.html">Rectangle</A> <B>getVisibleEditorRect</B>()</PRE><DL><DD>Gets the allocation to give the root View.  Due to an unfortunate set of historical events this  method is inappropriately named.  The Rectangle returned has nothing to do with visibility.   The component must have a non-zero positive size for  this translation to be computed.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the bounding box for the root view</DL></DD></DL><HR><A NAME="modelToView(javax.swing.text.JTextComponent, int)"><!-- --></A><H3>modelToView</H3><PRE>public <A HREF="../../../../java/awt/Rectangle.html">Rectangle</A> <B>modelToView</B>(<A HREF="../../../../javax/swing/text/JTextComponent.html">JTextComponent</A>&nbsp;tc,                             int&nbsp;pos)                      throws <A HREF="../../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Converts the given location in the model to a place in the view coordinate system. The component must have a non-zero positive size for  this translation to be computed.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/plaf/TextUI.html#modelToView(javax.swing.text.JTextComponent, int)">modelToView</A></CODE> in class <CODE><A HREF="../../../../javax/swing/plaf/TextUI.html">TextUI</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>tc</CODE> - the text component for which this UI is installed<DD><CODE>pos</CODE> - the local location in the model to translate >= 0<DT><B>Returns:</B><DD>the coordinates as a rectangle, null if the model is not painted<DT><B>Throws:</B><DD><CODE><A HREF="../../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the given position does not   represent a valid location in the associated document<DT><B>See Also: </B><DD><A HREF="../../../../javax/swing/plaf/TextUI.html#modelToView(javax.swing.text.JTextComponent, int)"><CODE>TextUI.modelToView(javax.swing.text.JTextComponent, int)</CODE></A></DL></DD>

⌨️ 快捷键说明

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