<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Tue Jun 29 06:02:03 GMT+01:00 1999 -->
<TITLE>
Swing 1.1 API Specification: Class  StyleSheet
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/StyleSheet.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Swing 1.1</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../javax/swing/text/html/ParagraphView.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/swing/text/html/StyleSheet.BoxPainter.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="StyleSheet.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;<A HREF="#inner_class_summary">INNER</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.swing.text.StyleContext">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.swing.text.html</FONT>
<BR>
Class  StyleSheet</H2>
<PRE>
java.lang.Object
  |
  +--<A HREF="../../../../javax/swing/text/StyleContext.html">javax.swing.text.StyleContext</A>
        |
        +--<B>javax.swing.text.html.StyleSheet</B>
</PRE>
<HR>
<DL>
<DT>public class <B>StyleSheet</B><DT>extends <A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></DL>

<P>
Support for defining the visual characteristics of
 html views being rendered.  The StyleSheet is used to
 translate the html model into visual characteristics.
 This enables views to be customized by a look-and-feel,
 multiple views over the same model can be rendered
 differently, etc.  This can be thought of as a CSS
 rule repository.  The key for CSS attributes is an
 object of type CSS.Attribute.  The type of the value
 is up to the StyleSheet implementation, but the
 <code>toString</code> method is required
 to return a string representation of CSS value.
 <p>
 The primary entry point for HTML View implementations
 to get their attributes is the 
 <a href="#getViewAttributes">getViewAttributes</a>
 method.  This should be implemented to establish the
 desired policy used to associate attributes with the view.
 Each HTMLEditorKit (i.e. and therefore each associated
 JEditorPane) can have its own StyleSheet, but by default one
 sheet will be shared by all of the HTMLEditorKit instances.
 HTMLDocument instance can also have a StyleSheet, which
 holds the document-specific CSS specifications.
 <p>
 In order for Views to store less state and therefore be
 more lightweight, the StyleSheet can act as a factory for
 painters that handle some of the rendering tasks.  This allows
 implementations to determine what they want to cache
 and have the sharing potentially at the level that a
 selector is common to multiple views.  Since the StyleSheet
 may be used by views over multiple documents and typically
 the html attributes don't effect the selector being used,
 the potential for sharing is significant.
 <p>
 The rules are stored as named styles, and other information
 is stored to translate the context of an element to a 
 rule quickly.  The following code fragment will display
 the named styles, and therefore the CSS rules contained.
 <code><pre>

import java.util.*;
import javax.swing.text.*;
import javax.swing.text.html.*;

public class ShowStyles {

public static void main(String[] args) {
HTMLEditorKit kit = new HTMLEditorKit();
HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();
StyleSheet styles = doc.getStyleSheet();

Enumeration rules = styles.getStyleNames();
while (rules.hasMoreElements()) {
String name = (String) rules.nextElement();
Style rule = styles.getStyle(name);
System.out.println(rule.toString());
}
System.exit(0);
}
}

 </pre></code>
 <p>
 <font color="red">Note: This implementation is currently
 incomplete.  It can be replaced with alternative implementations
 that are complete.  Future versions of this class will provide
 better CSS support.</font>
<P>
<DL>
<DT><B>See Also: </B><DD><A HREF="../../../../serialized-form.html#javax.swing.text.html.StyleSheet">Serialized Form</A></DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->

<A NAME="inner_class_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Inner Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.BoxPainter.html">StyleSheet.BoxPainter</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class to carry out some of the duties of
 css formatting.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.ListPainter.html">StyleSheet.ListPainter</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class to carry out some of the duties of css list
 formatting.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="inner_classes_inherited_from_class_javax.swing.text.StyleContext"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Inner classes inherited from class javax.swing.text.<A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/swing/text/StyleContext.NamedStyle.html">StyleContext.NamedStyle</A></B>,  
<B><A HREF="../../../../javax/swing/text/StyleContext.SmallAttributeSet.html">StyleContext.SmallAttributeSet</A></B></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="fields_inherited_from_class_javax.swing.text.StyleContext"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Fields inherited from class javax.swing.text.<A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><A HREF="../../../../javax/swing/text/StyleContext.html#DEFAULT_STYLE">DEFAULT_STYLE</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#StyleSheet()">StyleSheet</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a StyleSheet</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#addRule(java.lang.String)">addRule</A></B>(java.lang.String&nbsp;rule)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add a set of rules to the sheet.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getBackground(javax.swing.text.AttributeSet)">getBackground</A></B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Takes a set of attributes and turn it into a background color
 specification.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/swing/text/html/StyleSheet.BoxPainter.html">StyleSheet.BoxPainter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getBoxPainter(javax.swing.text.AttributeSet)">getBoxPainter</A></B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetch the box formatter to use for the given set
 of css attributes.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getDeclaration(java.lang.String)">getDeclaration</A></B>(java.lang.String&nbsp;decl)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Translate a CSS declaration to an AttributeSet that represents
 the CSS declaration.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Font</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getFont(javax.swing.text.AttributeSet)">getFont</A></B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetch the font to use for the given set of attributes.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getForeground(javax.swing.text.AttributeSet)">getForeground</A></B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Takes a set of attributes and turn it into a foreground color
 specification.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getIndexOfSize(float)">getIndexOfSize</A></B>(float&nbsp;pt)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/swing/text/html/StyleSheet.ListPainter.html">StyleSheet.ListPainter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getListPainter(javax.swing.text.AttributeSet)">getListPainter</A></B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetch the list formatter to use for the given set
 of css attributes.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getPointSize(int)">getPointSize</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the point size, given a size index.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getPointSize(java.lang.String)">getPointSize</A></B>(java.lang.String&nbsp;size)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Given a string "+2", "-2", "2".</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/swing/text/Style.html">Style</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getRule(javax.swing.text.html.HTML.Tag, javax.swing.text.Element)">getRule</A></B>(<A HREF="../../../../javax/swing/text/html/HTML.Tag.html">HTML.Tag</A>&nbsp;t,
        <A HREF="../../../../javax/swing/text/Element.html">Element</A>&nbsp;e)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetch the style to use to render the given type
 of html tag.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/swing/text/Style.html">Style</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getRule(java.lang.String)">getRule</A></B>(java.lang.String&nbsp;selector)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetch the rule that best matches the selector given
 in string form.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#getViewAttributes(javax.swing.text.View)">getViewAttributes</A></B>(<A HREF="../../../../javax/swing/text/View.html">View</A>&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetch a set of attributes to use in the view for
 displaying.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#loadRules(java.io.Reader, java.net.URL)">loadRules</A></B>(java.io.Reader&nbsp;in,
          java.net.URL&nbsp;ref)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Load a set of rules that have been specified in terms of
 CSS1 grammar.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#setBaseFontSize(int)">setBaseFontSize</A></B>(int&nbsp;sz)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#setBaseFontSize(java.lang.String)">setBaseFontSize</A></B>(java.lang.String&nbsp;size)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#stringToColor(java.lang.String)">stringToColor</A></B>(java.lang.String&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert a color string "RED" or "#NNNNNN" to a Color.</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/swing/text/html/StyleSheet.html#translateHTMLToCSS(javax.swing.text.AttributeSet)">translateHTMLToCSS</A></B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;htmlAttrSet)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert a set of html attributes to an equivalent
 set of css attributes.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.swing.text.StyleContext"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.swing.text.<A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><A HREF="../../../../javax/swing/text/StyleContext.html#addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object)">addAttribute</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)">addAttributes</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#addChangeListener(javax.swing.event.ChangeListener)">addChangeListener</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#addStyle(java.lang.String, javax.swing.text.Style)">addStyle</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#createLargeAttributeSet(javax.swing.text.AttributeSet)">createLargeAttributeSet</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#createSmallAttributeSet(javax.swing.text.AttributeSet)">createSmallAttributeSet</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getCompressionThreshold()">getCompressionThreshold</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getDefaultStyleContext()">getDefaultStyleContext</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getEmptySet()">getEmptySet</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getFont(java.lang.String, int, int)">getFont</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getFontMetrics(java.awt.Font)">getFontMetrics</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getStaticAttribute(java.lang.Object)">getStaticAttribute</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getStaticAttributeKey(java.lang.Object)">getStaticAttributeKey</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getStyle(java.lang.String)">getStyle</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#getStyleNames()">getStyleNames</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#readAttributes(java.io.ObjectInputStream, javax.swing.text.MutableAttributeSet)">readAttributes</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#readAttributeSet(java.io.ObjectInputStream, javax.swing.text.MutableAttributeSet)">readAttributeSet</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#reclaim(javax.swing.text.AttributeSet)">reclaim</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#registerStaticAttributeKey(java.lang.Object)">registerStaticAttributeKey</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#removeAttribute(javax.swing.text.AttributeSet, java.lang.Object)">removeAttribute</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)">removeAttributes</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration)">removeAttributes</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#removeChangeListener(javax.swing.event.ChangeListener)">removeChangeListener</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#removeStyle(java.lang.String)">removeStyle</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#toString()">toString</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#writeAttributes(java.io.ObjectOutputStream, javax.swing.text.AttributeSet)">writeAttributes</A>, 
<A HREF="../../../../javax/swing/text/StyleContext.html#writeAttributeSet(java.io.ObjectOutputStream, javax.swing.text.AttributeSet)">writeAttributeSet</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>clone, 
equals, 
finalize, 
getClass, 
hashCode, 
notify, 
notifyAll, 
wait, 
wait, 
wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="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" ID="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>&nbsp;t,
                     <A HREF="../../../../javax/swing/text/Element.html">Element</A>&nbsp;e)</PRE>
<DL>
<DD>Fetch 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>(java.lang.String&nbsp;selector)</PRE>
<DL>
<DD>Fetch the rule that best matches the selector given
 in string form.</DL>
<HR>

<A NAME="addRule(java.lang.String)"><!-- --></A><H3>
addRule</H3>
<PRE>
public void <B>addRule</B>(java.lang.String&nbsp;rule)</PRE>
<DL>
<DD>Add 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 &lt;style&gt; 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>(java.lang.String&nbsp;decl)</PRE>
<DL>
<DD>Translate 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>(java.io.Reader&nbsp;in,
                      java.net.URL&nbsp;ref)
               throws java.io.IOException</PRE>
<DL>
<DD>Load 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>&nbsp;v)</PRE>
<DL>
<DD>Fetch 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="getFont(javax.swing.text.AttributeSet)"><!-- --></A><H3>
getFont</H3>
<PRE>
public java.awt.Font <B>getFont</B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</PRE>
<DL>
<DD>Fetch the font to use for the given set of attributes.<DD><DL>
<DT><B>Overrides:</B><DD><A HREF="../../../../javax/swing/text/StyleContext.html#getFont(javax.swing.text.AttributeSet)">getFont</A> in class <A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></DL>
</DD>
</DL>
<HR>

<A NAME="getForeground(javax.swing.text.AttributeSet)"><!-- --></A><H3>
getForeground</H3>
<PRE>
public java.awt.Color <B>getForeground</B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - the set of attributes<DT><B>Returns:</B><DD>the color<DT><B>Overrides:</B><DD><A HREF="../../../../javax/swing/text/StyleContext.html#getForeground(javax.swing.text.AttributeSet)">getForeground</A> in class <A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></DL>
</DD>
</DL>
<HR>

<A NAME="getBackground(javax.swing.text.AttributeSet)"><!-- --></A><H3>
getBackground</H3>
<PRE>
public java.awt.Color <B>getBackground</B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>attr</CODE> - the set of attributes<DT><B>Returns:</B><DD>the color<DT><B>Overrides:</B><DD><A HREF="../../../../javax/swing/text/StyleContext.html#getBackground(javax.swing.text.AttributeSet)">getBackground</A> in class <A HREF="../../../../javax/swing/text/StyleContext.html">StyleContext</A></DL>
</DD>
</DL>
<HR>

<A NAME="getBoxPainter(javax.swing.text.AttributeSet)"><!-- --></A><H3>
getBoxPainter</H3>
<PRE>
public <A HREF="../../../../javax/swing/text/html/StyleSheet.BoxPainter.html">StyleSheet.BoxPainter</A> <B>getBoxPainter</B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</PRE>
<DL>
<DD>Fetch the box formatter to use for the given set
 of css attributes.</DL>
<HR>

<A NAME="getListPainter(javax.swing.text.AttributeSet)"><!-- --></A><H3>
getListPainter</H3>
<PRE>
public <A HREF="../../../../javax/swing/text/html/StyleSheet.ListPainter.html">StyleSheet.ListPainter</A> <B>getListPainter</B>(<A HREF="../../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</PRE>
<DL>
<DD>Fetch the list formatter to use for the given set
 of css attributes.</DL>
<HR>

<A NAME="stringToColor(java.lang.String)"><!-- --></A><H3>
stringToColor</H3>
<PRE>
public java.awt.Color <B>stringToColor</B>(java.lang.String&nbsp;str)</PRE>
<DL>
<DD>Convert a color string "RED" or "#NNNNNN" to a Color.
 Note: This will only convert the HTML3.2 colors strings
       or string of length 7
       otherwise, it will return null.</DL>
<HR>

<A NAME="setBaseFontSize(int)"><!-- --></A><H3>
setBaseFontSize</H3>
<PRE>
public void <B>setBaseFontSize</B>(int&nbsp;sz)</PRE>
<DL>
</DL>
<HR>

<A NAME="setBaseFontSize(java.lang.String)"><!-- --></A><H3>
setBaseFontSize</H3>
<PRE>
public void <B>setBaseFontSize</B>(java.lang.String&nbsp;size)</PRE>
<DL>
</DL>
<HR>

<A NAME="getIndexOfSize(float)"><!-- --></A><H3>
getIndexOfSize</H3>
<PRE>
public static int <B>getIndexOfSize</B>(float&nbsp;pt)</PRE>
<DL>
</DL>
<HR>

<A NAME="getPointSize(int)"><!-- --></A><H3>
getPointSize</H3>
<PRE>
public float <B>getPointSize</B>(int&nbsp;index)</PRE>
<DL>
<DD>Return the point size, given a size index.</DL>
<HR>

<A NAME="getPointSize(java.lang.String)"><!-- --></A><H3>
getPointSize</H3>
<PRE>
public float <B>getPointSize</B>(java.lang.String&nbsp;size)</PRE>
<DL>
<DD>Given a string "+2", "-2", "2".
  returns a point size value</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>&nbsp;htmlAttrSet)</PRE>
<DL>
<DD>Convert 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>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/StyleSheet.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Swing 1.1</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../javax/swing/text/html/ParagraphView.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/swing/text/html/StyleSheet.BoxPainter.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="StyleSheet.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;<A HREF="#inner_class_summary">INNER</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.swing.text.StyleContext">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries.<br>Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>
