net.sf.vex.css
Class StyleSheet

java.lang.Object
  |
  +--net.sf.vex.css.StyleSheet

public class StyleSheet
extends java.lang.Object

Represents a CSS style sheet.


Field Summary
static byte SOURCE_AUTHOR
          Style sheet was provided by the document author.
static byte SOURCE_DEFAULT
          Style sheet is the default for the renderer.
static byte SOURCE_USER
          Style sheet was provided by the user.
 
Constructor Summary
StyleSheet(Rule[] rules)
          Class constructor.
 
Method Summary
 Element getAfterElement(Element element)
          Returns a pseudo-element representing content to be displayed after the given element, or null if there is no such content.
 Element getBeforeElement(Element element)
          Returns a pseudo-element representing content to be displayed before the given element, or null if there is no such content.
 float getNumber(LexicalUnit lu)
           
 Rule[] getRules()
          Returns the rules contained within this stylesheet.
 Styles getStyles(Element element)
          Returns the styles for the given element.
static boolean isBorderStyle(LexicalUnit lu)
          Returns true if the given lexical unit represents a border style.
static boolean isBorderWidth(LexicalUnit lu)
          Returns true if the given lexical unit represents a border width.
static boolean isColor(LexicalUnit lu)
          Returns true if the given lexical unit represents a color.
static boolean isFontSize(LexicalUnit lu)
          Returns true if the given lexical unit represents a font size.
static boolean isFontStyle(LexicalUnit lu)
          Returns true if the given lexical unit represents a font style.
static boolean isFontVariant(LexicalUnit lu)
          Returns true if the given lexical unit represents a font variant.
static boolean isFontWeight(LexicalUnit lu)
          Returns true if the given lexical unit represents a font weight.
static boolean isInherit(LexicalUnit lu)
          Returns true if the given lexical unit represents the token "inherit".
static boolean isWhiteSpace(LexicalUnit lu)
          Returns true if the given lexical unit represents a white space value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCE_DEFAULT

public static final byte SOURCE_DEFAULT
Style sheet is the default for the renderer.

See Also:
Constant Field Values

SOURCE_AUTHOR

public static final byte SOURCE_AUTHOR
Style sheet was provided by the document author.

See Also:
Constant Field Values

SOURCE_USER

public static final byte SOURCE_USER
Style sheet was provided by the user.

See Also:
Constant Field Values
Constructor Detail

StyleSheet

public StyleSheet(Rule[] rules)
Class constructor.

Parameters:
rules - Rules that constitute the style sheet.
Method Detail

getAfterElement

public Element getAfterElement(Element element)
Returns a pseudo-element representing content to be displayed after the given element, or null if there is no such content.

Parameters:
element - Parent element of the pseudo-element.

getBeforeElement

public Element getBeforeElement(Element element)
Returns a pseudo-element representing content to be displayed before the given element, or null if there is no such content.

Parameters:
element - Parent element of the pseudo-element.

getStyles

public Styles getStyles(Element element)
Returns the styles for the given element. The styles are cached to ensure reasonable performance.

Parameters:
element - Element for which to calculate the styles.

getRules

public Rule[] getRules()
Returns the rules contained within this stylesheet.


isBorderStyle

public static boolean isBorderStyle(LexicalUnit lu)
Returns true if the given lexical unit represents a border style.

Parameters:
lu - LexicalUnit to check.

isBorderWidth

public static boolean isBorderWidth(LexicalUnit lu)
Returns true if the given lexical unit represents a border width.

Parameters:
lu - LexicalUnit to check.

isColor

public static boolean isColor(LexicalUnit lu)
Returns true if the given lexical unit represents a color.

Parameters:
lu - LexicalUnit to check.

isFontSize

public static boolean isFontSize(LexicalUnit lu)
Returns true if the given lexical unit represents a font size.

Parameters:
lu - LexicalUnit to check.

isFontStyle

public static boolean isFontStyle(LexicalUnit lu)
Returns true if the given lexical unit represents a font style.

Parameters:
lu - LexicalUnit to check.

isFontVariant

public static boolean isFontVariant(LexicalUnit lu)
Returns true if the given lexical unit represents a font variant.

Parameters:
lu - LexicalUnit to check.

isFontWeight

public static boolean isFontWeight(LexicalUnit lu)
Returns true if the given lexical unit represents a font weight.

Parameters:
lu - LexicalUnit to check.

isInherit

public static boolean isInherit(LexicalUnit lu)
Returns true if the given lexical unit represents the token "inherit".


isWhiteSpace

public static boolean isWhiteSpace(LexicalUnit lu)
Returns true if the given lexical unit represents a white space value.

Parameters:
lu - LexicalUnit to check.

getNumber

public float getNumber(LexicalUnit lu)