Class Labels
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.treemap.Labels
-
public final class Labels extends AbstractNode
The labels can control if and how a label, to represent the data, can be shown in the rectangle.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static Align
DEFAULT_ALIGN
Default label alignment,Align.LEFT
static String
DEFAULT_COLOR
Default label color,HtmlColor.TRANSPARENT
static boolean
DEFAULT_DISPLAY
Default labels display, false.static Overflow
DEFAULT_OVERFLOW
Default labels overflow,Overflow.CUT
.static int
DEFAULT_PADDING
Default label padding, 3static Position
DEFAULT_POSITION
Default labels position,Position.MIDDLE
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Align
getAlign()
Returns the text horizontal alignment used when drawing the label.AlignCallback
getAlignCallback()
Returns the align callback, if set, otherwisenull
.List<IsColor>
getColor()
Returns the color of the text.List<String>
getColorAsString()
Returns the color of the text.ColorsCallback
getColorCallback()
Returns the color callback, if set, otherwisenull
.IsFont
getFont()
Returns the font object.FontsCallback
getFontCallback()
Returns the font callback, if set, otherwisenull
.List<IsFont>
getFonts()
Returns the font of the text.FormatterCallback
getFormatterCallback()
Returns the formatter callback, if set, otherwisenull
.List<IsColor>
getHoverColor()
Returns the color of the text, when hovered.List<String>
getHoverColorAsString()
Returns the color of the text, when hovered.ColorsCallback
getHoverColorCallback()
Returns the hover color callback, if set, otherwisenull
.IsFont
getHoverFont()
Returns the font object when hovered.FontsCallback
getHoverFontCallback()
Returns the hover font callback, if set, otherwisenull
.List<IsFont>
getHoverFonts()
Returns the font of the text, when hovered.Overflow
getOverflow()
Returns the control what happens to a label that is too big to fit into a rectangle.OverflowCallback
getOverflowCallback()
Returns the overflow callback, if set, otherwisenull
.int
getPadding()
Returns the padding to apply around labels.Position
getPosition()
Returns the text vertical alignment used when drawing the label.PositionCallback
getPositionCallback()
Returns the position callback, if set, otherwisenull
.boolean
isDisplay()
Returnstrue
whether the element should be displayed.void
setAlign(NativeCallback alignCallback)
Sets the align callback.void
setAlign(AlignCallback alignCallback)
Sets the align callback.void
setAlign(Align align)
Sets the text horizontal alignment used when drawing the label.void
setColor(String... colors)
Sets the color of the text.void
setColor(List<IsColor> colors)
Sets the color of the text.void
setColor(NativeCallback colorCallback)
Sets the color callback.void
setColor(IsColor... colors)
Sets the color of the text.void
setColor(ColorsCallback colorCallback)
Sets the color callback.void
setDisplay(boolean display)
Setstrue
whether the element should be displayed.void
setFont(NativeCallback fontCallback)
Sets the font callback.void
setFont(FontsCallback fontCallback)
Sets the font callback.void
setFonts(List<FontItem> fonts)
Sets the font of the text.void
setFonts(FontItem... fonts)
Sets the font of the text.void
setFormatter(NativeCallback formatterCallback)
Sets the formatter callback.void
setFormatter(FormatterCallback formatterCallback)
Sets the formatter callback.void
setHoverColor(String... hoverColors)
Sets the color of the text, when hovered.void
setHoverColor(List<IsColor> hoverColors)
Sets the color of the text, when hovered.void
setHoverColor(NativeCallback hoverColorCallback)
Sets the hover color callback.void
setHoverColor(IsColor... hoverColors)
Sets the color of the text, when hovered.void
setHoverColor(ColorsCallback hoverColorCallback)
Sets the hover color callback.void
setHoverFont(NativeCallback hoverFontCallback)
Sets the hover font callback.void
setHoverFont(FontsCallback hoverFontCallback)
Sets the hover font callback.void
setHoverFonts(List<FontItem> fonts)
Sets the font of the text, when hovered.void
setHoverFonts(FontItem... fonts)
Sets the font of the text, when hovered.void
setOverflow(NativeCallback overflowCallback)
Sets the overflow callback.void
setOverflow(OverflowCallback overflowCallback)
Sets the overflow callback.void
setOverflow(Overflow overflow)
Sets the control what happens to a label that is too big to fit into a rectangle.void
setPadding(int padding)
Sets the padding to apply around labels.void
setPosition(NativeCallback positionCallback)
Sets the position callback.void
setPosition(PositionCallback positionCallback)
Sets the position callback.void
setPosition(Position position)
Sets the text vertical alignment used when drawing the label.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, 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
checkAndGetColor, 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, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Field Detail
-
DEFAULT_DISPLAY
public static final boolean DEFAULT_DISPLAY
Default labels display, false.- See Also:
- Constant Field Values
-
DEFAULT_POSITION
public static final Position DEFAULT_POSITION
Default labels position,Position.MIDDLE
.
-
DEFAULT_OVERFLOW
public static final Overflow DEFAULT_OVERFLOW
Default labels overflow,Overflow.CUT
.
-
DEFAULT_ALIGN
public static final Align DEFAULT_ALIGN
Default label alignment,Align.LEFT
-
DEFAULT_COLOR
public static final String DEFAULT_COLOR
Default label color,HtmlColor.TRANSPARENT
-
DEFAULT_PADDING
public static final int DEFAULT_PADDING
Default label padding, 3- See Also:
- Constant Field Values
-
-
Method Detail
-
getFont
public IsFont getFont()
Returns the font object.- Returns:
- the font object.
-
getHoverFont
public IsFont getHoverFont()
Returns the font object when hovered.- Returns:
- the font object when hovered
-
setFonts
public void setFonts(FontItem... fonts)
Sets the font of the text.- Parameters:
fonts
- the font of the text
-
setFonts
public void setFonts(List<FontItem> fonts)
Sets the font of the text.- Parameters:
fonts
- the font of the text
-
setHoverFonts
public void setHoverFonts(FontItem... fonts)
Sets the font of the text, when hovered.- Parameters:
fonts
- the font of the text, when hovered
-
setHoverFonts
public void setHoverFonts(List<FontItem> fonts)
Sets the font of the text, when hovered.- Parameters:
fonts
- the font of the text, when hovered
-
getHoverFonts
public List<IsFont> getHoverFonts()
Returns the font of the text, when hovered.- Returns:
- the font of the text, when hovered
-
setColor
public void setColor(IsColor... colors)
Sets the color of the text.- Parameters:
colors
- the color of the text
-
setColor
public void setColor(List<IsColor> colors)
Sets the color of the text.- Parameters:
colors
- the color of the text
-
setColor
public void setColor(String... colors)
Sets the color of the text.- Parameters:
colors
- the color of the text
-
getColorAsString
public List<String> getColorAsString()
Returns the color of the text.- Returns:
- the color of the text
-
getColor
public List<IsColor> getColor()
Returns the color of the text.- Returns:
- the color of the text
-
setHoverColor
public void setHoverColor(IsColor... hoverColors)
Sets the color of the text, when hovered.- Parameters:
hoverColors
- the color of the text, when hovered
-
setHoverColor
public void setHoverColor(List<IsColor> hoverColors)
Sets the color of the text, when hovered.- Parameters:
hoverColors
- the color of the text, when hovered
-
setHoverColor
public void setHoverColor(String... hoverColors)
Sets the color of the text, when hovered.- Parameters:
hoverColors
- the color of the text, when hovered
-
getHoverColorAsString
public List<String> getHoverColorAsString()
Returns the color of the text, when hovered.- Returns:
- the color of the text, when hovered
-
getHoverColor
public List<IsColor> getHoverColor()
Returns the color of the text, when hovered.- Returns:
- the color of the text, when hovered
-
setPosition
public void setPosition(Position position)
Sets the text vertical alignment used when drawing the label.- Parameters:
position
- the text vertical alignment used when drawing the label
-
getPosition
public Position getPosition()
Returns the text vertical alignment used when drawing the label.- Returns:
- the text vertical alignment used when drawing the label
-
setOverflow
public void setOverflow(Overflow overflow)
Sets the control what happens to a label that is too big to fit into a rectangle.- Parameters:
overflow
- the control what happens to a label that is too big to fit into a rectangle
-
getOverflow
public Overflow getOverflow()
Returns the control what happens to a label that is too big to fit into a rectangle.- Returns:
- the control what happens to a label that is too big to fit into a rectangle
-
getPositionCallback
public PositionCallback getPositionCallback()
Returns the position callback, if set, otherwisenull
.- Returns:
- the position callback, if set, otherwise
null
.
-
setPosition
public void setPosition(PositionCallback positionCallback)
Sets the position callback.- Parameters:
positionCallback
- the position callback.
-
setPosition
public void setPosition(NativeCallback positionCallback)
Sets the position callback.- Parameters:
positionCallback
- the position callback.
-
getOverflowCallback
public OverflowCallback getOverflowCallback()
Returns the overflow callback, if set, otherwisenull
.- Returns:
- the overflow callback, if set, otherwise
null
.
-
setOverflow
public void setOverflow(OverflowCallback overflowCallback)
Sets the overflow callback.- Parameters:
overflowCallback
- the overflow callback.
-
setOverflow
public void setOverflow(NativeCallback overflowCallback)
Sets the overflow callback.- Parameters:
overflowCallback
- the overflow callback.
-
getColorCallback
public ColorsCallback getColorCallback()
Returns the color callback, if set, otherwisenull
.- Returns:
- the color callback, if set, otherwise
null
.
-
setColor
public void setColor(ColorsCallback colorCallback)
Sets the color callback.- Parameters:
colorCallback
- the color callback.
-
setColor
public void setColor(NativeCallback colorCallback)
Sets the color callback.- Parameters:
colorCallback
- the color callback.
-
getHoverColorCallback
public ColorsCallback getHoverColorCallback()
Returns the hover color callback, if set, otherwisenull
.- Returns:
- the hover color callback, if set, otherwise
null
.
-
setHoverColor
public void setHoverColor(ColorsCallback hoverColorCallback)
Sets the hover color callback.- Parameters:
hoverColorCallback
- the hover color callback.
-
setHoverColor
public void setHoverColor(NativeCallback hoverColorCallback)
Sets the hover color callback.- Parameters:
hoverColorCallback
- the color callback.
-
getFontCallback
public final FontsCallback getFontCallback()
Returns the font callback, if set, otherwisenull
.- Returns:
- the font callback, if set, otherwise
null
.
-
setFont
public final void setFont(FontsCallback fontCallback)
Sets the font callback.- Parameters:
fontCallback
- the font callback to set
-
setFont
public final void setFont(NativeCallback fontCallback)
Sets the font callback.- Parameters:
fontCallback
- the font callback to set
-
getHoverFontCallback
public final FontsCallback getHoverFontCallback()
Returns the hover font callback, if set, otherwisenull
.- Returns:
- the hover font callback, if set, otherwise
null
.
-
setHoverFont
public final void setHoverFont(FontsCallback hoverFontCallback)
Sets the hover font callback.- Parameters:
hoverFontCallback
- the hover font callback to set
-
setHoverFont
public final void setHoverFont(NativeCallback hoverFontCallback)
Sets the hover font callback.- Parameters:
hoverFontCallback
- the hover font callback to set
-
setAlign
public final void setAlign(Align align)
Sets the text horizontal alignment used when drawing the label.- Parameters:
align
- the text horizontal alignment used when drawing the label.
-
getAlign
public final Align getAlign()
Returns the text horizontal alignment used when drawing the label.- Returns:
- the text horizontal alignment used when drawing the label.
-
setPadding
public final void setPadding(int padding)
Sets the padding to apply around labels.- Parameters:
padding
- padding to apply around labels.
-
getPadding
public final int getPadding()
Returns the padding to apply around labels.- Returns:
- padding to apply around labels.
-
getFormatterCallback
public final FormatterCallback getFormatterCallback()
Returns the formatter callback, if set, otherwisenull
.- Returns:
- the formatter callback, if set, otherwise
null
.
-
setFormatter
public final void setFormatter(FormatterCallback formatterCallback)
Sets the formatter callback.- Parameters:
formatterCallback
- the formatter callback.
-
setFormatter
public final void setFormatter(NativeCallback formatterCallback)
Sets the formatter callback.- Parameters:
formatterCallback
- the formatter callback.
-
getAlignCallback
public final AlignCallback getAlignCallback()
Returns the align callback, if set, otherwisenull
.- Returns:
- the align callback, if set, otherwise
null
.
-
setAlign
public final void setAlign(AlignCallback alignCallback)
Sets the align callback.- Parameters:
alignCallback
- the align callback.
-
setAlign
public final void setAlign(NativeCallback alignCallback)
Sets the align callback.- Parameters:
alignCallback
- the align callback.
-
setDisplay
public final void setDisplay(boolean display)
Setstrue
whether the element should be displayed.- Parameters:
display
-true
whether the element should be displayed
-
isDisplay
public final boolean isDisplay()
Returnstrue
whether the element should be displayed.- Returns:
true
whether the element should be displayed
-
-