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 protectedAbstractDatasetContext(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 booleancheckIfPropertyIsValid(Key property)Checks if the key passed as argument is a key already used for other context properties.intgetDataIndex()Returns the index of the current data.DatasetElementgetDatasetElement()Returns theDatasetElementrelated to the context, if there is, otherwisenull.intgetDatasetIndex()Returns the index of the current data set.DatasetItemgetDatasetItem()Returns theDatasetItemrelated to the context, if there is, otherwisenull.TransitionKeygetMode()Returns the update mode.booleanisActive()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 theDatasetItemrelated to the context, if there is, otherwisenull.- Returns:
- the
DatasetItemrelated to the context, if there is, otherwisenull
-
getDatasetElement
public final DatasetElement getDatasetElement()
Returns theDatasetElementrelated to the context, if there is, otherwisenull.- Returns:
- the
DatasetElementrelated to the context, if there is, otherwisenull
-
checkIfPropertyIsValid
protected boolean checkIfPropertyIsValid(Key property)
Description copied from class:ChartContextChecks if the key passed as argument is a key already used for other context properties.- Overrides:
checkIfPropertyIsValidin classChartContext- Parameters:
property- property to use to store a custom attribute- Returns:
trueif the property can be used to store an attribute.
-
-