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 SummaryConstructors Modifier Constructor Description protectedCommonElementOptions(NativeObject nativeObject)Creates the item using a native java script object which contains all properties.
 - 
Method SummaryAll 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.AbstractNodecheckAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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.NativeObjectContainercheckDefaultValuesArgument, 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, 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- 
CommonElementOptionsprotected 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- 
getDefaultBorderWidthprotected int getDefaultBorderWidth() This method must be overrided by all element where the border width is stored in different object.- Returns:
- an undefined integer
 
 - 
isBackgroundColorAsColorpublic final boolean isBackgroundColorAsColor() Returnstrueif the background color is defined as color.- Returns:
- trueif the background color is defined as color
 
 - 
isBackgroundColorAsGradientpublic final boolean isBackgroundColorAsGradient() Returnstrueif the background color is defined as gradient.- Returns:
- trueif the background color is defined as gradient
 
 - 
isBackgroundColorAsPatternpublic final boolean isBackgroundColorAsPattern() Returnstrueif the background color is defined as canvas pattern.- Returns:
- trueif the background color is defined as canvas pattern
 
 - 
getBackgroundColorAsStringpublic final String getBackgroundColorAsString() Returns the background color of the dataset item.- Returns:
- the background color of the dataset item.
 
 - 
getBackgroundColorpublic final IsColor getBackgroundColor() Returns the background color of the dataset item.- Returns:
- the background color of the dataset item.
 
 - 
getBackgroundColorAsGradientpublic final Gradient getBackgroundColorAsGradient() Returns the background color as gradient.- Returns:
- the background color or nullif is not a gradient
 
 - 
getBackgroundColorAsCanvasGradientpublic final CanvasGradientItem getBackgroundColorAsCanvasGradient() Returns the background color as canvas gradient.- Returns:
- the background color or nullif is not a canvas gradient
 
 - 
getBackgroundColorAsPatternpublic final Pattern getBackgroundColorAsPattern() Returns the background color as pattern.- Returns:
- the background color or nullif is not a pattern
 
 - 
getBackgroundColorAsCanvasPatternpublic final CanvasPatternItem getBackgroundColorAsCanvasPattern() Returns the background color as canvas pattern.- Returns:
- the background color or nullif is not a canvas pattern
 
 - 
setBackgroundColorpublic final void setBackgroundColor(IsColor backgroundColor) Sets the background color.- Parameters:
- backgroundColor- the background color.
 
 - 
setBackgroundColorpublic final void setBackgroundColor(String backgroundColor) Sets the background color.- Parameters:
- backgroundColor- the background color.
 
 - 
setBackgroundColorpublic final void setBackgroundColor(CanvasGradientItem backgroundColor) Sets the background color as gradient.- Parameters:
- backgroundColor- the background color as gradient.
 
 - 
setBackgroundColorpublic final void setBackgroundColor(CanvasPatternItem backgroundColor) Sets the background color as pattern.- Parameters:
- backgroundColor- the background color as pattern.
 
 - 
getBorderWidthpublic int getBorderWidth() Returns the border width of the dataset item in pixels.- Returns:
- the border width of the dataset item in pixels.
 
 - 
setBorderWidthpublic final void setBorderWidth(int borderWidth) Sets the border width.- Parameters:
- borderWidth- the border width.
 
 - 
isBorderColorAsColorpublic final boolean isBorderColorAsColor() Returnstrueif the border color is defined as color.- Returns:
- trueif the border color is defined as color
 
 - 
isBorderColorAsGradientpublic final boolean isBorderColorAsGradient() Returnstrueif the border color is defined as gradient.- Returns:
- trueif the border color is defined as gradient
 
 - 
getBorderColorAsStringpublic final String getBorderColorAsString() Returns the color of the dataset item border- Returns:
- the color of the dataset item border.
 
 - 
getBorderColorpublic final IsColor getBorderColor() Returns the color of the dataset item border- Returns:
- the color of the dataset item border
 
 - 
getBorderColorAsGradientpublic final Gradient getBorderColorAsGradient() Returns the border color as gradient.- Returns:
- the border color or nullif is not a gradient
 
 - 
getBorderColorAsCanvasGradientpublic final CanvasGradientItem getBorderColorAsCanvasGradient() Returns the border color as canvas gradient.- Returns:
- the border color or nullif is not a canvas gradient
 
 - 
setBorderColorpublic final void setBorderColor(IsColor borderColor) Sets the border color.- Parameters:
- borderColor- the border color.
 
 - 
setBorderColorpublic final void setBorderColor(String borderColor) Sets the border color.- Parameters:
- borderColor- the border color.
 
 - 
setBorderColorpublic final void setBorderColor(CanvasGradientItem borderColor) Sets the border color as gradient.- Parameters:
- borderColor- the border color as gradient.
 
 - 
createTooltipLabelColorpublic 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
 
 - 
inRangepublic 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 value
- y- point Y value
- useFinalPosition- if the position must be calculated with final dimensions or also during the animation.
- Returns:
- trueif the point is in the element
 
 - 
inXRangepublic final boolean inXRange(double x, boolean useFinalPosition)Returns if the point X passed as the argument is in the element.- Parameters:
- x- point X value
- useFinalPosition- if the position must be calculated with final dimensions or also during the animation.
- Returns:
- trueif the point X is in the element
 
 - 
inYRangepublic final boolean inYRange(double y, boolean useFinalPosition)Returns if the point Y passed as the argument is in the element.- Parameters:
- y- point Y value
- useFinalPosition- if the position must be calculated with final dimensions or also during the animation.
- Returns:
- trueif the point Y is in the element
 
 
- 
 
-