public class TLcdNVGStyle extends Object implements ILcdCloneable
The NVG style defines how objects should be rendered graphically, with the exception of points. The styling of points is specified
by TLcdNVGSymbol
. Depending on the geometry the element represents, the attributes of this object specifies how to style the
shape outlines, the inside of closed shapes, or text objects.
If a style attribute is not specified, a default value will be used for rendering. These default values are specified by the NVG specification; they are exposed as constants starting with "DEFAULT_"."
Modifier and Type | Field and Description |
---|---|
static Color |
DEFAULT_FILL_COLOR
Default fill color is null (area not filled).
|
static float |
DEFAULT_FILL_OPACITY
Default fill opacity is 1.0 (opaque).
|
static ELcdNVGFillPattern |
DEFAULT_FILL_PATTERN
Default fill pattern is 0 (Blank).
|
static Color |
DEFAULT_FONT_COLOR
Default font color is black.
|
static String |
DEFAULT_FONT_FAMILY
Default font family name is null which will result in a default AWT font (which is system specific).
|
static TLcdNVGFontSize |
DEFAULT_FONT_SIZE
Default font size is 12 pixels.
|
static ELcdNVGFontStyle |
DEFAULT_FONT_STYLE
Default font style is
ELcdNVGFontStyle#NORMAL . |
static ELcdNVGFontWeight |
DEFAULT_FONT_WEIGHT
Default font weight is
ELcdNVGFontWeight#NORMAL . |
static ELcdNVGLinePattern |
DEFAULT_LINE_PATTERN_BEGIN
Default line pattern at the beginning of the line.
|
static int |
DEFAULT_LINE_PATTERN_BEGIN_SIZE
Default line pattern size at the beginning of the line.
|
static ELcdNVGLinePattern |
DEFAULT_LINE_PATTERN_END
Default line pattern at the end of the line.
|
static int |
DEFAULT_LINE_PATTERN_END_SIZE
Default line pattern size at the end of the line.
|
static Color |
DEFAULT_STROKE_COLOR
Default stroke color is black.
|
static float[] |
DEFAULT_STROKE_DASH
Default stroke dash is an empty array, which means no dashing is used (a solid line).
|
static float |
DEFAULT_STROKE_OPACITY
Default stroke opacity is 1.0 (opaque).
|
static float |
DEFAULT_STROKE_WIDTH
Default stroke width is 1 pixel.
|
static ELcdNVGHorizontalAlignment |
DEFAULT_TEXT_ALIGN
Default text alignment is
ELcdNVGHorizontalAlignment#CENTER . |
static ELcdNVGVerticalAlignment |
DEFAULT_VERTICAL_ALIGN
Default vertical alignment is
ELcdNVGVerticalAlignment#MIDDLE . |
Constructor and Description |
---|
TLcdNVGStyle()
public constructor with every attributes set to null.
|
TLcdNVGStyle(boolean useDefault)
If useDefault is true, the attributes are set to the default ones defined in the different style interfaces.
|
Modifier and Type | Method and Description |
---|---|
TLcdNVGStyle |
clone()
Makes
Object.clone() public. |
boolean |
equals(Object o) |
Color |
getFillColor()
Get the fill color.
|
Float |
getFillOpacity()
Get the opacity of the area.
|
ELcdNVGFillPattern |
getFillPattern()
Get the fill pattern of the area, null if there is no fill pattern set.
|
Color |
getFontColor()
Get the font color.
|
String |
getFontFamily()
Get the font family name.
|
TLcdNVGFontSize |
getFontSize()
Get the font size as a TLcdNVGFontSize instance.
|
ELcdNVGFontStyle |
getFontStyle()
Get the font style.
|
ELcdNVGFontWeight |
getFontWeight()
Get the font weight.
|
ELcdNVGLinePattern |
getLinePatternBegin()
Get the line pattern at the beginning of the line.
|
Integer |
getLinePatternBeginSize()
Get the line pattern size at the beginning of the line.
|
ELcdNVGLinePattern |
getLinePatternEnd()
Get the line pattern at the end of the line.
|
Integer |
getLinePatternEndSize()
Get the line pattern size at the end of the line.
|
Color |
getStrokeColor()
Get the stroke color or null if it wasn't explicitly set.
|
float[] |
getStrokeDash()
Get the dashed representation of the stroke.
|
Float |
getStrokeOpacity()
Get the opacity of the stroke.
|
Float |
getStrokeWidth()
Get the width of the stroke.
|
ELcdNVGHorizontalAlignment |
getTextAlign()
Get the horizontal text alignment.
|
ELcdNVGVerticalAlignment |
getVerticalAlign()
Get the vertical text alignment.
|
int |
hashCode() |
void |
setFillColor(Color aFillColor)
Set the fill color.
|
void |
setFillOpacity(Float aFillOpacity)
Set the fill opacity
|
void |
setFillPattern(ELcdNVGFillPattern aFillPattern)
Set the fill pattern.
|
void |
setFontColor(Color aFontColor)
Set the font color.
|
void |
setFontFamily(String aFontFamily)
Set the font family name.
|
void |
setFontSize(TLcdNVGFontSize aFontSize)
Set the font size.
|
void |
setFontStyle(ELcdNVGFontStyle aFontStyle)
Set the font style.
|
void |
setFontWeight(ELcdNVGFontWeight aFontWeight)
Set the font weight.
|
void |
setLinePatternBegin(ELcdNVGLinePattern aLinePatternBegin)
Set the line pattern at the beginning of the line.
|
void |
setLinePatternBeginSize(Integer aLinePatternBeginSize)
Set the line pattern size at the beginning of the line.
|
void |
setLinePatternEnd(ELcdNVGLinePattern aLinePatternEnd)
Set the line pattern at the end of the line.
|
void |
setLinePatternEndSize(Integer aLinePatternEndSize)
Set the line pattern size at the beginning of the line.
|
void |
setStrokeColor(Color aStrokeColor)
Set the stroke color.
|
void |
setStrokeDash(float[] aStrokeDash)
Set the dashed representation of the stroke.
|
void |
setStrokeOpacity(Float aStrokeOpacity)
Set the opacity of the Stroke.
|
void |
setStrokeWidth(Float aStrokeWidth)
Set the stroke width of the stroke.
|
void |
setTextAlign(ELcdNVGHorizontalAlignment aTextAlign)
Set the horizontal text alignment.
|
void |
setVerticalAlign(ELcdNVGVerticalAlignment aVerticalAlign)
Set the vertical text alignment.
|
String |
toString() |
public static final Color DEFAULT_FILL_COLOR
public static final float DEFAULT_FILL_OPACITY
public static final ELcdNVGFillPattern DEFAULT_FILL_PATTERN
public static final String DEFAULT_FONT_FAMILY
public static final ELcdNVGFontStyle DEFAULT_FONT_STYLE
ELcdNVGFontStyle#NORMAL
.public static final ELcdNVGFontWeight DEFAULT_FONT_WEIGHT
ELcdNVGFontWeight#NORMAL
.public static final Color DEFAULT_FONT_COLOR
public static final TLcdNVGFontSize DEFAULT_FONT_SIZE
public static final ELcdNVGHorizontalAlignment DEFAULT_TEXT_ALIGN
ELcdNVGHorizontalAlignment#CENTER
.public static final ELcdNVGVerticalAlignment DEFAULT_VERTICAL_ALIGN
ELcdNVGVerticalAlignment#MIDDLE
.public static final Color DEFAULT_STROKE_COLOR
public static final float DEFAULT_STROKE_WIDTH
public static final float DEFAULT_STROKE_OPACITY
public static final float[] DEFAULT_STROKE_DASH
public static final ELcdNVGLinePattern DEFAULT_LINE_PATTERN_BEGIN
public static final int DEFAULT_LINE_PATTERN_BEGIN_SIZE
public static final ELcdNVGLinePattern DEFAULT_LINE_PATTERN_END
public static final int DEFAULT_LINE_PATTERN_END_SIZE
public TLcdNVGStyle()
public TLcdNVGStyle(boolean useDefault)
useDefault
- a flag to set the attribute to default or null.public Color getFillColor()
public Float getFillOpacity()
public ELcdNVGFillPattern getFillPattern()
public void setFillPattern(ELcdNVGFillPattern aFillPattern)
aFillPattern
- the fill pattern.public void setFillColor(Color aFillColor)
aFillColor
- The fill color.public void setFillOpacity(Float aFillOpacity)
aFillOpacity
- The opacity of the area expressed as a decimal value between 0 (completely transparent) and 1 (opaque).public Color getStrokeColor()
public Float getStrokeOpacity()
public ELcdNVGLinePattern getLinePatternBegin()
public Integer getLinePatternBeginSize()
public ELcdNVGLinePattern getLinePatternEnd()
public Integer getLinePatternEndSize()
public float[] getStrokeDash()
public Float getStrokeWidth()
public void setStrokeColor(Color aStrokeColor)
aStrokeColor
- The color of the stroke.public void setStrokeWidth(Float aStrokeWidth)
aStrokeWidth
- The stroke width of the stroke.public void setLinePatternBegin(ELcdNVGLinePattern aLinePatternBegin)
aLinePatternBegin
- a Line patternpublic void setLinePatternBeginSize(Integer aLinePatternBeginSize)
aLinePatternBeginSize
- a integer between 1 and 3.getLinePatternBeginSize()
public void setLinePatternEnd(ELcdNVGLinePattern aLinePatternEnd)
aLinePatternEnd
- a Line patternpublic void setLinePatternEndSize(Integer aLinePatternEndSize)
aLinePatternEndSize
- a integer between 1 and 3.getLinePatternEndSize()
public void setStrokeOpacity(Float aStrokeOpacity)
aStrokeOpacity
- The opacity of the stroke, expressed as a decimal value between 0 (completely transparent) and 1 (opaque).public void setStrokeDash(float[] aStrokeDash) throws IllegalArgumentException
aStrokeDash
- The dash array of the stroke.IllegalArgumentException
public String getFontFamily()
public ELcdNVGFontStyle getFontStyle()
ELcdNVGFontStyle#NORMAL
or ELcdNVGFontStyle#ITALIC
.public ELcdNVGFontWeight getFontWeight()
ELcdNVGFontWeight#NORMAL
or ELcdNVGFontWeight#BOLD
.public Color getFontColor()
public TLcdNVGFontSize getFontSize()
public ELcdNVGHorizontalAlignment getTextAlign()
ELcdNVGHorizontalAlignment#LEFT
,
ELcdNVGHorizontalAlignment#CENTER
or ELcdNVGHorizontalAlignment#RIGHT
.public ELcdNVGVerticalAlignment getVerticalAlign()
ELcdNVGVerticalAlignment#TOP
,
ELcdNVGVerticalAlignment#MIDDLE
or ELcdNVGVerticalAlignment#BOTTOM
.public void setFontFamily(String aFontFamily)
aFontFamily
- The font family name.public void setFontStyle(ELcdNVGFontStyle aFontStyle)
aFontStyle
- The ELcdNVGStyle
to set.public void setFontWeight(ELcdNVGFontWeight aFontWeight)
aFontWeight
- The ELcdNVGWeight
to set.public void setFontColor(Color aFontColor)
aFontColor
- The new font color.public void setFontSize(TLcdNVGFontSize aFontSize)
aFontSize
- A new font size .public void setTextAlign(ELcdNVGHorizontalAlignment aTextAlign)
aTextAlign
- The ELcdNVGHorizontalAlignment
to set..public void setVerticalAlign(ELcdNVGVerticalAlignment aVerticalAlign)
aVerticalAlign
- The ELcdNVGVerticalAlignment
to set..public TLcdNVGStyle clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()