📄 stylesheet.html
字号:
</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#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="StyleSheet()"><!-- --></A><H3>StyleSheet</H3><PRE>public <B>StyleSheet</B>()</PRE><DL><DD>Construct a StyleSheet</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="getRule(javax.swing.text.html.HTML.Tag, javax.swing.text.Element)"><!-- --></A><H3>getRule</H3><PRE>public <A HREF="../../../../javax/swing/text/Style.html">Style</A> <B>getRule</B>(<A HREF="../../../../javax/swing/text/html/HTML.Tag.html">HTML.Tag</A> t, <A HREF="../../../../javax/swing/text/Element.html">Element</A> e)</PRE><DL><DD>Fetches the style to use to render the given type of HTML tag. The element given is representing the tag and can be used to determine the nesting for situations where the attributes will differ if nesting inside of elements.<DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - the type to translate to visual attributes.<DD><CODE>e</CODE> - the element representing the tag. The element can be used to determine the nesting for situations where the attributes will differ if nested inside of other elements.</DL></DD></DL><HR><A NAME="getRule(java.lang.String)"><!-- --></A><H3>getRule</H3><PRE>public <A HREF="../../../../javax/swing/text/Style.html">Style</A> <B>getRule</B>(<A HREF="../../../../java/lang/String.html">String</A> selector)</PRE><DL><DD>Fetches the rule that best matches the selector given in string form. Where <code>selector</code> is a space separated String of the element names. For example, <code>selector</code> might be 'html body tr td''<p> The attributes of the returned Style will change as rules are added and removed. That is if you to ask for a rule with a selector "table p" and a new rule was added with a selector of "p" the returned Style would include the new attributes from the rule "p".</DL><HR><A NAME="addRule(java.lang.String)"><!-- --></A><H3>addRule</H3><PRE>public void <B>addRule</B>(<A HREF="../../../../java/lang/String.html">String</A> rule)</PRE><DL><DD>Adds a set of rules to the sheet. The rules are expected to be in valid CSS format. Typically this would be called as a result of parsing a <style> tag.</DL><HR><A NAME="getDeclaration(java.lang.String)"><!-- --></A><H3>getDeclaration</H3><PRE>public <A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>getDeclaration</B>(<A HREF="../../../../java/lang/String.html">String</A> decl)</PRE><DL><DD>Translates a CSS declaration to an AttributeSet that represents the CSS declaration. Typically this would be called as a result of encountering an HTML style attribute.</DL><HR><A NAME="loadRules(java.io.Reader, java.net.URL)"><!-- --></A><H3>loadRules</H3><PRE>public void <B>loadRules</B>(<A HREF="../../../../java/io/Reader.html">Reader</A> in, <A HREF="../../../../java/net/URL.html">URL</A> ref) throws <A HREF="../../../../java/io/IOException.html">IOException</A></PRE><DL><DD>Loads a set of rules that have been specified in terms of CSS1 grammar. If there are collisions with existing rules, the newly specified rule will win.<DD><DL><DT><B>Parameters:</B><DD><CODE>in</CODE> - the stream to read the CSS grammar from<DD><CODE>ref</CODE> - the reference URL. This value represents the location of the stream and may be null. All relative URLs specified in the stream will be based upon this parameter.</DL></DD></DL><HR><A NAME="getViewAttributes(javax.swing.text.View)"><!-- --></A><H3>getViewAttributes</H3><PRE>public <A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>getViewAttributes</B>(<A HREF="../../../../javax/swing/text/View.html">View</A> v)</PRE><DL><DD>Fetches a set of attributes to use in the view for displaying. This is basically a set of attributes that can be used for View.getAttributes.</DL><HR><A NAME="removeStyle(java.lang.String)"><!-- --></A><H3>removeStyle</H3><PRE>public void <B>removeStyle</B>(<A HREF="../../../../java/lang/String.html">String</A> nm)</PRE><DL><DD>Removes a named style previously added to the document.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/text/StyleContext.html#removeStyle(java.lang.String)">removeStyle</A></CODE> in class <CODE><A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></CODE></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="addStyleSheet(javax.swing.text.html.StyleSheet)"><!-- --></A><H3>addStyleSheet</H3><PRE>public void <B>addStyleSheet</B>(<A HREF="../../../../javax/swing/text/html/StyleSheet.html">StyleSheet</A> ss)</PRE><DL><DD>Adds the rules from the StyleSheet <code>ss</code> to those of the receiver. <code>ss's</code> rules will override the rules of any previously added style sheets. An added StyleSheet will never override the rules of the receiving style sheet.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="removeStyleSheet(javax.swing.text.html.StyleSheet)"><!-- --></A><H3>removeStyleSheet</H3><PRE>public void <B>removeStyleSheet</B>(<A HREF="../../../../javax/swing/text/html/StyleSheet.html">StyleSheet</A> ss)</PRE><DL><DD>Removes the StyleSheet <code>ss</code> from those of the receiver.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="getStyleSheets()"><!-- --></A><H3>getStyleSheets</H3><PRE>public <A HREF="../../../../javax/swing/text/html/StyleSheet.html">StyleSheet</A>[] <B>getStyleSheets</B>()</PRE><DL><DD>Returns an array of the linked StyleSheets. Will return null if there are no linked StyleSheets.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="importStyleSheet(java.net.URL)"><!-- --></A><H3>importStyleSheet</H3><PRE>public void <B>importStyleSheet</B>(<A HREF="../../../../java/net/URL.html">URL</A> url)</PRE><DL><DD>Imports a style sheet from <code>url</code>. The resulting rules are directly added to the receiver. If you do not want the rules to become part of the receiver, create a new StyleSheet and use addStyleSheet to link it in.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="setBase(java.net.URL)"><!-- --></A><H3>setBase</H3><PRE>public void <B>setBase</B>(<A HREF="../../../../java/net/URL.html">URL</A> base)</PRE><DL><DD>Sets the base. All import statements that are relative, will be relative to <code>base</code>.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="getBase()"><!-- --></A><H3>getBase</H3><PRE>public <A HREF="../../../../java/net/URL.html">URL</A> <B>getBase</B>()</PRE><DL><DD>Returns the base.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="addCSSAttribute(javax.swing.text.MutableAttributeSet, javax.swing.text.html.CSS.Attribute, java.lang.String)"><!-- --></A><H3>addCSSAttribute</H3><PRE>public void <B>addCSSAttribute</B>(<A HREF="../../../../javax/swing/text/MutableAttributeSet.html">MutableAttributeSet</A> attr, <A HREF="../../../../javax/swing/text/html/CSS.Attribute.html">CSS.Attribute</A> key, <A HREF="../../../../java/lang/String.html">String</A> value)</PRE><DL><DD>Adds a CSS attribute to the given set.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="addCSSAttributeFromHTML(javax.swing.text.MutableAttributeSet, javax.swing.text.html.CSS.Attribute, java.lang.String)"><!-- --></A><H3>addCSSAttributeFromHTML</H3><PRE>public boolean <B>addCSSAttributeFromHTML</B>(<A HREF="../../../../javax/swing/text/MutableAttributeSet.html">MutableAttributeSet</A> attr, <A HREF="../../../../javax/swing/text/html/CSS.Attribute.html">CSS.Attribute</A> key, <A HREF="../../../../java/lang/String.html">String</A> value)</PRE><DL><DD>Adds a CSS attribute to the given set.<DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="translateHTMLToCSS(javax.swing.text.AttributeSet)"><!-- --></A><H3>translateHTMLToCSS</H3><PRE>public <A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A> <B>translateHTMLToCSS</B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A> htmlAttrSet)</PRE><DL><DD>Converts a set of HTML attributes to an equivalent set of CSS attributes.<DD><DL><DT><B>Parameters:</B><DD><CODE>AttributeSet</CODE> - containing the HTML attributes.<DD><CODE>AttributeSet</CODE> - containing the corresponding CSS attributes. The AttributeSet will be empty if there are no mapping CSS attributes.</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> old, <A HREF="../../../../java/lang/Object.html">Object</A> key, <A HREF="../../../../java/lang/Object.html">Object</A> value)</PRE><DL><DD>Adds an attribute to the given set, and returns the new representative set. This is reimplemented to convert StyleConstant attributes to CSS prior to forwarding to the superclass behavior. The StyleConstants attribute has no corresponding CSS entry, the StyleConstants attribute is stored (but will likely be unused).<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../javax/swing/text/StyleContext.html#addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object)">addAttribute</A></CODE> in class <CODE><A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>old</CODE> - the old attribute set<DD><CODE>key</CODE> - the non-null attribute key<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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -