public final class LabelsOptions extends AbstractPluginOptions
Constructor and Description |
---|
LabelsOptions()
Creates an empty object with plugin options.
|
Modifier and Type | Method and Description |
---|---|
IsColor |
getFontColor()
Returns the the font color as color.
|
String |
getFontColorAsString()
Returns the the font color as string.
|
FontColorCallback<?> |
getFontColorCallback()
Returns the font color callback, if set, otherwise
null . |
String |
getFontFamily()
Returns the font family.
|
int |
getFontSize()
Returns the the font size.
|
FontStyle |
getFontStyle()
Returns the font style.
|
List<ImageElement> |
getImages()
Returns the images when
Render is Render.image . |
int |
getOutsidePadding()
Returns the padding when position is
Position.outside . |
Position |
getPosition()
Returns the position to draw label.
|
int |
getPrecision()
Returns the precision for percentage.
|
Render |
getRender()
Returns what data must be showed.
|
RenderCallback<?> |
getRenderCallback()
Returns the render callback, if set, otherwise
null . |
int |
getShadowBlur()
Returns the text shadow intensity.
|
IsColor |
getShadowColor()
Returns the text shadow color as color.
|
String |
getShadowColorAsString()
Returns the text shadow color as string.
|
int |
getShadowOffsetX()
Returns the text shadow X offset.
|
int |
getShadowOffsetY()
Returns the text shadow Y offset.
|
int |
getTextMargin()
Returns the margin of text when position is
Position.outside or Position.border . |
boolean |
isArc()
Returns if draws label in arc.
|
boolean |
isOverlap()
Returns if draws label even it's overlap.
|
boolean |
isShowActualPercentages()
Returns if shows the real calculated percentages from the values and don't apply the additional logic to fit the
percentages to 100 in total.
|
boolean |
isShowZero()
Returns whether or not labels of value 0 are displayed.
|
boolean |
isTextShadow()
Returns if draws text shadows under labels.
|
protected void |
register()
Registers the options to the factory to manage the cache of options.
|
void |
setArc(boolean arc)
Sets if draws label in arc.
|
void |
setFontColor(FontColorCallback<?> fontColorCallback)
Sets the font color callback.
|
void |
setFontColor(IsColor color)
Sets the font color as color.
|
void |
setFontColor(String color)
Sets the font color as string.
|
void |
setFontFamily(String fontFamily)
Sets the font family
|
void |
setFontSize(int size)
Sets the font size.
|
void |
setFontStyle(FontStyle fontStyle)
Sets the font style.
|
void |
setImages(Image... images)
Sets the images when
Render is Render.image . |
void |
setImages(ImageElement... images)
Sets the images when
Render is Render.image . |
void |
setImages(ImageResource... images)
Sets the images when
Render is Render.image . |
void |
setOutsidePadding(int outsidePadding)
Sets the padding when position is
Position.outside . |
void |
setOverlap(boolean overlap)
Sets if draws label even it's overlap.
|
void |
setPosition(Position position)
+ Sets the position to draw label.
|
void |
setPrecision(int precision)
Sets the precision for percentage.
|
void |
setRender(Render render)
Sets what data must be showed.
|
void |
setRender(RenderCallback<?> renderCallback)
Sets the render callback.
|
void |
setShadowBlur(int shadowBlur)
Sets the text shadow intensity.
|
void |
setShadowColor(IsColor shadowColor)
Sets the text shadow color as color.
|
void |
setShadowColor(String shadowColor)
Sets the text shadow color as string.
|
void |
setShadowOffsetX(int shadowOffsetX)
Sets the text shadow X offset.
|
void |
setShadowOffsetY(int shadowOffsetY)
Sets the text shadow Y offset.
|
void |
setShowActualPercentages(boolean showActualPercentages)
Sets if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages
to 100 in total.
|
void |
setShowZero(boolean showZero)
Sets whether or not labels of value 0 are displayed.
|
void |
setTextMargin(int textMargin)
Sets the margin of text when position is
Position.outside or Position.border . |
void |
setTextShadow(boolean textShadow)
Sets if draws text shadows under labels.
|
getId, getPluginId, getReferences
getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, 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 LabelsOptions()
protected void register()
AbstractPluginOptions
register
in class AbstractPluginOptions
public final void setRender(Render render)
render
- what data must be showed.public final Render getRender()
Render.value
.public final void setPrecision(int precision)
precision
- the precision for percentagepublic final int getPrecision()
public final void setShowZero(boolean showZero)
showZero
- whether or not labels of value 0 are displayed.public final boolean isShowZero()
public final void setFontSize(int size)
size
- the font size.public final int getFontSize()
Defaults.get().getGlobal().getDefaultFontSize()
.public final void setFontColor(IsColor color)
color
- the font color as color.public final void setFontColor(String color)
color
- the font color as string.public final String getFontColorAsString()
Defaults.get().getGlobal().getDefaultFontColorAsString()
, even if the
font color callback has been set.public final IsColor getFontColor()
public final void setFontStyle(FontStyle fontStyle)
fontStyle
- the font style.public final FontStyle getFontStyle()
Defaults.get().getGlobal().getDefaultFontStyle()
.public final void setFontFamily(String fontFamily)
fontFamily
- the font familypublic final String getFontFamily()
Defaults.get().getGlobal().getDefaultFontFamily()
.public final void setTextShadow(boolean textShadow)
textShadow
- true
if draws text shadows under labels.public final boolean isTextShadow()
true
if draws text shadows under labels. Default is false
.public final void setShadowBlur(int shadowBlur)
shadowBlur
- the text shadow intensity.public final int getShadowBlur()
public final void setShadowOffsetX(int shadowOffsetX)
shadowOffsetX
- the text shadow X offset.public final int getShadowOffsetX()
public final void setShadowOffsetY(int shadowOffsetY)
shadowOffsetY
- the text shadow Y offset.public final int getShadowOffsetY()
public final void setShadowColor(IsColor shadowColor)
shadowColor
- the text shadow color as color.public final void setShadowColor(String shadowColor)
shadowColor
- the text shadow color as string.public final String getShadowColorAsString()
rgba(0,0,0,0.3)
.public final IsColor getShadowColor()
public final void setArc(boolean arc)
arc
- if draws label in arc.public final boolean isArc()
true
if draws label in arc. Default is false
.public final void setPosition(Position position)
position
- the position to draw label.public final Position getPosition()
Position.defaults
.public final void setOverlap(boolean overlap)
overlap
- if draws label even it's overlap.public final boolean isOverlap()
true
if draws label even it's overlap. Default is true
.public final void setShowActualPercentages(boolean showActualPercentages)
showActualPercentages
- if shows the real calculated percentages from the values and don't apply the additional
logic to fit the percentages to 100 in total.public final boolean isShowActualPercentages()
true
if shows the real calculated percentages from the values and don't apply the additional logic to
fit the percentages to 100 in total. Default is false
.public final void setOutsidePadding(int outsidePadding)
Position.outside
.outsidePadding
- the padding when position is Position.outside
.public final int getOutsidePadding()
Position.outside
.Position.outside
. Default is 2.public final void setTextMargin(int textMargin)
Position.outside
or Position.border
.textMargin
- the margin of text when position is Position.outside
or Position.border
.public final int getTextMargin()
Position.outside
or Position.border
.Position.outside
or Position.border
. Default is 2.public final void setImages(ImageResource... images)
Render
is Render.image
.images
- images when Render
is Render.image
.public final void setImages(Image... images)
Render
is Render.image
.images
- images when Render
is Render.image
.public final void setImages(ImageElement... images)
Render
is Render.image
.images
- images when Render
is Render.image
.public final List<ImageElement> getImages()
Render
is Render.image
.Render
is Render.image
or an empty list.public RenderCallback<?> getRenderCallback()
null
.null
public void setRender(RenderCallback<?> renderCallback)
renderCallback
- the render callback to setpublic FontColorCallback<?> getFontColorCallback()
null
.null
public void setFontColor(FontColorCallback<?> fontColorCallback)
fontColorCallback
- the font color callback.