Class LabelsOptions
- 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.labels.LabelsOptions
-
- All Implemented Interfaces:
IsDefaultEventHandler
,HasEvents
public final class LabelsOptions extends AbstractPluginOptions
This is the object to map theLabelsPlugin.ID
plugin options, both at chart and global level.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pepstock.charba.client.plugins.AbstractPluginOptions
AbstractPluginOptions.Property
-
-
Constructor Summary
Constructors Constructor Description LabelsOptions()
Creates newLabelsPlugin.ID
plugin options.LabelsOptions(IsChart chart)
Creates newLabelsPlugin.ID
plugin options, relating to chart instance for default.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Label
createLabel(String id)
Creates new label (if not exist) using the label if passed as argument.Label
createLabel(LabelId id)
Creates new label (if not exist) using the label if passed as argument.Label
getLabel(String id)
Returns the label with the id passed as argument ornull
if not exist.Label
getLabel(LabelId id)
Returns the label with the id passed as argument ornull
if not exist.List<Label>
getLabels()
Returns the collection of labels.boolean
hasLabel(String id)
Returnstrue
if the label with the id passed as argument exists.boolean
hasLabel(LabelId id)
Returnstrue
if the label with the id passed as argument exists.void
removeLabel(String id)
Removes the label by the id passed as argument, if exists.void
removeLabel(LabelId id)
Removes the label by the id passed as argument, if exists.-
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, 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
-
LabelsOptions
public LabelsOptions()
Creates newLabelsPlugin.ID
plugin options.
-
LabelsOptions
public LabelsOptions(IsChart chart)
Creates newLabelsPlugin.ID
plugin options, relating to chart instance for default.- Parameters:
chart
- chart instance related to the plugin options
-
-
Method Detail
-
createLabel
public Label createLabel(String id)
Creates new label (if not exist) using the label if passed as argument.- Parameters:
id
- label id to use- Returns:
- new empty label object
-
createLabel
public Label createLabel(LabelId id)
Creates new label (if not exist) using the label if passed as argument.- Parameters:
id
- label id to use- Returns:
- new empty label object
-
hasLabel
public boolean hasLabel(String id)
Returnstrue
if the label with the id passed as argument exists.- Parameters:
id
- label id to check- Returns:
true
if the label with the id passed as argument exists
-
hasLabel
public boolean hasLabel(LabelId id)
Returnstrue
if the label with the id passed as argument exists.- Parameters:
id
- label id to check- Returns:
true
if the label with the id passed as argument exists
-
removeLabel
public void removeLabel(String id)
Removes the label by the id passed as argument, if exists.- Parameters:
id
- label id to check
-
removeLabel
public void removeLabel(LabelId id)
Removes the label by the id passed as argument, if exists.- Parameters:
id
- label id to check
-
getLabels
public List<Label> getLabels()
Returns the collection of labels.- Returns:
- the collection of labels
-
getLabel
public Label getLabel(String id)
Returns the label with the id passed as argument ornull
if not exist.- Parameters:
id
- label id to use to retrieve the label- Returns:
- the label or
null
if not exist
-
-