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 theChartElements.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCommonElementOptions(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 TooltipLabelColorcreateTooltipLabelColor()Create newTooltipLabelColorfilling it with background and border color of dataset element.IsColorgetBackgroundColor()Returns the background color of the dataset item.CanvasGradientItemgetBackgroundColorAsCanvasGradient()Returns the background color as canvas gradient.CanvasPatternItemgetBackgroundColorAsCanvasPattern()Returns the background color as canvas pattern.GradientgetBackgroundColorAsGradient()Returns the background color as gradient.PatterngetBackgroundColorAsPattern()Returns the background color as pattern.StringgetBackgroundColorAsString()Returns the background color of the dataset item.IsColorgetBorderColor()Returns the color of the dataset item borderCanvasGradientItemgetBorderColorAsCanvasGradient()Returns the border color as canvas gradient.GradientgetBorderColorAsGradient()Returns the border color as gradient.StringgetBorderColorAsString()Returns the color of the dataset item borderintgetBorderWidth()Returns the border width of the dataset item in pixels.protected intgetDefaultBorderWidth()This method must be overrided by all element where the border width is stored in different object.booleaninRange(double x, double y, boolean useFinalPosition)Returns if the point passed as the argument is in the element.booleaninXRange(double x, boolean useFinalPosition)Returns if the point X passed as the argument is in the element.booleaninYRange(double y, boolean useFinalPosition)Returns if the point Y passed as the argument is in the element.booleanisBackgroundColorAsColor()Returnstrueif the background color is defined as color.booleanisBackgroundColorAsGradient()Returnstrueif the background color is defined as gradient.booleanisBackgroundColorAsPattern()Returnstrueif the background color is defined as canvas pattern.booleanisBorderColorAsColor()Returnstrueif the border color is defined as color.booleanisBorderColorAsGradient()Returnstrueif the border color is defined as gradient.voidsetBackgroundColor(String backgroundColor)Sets the background color.voidsetBackgroundColor(IsColor backgroundColor)Sets the background color.voidsetBackgroundColor(CanvasGradientItem backgroundColor)Sets the background color as gradient.voidsetBackgroundColor(CanvasPatternItem backgroundColor)Sets the background color as pattern.voidsetBorderColor(String borderColor)Sets the border color.voidsetBorderColor(IsColor borderColor)Sets the border color.voidsetBorderColor(CanvasGradientItem borderColor)Sets the border color as gradient.voidsetBorderWidth(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, 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, 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()
Returnstrueif the background color is defined as color.- Returns:
trueif the background color is defined as color
-
isBackgroundColorAsGradient
public final boolean isBackgroundColorAsGradient()
Returnstrueif the background color is defined as gradient.- Returns:
trueif the background color is defined as gradient
-
isBackgroundColorAsPattern
public final boolean isBackgroundColorAsPattern()
Returnstrueif the background color is defined as canvas pattern.- Returns:
trueif 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
nullif is not a gradient
-
getBackgroundColorAsCanvasGradient
public final CanvasGradientItem getBackgroundColorAsCanvasGradient()
Returns the background color as canvas gradient.- Returns:
- the background color or
nullif is not a canvas gradient
-
getBackgroundColorAsPattern
public final Pattern getBackgroundColorAsPattern()
Returns the background color as pattern.- Returns:
- the background color or
nullif is not a pattern
-
getBackgroundColorAsCanvasPattern
public final CanvasPatternItem getBackgroundColorAsCanvasPattern()
Returns the background color as canvas pattern.- Returns:
- the background color or
nullif 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()
Returnstrueif the border color is defined as color.- Returns:
trueif the border color is defined as color
-
isBorderColorAsGradient
public final boolean isBorderColorAsGradient()
Returnstrueif the border color is defined as gradient.- Returns:
trueif 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
nullif is not a gradient
-
getBorderColorAsCanvasGradient
public final CanvasGradientItem getBorderColorAsCanvasGradient()
Returns the border color as canvas gradient.- Returns:
- the border color or
nullif 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 newTooltipLabelColorfilling it with background and border color of dataset element.- Returns:
- new
TooltipLabelColorfilling 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:
trueif 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:
trueif 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:
trueif the point Y is in the element
-
-