public final class LineLabel extends NativeObjectContainer
Modifier and Type | Field and Description |
---|---|
static IsColor |
DEFAULT_BACKGROUND_COLOR
Default line label background color, rgba(0, 0, 0, 0.8).
|
static String |
DEFAULT_BACKGROUND_COLOR_AS_STRING
Default line label background color as string, rgba(0, 0, 0, 0.8).
|
static double |
DEFAULT_CORNER_RADIUS
Default line label corner radius, 6.0.
|
static boolean |
DEFAULT_ENABLED
Default line label enabled, false.
|
static IsColor |
DEFAULT_FONT_COLOR
Default line label font color, white.
|
static String |
DEFAULT_FONT_COLOR_AS_STRING
Default line label font color as string, white.
|
static FontStyle |
DEFAULT_FONT_STYLE
Default line label font style,
FontStyle.BOLD . |
static LineLabelPosition |
DEFAULT_POSITION
Default line label position,
LineLabelPosition.CENTER . |
static int |
DEFAULT_X_ADJUST
Default line label X adjust, 0.
|
static int |
DEFAULT_X_PADDING
Default line label X padding, 6.
|
static int |
DEFAULT_Y_ADJUST
Default line label Y adjust, 0.
|
static int |
DEFAULT_Y_PADDING
Default line label Y padding, 6.
|
Modifier and Type | Method and Description |
---|---|
IsColor |
getBackgroundColor()
Returns the background color of label.
|
String |
getBackgroundColorAsString()
Returns the background color of label.
|
List<String> |
getContent()
Returns the text to display in label as list.
|
double |
getCornerRadius()
Returns the radius of label rectangle.
|
IsColor |
getFontColor()
Returns the font color of text.
|
String |
getFontColorAsString()
Returns the font color of text as string.
|
String |
getFontFamily()
Returns the font family of text.
|
int |
getFontSize()
Returns the font size of text.
|
FontStyle |
getFontStyle()
Returns the font style of text.
|
LineLabelPosition |
getPosition()
Returns the anchor position of label on line.
|
int |
getXAdjust()
Returns the adjustment along x-axis (left-right) of label relative to above number (can be negative).
For horizontal lines positioned left or right, negative values move the label toward the edge, and positive values toward the center. |
int |
getXPadding()
Returns the padding of label to add left and right.
|
int |
getYAdjust()
Returns the adjustment along y-axis (top-bottom) of label relative to above number (can be negative).
For vertical lines positioned top or bottom, negative values move the label toward the edge, and positive values toward the center. |
int |
getYPadding()
Returns the padding of label to add top and bottom.
|
boolean |
isEnabled()
Returns
true whether the label is enabled and should be displayed. |
void |
setBackgroundColor(IsColor backgroundColor)
Sets the background color of label.
|
void |
setBackgroundColor(String backgroundColor)
Sets the background color of label as string.
|
void |
setContent(List<String> content)
Sets the text to display in label.
Provide a list to display values on a new line. |
void |
setContent(String... content)
Sets the text to display in label.
Provide an array to display values on a new line. |
void |
setCornerRadius(double cornerRadius)
Sets the radius of label rectangle.
|
void |
setEnabled(boolean enabled)
Sets
true whether the label is enabled and should be displayed. |
void |
setFontColor(IsColor fontColor)
Sets the font color of text.
|
void |
setFontColor(String fontColor)
Sets the font color of text as string.
|
void |
setFontFamily(String fontFamily)
Sets the font family of text.
|
void |
setFontSize(int fontSize)
Sets the font size of text.
|
void |
setFontStyle(FontStyle fontStyle)
Sets the font style of text.
|
void |
setPosition(LineLabelPosition position)
Sets the anchor position of label on line.
|
void |
setXAdjust(int xAdjust)
Sets the adjustment along x-axis (left-right) of label relative to above number (can be negative).
For horizontal lines positioned left or right, negative values move the label toward the edge, and positive values toward the center. |
void |
setXPadding(int xPadding)
Sets the padding of label to add left and right.
|
void |
setYAdjust(int yAdjust)
Sets the adjustment along y-axis (top-bottom) of label relative to above number (can be negative).
For vertical lines positioned top or bottom, negative values move the label toward the edge, and positive values toward the center. |
void |
setYPadding(int yPadding)
Sets the padding of label to add top and bottom.
|
checkValue, empty, getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public static final boolean DEFAULT_ENABLED
public static final IsColor DEFAULT_BACKGROUND_COLOR
public static final String DEFAULT_BACKGROUND_COLOR_AS_STRING
public static final FontStyle DEFAULT_FONT_STYLE
FontStyle.BOLD
.public static final IsColor DEFAULT_FONT_COLOR
public static final String DEFAULT_FONT_COLOR_AS_STRING
public static final int DEFAULT_X_PADDING
public static final int DEFAULT_Y_PADDING
public static final double DEFAULT_CORNER_RADIUS
public static final LineLabelPosition DEFAULT_POSITION
LineLabelPosition.CENTER
.public static final int DEFAULT_X_ADJUST
public static final int DEFAULT_Y_ADJUST
public void setEnabled(boolean enabled)
true
whether the label is enabled and should be displayed.enabled
- true
whether the label is enabled and should be displayedpublic boolean isEnabled()
true
whether the label is enabled and should be displayed.true
whether the label is enabled and should be displayedpublic void setBackgroundColor(IsColor backgroundColor)
backgroundColor
- the background color of labelpublic void setBackgroundColor(String backgroundColor)
backgroundColor
- the background color of labelpublic String getBackgroundColorAsString()
public IsColor getBackgroundColor()
public void setFontSize(int fontSize)
fontSize
- the font size of textpublic int getFontSize()
public void setFontStyle(FontStyle fontStyle)
fontStyle
- the font style of textpublic FontStyle getFontStyle()
public void setFontColor(IsColor fontColor)
fontColor
- the font color of textpublic void setFontColor(String fontColor)
fontColor
- the font color of textpublic String getFontColorAsString()
public IsColor getFontColor()
public void setFontFamily(String fontFamily)
fontFamily
- the font family of textpublic String getFontFamily()
public void setXPadding(int xPadding)
xPadding
- the padding of label to add left and rightpublic int getXPadding()
public void setYPadding(int yPadding)
yPadding
- the padding of label to add top and bottompublic int getYPadding()
public void setCornerRadius(double cornerRadius)
cornerRadius
- the radius of label rectanglepublic double getCornerRadius()
public void setPosition(LineLabelPosition position)
position
- the anchor position of label on linepublic LineLabelPosition getPosition()
public void setXAdjust(int xAdjust)
xAdjust
- the adjustment along x-axis (left-right) of labelpublic int getXAdjust()
public void setYAdjust(int yAdjust)
yAdjust
- the adjustment along y-axis (top-bottom) of labelpublic int getYAdjust()
public void setContent(List<String> content)
content
- the text to display in label as multi-line valuespublic void setContent(String... content)
content
- the text to display in label