Package org.pepstock.charba.client.items
Class TooltipLabelColor
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.items.TooltipLabelColor
-
public final class TooltipLabelColor extends NativeObjectContainer
This object contains the color info when a label in the tooltip.
It must be used in the label tooltip callback.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TooltipLabelColor.TooltipLabelColorFactory
Inner class to create tooltip label color by a native object.
-
Field Summary
Fields Modifier and Type Field Description static TooltipLabelColor.TooltipLabelColorFactory
FACTORY
Tooltip color factory to create label color objects.
-
Constructor Summary
Constructors Constructor Description TooltipLabelColor()
Creates the object with an empty native object.TooltipLabelColor(String backgroundColor)
Creates the object with initial colors.TooltipLabelColor(String backgroundColor, String borderColor)
Creates the object with initial colors.TooltipLabelColor(IsColor backgroundColor)
Creates the object with initial colors.TooltipLabelColor(IsColor backgroundColor, IsColor borderColor)
Creates the object with initial colors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColor
getBackgroundColor()
Returns the background color of the label.CanvasGradientItem
getBackgroundColorAsCanvasGradient()
Returns the background color as canvas gradient.CanvasPatternItem
getBackgroundColorAsCanvasPattern()
Returns the background color as canvas pattern.Gradient
getBackgroundColorAsGradient()
Returns the background color as gradient.Pattern
getBackgroundColorAsPattern()
Returns the background color as pattern.String
getBackgroundColorAsString()
Returns the background color of the label.IsColor
getBorderColor()
Returns the border color of the label.CanvasGradientItem
getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.Gradient
getBorderColorAsGradient()
Returns the border color as gradient.String
getBorderColorAsString()
Returns the border color of the label.List<Integer>
getBorderDash()
Returns the line dash pattern used when stroking borders, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.int
getBorderRadius()
Returns the bar border radius (in pixels).int
getBorderWidth()
Returns the border width.boolean
isBackgroundColorAsColor()
Returnstrue
if the background color of the tooltip item is defined as color.boolean
isBackgroundColorAsGradient()
Returnstrue
if the background color of the tooltip item is defined as gradient.boolean
isBackgroundColorAsPattern()
Returnstrue
if the background color of the tooltip item is defined as canvas pattern.boolean
isBorderColorAsColor()
Returnstrue
if the border color of the tooltip item is defined as color.boolean
isBorderColorAsGradient()
Returnstrue
if the border color of the tooltip item is defined as gradient.NativeObject
nativeObject()
Wraps the protected method to get the java script object in order to consume it.void
setBackgroundColor(String backgroundColor)
Sets the background color of the tooltip item as string.void
setBackgroundColor(IsColor backgroundColor)
Sets the background color of the tooltip item.void
setBackgroundColor(TooltipItem tooltipItem, Gradient gradient)
Sets the background color of the tooltip item as gradient.void
setBackgroundColor(TooltipItem tooltipItem, Pattern pattern)
Sets the background color of the tooltip item as patternvoid
setBorderColor(String borderColor)
Sets border color as stringvoid
setBorderColor(IsColor borderColor)
Sets border colorvoid
setBorderColor(CanvasGradientItem gradient)
Sets the border color of the tooltip item as canvas gradient.void
setBorderColor(TooltipItem tooltipItem, Gradient gradient)
Sets the border color of the tooltip item as gradient.void
setBorderDash(int... borderDash)
Sets the line dash pattern used when stroking borders, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.void
setBorderRadius(int borderRadius)
Sets the bar border radius (in pixels).void
setBorderWidth(int borderWidth)
Sets the border width.-
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, 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
-
FACTORY
public static final TooltipLabelColor.TooltipLabelColorFactory FACTORY
Tooltip color factory to create label color objects.
-
-
Constructor Detail
-
TooltipLabelColor
public TooltipLabelColor()
Creates the object with an empty native object.
-
TooltipLabelColor
public TooltipLabelColor(IsColor backgroundColor)
Creates the object with initial colors.- Parameters:
backgroundColor
- background color to be set
-
TooltipLabelColor
public TooltipLabelColor(IsColor backgroundColor, IsColor borderColor)
Creates the object with initial colors.- Parameters:
backgroundColor
- background color to be setborderColor
- border color to be set
-
TooltipLabelColor
public TooltipLabelColor(String backgroundColor)
Creates the object with initial colors.- Parameters:
backgroundColor
- background color to be set
-
-
Method Detail
-
setBackgroundColor
public void setBackgroundColor(String backgroundColor)
Sets the background color of the tooltip item as string.- Parameters:
backgroundColor
- the background color of the tooltip item
-
setBackgroundColor
public void setBackgroundColor(IsColor backgroundColor)
Sets the background color of the tooltip item.- Parameters:
backgroundColor
- the background color of the tooltip item
-
setBackgroundColor
public void setBackgroundColor(TooltipItem tooltipItem, Pattern pattern)
Sets the background color of the tooltip item as pattern- Parameters:
tooltipItem
- tooltip item related to this labelpattern
- the background color of the tooltip item as pattern
-
setBackgroundColor
public void setBackgroundColor(TooltipItem tooltipItem, Gradient gradient)
Sets the background color of the tooltip item as gradient.- Parameters:
tooltipItem
- tooltip item related to this labelgradient
- the background color of the tooltip item as gradient
-
isBackgroundColorAsColor
public boolean isBackgroundColorAsColor()
Returnstrue
if the background color of the tooltip item is defined as color.- Returns:
true
if the background color of the tooltip item is defined as color
-
isBackgroundColorAsGradient
public boolean isBackgroundColorAsGradient()
Returnstrue
if the background color of the tooltip item is defined as gradient.- Returns:
true
if the background color of the tooltip item is defined as gradient
-
isBackgroundColorAsPattern
public boolean isBackgroundColorAsPattern()
Returnstrue
if the background color of the tooltip item is defined as canvas pattern.- Returns:
true
if the background color of the tooltip item is defined as canvas pattern
-
getBackgroundColorAsString
public String getBackgroundColorAsString()
Returns the background color of the label.- Returns:
- the background color of the label.
-
getBackgroundColor
public IsColor getBackgroundColor()
Returns the background color of the label.- Returns:
- the background color of the label.
-
getBackgroundColorAsPattern
public Pattern getBackgroundColorAsPattern()
Returns the background color as pattern.- Returns:
- the background color or
null
if is not a pattern
-
getBackgroundColorAsCanvasPattern
public CanvasPatternItem getBackgroundColorAsCanvasPattern()
Returns the background color as canvas pattern.- Returns:
- the background color or
null
if is not a canvas pattern
-
getBackgroundColorAsGradient
public Gradient getBackgroundColorAsGradient()
Returns the background color as gradient.- Returns:
- the background color or
null
if is not a gradient
-
getBackgroundColorAsCanvasGradient
public CanvasGradientItem getBackgroundColorAsCanvasGradient()
Returns the background color as canvas gradient.- Returns:
- the background color or
null
if is not a canvas gradient
-
isBorderColorAsColor
public boolean isBorderColorAsColor()
Returnstrue
if the border color of the tooltip item is defined as color.- Returns:
true
if the border color of the tooltip item is defined as color
-
isBorderColorAsGradient
public boolean isBorderColorAsGradient()
Returnstrue
if the border color of the tooltip item is defined as gradient.- Returns:
true
if the border color of the tooltip item is defined as gradient
-
setBorderColor
public void setBorderColor(String borderColor)
Sets border color as string- Parameters:
borderColor
- border color
-
setBorderColor
public void setBorderColor(IsColor borderColor)
Sets border color- Parameters:
borderColor
- border color
-
setBorderColor
public void setBorderColor(CanvasGradientItem gradient)
Sets the border color of the tooltip item as canvas gradient.- Parameters:
gradient
- the border color of the tooltip item as canvas gradient
-
setBorderColor
public void setBorderColor(TooltipItem tooltipItem, Gradient gradient)
Sets the border color of the tooltip item as gradient.- Parameters:
tooltipItem
- tooltip item related to this labelgradient
- the border color of the tooltip item as gradient
-
getBorderColorAsString
public String getBorderColorAsString()
Returns the border color of the label.- Returns:
- the border color of the label.
-
getBorderColor
public IsColor getBorderColor()
Returns the border color of the label.- Returns:
- the border color of the label.
-
getBorderColorAsGradient
public Gradient getBorderColorAsGradient()
Returns the border color as gradient.- Returns:
- the border color or
null
if is not a gradient
-
getBorderColorAsCanvasGradient
public CanvasGradientItem getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.- Returns:
- the border color or
null
if is not a canvas gradient
-
setBorderWidth
public void setBorderWidth(int borderWidth)
Sets the border width.- Parameters:
borderWidth
- the border width.
-
getBorderWidth
public int getBorderWidth()
Returns the border width.- Returns:
- the border width.
-
setBorderRadius
public void setBorderRadius(int borderRadius)
Sets the bar border radius (in pixels).- Parameters:
borderRadius
- the bar border radius (in pixels).
-
getBorderRadius
public int getBorderRadius()
Returns the bar border radius (in pixels).- Returns:
- the bar border radius (in pixels).
-
setBorderDash
public void setBorderDash(int... borderDash)
Sets the line dash pattern used when stroking borders, 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 borders, 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 borders, 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 borders, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
-
nativeObject
public NativeObject nativeObject()
Wraps the protected method to get the java script object in order to consume it.- Returns:
- the java script object in order to consume it.
-
-