Class SegmentContext
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.callbacks.ChartContext
-
- org.pepstock.charba.client.callbacks.SegmentContext
-
public final class SegmentContext extends ChartContext
The callback or handler context wrapper, created and passed bySegmentwhich contains the line charts references.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description SegmentContext(NativeObject nativeObject)Creates the object with native object instance to be wrapped, called byconfigurationpackage.
-
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.intgetDatasetIndex()Returns the index of the current data set.intgetEndDataIndex()Returns the index of the current data of ending point of segment.PointElementgetEndPoint()Returns thePointElementrelated to the data as ending point of segment.intgetStartDataIndex()Returns the index of the current data of starting point of segment.PointElementgetStartPoint()Returns thePointElementrelated to the data as starting point of segment.protected booleanisConsistent()Returnstrueif the context is consistent.
Custom context (the plugin ones) should extend it and check if the context is consistent before invoking the callback.-
Methods inherited from class org.pepstock.charba.client.callbacks.ChartContext
getAttribute, getAttribute, getAttribute, getAttribute, getAttributes, getChart, getType, hasAttributes, 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, 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
-
SegmentContext
public SegmentContext(NativeObject nativeObject)
Creates the object with native object instance to be wrapped, called byconfigurationpackage.- Parameters:
nativeObject- native object instance to be wrapped.
-
-
Method Detail
-
getStartPoint
public PointElement getStartPoint()
Returns thePointElementrelated to the data as starting point of segment.- Returns:
- the
PointElementrelated to the data as starting point of segment
-
getEndPoint
public PointElement getEndPoint()
Returns thePointElementrelated to the data as ending point of segment.- Returns:
- the
PointElementrelated to the data as ending point of segment
-
getDatasetIndex
public int getDatasetIndex()
Returns the index of the current data set.- Returns:
- the index of the current data set.
-
getStartDataIndex
public int getStartDataIndex()
Returns the index of the current data of starting point of segment.- Returns:
- the index of the current data of starting point of segment
-
getEndDataIndex
public int getEndDataIndex()
Returns the index of the current data of ending point of segment.- Returns:
- the index of the current data of ending point of segment
-
isConsistent
protected boolean isConsistent()
Description copied from class:ChartContextReturnstrueif the context is consistent.
Custom context (the plugin ones) should extend it and check if the context is consistent before invoking the callback.- Overrides:
isConsistentin classChartContext- Returns:
trueif the context is consistent
-
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.
-
-