public final class LineLabel extends AbstractNode implements IsScriptableFontProvider<AnnotationContext>
Modifier and Type | Field and Description |
---|---|
static double |
AUTO_ROTATION
Constant to use to set AUTO rotation of the label, to use in the rotation callback.
|
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 IsColor |
DEFAULT_COLOR
Default line label text color,
HtmlColor.WHITE . |
static int |
DEFAULT_CORNER_RADIUS
Default line label corner radius, 6.
|
static boolean |
DEFAULT_DISPLAY
Default line label display, false.
|
static String |
DEFAULT_FONT_COLOR_AS_STRING
Default line label font color as string, rgb(255, 255, 255).
|
static FontStyle |
DEFAULT_FONT_STYLE
Default line label font style,
FontStyle.BOLD . |
static LabelPosition |
DEFAULT_POSITION
Default line label position,
LabelPosition.CENTER . |
static double |
DEFAULT_ROTATION
Default line label rotation, 0.0.
|
static TextAlign |
DEFAULT_TEXT_ALIGN
Default text align for labels,
TextAlign.CENTER . |
static double |
DEFAULT_X_ADJUST
Default line label X adjust, 0.0.
|
static int |
DEFAULT_X_PADDING
Default line label X padding, 6.
|
static double |
DEFAULT_Y_ADJUST
Default line label Y adjust, 0.0.
|
static int |
DEFAULT_Y_PADDING
Default line label Y padding, 6.
|
Modifier and Type | Method and Description |
---|---|
default IsColor |
getBackgroundColor()
Returns the color of the background of annotation.
|
default String |
getBackgroundColorAsString()
Returns the color of the background of annotation.
|
default ColorCallback<AnnotationContext> |
getBackgroundColorCallback()
Returns the callback called to set the color of the background of annotation.
|
org.pepstock.charba.client.annotation.BackgroundColorHandler |
getBackgroundColorHandler()
Returns a background color handler instance to use in the default methods of this interface.
|
IsColor |
getColor()
Returns the color of text.
|
String |
getColorAsString()
Returns the color of text as string.
|
ColorCallback<AnnotationContext> |
getColorCallback()
Returns the callback called to set the color of the text of label.
|
List<String> |
getContent()
Returns the text to display in label as list.
|
Img |
getContentAsImage()
Returns the text to display in label as list.
|
ContentCallback |
getContentCallback()
Returns the callback called to set the text to display in label as list.
|
int |
getCornerRadius()
Returns the radius of label rectangle.
|
CornerRadiusCallback<AnnotationContext> |
getCornerRadiusCallback()
Returns the callback called to set the corner radius.
|
DisplayCallback<AnnotationContext> |
getDisplayCallback()
Returns the callback called to set whether the label should be displayed.
|
DrawTime |
getDrawTime()
Returns the draw time which defines when the annotations are drawn.
|
Font |
getFont()
Returns the font element.
|
FontCallback<AnnotationContext> |
getFontCallback()
Returns the font callback, if set, otherwise
null . |
int |
getImageHeight()
Returns the height of label content, when is set as
Img , in pixels in order to scale the image when drawn. |
String |
getImageHeightAsPercentage()
Returns the height of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
ImageSizeCallback |
getImageHeightCallback()
Returns the callback called to set the height of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
int |
getImageWidth()
Returns the width of label content, when is set as
Img , in pixels in order to scale the image when drawn. |
String |
getImageWidthAsPercentage()
Returns the width of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
ImageSizeCallback |
getImageWidthCallback()
Returns the callback called to set the width of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
LabelPosition |
getPosition()
Returns the anchor position of label on line.
|
LabelPositionCallback |
getPositionCallback()
Returns the callback called to set the anchor position of label on line.
|
double |
getRotation()
Returns the rotation of label in degrees.
|
RotationCallback<AnnotationContext> |
getRotationCallback()
Returns the callback called to set the rotation of label in degrees.
|
TextAlign |
getTextAlign()
Returns the horizontal alignment of the label text when multiple lines.
|
TextAlignCallback<AnnotationContext> |
getTextAlignCallback()
Returns the callback called to set the horizontal alignment of the label text when multiple lines.
|
double |
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. |
AdjustSizeCallback |
getXAdjustCallback()
Returns the callback called to set the adjustment along x-axis (left-right) of label relative to above number (can be negative).
|
int |
getXPadding()
Returns the padding of label to add left and right.
|
PaddingSizeCallback |
getXPaddingCallback()
Returns the callback called to set the padding of label to add left and right.
|
double |
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. |
AdjustSizeCallback |
getYAdjustCallback()
Returns the callback called to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative).
|
int |
getYPadding()
Returns the padding of label to add top and bottom.
|
PaddingSizeCallback |
getYPaddingCallback()
Returns the callback called to set the padding of label to add top and bottom.
|
boolean |
isAutoRotation()
Returns
true whether the rotation of label must calculates automatically. |
boolean |
isDisplay()
Returns
true whether the label should be displayed. |
void |
setAutoRotation(boolean autoRotation)
Sets
true whether the rotation of label must calculates automatically. |
default void |
setBackgroundColor(ColorCallback<AnnotationContext> backgroundColorCallback)
Sets the callback to set the color of the background of annotation.
|
default void |
setBackgroundColor(IsColor backgroundColor)
Sets the color of the background of annotation.
|
default void |
setBackgroundColor(NativeCallback backgroundColorCallback)
Sets the callback to set the color of the background of annotation.
|
default void |
setBackgroundColor(String backgroundColor)
Sets the color of the background of annotation.
|
void |
setColor(ColorCallback<AnnotationContext> colorCallback)
Sets the callback to set the color of the text of label.
|
void |
setColor(IsColor fontColor)
Sets the color of text.
|
void |
setColor(NativeCallback colorCallback)
Sets the callback to set the color of the text of label.
|
void |
setColor(String fontColor)
Sets the color of text as string.
|
void |
setContent(ContentCallback contentCallback)
Sets the callback to set the text to display in label as list.
|
void |
setContent(Img content)
Sets the image to display in label.
|
void |
setContent(List<String> content)
Sets the text to display in label.
Provide a list to display values on a new line. |
void |
setContent(NativeCallback contentCallback)
Sets the callback to set the text to display in label as list.
|
void |
setContent(String... content)
Sets the text to display in label.
Provide an array to display values on a new line. |
void |
setCornerRadius(CornerRadiusCallback<AnnotationContext> cornerRadiusCallback)
Sets the callback to set the corner radius.
|
void |
setCornerRadius(int cornerRadius)
Sets the radius of label rectangle.
|
void |
setCornerRadius(NativeCallback cornerRadiusCallback)
Sets the callback to set the corner radius.
|
void |
setDisplay(boolean display)
Sets
true whether the label should be displayed. |
void |
setDisplay(DisplayCallback<AnnotationContext> displayCallback)
Sets the callback to set whether the label should be displayed.
|
void |
setDisplay(NativeCallback displayCallback)
Sets the callback to set whether the label should be displayed.
|
void |
setDrawTime(DrawTime drawTime)
Sets the draw time which defines when the annotations are drawn.
|
void |
setFont(FontCallback<AnnotationContext> fontCallback)
Sets the the font callback.
|
void |
setFont(NativeCallback fontCallback)
Sets the the font callback.
|
void |
setImageHeight(ImageSizeCallback imageSizeCallback)
Sets the callback to set the height of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
void |
setImageHeight(int height)
Sets the height of label content, when is set as
Img , in pixels in order to scale the image when drawn. |
void |
setImageHeight(NativeCallback imageSizeCallback)
Sets the callback to set the height of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
void |
setImageHeightAsPercentage(String heightPercentage)
Sets the height of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
void |
setImageWidth(ImageSizeCallback imageSizeCallback)
Sets the callback to set the width of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
void |
setImageWidth(int width)
Sets the width of label content, when is set as
Img , in pixels in order to scale the image when drawn. |
void |
setImageWidth(NativeCallback imageSizeCallback)
Sets the callback to set the width of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
void |
setImageWidthAsPercentage(String widthPercentage)
Sets the width of label content, when is set as
Img , in percentage (format is "{n}%") in order to scale the image when drawn. |
void |
setPosition(LabelPosition position)
Sets the anchor position of label on line.
|
void |
setPosition(LabelPositionCallback positionCallback)
Sets the callback to set the anchor position of label on line.
|
void |
setPosition(NativeCallback positionCallback)
Sets the callback to set the anchor position of label on line.
|
void |
setRotation(double rotation)
Sets the rotation of label in degrees.
|
void |
setRotation(NativeCallback rotationCallback)
Sets the callback to set the rotation of label in degrees.
|
void |
setRotation(RotationCallback<AnnotationContext> rotationCallback)
Sets the callback to set the rotation of label in degrees.
|
void |
setTextAlign(NativeCallback alignCallback)
Sets the callback to set the horizontal alignment of the label text when multiple lines.
|
void |
setTextAlign(TextAlign align)
Sets the horizontal alignment of the label text when multiple lines.
|
void |
setTextAlign(TextAlignCallback<AnnotationContext> alignCallback)
Sets the callback to set the horizontal alignment of the label text when multiple lines.
|
void |
setXAdjust(AdjustSizeCallback adjustCallback)
Sets the callback to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative).
|
void |
setXAdjust(double 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 |
setXAdjust(NativeCallback adjustCallback)
Sets the callback to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative).
|
void |
setXPadding(int xPadding)
Sets the padding of label to add left and right.
|
void |
setXPadding(NativeCallback paddingCallback)
Sets the callback to set the padding of label to add left and right.
|
void |
setXPadding(PaddingSizeCallback paddingCallback)
Sets the callback to set the padding of label to add left and right.
|
void |
setYAdjust(AdjustSizeCallback adjustCallback)
Sets the callback to set the adjustment along x-axis (left-right) of label relative to above number (can be negative).
|
void |
setYAdjust(double 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 |
setYAdjust(NativeCallback adjustCallback)
Sets the callback to set the adjustment along x-axis (left-right) of label relative to above number (can be negative).
|
void |
setYPadding(int yPadding)
Sets the padding of label to add top and bottom.
|
void |
setYPadding(NativeCallback paddingCallback)
Sets the callback to set the padding of label to add top and bottom.
|
void |
setYPadding(PaddingSizeCallback paddingCallback)
Sets the callback to set the padding of label to add top and bottom.
|
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public static final double AUTO_ROTATION
public static final boolean DEFAULT_DISPLAY
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_COLOR
HtmlColor.WHITE
.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 int DEFAULT_CORNER_RADIUS
public static final LabelPosition DEFAULT_POSITION
LabelPosition.CENTER
.public static final double DEFAULT_X_ADJUST
public static final double DEFAULT_Y_ADJUST
public static final TextAlign DEFAULT_TEXT_ALIGN
TextAlign.CENTER
.public static final double DEFAULT_ROTATION
public org.pepstock.charba.client.annotation.BackgroundColorHandler getBackgroundColorHandler()
public Font getFont()
public void setDisplay(boolean display)
true
whether the label should be displayed.display
- true
whether the label should be displayedpublic boolean isDisplay()
true
whether the label should be displayed.true
whether the label should be displayedpublic void setColor(IsColor fontColor)
fontColor
- the color of textpublic void setColor(String fontColor)
fontColor
- the color of textpublic String getColorAsString()
public IsColor getColor()
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(int cornerRadius)
cornerRadius
- the radius of label rectanglepublic int getCornerRadius()
public void setPosition(LabelPosition position)
position
- the anchor position of label on linepublic LabelPosition getPosition()
public void setTextAlign(TextAlign align)
align
- the horizontal alignment of the label text when multiple linespublic TextAlign getTextAlign()
public void setXAdjust(double xAdjust)
xAdjust
- the adjustment along x-axis (left-right) of labelpublic double getXAdjust()
public void setYAdjust(double yAdjust)
yAdjust
- the adjustment along y-axis (top-bottom) of labelpublic double getYAdjust()
public void setRotation(double rotation)
rotation
- the rotation of label in degreespublic double getRotation()
public void setAutoRotation(boolean autoRotation)
true
whether the rotation of label must calculates automatically.autoRotation
- true
whether the rotation of label must calculates automaticallypublic boolean isAutoRotation()
true
whether the rotation of label must calculates automatically.true
whether the rotation of label must calculates automaticallypublic 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 labelpublic void setContent(Img content)
content
- the image to display in labelpublic List<String> getContent()
public Img getContentAsImage()
public void setImageHeight(int height)
Img
, in pixels in order to scale the image when drawn.height
- the height of label content, when is set as Img
, in pixels in order to scale the image when drawnpublic void setImageHeightAsPercentage(String heightPercentage)
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.heightPercentage
- the height of label content, when is set as Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic int getImageHeight()
Img
, in pixels in order to scale the image when drawn.Img
, in pixels in order to scale the image when drawnpublic String getImageHeightAsPercentage()
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic void setImageWidth(int width)
Img
, in pixels in order to scale the image when drawn.width
- the height of label content, when is set as Img
, in pixels in order to scale the image when drawnpublic void setImageWidthAsPercentage(String widthPercentage)
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.widthPercentage
- the height of label content, when is set as Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic int getImageWidth()
Img
, in pixels in order to scale the image when drawn.Img
, in pixels in order to scale the image when drawnpublic String getImageWidthAsPercentage()
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic void setDrawTime(DrawTime drawTime)
drawTime
- the draw time which defines when the annotations are drawnpublic DrawTime getDrawTime()
public ColorCallback<AnnotationContext> getColorCallback()
public void setColor(ColorCallback<AnnotationContext> colorCallback)
colorCallback
- to set the color of the text of labelpublic void setColor(NativeCallback colorCallback)
colorCallback
- to set the color of the text of labelpublic CornerRadiusCallback<AnnotationContext> getCornerRadiusCallback()
public void setCornerRadius(CornerRadiusCallback<AnnotationContext> cornerRadiusCallback)
cornerRadiusCallback
- to set the corner radiuspublic void setCornerRadius(NativeCallback cornerRadiusCallback)
cornerRadiusCallback
- to set the corner radiuspublic ContentCallback getContentCallback()
public void setContent(ContentCallback contentCallback)
contentCallback
- to set the text to display in label as listpublic void setContent(NativeCallback contentCallback)
contentCallback
- to set the text to display in label as listpublic DisplayCallback<AnnotationContext> getDisplayCallback()
public void setDisplay(DisplayCallback<AnnotationContext> displayCallback)
displayCallback
- to set whether the label should be displayedpublic void setDisplay(NativeCallback displayCallback)
displayCallback
- to set whether the label should be displayedpublic RotationCallback<AnnotationContext> getRotationCallback()
public void setRotation(RotationCallback<AnnotationContext> rotationCallback)
rotationCallback
- to set the rotation of label in degreespublic void setRotation(NativeCallback rotationCallback)
rotationCallback
- to set the rotation of label in degreespublic ImageSizeCallback getImageHeightCallback()
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic void setImageHeight(ImageSizeCallback imageSizeCallback)
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.imageSizeCallback
- to set the height of label content, when is set as Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic void setImageHeight(NativeCallback imageSizeCallback)
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.imageSizeCallback
- to set the height of label content, when is set as Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic ImageSizeCallback getImageWidthCallback()
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic void setImageWidth(ImageSizeCallback imageSizeCallback)
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.imageSizeCallback
- to set the width of label content, when is set as Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic void setImageWidth(NativeCallback imageSizeCallback)
Img
, in percentage (format is "{n}%") in order to scale the image when drawn.imageSizeCallback
- to set the width of label content, when is set as Img
, in percentage (format is "{n}%") in order to scale the image when drawnpublic LabelPositionCallback getPositionCallback()
public void setPosition(LabelPositionCallback positionCallback)
positionCallback
- to set the anchor position of label on linepublic void setPosition(NativeCallback positionCallback)
positionCallback
- to set the anchor position of label on linepublic TextAlignCallback<AnnotationContext> getTextAlignCallback()
public void setTextAlign(TextAlignCallback<AnnotationContext> alignCallback)
alignCallback
- to the horizontal alignment of the label text when multiple linespublic void setTextAlign(NativeCallback alignCallback)
alignCallback
- to the horizontal alignment of the label text when multiple linespublic PaddingSizeCallback getXPaddingCallback()
public void setXPadding(PaddingSizeCallback paddingCallback)
paddingCallback
- to set the padding of label to add left and rightpublic void setXPadding(NativeCallback paddingCallback)
paddingCallback
- to set the padding of label to add left and rightpublic PaddingSizeCallback getYPaddingCallback()
public void setYPadding(PaddingSizeCallback paddingCallback)
paddingCallback
- to set the padding of label to add top and bottompublic void setYPadding(NativeCallback paddingCallback)
paddingCallback
- to set the padding of label to add top and bottompublic AdjustSizeCallback getXAdjustCallback()
public void setXAdjust(AdjustSizeCallback adjustCallback)
adjustCallback
- to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative)public void setXAdjust(NativeCallback adjustCallback)
adjustCallback
- to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative)public AdjustSizeCallback getYAdjustCallback()
public void setYAdjust(AdjustSizeCallback adjustCallback)
adjustCallback
- to set the adjustment along x-axis (left-right) of label relative to above number (can be negative)public void setYAdjust(NativeCallback adjustCallback)
adjustCallback
- to set the adjustment along x-axis (left-right) of label relative to above number (can be negative)public final FontCallback<AnnotationContext> getFontCallback()
null
.getFontCallback
in interface IsScriptableFontProvider<AnnotationContext>
null
.public void setFont(FontCallback<AnnotationContext> fontCallback)
setFont
in interface IsScriptableFontProvider<AnnotationContext>
fontCallback
- the font callback to setpublic void setFont(NativeCallback fontCallback)
setFont
in interface IsScriptableFontProvider<AnnotationContext>
fontCallback
- the font callback to setpublic void setBackgroundColor(IsColor backgroundColor)
backgroundColor
- the color of the background of annotationpublic void setBackgroundColor(String backgroundColor)
backgroundColor
- the color of the background of annotationpublic String getBackgroundColorAsString()
public IsColor getBackgroundColor()
public ColorCallback<AnnotationContext> getBackgroundColorCallback()
public void setBackgroundColor(ColorCallback<AnnotationContext> backgroundColorCallback)
backgroundColorCallback
- to set the color of the background of annotationpublic void setBackgroundColor(NativeCallback backgroundColorCallback)
backgroundColorCallback
- to set the color of the background of annotation