Class DatasetsItemsSelectorOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.plugins.AbstractPluginOptions
-
- org.pepstock.charba.client.impl.plugins.DatasetsItemsSelectorOptions
-
- All Implemented Interfaces:
IsDefaultEventHandler,HasEvents
public final class DatasetsItemsSelectorOptions extends AbstractPluginOptions
Configuration options ofDatasetsItemsSelector.IDplugin.
It is managing:
- the X axis ID
- the Y axis ID
- the selection color
- the border color
- the border width
- the border dash
- the border dash offset
- flag to fire event on update
- flag to activate clean selection by
KeyboardUiKey.ESCAPE - "clear" options
- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_ALPHADefault alpha of selecting/selection colors, 0.3.static DefaultScaleIdDEFAULT_AXIS_IDDefault X axis id,DefaultScaleId.X.static IsColorDEFAULT_BORDER_COLORDefault border color for area,GwtMaterialColor.GREY_DARKEN_2.static doubleDEFAULT_BORDER_DASH_OFFSETDefault border dash offset of selection area, 0.0.static intDEFAULT_BORDER_WIDTHDefault border width of selection area, 0.static booleanDEFAULT_CLEAR_BY_ESCAPE_ENABLEDDefault flag option to activate clear selection byKeyboardUiKey.ESCAPE, true.static IsColorDEFAULT_COLORDefault color for area,GwtMaterialColor.ORANGE_LIGHTEN_3, alpha 0.3.static booleanDEFAULT_ENABLEDDefault enabled options, true.
-
Constructor Summary
Constructors Constructor Description DatasetsItemsSelectorOptions()Builds the object with new java script object setting the default value of plugin.
The global plugin options is used, if exists, as defaults values.DatasetsItemsSelectorOptions(IsChart chart)Builds the object with a chart instance in order to get the right defaults.
If the plugin options have not been set by chart type, it will use the global.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColorgetBorderColor()Returns the color.StringgetBorderColorAsString()Returns the color.List<Integer>getBorderDash()Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.doublegetBorderDashOffset()Returns the line dash pattern offset.intgetBorderWidth()Returns the border width of the selection.IsColorgetColor()Returns the color.StringgetColorAsString()Returns the color.ModifierKeygetModifierKey()Returns the modifier key to activate selection.SelectionCleanergetSelectionCleaner()Returns the selection cleaner element.ScaleIdgetXAxisID()Returns the ID of the x axis to plot this dataset on.ScaleIdgetYAxisID()Returns the ID of the y axis to plot this dataset on.booleanisEnabled()Returnstrueif plugin is enabled.booleanisEnabledClearByEscape()Returnstrueif you want to clear selection byKeyboardUiKey.ESCAPE.voidsetBorderColor(String color)Sets the color.voidsetBorderColor(IsColor color)Sets the color.voidsetBorderDash(int... borderDash)Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.voidsetBorderDashOffset(double borderDashOffset)Sets the line dash pattern offset.voidsetBorderWidth(int borderWidth)Sets the border width of the selection.voidsetColor(String color)Sets the color.voidsetColor(IsColor color)Sets the color.voidsetEnabled(boolean enabled)Setstrueif plugin is enabled.voidsetEnabledClearByEscape(boolean enabled)Setstrueif you want to clear selection byKeyboardUiKey.ESCAPE.voidsetEvents(Set<IsEvent> events)Sets the browser events that the legend should listen to.voidsetEvents(IsEvent... events)Sets the browser events that the chart should listen to.voidsetModifierKey(ModifierKey modifierKey)Sets the modifier key to activate selection.voidsetXAxisID(String xAxisID)Sets the ID of the x axis to plot this dataset on.voidsetXAxisID(ScaleId xAxisID)Sets the ID of the x axis to plot this dataset on.voidsetYAxisID(String yAxisID)Sets the ID of the y axis to plot this dataset on.voidsetYAxisID(ScaleId yAxisID)Sets the ID of the y axis to plot this dataset on.-
Methods inherited from class org.pepstock.charba.client.plugins.AbstractPluginOptions
applyingDefaults, applyingDefaults, getEventsOptionHandler, getId, getPluginId, loadGlobalsPluginOptions, store, store, store, store
-
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
-
-
-
-
Field Detail
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
Default enabled options, true.- See Also:
- Constant Field Values
-
DEFAULT_ALPHA
public static final double DEFAULT_ALPHA
Default alpha of selecting/selection colors, 0.3.- See Also:
- Constant Field Values
-
DEFAULT_COLOR
public static final IsColor DEFAULT_COLOR
Default color for area,GwtMaterialColor.ORANGE_LIGHTEN_3, alpha 0.3.
-
DEFAULT_AXIS_ID
public static final DefaultScaleId DEFAULT_AXIS_ID
Default X axis id,DefaultScaleId.X.
-
DEFAULT_BORDER_WIDTH
public static final int DEFAULT_BORDER_WIDTH
Default border width of selection area, 0.- See Also:
- Constant Field Values
-
DEFAULT_BORDER_DASH_OFFSET
public static final double DEFAULT_BORDER_DASH_OFFSET
Default border dash offset of selection area, 0.0.- See Also:
- Constant Field Values
-
DEFAULT_BORDER_COLOR
public static final IsColor DEFAULT_BORDER_COLOR
Default border color for area,GwtMaterialColor.GREY_DARKEN_2.
-
DEFAULT_CLEAR_BY_ESCAPE_ENABLED
public static final boolean DEFAULT_CLEAR_BY_ESCAPE_ENABLED
Default flag option to activate clear selection byKeyboardUiKey.ESCAPE, true.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DatasetsItemsSelectorOptions
public DatasetsItemsSelectorOptions()
Builds the object with new java script object setting the default value of plugin.
The global plugin options is used, if exists, as defaults values.
-
DatasetsItemsSelectorOptions
public DatasetsItemsSelectorOptions(IsChart chart)
Builds the object with a chart instance in order to get the right defaults.
If the plugin options have not been set by chart type, it will use the global.- Parameters:
chart- chart instance related to the plugin options
-
-
Method Detail
-
setEvents
public void setEvents(IsEvent... events)
Description copied from interface:HasEventsSets the browser events that the chart should listen to.
-
setEvents
public void setEvents(Set<IsEvent> events)
Description copied from interface:HasEventsSets the browser events that the legend should listen to.
-
getSelectionCleaner
public SelectionCleaner getSelectionCleaner()
Returns the selection cleaner element.- Returns:
- the selection cleaner element
-
setEnabled
public void setEnabled(boolean enabled)
Setstrueif plugin is enabled.- Parameters:
enabled-trueif plugin is enabled.
-
isEnabled
public boolean isEnabled()
Returnstrueif plugin is enabled.- Returns:
trueif plugin is enabled.
-
setEnabledClearByEscape
public void setEnabledClearByEscape(boolean enabled)
Setstrueif you want to clear selection byKeyboardUiKey.ESCAPE.- Parameters:
enabled-trueif you want to clear selection byKeyboardUiKey.ESCAPE.
-
isEnabledClearByEscape
public boolean isEnabledClearByEscape()
Returnstrueif you want to clear selection byKeyboardUiKey.ESCAPE.- Returns:
trueif you want to clear selection byKeyboardUiKey.ESCAPE.
-
setXAxisID
public void setXAxisID(String xAxisID)
Sets the ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found x axis.- Parameters:
xAxisID- the ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found x axis.
-
setXAxisID
public void setXAxisID(ScaleId xAxisID)
Sets the ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found x axis.- Parameters:
xAxisID- the ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found x axis.
-
getXAxisID
public ScaleId getXAxisID()
Returns the ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found x axis.- Returns:
- the ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found x axis.
-
setYAxisID
public void setYAxisID(String yAxisID)
Sets the ID of the y axis to plot this dataset on. If not specified, the chart area is used.- Parameters:
yAxisID- the ID of the y axis to plot this dataset on. If not specified, the chart area is used.
-
setYAxisID
public void setYAxisID(ScaleId yAxisID)
Sets the ID of the y axis to plot this dataset on. If not specified, the chart area is used.- Parameters:
yAxisID- the ID of the y axis to plot this dataset on. If not specified, the chart area is used.
-
getYAxisID
public ScaleId getYAxisID()
Returns the ID of the y axis to plot this dataset on. If not specified, the chart area is used.- Returns:
- the ID of the y axis to plot this dataset on. If not specified, the chart area is used.
-
getColorAsString
public String getColorAsString()
Returns the color.- Returns:
- the color.
-
getColor
public IsColor getColor()
Returns the color.- Returns:
- the color.
-
setColor
public void setColor(String color)
Sets the color.- Parameters:
color- the color.
-
setColor
public void setColor(IsColor color)
Sets the color.- Parameters:
color- the color.
-
setBorderDash
public void setBorderDash(int... borderDash)
Sets the line dash pattern used when stroking lines, 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 lines
-
getBorderDash
public List<Integer> getBorderDash()
Returns the line dash pattern used when stroking lines, 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 lines.
-
setBorderDashOffset
public void setBorderDashOffset(double borderDashOffset)
Sets the line dash pattern offset.- Parameters:
borderDashOffset- the line dash pattern offset.
-
getBorderDashOffset
public double getBorderDashOffset()
Returns the line dash pattern offset.- Returns:
- the line dash pattern offset.
-
setBorderWidth
public void setBorderWidth(int borderWidth)
Sets the border width of the selection.- Parameters:
borderWidth- the border width of the selection.
-
getBorderWidth
public int getBorderWidth()
Returns the border width of the selection.- Returns:
- list of the border width of the selection.
-
getBorderColorAsString
public String getBorderColorAsString()
Returns the color.- Returns:
- the color.
-
getBorderColor
public IsColor getBorderColor()
Returns the color.- Returns:
- the color.
-
setBorderColor
public void setBorderColor(String color)
Sets the color.- Parameters:
color- the color.
-
setBorderColor
public void setBorderColor(IsColor color)
Sets the color.- Parameters:
color- the color.
-
setModifierKey
public void setModifierKey(ModifierKey modifierKey)
Sets the modifier key to activate selection.- Parameters:
modifierKey- the modifier key to activate selection
-
getModifierKey
public ModifierKey getModifierKey()
Returns the modifier key to activate selection.- Returns:
- the modifier key to activate selection
-
-