public class CSSNodeStyle extends Object implements CSSStyle
Modifier and Type | Field and Description |
---|---|
Color |
background |
NodeBorder |
border |
static String |
CSS_BACKGROUND |
static String |
CSS_BORDER |
static String |
CSS_BORDER_RAISED |
static String |
CSS_BORDER_SIMPLE |
static String |
CSS_BORDER_STRONG |
static String |
CSS_FOREGROUND |
static String |
CSS_SHAPE |
static String |
CSS_SHAPE_ELLIPSE |
static String |
CSS_SHAPE_RECTANGLE |
static String |
CSS_TEXTCOLOR |
Color |
foreground |
NodeShape |
shape |
Color |
textcolor |
Constructor and Description |
---|
CSSNodeStyle()
A new style from the with all values to NULL
|
CSSNodeStyle(Color background,
Color foreground,
Color textcolor,
NodeBorder border,
NodeShape shape)
A new style from the scratch
|
CSSNodeStyle(CSSNodeStyle s)
A new style copied from another
|
CSSNodeStyle(NodeAttributesReader areader)
A new style from a GsAttributesReader areader
|
Modifier and Type | Method and Description |
---|---|
void |
apply(AttributesReader areader)
Apply the style to an element using its GsAttributesReader
|
Object |
clone() |
static CSSStyle |
fromString(String[] lines)
Create a new style from an array of strings
|
void |
merge(CSSStyle sa)
Merge the defined attributes from the style s
|
void |
setProperty(String property,
String value,
int i)
Define the value of a property of a style
|
String |
toString()
a css string representation of this style.
|
String |
toString(int tabs_count)
a css string representation of this style.
|
public static final String CSS_BACKGROUND
public static final String CSS_FOREGROUND
public static final String CSS_TEXTCOLOR
public static final String CSS_SHAPE
public static final String CSS_BORDER
public static final String CSS_SHAPE_ELLIPSE
public static final String CSS_SHAPE_RECTANGLE
public static final String CSS_BORDER_SIMPLE
public static final String CSS_BORDER_RAISED
public static final String CSS_BORDER_STRONG
public Color background
public Color foreground
public Color textcolor
public NodeBorder border
public NodeShape shape
public CSSNodeStyle()
public CSSNodeStyle(Color background, Color foreground, Color textcolor, NodeBorder border, NodeShape shape)
background
- the background color for the nodeforeground
- the foreground color for the nodeborder
- the style for the lineshape
- the shape for the lineNodeAttributesReader
public CSSNodeStyle(NodeAttributesReader areader)
areader
- public CSSNodeStyle(CSSNodeStyle s)
s
- public void merge(CSSStyle sa)
CSSStyle
public void apply(AttributesReader areader)
CSSStyle
public void setProperty(String property, String value, int i) throws CSSSyntaxException
CSSStyle
setProperty
in interface CSSStyle
i
- the index in the parsed textCSSSyntaxException
public String toString()
public String toString(int tabs_count)
tabs_count
- the number of tabulations to append at the begining of each linepublic static CSSStyle fromString(String[] lines) throws PatternSyntaxException, CSSSyntaxException
lines
- PatternSyntaxException
CSSSyntaxException
- if there is an error in the syntaxCopyright © 2005–2020. All rights reserved.