Class AbstractDatasetContext
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.callbacks.ChartContext
-
- org.pepstock.charba.client.callbacks.AbstractDatasetContext
-
- Direct Known Subclasses:
DataLabelsContext
,DatasetContext
,LabelsContext
public abstract class AbstractDatasetContext extends ChartContext
The option context is used to give contextual information when resolving options where the data set locator (data and data set index) must be used.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDatasetContext(NativeObject nativeObject)
Creates the object with native object instance to be wrapped.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkIfPropertyIsValid(Key property)
Checks if the key passed as argument is a key already used for other context properties.int
getDataIndex()
Returns the index of the current data.DatasetElement
getDatasetElement()
Returns theDatasetElement
related to the context, if there is, otherwisenull
.int
getDatasetIndex()
Returns the index of the current data set.DatasetItem
getDatasetItem()
Returns theDatasetItem
related to the context, if there is, otherwisenull
.TransitionKey
getMode()
Returns the update mode.boolean
isActive()
Returns true if element is active (hovered).-
Methods inherited from class org.pepstock.charba.client.callbacks.ChartContext
getAttribute, getAttribute, getAttribute, getAttribute, getAttributes, getChart, getType, hasAttributes, isConsistent, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes
-
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, 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
-
AbstractDatasetContext
protected AbstractDatasetContext(NativeObject nativeObject)
Creates the object with native object instance to be wrapped.- Parameters:
nativeObject
- native object instance to be wrapped
-
-
Method Detail
-
isActive
public final boolean isActive()
Returns true if element is active (hovered).- Returns:
- true if element is active (hovered)
-
getMode
public final TransitionKey getMode()
Returns the update mode.- Returns:
- the update mode
-
getDatasetIndex
public final int getDatasetIndex()
Returns the index of the current data set.- Returns:
- the index of the current data set.
-
getDataIndex
public final int getDataIndex()
Returns the index of the current data.- Returns:
- the index of the current data.
-
getDatasetItem
public final DatasetItem getDatasetItem()
Returns theDatasetItem
related to the context, if there is, otherwisenull
.- Returns:
- the
DatasetItem
related to the context, if there is, otherwisenull
-
getDatasetElement
public final DatasetElement getDatasetElement()
Returns theDatasetElement
related to the context, if there is, otherwisenull
.- Returns:
- the
DatasetElement
related to the context, if there is, otherwisenull
-
checkIfPropertyIsValid
protected boolean checkIfPropertyIsValid(Key property)
Description copied from class:ChartContext
Checks if the key passed as argument is a key already used for other context properties.- Overrides:
checkIfPropertyIsValid
in classChartContext
- Parameters:
property
- property to use to store a custom attribute- Returns:
true
if the property can be used to store an attribute.
-
-