Package com.inet.html.css
Class CSS
java.lang.Object
com.inet.html.css.CSS
- Direct Known Subclasses:
CSS.UnknownAttribute
Contains all implemented CSS attributes and additional setters
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA list of CSS attributes.static classWrapper for an unknown attribute that was parsed in a CSS context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final CSS.AttributegetAttribute(String name) Get the CSS Attribute with the same name.static booleanChecks whether the element has font weight bold set directly or by inheritstatic booleanChecks whether the element has font style italic or oblique set directly or by inheritstatic booleanisUnderline(Element element) Checks whether the element has text decoration underline set directly or by inheritstatic voidsetFontFamily(MutableAttributeSet a, String family) Correctly sets the CSS.FONT_FAMILY attributestatic voidsetFontSize(MutableAttributeSet a, int size) Correctly sets the CSS.FONT_SIZE attributestatic voidsetFontSizePT(MutableAttributeSet a, float size) Correctly sets the CSS.FONT_SIZE attributestatic voidsetFontSizePT(MutableAttributeSet a, int size) Correctly sets the CSS.FONT_SIZE attributestatic voidsetFontStyle(MutableAttributeSet a, boolean italic) Correctly sets the CSS.FONT_STYLE attributestatic voidsetFontWeight(MutableAttributeSet a, boolean bold) Correctly sets the CSS.FONT_WEIGHT attributestatic voidsetMarginLeft(MutableAttributeSet a, int pixels) Correctly sets the CSS.MARGIN_LEFT attributestatic voidsetTextColor(MutableAttributeSet a, Color color) Correctly sets the CSS.COLOR attributestatic voidsetTextDecoration(MutableAttributeSet a, int decoration) Correctly sets the CSS.TEXT_DECORATION attribute
-
Constructor Details
-
CSS
public CSS()
-
-
Method Details
-
getAttribute
Get the CSS Attribute with the same name.- Parameters:
name- the lower case name- Returns:
- the Attribute or null
-
setTextColor
Correctly sets the CSS.COLOR attribute- Parameters:
a- The attribute set to modifycolor- The color to set
-
setFontSizePT
Correctly sets the CSS.FONT_SIZE attribute- Parameters:
a- The attribute set to modifysize- the size in PT to set
-
setFontSizePT
Correctly sets the CSS.FONT_SIZE attribute- Parameters:
a- The attribute set to modifysize- the size in PT to set
-
setFontSize
Correctly sets the CSS.FONT_SIZE attribute- Parameters:
a- The attribute set to modifysize- the size in pixels to set
-
setFontWeight
Correctly sets the CSS.FONT_WEIGHT attribute- Parameters:
a- The attribute set to modifybold- set to true, to make the font bold
-
setFontStyle
Correctly sets the CSS.FONT_STYLE attribute- Parameters:
a- The attribute set to modifyitalic- set to true, to make the font italics
-
setTextDecoration
Correctly sets the CSS.TEXT_DECORATION attribute- Parameters:
a- The attribute set to modifydecoration- TheTextDecorationconstant
-
setFontFamily
Correctly sets the CSS.FONT_FAMILY attribute- Parameters:
a- The attribute set to modifyfamily- The name of the font or font family to set
-
isBold
Checks whether the element has font weight bold set directly or by inherit- Parameters:
element- the element to check - in most cases the character element- Returns:
- true, if the font at this element level would be displayed bold
-
isItalic
Checks whether the element has font style italic or oblique set directly or by inherit- Parameters:
element- the element to check - in most cases the character element- Returns:
- true, if the font at this element level would be displayed italic
-
isUnderline
Checks whether the element has text decoration underline set directly or by inherit- Parameters:
element- the element to check - in most cases the character element- Returns:
- true, if the font at this element level would be displayed underlined
-
setMarginLeft
Correctly sets the CSS.MARGIN_LEFT attribute- Parameters:
a- The attribute set to modifypixels- the margin width in pixel
-