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

📄 stylecontext.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<DL><DD>Removes a named style previously added to the document.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>nm</CODE> - the name of the style to remove</DL></DD></DL><HR><A NAME="getStyle(java.lang.String)"><!-- --></A><H3>getStyle</H3><PRE>public <A HREF="../../../javax/swing/text/Style.html">Style</A> <B>getStyle</B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;nm)</PRE><DL><DD>Fetches a named style previously added to the document<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>nm</CODE> - the name of the style<DT><B>Returns:</B><DD>the style</DL></DD></DL><HR><A NAME="getStyleNames()"><!-- --></A><H3>getStyleNames</H3><PRE>public <A HREF="../../../java/util/Enumeration.html">Enumeration</A> <B>getStyleNames</B>()</PRE><DL><DD>Fetches the names of the styles defined.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the list of names as an enumeration</DL></DD></DL><HR><A NAME="addChangeListener(javax.swing.event.ChangeListener)"><!-- --></A><H3>addChangeListener</H3><PRE>public void <B>addChangeListener</B>(<A HREF="../../../javax/swing/event/ChangeListener.html">ChangeListener</A>&nbsp;l)</PRE><DL><DD>Adds a listener to track when styles are added or removed.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the change listener</DL></DD></DL><HR><A NAME="removeChangeListener(javax.swing.event.ChangeListener)"><!-- --></A><H3>removeChangeListener</H3><PRE>public void <B>removeChangeListener</B>(<A HREF="../../../javax/swing/event/ChangeListener.html">ChangeListener</A>&nbsp;l)</PRE><DL><DD>Removes a listener that was tracking styles being added or removed.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the change listener</DL></DD></DL><HR><A NAME="getFont(javax.swing.text.AttributeSet)"><!-- --></A><H3>getFont</H3><PRE>public <A HREF="../../../java/awt/Font.html">Font</A> <B>getFont</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attr)</PRE><DL><DD>Gets the font from an attribute set.  This is implemented to try and fetch a cached font for the given AttributeSet, and if that fails  the font features are resolved and the font is fetched from the low-level font cache.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attr</CODE> - the attribute set<DT><B>Returns:</B><DD>the font</DL></DD></DL><HR><A NAME="getForeground(javax.swing.text.AttributeSet)"><!-- --></A><H3>getForeground</H3><PRE>public <A HREF="../../../java/awt/Color.html">Color</A> <B>getForeground</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attr)</PRE><DL><DD>Takes a set of attributes and turn it into a foreground color specification.  This might be used to specify things like brighter, more hue, etc.  By default it simply returns the value specified by the StyleConstants.Foreground attribute.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attr</CODE> - the set of attributes<DT><B>Returns:</B><DD>the color</DL></DD></DL><HR><A NAME="getBackground(javax.swing.text.AttributeSet)"><!-- --></A><H3>getBackground</H3><PRE>public <A HREF="../../../java/awt/Color.html">Color</A> <B>getBackground</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attr)</PRE><DL><DD>Takes a set of attributes and turn it into a background color specification.  This might be used to specify things like brighter, more hue, etc.  By default it simply returns the value specified by the StyleConstants.Background attribute.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attr</CODE> - the set of attributes<DT><B>Returns:</B><DD>the color</DL></DD></DL><HR><A NAME="getFont(java.lang.String, int, int)"><!-- --></A><H3>getFont</H3><PRE>public <A HREF="../../../java/awt/Font.html">Font</A> <B>getFont</B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;family,                    int&nbsp;style,                    int&nbsp;size)</PRE><DL><DD>Gets a new font.  This returns a Font from a cache if a cached font exists.  If not, a Font is added to the cache.  This is basically a low-level cache for 1.1 font features.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>family</CODE> - the font family (such as "Monospaced")<DD><CODE>style</CODE> - the style of the font (such as Font.PLAIN)<DD><CODE>size</CODE> - the point size >= 1<DT><B>Returns:</B><DD>the new font</DL></DD></DL><HR><A NAME="getFontMetrics(java.awt.Font)"><!-- --></A><H3>getFontMetrics</H3><PRE>public <A HREF="../../../java/awt/FontMetrics.html">FontMetrics</A> <B>getFontMetrics</B>(<A HREF="../../../java/awt/Font.html">Font</A>&nbsp;f)</PRE><DL><DD>Returns font metrics for a font.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>f</CODE> - the font<DT><B>Returns:</B><DD>the metrics</DL></DD></DL><HR><A NAME="addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object)"><!-- --></A><H3>addAttribute</H3><PRE>public <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>addAttribute</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;old,                                 <A HREF="../../../java/lang/Object.html">Object</A>&nbsp;name,                                 <A HREF="../../../java/lang/Object.html">Object</A>&nbsp;value)</PRE><DL><DD>Adds an attribute to the given set, and returns the new representative set. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html#addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object)">addAttribute</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>old</CODE> - the old attribute set<DD><CODE>name</CODE> - the non-null attribute name<DD><CODE>value</CODE> - the attribute value<DT><B>Returns:</B><DD>the updated attribute set<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/MutableAttributeSet.html#addAttribute(java.lang.Object, java.lang.Object)"><CODE>MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)</CODE></A></DL></DD></DL><HR><A NAME="addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)"><!-- --></A><H3>addAttributes</H3><PRE>public <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>addAttributes</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;old,                                  <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attr)</PRE><DL><DD>Adds a set of attributes to the element. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html#addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)">addAttributes</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>old</CODE> - the old attribute set<DD><CODE>attr</CODE> - the attributes to add<DT><B>Returns:</B><DD>the updated attribute set<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/MutableAttributeSet.html#addAttribute(java.lang.Object, java.lang.Object)"><CODE>MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)</CODE></A></DL></DD></DL><HR><A NAME="removeAttribute(javax.swing.text.AttributeSet, java.lang.Object)"><!-- --></A><H3>removeAttribute</H3><PRE>public <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>removeAttribute</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;old,                                    <A HREF="../../../java/lang/Object.html">Object</A>&nbsp;name)</PRE><DL><DD>Removes an attribute from the set. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html#removeAttribute(javax.swing.text.AttributeSet, java.lang.Object)">removeAttribute</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>old</CODE> - the old set of attributes<DD><CODE>name</CODE> - the non-null attribute name<DT><B>Returns:</B><DD>the updated attribute set<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/MutableAttributeSet.html#removeAttribute(java.lang.Object)"><CODE>MutableAttributeSet.removeAttribute(java.lang.Object)</CODE></A></DL></DD></DL><HR><A NAME="removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration)"><!-- --></A><H3>removeAttributes</H3><PRE>public <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>removeAttributes</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;old,                                     <A HREF="../../../java/util/Enumeration.html">Enumeration</A>&nbsp;names)</PRE><DL><DD>Removes a set of attributes for the element. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html#removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration)">removeAttributes</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>old</CODE> - the old attribute set<DD><CODE>names</CODE> - the attribute names<DT><B>Returns:</B><DD>the updated attribute set<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/MutableAttributeSet.html#removeAttributes(java.util.Enumeration)"><CODE>MutableAttributeSet.removeAttributes(java.util.Enumeration)</CODE></A></DL></DD></DL><HR><A NAME="removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)"><!-- --></A><H3>removeAttributes</H3><PRE>public <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>removeAttributes</B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;old,                                     <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attrs)</PRE><DL><DD>Removes a set of attributes for the element. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html#removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)">removeAttributes</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>old</CODE> - the old attribute set<DD><CODE>attrs</CODE> - the attributes<DT><B>Returns:</B><DD>the updated attribute set<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/MutableAttributeSet.html#removeAttributes(java.util.Enumeration)"><CODE>MutableAttributeSet.removeAttributes(java.util.Enumeration)</CODE></A></DL></DD></DL><HR><A NAME="getEmptySet()"><!-- --></A><H3>getEmptySet</H3><PRE>public <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>getEmptySet</B>()</PRE><DL><DD>Fetches an empty AttributeSet.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html#getEmptySet()">getEmptySet</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the set</DL></DD></DL><HR>

⌨️ 快捷键说明

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