Package org.pepstock.charba.client.items
Class CommonElementOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.items.ChartElementOptions
-
- org.pepstock.charba.client.items.CommonElementOptions
-
- Direct Known Subclasses:
ArcElementOptions
,BarElementOptions
,MatrixElementOptions
,PointElementOptions
,TreeMapElementOptions
public class CommonElementOptions extends ChartElementOptions
Maps the common options of theChartElement
s.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CommonElementOptions(NativeObject nativeObject)
Creates the item using a native java script object which contains all properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TooltipLabelColor
createTooltipLabelColor()
Create newTooltipLabelColor
filling it with background and border color of dataset element.IsColor
getBackgroundColor()
Returns the background color of the dataset item.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 dataset item.IsColor
getBorderColor()
Returns the color of the dataset item borderCanvasGradientItem
getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.Gradient
getBorderColorAsGradient()
Returns the border color as gradient.String
getBorderColorAsString()
Returns the color of the dataset item borderint
getBorderWidth()
Returns the border width of the dataset item in pixels.protected int
getDefaultBorderWidth()
This method must be overrided by all element where the border width is stored in different object.boolean
inRange(double x, double y, boolean useFinalPosition)
Returns if the point passed as the argument is in the element.boolean
inXRange(double x, boolean useFinalPosition)
Returns if the point X passed as the argument is in the element.boolean
inYRange(double y, boolean useFinalPosition)
Returns if the point Y passed as the argument is in the element.boolean
isBackgroundColorAsColor()
Returnstrue
if the background color is defined as color.boolean
isBackgroundColorAsGradient()
Returnstrue
if the background color is defined as gradient.boolean
isBackgroundColorAsPattern()
Returnstrue
if the background color is defined as canvas pattern.boolean
isBorderColorAsColor()
Returnstrue
if the border color is defined as color.boolean
isBorderColorAsGradient()
Returnstrue
if the border color is defined as gradient.void
setBackgroundColor(String backgroundColor)
Sets the background color.void
setBackgroundColor(IsColor backgroundColor)
Sets the background color.void
setBackgroundColor(CanvasGradientItem backgroundColor)
Sets the background color as gradient.void
setBackgroundColor(CanvasPatternItem backgroundColor)
Sets the background color as pattern.void
setBorderColor(String borderColor)
Sets the border color.void
setBorderColor(IsColor borderColor)
Sets the border color.void
setBorderColor(CanvasGradientItem borderColor)
Sets the border color as gradient.void
setBorderWidth(int borderWidth)
Sets the border width.-
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
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
-
-
-
-
Constructor Detail
-
CommonElementOptions
protected CommonElementOptions(NativeObject nativeObject)
Creates the item using a native java script object which contains all properties.- Parameters:
nativeObject
- native java script object which contains all properties.
-
-
Method Detail
-
getDefaultBorderWidth
protected int getDefaultBorderWidth()
This method must be overrided by all element where the border width is stored in different object.- Returns:
- an undefined integer
-
isBackgroundColorAsColor
public final boolean isBackgroundColorAsColor()
Returnstrue
if the background color is defined as color.- Returns:
true
if the background color is defined as color
-
isBackgroundColorAsGradient
public final boolean isBackgroundColorAsGradient()
Returnstrue
if the background color is defined as gradient.- Returns:
true
if the background color is defined as gradient
-
isBackgroundColorAsPattern
public final boolean isBackgroundColorAsPattern()
Returnstrue
if the background color is defined as canvas pattern.- Returns:
true
if the background color is defined as canvas pattern
-
getBackgroundColorAsString
public final String getBackgroundColorAsString()
Returns the background color of the dataset item.- Returns:
- the background color of the dataset item.
-
getBackgroundColor
public final IsColor getBackgroundColor()
Returns the background color of the dataset item.- Returns:
- the background color of the dataset item.
-
getBackgroundColorAsGradient
public final Gradient getBackgroundColorAsGradient()
Returns the background color as gradient.- Returns:
- the background color or
null
if is not a gradient
-
getBackgroundColorAsCanvasGradient
public final CanvasGradientItem getBackgroundColorAsCanvasGradient()
Returns the background color as canvas gradient.- Returns:
- the background color or
null
if is not a canvas gradient
-
getBackgroundColorAsPattern
public final Pattern getBackgroundColorAsPattern()
Returns the background color as pattern.- Returns:
- the background color or
null
if is not a pattern
-
getBackgroundColorAsCanvasPattern
public final CanvasPatternItem getBackgroundColorAsCanvasPattern()
Returns the background color as canvas pattern.- Returns:
- the background color or
null
if is not a canvas pattern
-
setBackgroundColor
public final void setBackgroundColor(IsColor backgroundColor)
Sets the background color.- Parameters:
backgroundColor
- the background color.
-
setBackgroundColor
public final void setBackgroundColor(String backgroundColor)
Sets the background color.- Parameters:
backgroundColor
- the background color.
-
setBackgroundColor
public final void setBackgroundColor(CanvasGradientItem backgroundColor)
Sets the background color as gradient.- Parameters:
backgroundColor
- the background color as gradient.
-
setBackgroundColor
public final void setBackgroundColor(CanvasPatternItem backgroundColor)
Sets the background color as pattern.- Parameters:
backgroundColor
- the background color as pattern.
-
getBorderWidth
public int getBorderWidth()
Returns the border width of the dataset item in pixels.- Returns:
- the border width of the dataset item in pixels.
-
setBorderWidth
public final void setBorderWidth(int borderWidth)
Sets the border width.- Parameters:
borderWidth
- the border width.
-
isBorderColorAsColor
public final boolean isBorderColorAsColor()
Returnstrue
if the border color is defined as color.- Returns:
true
if the border color is defined as color
-
isBorderColorAsGradient
public final boolean isBorderColorAsGradient()
Returnstrue
if the border color is defined as gradient.- Returns:
true
if the border color is defined as gradient
-
getBorderColorAsString
public final String getBorderColorAsString()
Returns the color of the dataset item border- Returns:
- the color of the dataset item border.
-
getBorderColor
public final IsColor getBorderColor()
Returns the color of the dataset item border- Returns:
- the color of the dataset item border
-
getBorderColorAsGradient
public final Gradient getBorderColorAsGradient()
Returns the border color as gradient.- Returns:
- the border color or
null
if is not a gradient
-
getBorderColorAsCanvasGradient
public final CanvasGradientItem getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.- Returns:
- the border color or
null
if is not a canvas gradient
-
setBorderColor
public final void setBorderColor(IsColor borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.
-
setBorderColor
public final void setBorderColor(String borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.
-
setBorderColor
public final void setBorderColor(CanvasGradientItem borderColor)
Sets the border color as gradient.- Parameters:
borderColor
- the border color as gradient.
-
createTooltipLabelColor
public final TooltipLabelColor createTooltipLabelColor()
Create newTooltipLabelColor
filling it with background and border color of dataset element.- Returns:
- new
TooltipLabelColor
filling it with background and border color of dataset element
-
inRange
public final boolean inRange(double x, double y, boolean useFinalPosition)
Returns if the point passed as the argument is in the element.- Parameters:
x
- point X valuey
- point Y valueuseFinalPosition
- if the position must be calculated with final dimensions or also during the animation.- Returns:
true
if the point is in the element
-
inXRange
public final boolean inXRange(double x, boolean useFinalPosition)
Returns if the point X passed as the argument is in the element.- Parameters:
x
- point X valueuseFinalPosition
- if the position must be calculated with final dimensions or also during the animation.- Returns:
true
if the point X is in the element
-
inYRange
public final boolean inYRange(double y, boolean useFinalPosition)
Returns if the point Y passed as the argument is in the element.- Parameters:
y
- point Y valueuseFinalPosition
- if the position must be calculated with final dimensions or also during the animation.- Returns:
true
if the point Y is in the element
-
-