Class LineLabel
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.annotation.LineLabel
-
- All Implemented Interfaces:
IsScriptableFontProvider<AnnotationContext>
public final class LineLabel extends AbstractNode implements IsScriptableFontProvider<AnnotationContext>
Implements a LABEL to apply on a LINE annotation.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field 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 CapStyle
DEFAULT_BORDER_CAP_STYLE
Default line label border cap style,CapStyle.BUTT
.static IsColor
DEFAULT_BORDER_COLOR
Default line label background color, black.static String
DEFAULT_BORDER_COLOR_AS_STRING
Default line label background color as string, black.static int
DEFAULT_BORDER_DASH_OFFSET
Default line label border dash offset, 0.static JoinStyle
DEFAULT_BORDER_JOIN_STYLE
Default line label border join style,JoinStyle.MITER
.static int
DEFAULT_BORDER_RADIUS
Default line label border radius, 6.static int
DEFAULT_BORDER_WIDTH
Default line label border width, 0.static IsColor
DEFAULT_COLOR
Default line label text color,HtmlColor.WHITE
.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method 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()
CapStyle
getBorderCapStyle()
Returns how the end points of every line are drawn.CapStyleCallback<AnnotationContext>
getBorderCapStyleCallback()
Returns the border capstyle callback, if set, otherwisenull
.IsColor
getBorderColor()
Returns the color of the border of label.String
getBorderColorAsString()
Returns the color of the border of annotation.ColorCallback<AnnotationContext>
getBorderColorCallback()
Returns the callback called to set the color of the border of annotation.List<Integer>
getBorderDash()
Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.BorderDashCallback<AnnotationContext>
getBorderDashCallback()
Returns the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.double
getBorderDashOffset()
Returns the line dash pattern offset.BorderDashOffsetCallback<AnnotationContext>
getBorderDashOffsetCallback()
Returns the callback called to set the line dash pattern offset.JoinStyle
getBorderJoinStyle()
Returns how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).JoinStyleCallback<AnnotationContext>
getBorderJoinStyleCallback()
Returns the border join style callback, if set, otherwisenull
.default int
getBorderRadius()
Returns the border radius (in pixels).default BarBorderRadius
getBorderRadiusAsObject()
Returns the border radius (in pixels).default BorderRadiusCallback<AnnotationContext>
getBorderRadiusCallback()
Returns the callback called to set the border radius.org.pepstock.charba.client.annotation.BorderRadiusHandler
getBorderRadiusHandler()
int
getBorderWidth()
Returns the width of the border in pixels.WidthCallback<AnnotationContext>
getBorderWidthCallback()
Returns the callback called to set the width of the border in pixels.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.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, otherwisenull
.int
getImageHeight()
Returns the height of label content, when is set asImg
, in pixels in order to scale the image when drawn.String
getImageHeightAsPercentage()
Returns the height of label content, when is set asImg
, 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 asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.int
getImageWidth()
Returns the width of label content, when is set asImg
, in pixels in order to scale the image when drawn.String
getImageWidthAsPercentage()
Returns the width of label content, when is set asImg
, 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 asImg
, 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()
Returnstrue
whether the rotation of label must calculates automatically.boolean
isDisplay()
Returnstrue
whether the label should be displayed.void
setAutoRotation(boolean autoRotation)
Setstrue
whether the rotation of label must calculates automatically.default void
setBackgroundColor(String backgroundColor)
Sets the color of the background of annotation.default void
setBackgroundColor(ColorCallback<AnnotationContext> backgroundColorCallback)
Sets the callback to set 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(IsColor backgroundColor)
Sets the color of the background of annotation.void
setBorderCapStyle(CapStyleCallback<AnnotationContext> borderCapStyleCallback)
Sets the border capstyle callback.void
setBorderCapStyle(NativeCallback borderCapStyleCallback)
Sets the border capstyle callback.void
setBorderCapStyle(CapStyle borderCapStyle)
Sets how the end points of every line are drawn.void
setBorderColor(String borderColor)
Sets the color of the border of label.void
setBorderColor(ColorCallback<AnnotationContext> borderColorCallback)
Sets the callback to set the color of the border of annotation.void
setBorderColor(NativeCallback borderColorCallback)
Sets the callback to set the color of the border of annotation.void
setBorderColor(IsColor borderColor)
Sets the color of the border of label.void
setBorderDash(int... borderDash)
Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.void
setBorderDash(BorderDashCallback<AnnotationContext> borderDashCallback)
Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.void
setBorderDash(NativeCallback borderDashCallback)
Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.void
setBorderDashOffset(double borderDashOffset)
Sets the line dash pattern offset.void
setBorderDashOffset(BorderDashOffsetCallback<AnnotationContext> borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.void
setBorderDashOffset(NativeCallback borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.void
setBorderJoinStyle(JoinStyleCallback<AnnotationContext> borderJoinStyleCallback)
Sets the border join style callback.void
setBorderJoinStyle(NativeCallback borderJoinStyleCallback)
Sets the border join style callback.void
setBorderJoinStyle(JoinStyle borderJoinStyle)
Sets how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).default void
setBorderRadius(int radius)
Sets the border radius.default void
setBorderRadius(BorderRadiusCallback<AnnotationContext> borderRadiusCallback)
Sets the callback to set the border radius.default void
setBorderRadius(NativeCallback borderRadiusCallback)
Sets the callback to set the border radius.default void
setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).void
setBorderWidth(int borderWidth)
Sets the width of the border in pixels.void
setBorderWidth(NativeCallback borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.void
setBorderWidth(WidthCallback<AnnotationContext> borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.void
setColor(String fontColor)
Sets the color of text as string.void
setColor(ColorCallback<AnnotationContext> colorCallback)
Sets the callback to set the color of the text of label.void
setColor(NativeCallback colorCallback)
Sets the callback to set the color of the text of label.void
setColor(IsColor fontColor)
Sets the color of text.void
setContent(String... content)
Sets the text to display in label.
Provide an array to display values on a new line.void
setContent(List<String> content)
Sets the text to display in label.
Provide a list to display values on a new line.void
setContent(ContentCallback contentCallback)
Sets the callback to set the text to display in label as list.void
setContent(NativeCallback 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
setDisplay(boolean display)
Setstrue
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 font callback.void
setFont(NativeCallback fontCallback)
Sets the font callback.void
setImageHeight(int height)
Sets the height of label content, when is set asImg
, in pixels in order to scale the image when drawn.void
setImageHeight(ImageSizeCallback imageSizeCallback)
Sets the callback to set the height of label content, when is set asImg
, in percentage (format is "{n}%") 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 asImg
, 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 asImg
, 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 asImg
, in pixels 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 asImg
, in percentage (format is "{n}%") 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 asImg
, 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 asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.void
setPosition(LabelPositionCallback positionCallback)
Sets the callback to set the anchor position of label on line.void
setPosition(LabelPosition position)
Sets 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(TextAlignCallback<AnnotationContext> 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
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(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(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(PaddingSizeCallback paddingCallback)
Sets the callback to set 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
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(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(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(PaddingSizeCallback paddingCallback)
Sets the callback to set 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.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
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
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
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
-
-
-
-
Field Detail
-
AUTO_ROTATION
public static final double AUTO_ROTATION
Constant to use to set AUTO rotation of the label, to use in the rotation callback.- See Also:
- Constant Field Values
-
DEFAULT_DISPLAY
public static final boolean DEFAULT_DISPLAY
Default line label display, false.- See Also:
- Constant Field Values
-
DEFAULT_BACKGROUND_COLOR
public static final IsColor DEFAULT_BACKGROUND_COLOR
Default line label background color, rgba(0, 0, 0, 0.8).
-
DEFAULT_BACKGROUND_COLOR_AS_STRING
public static final String DEFAULT_BACKGROUND_COLOR_AS_STRING
Default line label background color as string, rgba(0, 0, 0, 0.8).
-
DEFAULT_FONT_STYLE
public static final FontStyle DEFAULT_FONT_STYLE
Default line label font style,FontStyle.BOLD
.
-
DEFAULT_COLOR
public static final IsColor DEFAULT_COLOR
Default line label text color,HtmlColor.WHITE
.
-
DEFAULT_FONT_COLOR_AS_STRING
public static final String DEFAULT_FONT_COLOR_AS_STRING
Default line label font color as string, rgb(255, 255, 255).
-
DEFAULT_X_PADDING
public static final int DEFAULT_X_PADDING
Default line label X padding, 6.- See Also:
- Constant Field Values
-
DEFAULT_Y_PADDING
public static final int DEFAULT_Y_PADDING
Default line label Y padding, 6.- See Also:
- Constant Field Values
-
DEFAULT_BORDER_COLOR
public static final IsColor DEFAULT_BORDER_COLOR
Default line label background color, black.
-
DEFAULT_BORDER_COLOR_AS_STRING
public static final String DEFAULT_BORDER_COLOR_AS_STRING
Default line label background color as string, black.
-
DEFAULT_BORDER_WIDTH
public static final int DEFAULT_BORDER_WIDTH
Default line label border width, 0.- See Also:
- Constant Field Values
-
DEFAULT_BORDER_RADIUS
public static final int DEFAULT_BORDER_RADIUS
Default line label border radius, 6.- See Also:
- Constant Field Values
-
DEFAULT_BORDER_CAP_STYLE
public static final CapStyle DEFAULT_BORDER_CAP_STYLE
Default line label border cap style,CapStyle.BUTT
.
-
DEFAULT_BORDER_JOIN_STYLE
public static final JoinStyle DEFAULT_BORDER_JOIN_STYLE
Default line label border join style,JoinStyle.MITER
.
-
DEFAULT_BORDER_DASH_OFFSET
public static final int DEFAULT_BORDER_DASH_OFFSET
Default line label border dash offset, 0.- See Also:
- Constant Field Values
-
DEFAULT_POSITION
public static final LabelPosition DEFAULT_POSITION
Default line label position,LabelPosition.CENTER
.
-
DEFAULT_X_ADJUST
public static final double DEFAULT_X_ADJUST
Default line label X adjust, 0.0.- See Also:
- Constant Field Values
-
DEFAULT_Y_ADJUST
public static final double DEFAULT_Y_ADJUST
Default line label Y adjust, 0.0.- See Also:
- Constant Field Values
-
DEFAULT_TEXT_ALIGN
public static final TextAlign DEFAULT_TEXT_ALIGN
Default text align for labels,TextAlign.CENTER
.
-
DEFAULT_ROTATION
public static final double DEFAULT_ROTATION
Default line label rotation, 0.0.- See Also:
- Constant Field Values
-
-
Method Detail
-
getBackgroundColorHandler
public org.pepstock.charba.client.annotation.BackgroundColorHandler getBackgroundColorHandler()
-
getBorderRadiusHandler
public org.pepstock.charba.client.annotation.BorderRadiusHandler getBorderRadiusHandler()
-
getFont
public Font getFont()
Returns the font element.- Returns:
- the font element.
-
setDisplay
public void setDisplay(boolean display)
Setstrue
whether the label should be displayed.- Parameters:
display
-true
whether the label should be displayed
-
isDisplay
public boolean isDisplay()
Returnstrue
whether the label should be displayed.- Returns:
true
whether the label should be displayed
-
setColor
public void setColor(IsColor fontColor)
Sets the color of text.- Parameters:
fontColor
- the color of text
-
setColor
public void setColor(String fontColor)
Sets the color of text as string.- Parameters:
fontColor
- the color of text
-
getColorAsString
public String getColorAsString()
Returns the color of text as string.- Returns:
- the color of text
-
getColor
public IsColor getColor()
Returns the color of text.- Returns:
- the color of text
-
setXPadding
public void setXPadding(int xPadding)
Sets the padding of label to add left and right.- Parameters:
xPadding
- the padding of label to add left and right
-
getXPadding
public int getXPadding()
Returns the padding of label to add left and right.- Returns:
- the padding of label to add left and right
-
setYPadding
public void setYPadding(int yPadding)
Sets the padding of label to add top and bottom.- Parameters:
yPadding
- the padding of label to add top and bottom
-
getYPadding
public int getYPadding()
Returns the padding of label to add top and bottom.- Returns:
- the padding of label to add top and bottom
-
setPosition
public void setPosition(LabelPosition position)
Sets the anchor position of label on line.- Parameters:
position
- the anchor position of label on line
-
getPosition
public LabelPosition getPosition()
Returns the anchor position of label on line.- Returns:
- the anchor position of label on line
-
setTextAlign
public void setTextAlign(TextAlign align)
Sets the horizontal alignment of the label text when multiple lines.- Parameters:
align
- the horizontal alignment of the label text when multiple lines
-
getTextAlign
public TextAlign getTextAlign()
Returns the horizontal alignment of the label text when multiple lines.- Returns:
- the horizontal alignment of the label text when multiple lines
-
setXAdjust
public 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.- Parameters:
xAdjust
- the adjustment along x-axis (left-right) of label
-
getXAdjust
public 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.- Returns:
- the adjustment along x-axis (left-right) of label
-
setYAdjust
public 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.- Parameters:
yAdjust
- the adjustment along y-axis (top-bottom) of label
-
getYAdjust
public 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.- Returns:
- the adjustment along y-axis (top-bottom) of label
-
setRotation
public void setRotation(double rotation)
Sets the rotation of label in degrees.- Parameters:
rotation
- the rotation of label in degrees
-
getRotation
public double getRotation()
Returns the rotation of label in degrees.- Returns:
- the rotation of label in degrees
-
setAutoRotation
public void setAutoRotation(boolean autoRotation)
Setstrue
whether the rotation of label must calculates automatically.- Parameters:
autoRotation
-true
whether the rotation of label must calculates automatically
-
isAutoRotation
public boolean isAutoRotation()
Returnstrue
whether the rotation of label must calculates automatically.- Returns:
true
whether the rotation of label must calculates automatically
-
setContent
public void setContent(List<String> content)
Sets the text to display in label.
Provide a list to display values on a new line.- Parameters:
content
- the text to display in label as multi-line values
-
setContent
public void setContent(String... content)
Sets the text to display in label.
Provide an array to display values on a new line.- Parameters:
content
- the text to display in label
-
setContent
public void setContent(Img content)
Sets the image to display in label.- Parameters:
content
- the image to display in label
-
getContent
public List<String> getContent()
Returns the text to display in label as list.- Returns:
- the text to display in label as list
-
getContentAsImage
public Img getContentAsImage()
Returns the text to display in label as list.- Returns:
- the text to display in label as list
-
setImageHeight
public void setImageHeight(int height)
Sets the height of label content, when is set asImg
, in pixels in order to scale the image when drawn.- Parameters:
height
- the height of label content, when is set asImg
, in pixels in order to scale the image when drawn
-
setImageHeightAsPercentage
public void setImageHeightAsPercentage(String heightPercentage)
Sets the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Parameters:
heightPercentage
- the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn
-
getImageHeight
public int getImageHeight()
Returns the height of label content, when is set asImg
, in pixels in order to scale the image when drawn.- Returns:
- the height of label content, when is set as
Img
, in pixels in order to scale the image when drawn
-
getImageHeightAsPercentage
public String getImageHeightAsPercentage()
Returns the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Returns:
- the height of label content, when is set as
Img
, in percentage (format is "{n}%") in order to scale the image when drawn
-
setImageWidth
public void setImageWidth(int width)
Sets the width of label content, when is set asImg
, in pixels in order to scale the image when drawn.- Parameters:
width
- the height of label content, when is set asImg
, in pixels in order to scale the image when drawn
-
setImageWidthAsPercentage
public void setImageWidthAsPercentage(String widthPercentage)
Sets the width of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Parameters:
widthPercentage
- the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn
-
getImageWidth
public int getImageWidth()
Returns the width of label content, when is set asImg
, in pixels in order to scale the image when drawn.- Returns:
- the width of label content, when is set as
Img
, in pixels in order to scale the image when drawn
-
getImageWidthAsPercentage
public String getImageWidthAsPercentage()
Returns the width of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Returns:
- the width of label content, when is set as
Img
, in percentage (format is "{n}%") in order to scale the image when drawn
-
setDrawTime
public void setDrawTime(DrawTime drawTime)
Sets the draw time which defines when the annotations are drawn.- Parameters:
drawTime
- the draw time which defines when the annotations are drawn
-
getDrawTime
public DrawTime getDrawTime()
Returns the draw time which defines when the annotations are drawn.- Returns:
- the draw time which defines when the annotations are drawn
-
setBorderColor
public void setBorderColor(IsColor borderColor)
Sets the color of the border of label.- Parameters:
borderColor
- the color of the border of label
-
setBorderColor
public void setBorderColor(String borderColor)
Sets the color of the border of label.- Parameters:
borderColor
- the color of the border of label
-
getBorderColorAsString
public String getBorderColorAsString()
Returns the color of the border of annotation.- Returns:
- the color of the border of annotation
-
getBorderColor
public IsColor getBorderColor()
Returns the color of the border of label.- Returns:
- the color of the border of label
-
setBorderWidth
public void setBorderWidth(int borderWidth)
Sets the width of the border in pixels.- Parameters:
borderWidth
- the width of the border in pixels.
-
getBorderWidth
public int getBorderWidth()
Returns the width of the border in pixels.- Returns:
- the width of the border in pixels.
-
setBorderCapStyle
public void setBorderCapStyle(CapStyle borderCapStyle)
Sets how the end points of every line are drawn.- Parameters:
borderCapStyle
- how the end points of every line are drawn.
-
getBorderCapStyle
public CapStyle getBorderCapStyle()
Returns how the end points of every line are drawn.- Returns:
- how the end points of every line are drawn.
-
setBorderDash
public void setBorderDash(int... borderDash)
Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
borderDash
- the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
-
getBorderDash
public List<Integer> getBorderDash()
Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Returns:
- the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
-
setBorderDashOffset
public void setBorderDashOffset(double borderDashOffset)
Sets the line dash pattern offset.- Parameters:
borderDashOffset
- the line dash pattern offset.
-
getBorderDashOffset
public double getBorderDashOffset()
Returns the line dash pattern offset.- Returns:
- the line dash pattern offset.
-
setBorderJoinStyle
public void setBorderJoinStyle(JoinStyle borderJoinStyle)
Sets how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).- Parameters:
borderJoinStyle
- how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
-
getBorderJoinStyle
public JoinStyle getBorderJoinStyle()
Returns how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).- Returns:
- how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
-
getColorCallback
public ColorCallback<AnnotationContext> getColorCallback()
Returns the callback called to set the color of the text of label.- Returns:
- the callback called to set the color of the text of label
-
setColor
public void setColor(ColorCallback<AnnotationContext> colorCallback)
Sets the callback to set the color of the text of label.- Parameters:
colorCallback
- to set the color of the text of label
-
setColor
public void setColor(NativeCallback colorCallback)
Sets the callback to set the color of the text of label.- Parameters:
colorCallback
- to set the color of the text of label
-
getContentCallback
public ContentCallback getContentCallback()
Returns the callback called to set the text to display in label as list.- Returns:
- the callback called to set the text to display in label as list
-
setContent
public void setContent(ContentCallback contentCallback)
Sets the callback to set the text to display in label as list.- Parameters:
contentCallback
- to set the text to display in label as list
-
setContent
public void setContent(NativeCallback contentCallback)
Sets the callback to set the text to display in label as list.- Parameters:
contentCallback
- to set the text to display in label as list
-
getDisplayCallback
public DisplayCallback<AnnotationContext> getDisplayCallback()
Returns the callback called to set whether the label should be displayed.- Returns:
- the callback called to set whether the label should be displayed
-
setDisplay
public void setDisplay(DisplayCallback<AnnotationContext> displayCallback)
Sets the callback to set whether the label should be displayed.- Parameters:
displayCallback
- to set whether the label should be displayed
-
setDisplay
public void setDisplay(NativeCallback displayCallback)
Sets the callback to set whether the label should be displayed.- Parameters:
displayCallback
- to set whether the label should be displayed
-
getRotationCallback
public RotationCallback<AnnotationContext> getRotationCallback()
Returns the callback called to set the rotation of label in degrees.- Returns:
- the callback called to set the rotation of label in degrees
-
setRotation
public void setRotation(RotationCallback<AnnotationContext> rotationCallback)
Sets the callback to set the rotation of label in degrees.- Parameters:
rotationCallback
- to set the rotation of label in degrees
-
setRotation
public void setRotation(NativeCallback rotationCallback)
Sets the callback to set the rotation of label in degrees.- Parameters:
rotationCallback
- to set the rotation of label in degrees
-
getImageHeightCallback
public ImageSizeCallback getImageHeightCallback()
Returns the callback called to set the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- 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
-
setImageHeight
public void setImageHeight(ImageSizeCallback imageSizeCallback)
Sets the callback to set the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Parameters:
imageSizeCallback
- to set the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn
-
setImageHeight
public void setImageHeight(NativeCallback imageSizeCallback)
Sets the callback to set the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Parameters:
imageSizeCallback
- to set the height of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn
-
getImageWidthCallback
public ImageSizeCallback getImageWidthCallback()
Returns the callback called to set the width of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- 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
-
setImageWidth
public void setImageWidth(ImageSizeCallback imageSizeCallback)
Sets the callback to set the width of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Parameters:
imageSizeCallback
- to set the width of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn
-
setImageWidth
public void setImageWidth(NativeCallback imageSizeCallback)
Sets the callback to set the width of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn.- Parameters:
imageSizeCallback
- to set the width of label content, when is set asImg
, in percentage (format is "{n}%") in order to scale the image when drawn
-
getPositionCallback
public LabelPositionCallback getPositionCallback()
Returns the callback called to set the anchor position of label on line.- Returns:
- the callback called to set the anchor position of label on line
-
setPosition
public void setPosition(LabelPositionCallback positionCallback)
Sets the callback to set the anchor position of label on line.- Parameters:
positionCallback
- to set the anchor position of label on line
-
setPosition
public void setPosition(NativeCallback positionCallback)
Sets the callback to set the anchor position of label on line.- Parameters:
positionCallback
- to set the anchor position of label on line
-
getTextAlignCallback
public TextAlignCallback<AnnotationContext> getTextAlignCallback()
Returns the callback called to set the horizontal alignment of the label text when multiple lines.- Returns:
- the callback called to set the horizontal alignment of the label text when multiple lines
-
setTextAlign
public void setTextAlign(TextAlignCallback<AnnotationContext> alignCallback)
Sets the callback to set the horizontal alignment of the label text when multiple lines.- Parameters:
alignCallback
- to the horizontal alignment of the label text when multiple lines
-
setTextAlign
public void setTextAlign(NativeCallback alignCallback)
Sets the callback to set the horizontal alignment of the label text when multiple lines.- Parameters:
alignCallback
- to the horizontal alignment of the label text when multiple lines
-
getXPaddingCallback
public PaddingSizeCallback getXPaddingCallback()
Returns the callback called to set the padding of label to add left and right.- Returns:
- the callback called to set the padding of label to add left and right
-
setXPadding
public void setXPadding(PaddingSizeCallback paddingCallback)
Sets the callback to set the padding of label to add left and right.- Parameters:
paddingCallback
- to set the padding of label to add left and right
-
setXPadding
public void setXPadding(NativeCallback paddingCallback)
Sets the callback to set the padding of label to add left and right.- Parameters:
paddingCallback
- to set the padding of label to add left and right
-
getYPaddingCallback
public PaddingSizeCallback getYPaddingCallback()
Returns the callback called to set the padding of label to add top and bottom.- Returns:
- the callback called to set the padding of label to add top and bottom
-
setYPadding
public void setYPadding(PaddingSizeCallback paddingCallback)
Sets the callback to set the padding of label to add top and bottom.- Parameters:
paddingCallback
- to set the padding of label to add top and bottom
-
setYPadding
public void setYPadding(NativeCallback paddingCallback)
Sets the callback to set the padding of label to add top and bottom.- Parameters:
paddingCallback
- to set the padding of label to add top and bottom
-
getXAdjustCallback
public AdjustSizeCallback getXAdjustCallback()
Returns the callback called to set the adjustment along x-axis (left-right) of label relative to above number (can be negative).- Returns:
- the callback called to set the adjustment along x-axis (left-right) of label relative to above number (can be negative)
-
setXAdjust
public 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).- Parameters:
adjustCallback
- to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative)
-
setXAdjust
public 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).- Parameters:
adjustCallback
- to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative)
-
getYAdjustCallback
public AdjustSizeCallback getYAdjustCallback()
Returns the callback called to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative).- Returns:
- the callback called to set the adjustment along y-axis (top-bottom) of label relative to above number (can be negative)
-
setYAdjust
public 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).- Parameters:
adjustCallback
- to set the adjustment along x-axis (left-right) of label relative to above number (can be negative)
-
setYAdjust
public 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).- Parameters:
adjustCallback
- to set the adjustment along x-axis (left-right) of label relative to above number (can be negative)
-
getFontCallback
public final FontCallback<AnnotationContext> getFontCallback()
Returns the font callback, if set, otherwisenull
.- Specified by:
getFontCallback
in interfaceIsScriptableFontProvider<AnnotationContext>
- Returns:
- the font callback, if set, otherwise
null
.
-
setFont
public void setFont(FontCallback<AnnotationContext> fontCallback)
Sets the font callback.- Specified by:
setFont
in interfaceIsScriptableFontProvider<AnnotationContext>
- Parameters:
fontCallback
- the font callback to set
-
setFont
public void setFont(NativeCallback fontCallback)
Sets the font callback.- Specified by:
setFont
in interfaceIsScriptableFontProvider<AnnotationContext>
- Parameters:
fontCallback
- the font callback to set
-
getBorderWidthCallback
public WidthCallback<AnnotationContext> getBorderWidthCallback()
Returns the callback called to set the width of the border in pixels.- Returns:
- the callback called to set the width of the border in pixels
-
setBorderWidth
public void setBorderWidth(WidthCallback<AnnotationContext> borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.- Parameters:
borderWidthCallback
- to set the width of the border in pixels
-
setBorderWidth
public void setBorderWidth(NativeCallback borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.- Parameters:
borderWidthCallback
- to set the width of the border in pixels
-
getBorderColorCallback
public ColorCallback<AnnotationContext> getBorderColorCallback()
Returns the callback called to set the color of the border of annotation.- Returns:
- the callback called to set the color of the border of annotation
-
setBorderColor
public void setBorderColor(ColorCallback<AnnotationContext> borderColorCallback)
Sets the callback to set the color of the border of annotation.- Parameters:
borderColorCallback
- to set the color of the border of annotation
-
setBorderColor
public void setBorderColor(NativeCallback borderColorCallback)
Sets the callback to set the color of the border of annotation.- Parameters:
borderColorCallback
- to set the color of the border of annotation
-
getBorderDashOffsetCallback
public BorderDashOffsetCallback<AnnotationContext> getBorderDashOffsetCallback()
Returns the callback called to set the line dash pattern offset.- Returns:
- the callback called to set the line dash pattern offset
-
setBorderDashOffset
public void setBorderDashOffset(BorderDashOffsetCallback<AnnotationContext> borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.- Parameters:
borderDashOffsetCallback
- to set the line dash pattern offset
-
setBorderDashOffset
public void setBorderDashOffset(NativeCallback borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.- Parameters:
borderDashOffsetCallback
- to set the line dash pattern offset
-
getBorderDashCallback
public BorderDashCallback<AnnotationContext> getBorderDashCallback()
Returns the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Returns:
- the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
-
setBorderDash
public void setBorderDash(BorderDashCallback<AnnotationContext> borderDashCallback)
Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
borderDashCallback
- to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
-
setBorderDash
public void setBorderDash(NativeCallback borderDashCallback)
Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
borderDashCallback
- to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
-
getBorderCapStyleCallback
public CapStyleCallback<AnnotationContext> getBorderCapStyleCallback()
Returns the border capstyle callback, if set, otherwisenull
.- Returns:
- the border capstyle callback, if set, otherwise
null
.
-
setBorderCapStyle
public void setBorderCapStyle(CapStyleCallback<AnnotationContext> borderCapStyleCallback)
Sets the border capstyle callback.- Parameters:
borderCapStyleCallback
- the border capstyle callback.
-
setBorderCapStyle
public void setBorderCapStyle(NativeCallback borderCapStyleCallback)
Sets the border capstyle callback.- Parameters:
borderCapStyleCallback
- the border capstyle callback.
-
getBorderJoinStyleCallback
public JoinStyleCallback<AnnotationContext> getBorderJoinStyleCallback()
Returns the border join style callback, if set, otherwisenull
.- Returns:
- the border join style callback, if set, otherwise
null
.
-
setBorderJoinStyle
public void setBorderJoinStyle(JoinStyleCallback<AnnotationContext> borderJoinStyleCallback)
Sets the border join style callback.- Parameters:
borderJoinStyleCallback
- the border join style callback.
-
setBorderJoinStyle
public void setBorderJoinStyle(NativeCallback borderJoinStyleCallback)
Sets the border join style callback.- Parameters:
borderJoinStyleCallback
- the border join style callback.
-
setBackgroundColor
public default void setBackgroundColor(IsColor backgroundColor)
Sets the color of the background of annotation.- Parameters:
backgroundColor
- the color of the background of annotation
-
setBackgroundColor
public default void setBackgroundColor(String backgroundColor)
Sets the color of the background of annotation.- Parameters:
backgroundColor
- the color of the background of annotation
-
getBackgroundColorAsString
public default String getBackgroundColorAsString()
Returns the color of the background of annotation.- Returns:
- the color of the background of annotation
-
getBackgroundColor
public default IsColor getBackgroundColor()
Returns the color of the background of annotation.- Returns:
- the color of the background of annotation
-
getBackgroundColorCallback
public default ColorCallback<AnnotationContext> getBackgroundColorCallback()
Returns the callback called to set the color of the background of annotation.- Returns:
- the callback called to set the color of the background of annotation
-
setBackgroundColor
public default void setBackgroundColor(ColorCallback<AnnotationContext> backgroundColorCallback)
Sets the callback to set the color of the background of annotation.- Parameters:
backgroundColorCallback
- to set the color of the background of annotation
-
setBackgroundColor
public default void setBackgroundColor(NativeCallback backgroundColorCallback)
Sets the callback to set the color of the background of annotation.- Parameters:
backgroundColorCallback
- to set the color of the background of annotation
-
setBorderRadius
public default void setBorderRadius(int radius)
Sets the border radius.- Parameters:
radius
- the border radius.
-
setBorderRadius
public default void setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).- Parameters:
borderRadius
- the border radius (in pixels).
-
getBorderRadius
public default int getBorderRadius()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
getBorderRadiusAsObject
public default BarBorderRadius getBorderRadiusAsObject()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
getBorderRadiusCallback
public default BorderRadiusCallback<AnnotationContext> getBorderRadiusCallback()
Returns the callback called to set the border radius.- Returns:
- the callback called to set the border radius
-
setBorderRadius
public default void setBorderRadius(BorderRadiusCallback<AnnotationContext> borderRadiusCallback)
Sets the callback to set the border radius.- Parameters:
borderRadiusCallback
- to set the border radius
-
setBorderRadius
public default void setBorderRadius(NativeCallback borderRadiusCallback)
Sets the callback to set the border radius.- Parameters:
borderRadiusCallback
- to set the border radius
-
-