public static class StyleParser.StyleInfo extends Object
| Constructor and Description |
|---|
StyleInfo()
Creates a new StyleInfo.
|
StyleInfo(Map<String,String> values)
Creates a new StyleInfo given the parsed Map of keys and values.
|
StyleInfo(String... styleString)
Parses the given style strings and encapsulates their details in
a StyleInfo object.
|
StyleInfo(StyleParser.StyleInfo info)
Creates a new style info by copying styles from existing style info.
|
public StyleInfo(String... styleString)
styleString - One or more style strings.public StyleInfo(Map<String,String> values)
values - public StyleInfo()
public StyleInfo(StyleParser.StyleInfo info)
info - Style to copy.public StyleParser.PaddingInfo getPadding()
public StyleParser.MarginInfo getMargin()
public StyleParser.BorderInfo getBorder()
public StyleParser.FontInfo getFont()
public StyleParser.StyleInfo setFont(String font)
font - A valid font style string. E.g. "2mm native:MainRegular"public StyleParser.StyleInfo setFontSize(String fontSize)
fontSize - A valid font size. E.g. "2mm"public StyleParser.StyleInfo setFontName(String fontName)
fontName - A valid font name. E.g. "native:MainRegular"public Integer getBgColor()
public Integer getFgColor()
public StyleParser.StyleInfo setFgColor(String fgColor)
fgColor - A valid color string. E.g. "ff0000"public StyleParser.StyleInfo setBgColor(String bgColor)
bgColor - A valid color string. E.g. "ff0000"public StyleParser.StyleInfo setTransparency(String transparency)
transparency - A valid transparency string (0-255). E.g. "255"public StyleParser.StyleInfo setOpacity(String opacity)
opacity - A valid opacity string (0-255). E.g. "255"public StyleParser.StyleInfo setPadding(String padding)
padding - A valid padding string. E.g. "1mm", or "2mm 3px 0 5mm"public StyleParser.StyleInfo setMargin(String margin)
margin - A valid margin string. E.g. "1mm", or "2mm 3px 0 0"public StyleParser.StyleInfo setBorder(String border)
border - A valid border string. E.g. "1px solid ff0000", or "splicedImage notes.png 0.25 0.25 0.25 0.25"public Integer getTransparency()
public Integer getOpacity()
public Integer getAlignment()
Component.LEFT, Component.RIGHT, Component.CENTER. Or null if
alignment wasn't specified.public StyleParser.StyleInfo setAlignment(int alignment)
alignment - One of Component.LEFT, Component.RIGHT, Component.CENTERpublic StyleParser.StyleInfo setAlignment(String alignment)
Component.LEFT, Component.RIGHT, Component.CENTER. Or the
literal strings "center", "left", or "right". Or null to unset this property.alignment - public String getAlignmentAsString()
public Integer getBgType()
public StyleParser.StyleInfo setBgType(String type)
type - A valid background type string. E.g. "image_scaled_fit"public StyleParser.StyleInfo setBgType(Integer i)
i - A background type. One of Style.BACKGROUND_XXX constants.public String getBgTypeAsString()
public StyleParser.ImageInfo getBgImage()
public StyleParser.StyleInfo setBgImage(String bgImage)
bgImage - A valid image string. E.g. "notes.png" (to refer to the notes.png image in the theme), or "/notes.png" to refer to notes.png in the src directory.public Integer getTextDecoration()
public String getTextDecorationAsString()
public String toStyleString()
Component.setInlineAllStyles(java.lang.String)