Package Summary  Overview Summary

class:StyleSheet [CHANGED]

  • All Implemented Interfaces:
    Serializable, AbstractDocument.AttributeContext


    public class StyleSheet
    extends StyleContext
    
    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 toString method is required to return a string representation of CSS value.

    The primary entry point for HTML View implementations to get their attributes is the getViewAttributes 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.

    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.

    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.

    
      
       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);
           }
       }
      
     
    

    The semantics for when a CSS style should overide visual attributes defined by an element are not well defined. For example, the html <body bgcolor=red> makes the body have a red background. But if the html file also contains the CSS rule body { background: blue } it becomes less clear as to what color the background of the body should be. The current implementation gives visual attributes defined in the element the highest precedence, that is they are always checked before any styles. Therefore, in the previous example the background would have a red color as the body element defines the background color to be red.

    As already mentioned this supports CSS. We don't support the full CSS spec. Refer to the javadoc of the CSS class to see what properties we support. The two major CSS parsing related concepts we do not currently support are pseudo selectors, such as A:link { color: red } , and the important modifier.

    Implementation 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.
  • All Implemented Interfaces:
    Serializable, AbstractDocument.AttributeContext


    public class StyleSheet
    extends StyleContext
    
    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 toString method is required to return a string representation of CSS value.

    The primary entry point for HTML View implementations to get their attributes is the getViewAttributes 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.

    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.

    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.

    
      
       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);
           }
       }
      
     
    

    The semantics for when a CSS style should overide visual attributes defined by an element are not well defined. For example, the html <body bgcolor=red> makes the body have a red background. But if the html file also contains the CSS rule body { background: blue } it becomes less clear as to what color the background of the body should be. The current implementation gives visual attributes defined in the element the highest precedence, that is they are always checked before any styles. Therefore, in the previous example the background would have a red color as the body element defines the background color to be red.

    As already mentioned this supports CSS. We don't support the full CSS spec. Refer to the javadoc of the CSS class to see what properties we support. The two major CSS parsing related concepts we do not currently support are pseudo selectors, such as A:link { color: red } , and the important modifier.

    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.

  • All Implemented Interfaces:
    Serializable, AbstractDocument.AttributeContext


    public class StyleSheet
    extends StyleContext
    
    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 toString method is required to return a string representation of CSS value.

    The primary entry point for HTML View implementations to get their attributes is the getViewAttributes 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.

    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.

    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.

    
      
       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);
           }
       }
      
     
    

    The semantics for when a CSS style should overide visual attributes defined by an element are not well defined. For example, the html <body bgcolor=red> makes the body have a red background. But if the html file also contains the CSS rule body { background: blue } it becomes less clear as to what color the background of the body should be. The current implementation gives visual attributes defined in the element the highest precedence, that is they are always checked before any styles. Therefore, in the previous example the background would have a red color as the body element defines the background color to be red.

    As already mentioned this supports CSS. We don't support the full CSS spec. Refer to the javadoc of the CSS class to see what properties we support. The two major CSS parsing related concepts we do not currently support are pseudo selectors, such as A:link { color: red } , and the important modifier.

    Implementation 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.

constructor:StyleSheet() [NONE]

  • StyleSheet

    public StyleSheet()
    Construct a StyleSheet

method:getRule(javax.swing.text.html.HTML.Tag, javax.swing.text.Element) [NONE]

  • getRule

    public Style getRule(HTML.Tag t,
                         Element e)
    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.
    Parameters:
    t - the type to translate to visual attributes
    e - 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
    Returns:
    the set of CSS attributes to use to render the tag

method:getRule(java.lang.String) [CHANGED]

  • getRule

    public Style getRule(String selector)
    Fetches the rule that best matches the selector given in string form. Where selector is a space separated String of the element names. For example, selector might be 'html body tr td''

    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".

    Parameters:
    selector - a space separated String of the element names.
    Returns:
    the rule that best matches the selector.
  • getRule

    public Style getRule(String selector)
    Fetches the rule that best matches the selector given in string form. Where selector is a space separated String of the element names. For example, selector might be 'html body tr td''

    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".

  • getRule

    public Style getRule(String selector)
    Fetches the rule that best matches the selector given in string form. Where selector is a space separated String of the element names. For example, selector might be 'html body tr td''

    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".

    Parameters:
    selector - a space separated String of the element names.
    Returns:
    the rule that best matches the selector.

method:addRule(java.lang.String) [CHANGED]

  • addRule

    public void addRule(String rule)
    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.
    Parameters:
    rule - a set of rules
  • addRule

    public void addRule(String rule)
    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.
  • addRule

    public void addRule(String rule)
    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.
    Parameters:
    rule - a set of rules

method:getDeclaration(java.lang.String) [CHANGED]

  • getDeclaration

    public AttributeSet getDeclaration(String decl)
    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.
    Parameters:
    decl - a CSS declaration
    Returns:
    a set of attributes that represents the CSS declaration.
  • getDeclaration

    public AttributeSet getDeclaration(String decl)
    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.
  • getDeclaration

    public AttributeSet getDeclaration(String decl)
    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.
    Parameters:
    decl - a CSS declaration
    Returns:
    a set of attributes that represents the CSS declaration.

method:loadRules(java.io.Reader, java.net.URL) [CHANGED]

  • loadRules

    public void loadRules(Reader in,
                          URL ref)
                   throws IOException
    
    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.
    Parameters:
    in - the stream to read the CSS grammar from
    ref - 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.
    Throws:
    IOException - if I/O error occured.
  • loadRules

    public void loadRules(Reader in,
                          URL ref)
                   throws IOException
    
    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.
    Parameters:
    in - the stream to read the CSS grammar from
    ref - 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.
    Throws:
    IOException
  • loadRules

    public void loadRules(Reader in,
                          URL ref)
                   throws IOException
    
    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.
    Parameters:
    in - the stream to read the CSS grammar from
    ref - 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.
    Throws:
    IOException - if I/O error occured.

method:getViewAttributes(javax.swing.text.View) [CHANGED]

  • getViewAttributes

    public AttributeSet getViewAttributes(View v)
    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.
    Parameters:
    v - a view
    Returns:
    the of attributes
  • getViewAttributes

    public AttributeSet getViewAttributes(View v)
    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.
  • getViewAttributes

    public AttributeSet getViewAttributes(View v)
    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.
    Parameters:
    v - a view
    Returns:
    the of attributes

method:removeStyle(java.lang.String) [NONE]

  • removeStyle

    public void removeStyle(String nm)
    Removes a named style previously added to the document.
    Overrides:
    removeStyle in class StyleContext
    Parameters:
    nm - the name of the style to remove

method:addStyleSheet(javax.swing.text.html.StyleSheet) [CHANGED]

  • addStyleSheet

    public void addStyleSheet(StyleSheet ss)
    Adds the rules from the StyleSheet ss to those of the receiver. ss's rules will override the rules of any previously added style sheets. An added StyleSheet will never override the rules of the receiving style sheet.
    Parameters:
    ss - a StyleSheet
    Since:
    1.3
  • addStyleSheet

    public void addStyleSheet(StyleSheet ss)
    Adds the rules from the StyleSheet ss to those of the receiver. ss's rules will override the rules of any previously added style sheets. An added StyleSheet will never override the rules of the receiving style sheet.
    Since:
    1.3
  • addStyleSheet

    public void addStyleSheet(StyleSheet ss)
    Adds the rules from the StyleSheet ss to those of the receiver. ss's rules will override the rules of any previously added style sheets. An added StyleSheet will never override the rules of the receiving style sheet.
    Parameters:
    ss - a StyleSheet
    Since:
    1.3

method:removeStyleSheet(javax.swing.text.html.StyleSheet) [CHANGED]

  • removeStyleSheet

    public void removeStyleSheet(StyleSheet ss)
    Removes the StyleSheet ss from those of the receiver.
    Parameters:
    ss - a StyleSheet
    Since:
    1.3
  • removeStyleSheet

    public void removeStyleSheet(StyleSheet ss)
    Removes the StyleSheet ss from those of the receiver.
    Since:
    1.3
  • removeStyleSheet

    public void removeStyleSheet(StyleSheet ss)
    Removes the StyleSheet ss from those of the receiver.
    Parameters:
    ss - a StyleSheet
    Since:
    1.3

method:getStyleSheets() [CHANGED]

  • getStyleSheets

    public StyleSheet[] getStyleSheets()
    Returns an array of the linked StyleSheets. Will return null if there are no linked StyleSheets.
    Returns:
    an array of StyleSheets.
    Since:
    1.3
  • getStyleSheets

    public StyleSheet[] getStyleSheets()
    Returns an array of the linked StyleSheets. Will return null if there are no linked StyleSheets.
    Since:
    1.3
  • getStyleSheets

    public StyleSheet[] getStyleSheets()
    Returns an array of the linked StyleSheets. Will return null if there are no linked StyleSheets.
    Returns:
    an array of StyleSheets.
    Since:
    1.3

method:importStyleSheet(java.net.URL) [CHANGED]

  • importStyleSheet

    public void importStyleSheet(URL url)
    Imports a style sheet from url. 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.
    Parameters:
    url - an url
    Since:
    1.3
  • importStyleSheet

    public void importStyleSheet(URL url)
    Imports a style sheet from url. 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.
    Since:
    1.3
  • importStyleSheet

    public void importStyleSheet(URL url)
    Imports a style sheet from url. 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.
    Parameters:
    url - an url
    Since:
    1.3

method:setBase(java.net.URL) [CHANGED]

  • setBase

    public void setBase(URL base)
    Sets the base. All import statements that are relative, will be relative to base.
    Parameters:
    base - a base.
    Since:
    1.3
  • setBase

    public void setBase(URL base)
    Sets the base. All import statements that are relative, will be relative to base.
    Since:
    1.3
  • setBase

    public void setBase(URL base)
    Sets the base. All import statements that are relative, will be relative to base.
    Parameters:
    base - a base.
    Since:
    1.3

method:getBase() [CHANGED]

  • getBase

    public URL getBase()
    Returns the base.
    Returns:
    the base.
    Since:
    1.3
  • getBase

    public URL getBase()
    Returns the base.
    Since:
    1.3
  • getBase

    public URL getBase()
    Returns the base.
    Returns:
    the base.
    Since:
    1.3

method:addCSSAttribute(javax.swing.text.MutableAttributeSet, javax.swing.text.html.CSS.Attribute, java.lang.String) [CHANGED]

  • addCSSAttribute

    public void addCSSAttribute(MutableAttributeSet attr,
                                CSS.Attribute key,
                                String value)
    Adds a CSS attribute to the given set.
    Parameters:
    attr - a set of attributes
    key - a CSS property
    value - an HTML attribute value
    Since:
    1.3
  • addCSSAttribute

    public void addCSSAttribute(MutableAttributeSet attr,
                                CSS.Attribute key,
                                String value)
    Adds a CSS attribute to the given set.
    Parameters:
    attr - a set of attributes
    key - a CSS property
    value - an HTML attribute value
    Since:
    1.3

method:addCSSAttributeFromHTML(javax.swing.text.MutableAttributeSet, javax.swing.text.html.CSS.Attribute, java.lang.String) [CHANGED]

  • addCSSAttributeFromHTML

    public boolean addCSSAttributeFromHTML(MutableAttributeSet attr,
                                           CSS.Attribute key,
                                           String value)
    Adds a CSS attribute to the given set.
    Parameters:
    attr - a set of attributes
    key - a CSS property
    value - an HTML attribute value
    Returns:
    true if an HTML attribute value can be converted to a CSS attribute, false otherwise.
    Since:
    1.3
  • addCSSAttributeFromHTML

    public boolean addCSSAttributeFromHTML(MutableAttributeSet attr,
                                           CSS.Attribute key,
                                           String value)
    Adds a CSS attribute to the given set.
    Parameters:
    attr - a set of attributes
    key - a CSS property
    value - an HTML attribute value
    Returns:
    true if an HTML attribute value can be converted to a CSS attribute, false otherwise.
    Since:
    1.3

method:translateHTMLToCSS(javax.swing.text.AttributeSet) [CHANGED]

  • translateHTMLToCSS

    public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet)
    Converts a set of HTML attributes to an equivalent set of CSS attributes.
    Parameters:
    htmlAttrSet - AttributeSet containing the HTML attributes.
    Returns:
    the set of CSS attributes.
  • translateHTMLToCSS

    public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet)
    Converts a set of HTML attributes to an equivalent set of CSS attributes.
    Parameters:
    htmlAttrSet - AttributeSet containing the HTML attributes.
  • translateHTMLToCSS

    public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet)
    Converts a set of HTML attributes to an equivalent set of CSS attributes.
    Parameters:
    htmlAttrSet - AttributeSet containing the HTML attributes.
    Returns:
    the set of CSS attributes.

method:addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object) [NONE]

method:addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) [NONE]

method:removeAttribute(javax.swing.text.AttributeSet, java.lang.Object) [NONE]

method:removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration) [NONE]

method:removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) [NONE]

method:createSmallAttributeSet(javax.swing.text.AttributeSet) [CHANGED]

  • createSmallAttributeSet

    protected StyleContext.SmallAttributeSet createSmallAttributeSet(AttributeSet a)
    Creates a compact set of attributes that might be shared. This is a hook for subclasses that want to alter the behavior of SmallAttributeSet. This can be reimplemented to return an AttributeSet that provides some sort of attribute conversion.
    Overrides:
    createSmallAttributeSet in class StyleContext
    Parameters:
    a - The set of attributes to be represented in the the compact form.
    Returns:
    a compact set of attributes that might be shared
  • createSmallAttributeSet

    protected StyleContext.SmallAttributeSet createSmallAttributeSet(AttributeSet a)
    Creates a compact set of attributes that might be shared. This is a hook for subclasses that want to alter the behavior of SmallAttributeSet. This can be reimplemented to return an AttributeSet that provides some sort of attribute conversion.
    Overrides:
    createSmallAttributeSet in class StyleContext
    Parameters:
    a - The set of attributes to be represented in the the compact form.
  • createSmallAttributeSet

    protected StyleContext.SmallAttributeSet createSmallAttributeSet(AttributeSet a)
    Creates a compact set of attributes that might be shared. This is a hook for subclasses that want to alter the behavior of SmallAttributeSet. This can be reimplemented to return an AttributeSet that provides some sort of attribute conversion.
    Overrides:
    createSmallAttributeSet in class StyleContext
    Parameters:
    a - The set of attributes to be represented in the the compact form.
    Returns:
    a compact set of attributes that might be shared

method:createLargeAttributeSet(javax.swing.text.AttributeSet) [CHANGED]

  • createLargeAttributeSet

    protected MutableAttributeSet createLargeAttributeSet(AttributeSet a)
    Creates a large set of attributes that should trade off space for time. This set will not be shared. This is a hook for subclasses that want to alter the behavior of the larger attribute storage format (which is SimpleAttributeSet by default). This can be reimplemented to return a MutableAttributeSet that provides some sort of attribute conversion.
    Overrides:
    createLargeAttributeSet in class StyleContext
    Parameters:
    a - The set of attributes to be represented in the the larger form.
    Returns:
    a large set of attributes that should trade off space for time
  • createLargeAttributeSet

    protected MutableAttributeSet createLargeAttributeSet(AttributeSet a)
    Creates a large set of attributes that should trade off space for time. This set will not be shared. This is a hook for subclasses that want to alter the behavior of the larger attribute storage format (which is SimpleAttributeSet by default). This can be reimplemented to return a MutableAttributeSet that provides some sort of attribute conversion.
    Overrides:
    createLargeAttributeSet in class StyleContext
    Parameters:
    a - The set of attributes to be represented in the the larger form.
  • createLargeAttributeSet

    protected MutableAttributeSet createLargeAttributeSet(AttributeSet a)
    Creates a large set of attributes that should trade off space for time. This set will not be shared. This is a hook for subclasses that want to alter the behavior of the larger attribute storage format (which is SimpleAttributeSet by default). This can be reimplemented to return a MutableAttributeSet that provides some sort of attribute conversion.
    Overrides:
    createLargeAttributeSet in class StyleContext
    Parameters:
    a - The set of attributes to be represented in the the larger form.
    Returns:
    a large set of attributes that should trade off space for time

method:getFont(javax.swing.text.AttributeSet) [NONE]

  • getFont

    public Font getFont(AttributeSet a)
    Fetches the font to use for the given set of attributes.
    Overrides:
    getFont in class StyleContext
    Parameters:
    a - the attribute set
    Returns:
    the font

method:getForeground(javax.swing.text.AttributeSet) [NONE]

  • getForeground

    public Color getForeground(AttributeSet a)
    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.
    Overrides:
    getForeground in class StyleContext
    Parameters:
    a - the set of attributes
    Returns:
    the color

method:getBackground(javax.swing.text.AttributeSet) [NONE]

  • getBackground

    public Color getBackground(AttributeSet a)
    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.
    Overrides:
    getBackground in class StyleContext
    Parameters:
    a - the set of attributes
    Returns:
    the color

method:getBoxPainter(javax.swing.text.AttributeSet) [CHANGED]

  • getBoxPainter

    public StyleSheet.BoxPainter getBoxPainter(AttributeSet a)
    Fetches the box formatter to use for the given set of CSS attributes.
    Parameters:
    a - a set of CSS attributes
    Returns:
    the box formatter.
  • getBoxPainter

    public StyleSheet.BoxPainter getBoxPainter(AttributeSet a)
    Fetches the box formatter to use for the given set of CSS attributes.
    Parameters:
    a - a set of CSS attributes
    Returns:
    the box formatter.

method:getListPainter(javax.swing.text.AttributeSet) [CHANGED]

  • getListPainter

    public StyleSheet.ListPainter getListPainter(AttributeSet a)
    Fetches the list formatter to use for the given set of CSS attributes.
    Parameters:
    a - a set of CSS attributes
    Returns:
    the list formatter.
  • getListPainter

    public StyleSheet.ListPainter getListPainter(AttributeSet a)
    Fetches the list formatter to use for the given set of CSS attributes.
    Parameters:
    a - a set of CSS attributes
    Returns:
    the list formatter.

method:setBaseFontSize(int) [CHANGED]

  • setBaseFontSize

    public void setBaseFontSize(int sz)
    Sets the base font size, with valid values between 1 and 7.
    Parameters:
    sz - a font size.
  • setBaseFontSize

    public void setBaseFontSize(int sz)
    Sets the base font size, with valid values between 1 and 7.
  • setBaseFontSize

    public void setBaseFontSize(int sz)
    Sets the base font size, with valid values between 1 and 7.
    Parameters:
    sz - a font size.

method:setBaseFontSize(java.lang.String) [CHANGED]

  • setBaseFontSize

    public void setBaseFontSize(String size)
    Sets the base font size from the passed in String. The string can either identify a specific font size, with legal values between 1 and 7, or identify a relative font size such as +1 or -2.
    Parameters:
    size - a font size.
  • setBaseFontSize

    public void setBaseFontSize(String size)
    Sets the base font size from the passed in String. The string can either identify a specific font size, with legal values between 1 and 7, or identify a relative font size such as +1 or -2.
  • setBaseFontSize

    public void setBaseFontSize(String size)
    Sets the base font size from the passed in String. The string can either identify a specific font size, with legal values between 1 and 7, or identify a relative font size such as +1 or -2.
    Parameters:
    size - a font size.

method:getIndexOfSize(float) [CHANGED]

  • getIndexOfSize

    public static int getIndexOfSize(float pt)
    Returns the index of HTML/CSS size model.
    Parameters:
    pt - a size of point
    Returns:
    the index of HTML/CSS size model.
  • getIndexOfSize

    public static int getIndexOfSize(float pt)
  • getIndexOfSize

    public static int getIndexOfSize(float pt)
    Returns the index of HTML/CSS size model.
    Parameters:
    pt - a size of point
    Returns:
    the index of HTML/CSS size model.

method:getPointSize(int) [CHANGED]

  • getPointSize

    public float getPointSize(int index)
    Returns the point size, given a size index.
    Parameters:
    index - a size index
    Returns:
    the point size value.
  • getPointSize

    public float getPointSize(int index)
    Returns the point size, given a size index.
  • getPointSize

    public float getPointSize(int index)
    Returns the point size, given a size index.
    Parameters:
    index - a size index
    Returns:
    the point size value.

method:getPointSize(java.lang.String) [CHANGED]

  • getPointSize

    public float getPointSize(String size)
    Given a string such as "+2", "-2", or "2", returns a point size value.
    Parameters:
    size - a CSS string describing font size
    Returns:
    the point size value.
  • getPointSize

    public float getPointSize(String size)
    Given a string such as "+2", "-2", or "2", returns a point size value.
  • getPointSize

    public float getPointSize(String size)
    Given a string such as "+2", "-2", or "2", returns a point size value.
    Parameters:
    size - a CSS string describing font size
    Returns:
    the point size value.

method:stringToColor(java.lang.String) [CHANGED]

  • stringToColor

    public Color stringToColor(String string)
    Converts a color string such as "RED" or "#NNNNNN" to a Color. Note: This will only convert the HTML3.2 color strings or a string of length 7; otherwise, it will return null.
    Parameters:
    string - color string such as "RED" or "#NNNNNN"
    Returns:
    the color
  • stringToColor

    public Color stringToColor(String string)
    Converts a color string such as "RED" or "#NNNNNN" to a Color. Note: This will only convert the HTML3.2 color strings or a string of length 7; otherwise, it will return null.
  • stringToColor

    public Color stringToColor(String string)
    Converts a color string such as "RED" or "#NNNNNN" to a Color. Note: This will only convert the HTML3.2 color strings or a string of length 7; otherwise, it will return null.
    Parameters:
    string - color string such as "RED" or "#NNNNNN"
    Returns:
    the color

© 2017 Oracle Corporation and/or its affiliates