public class ChartContext extends NativeObjectContainer
Constructor and Description |
---|
ChartContext(NativeObject nativeObject)
Creates the object with native object instance to be wrapped.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkIfPropertyIsValid(Key property)
Checks if the key passed as argument is a key already used for other context properties.
|
boolean |
getAttribute(Key key,
boolean defaultValue)
Returns a custom field value from data point.
|
double |
getAttribute(Key key,
double defaultValue)
Returns a custom field value from data point.
|
int |
getAttribute(Key key,
int defaultValue)
Returns a custom field value from data point.
|
String |
getAttribute(Key key,
String defaultValue)
Returns a custom field value from data point.
|
<T extends NativeObjectContainer> |
getAttributes(NativeObjectContainerFactory<T> factory)
Returns the attributes, if exist.
|
IsChart |
getChart()
Returns the CHARBA chart instance.
|
ContextType |
getType()
Returns the type of the context.
|
boolean |
hasAttributes()
Checks if there is any attribute node.
|
protected boolean |
isConsistent()
Returns
true if the context is consistent.Custom context (the plugin ones) should extend it and check if the context is consistent before invoking the callback. |
void |
setAttribute(Key key,
boolean value)
Sets a custom field to data point.
|
void |
setAttribute(Key key,
double value)
Sets a custom field to data point.
|
void |
setAttribute(Key key,
int value)
Sets a custom field to data point.
|
void |
setAttribute(Key key,
String value)
Sets a custom field to data point.
|
<T extends NativeObjectContainer> |
setAttributes(T attributes)
Sets the additional attributes.
|
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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public ChartContext(NativeObject nativeObject)
nativeObject
- native object instance to be wrapped.public final IsChart getChart()
public final ContextType getType()
public final <T extends NativeObjectContainer> void setAttributes(T attributes)
T
- type of native object container to storeattributes
- additional attributes instance.public final boolean hasAttributes()
true
if there is an attributes node, otherwise false
.public final <T extends NativeObjectContainer> T getAttributes(NativeObjectContainerFactory<T> factory)
T
- type of native object container to returnfactory
- factory instance to create a native object container.public final void setAttribute(Key key, double value)
key
- key of java script object to set.value
- value to set.public final double getAttribute(Key key, double defaultValue)
key
- key of java script object to get.defaultValue
- default value if the property is missingpublic final void setAttribute(Key key, boolean value)
key
- key of java script object to set.value
- value to set.public final boolean getAttribute(Key key, boolean defaultValue)
key
- key of java script object to get.defaultValue
- default value if the property is missingpublic final void setAttribute(Key key, int value)
key
- key of java script object to set.value
- value to set.public final int getAttribute(Key key, int defaultValue)
key
- key of java script object to get.defaultValue
- default value if the property is missingpublic final void setAttribute(Key key, String value)
key
- key of java script object to set.value
- value to set.public final String getAttribute(Key key, String defaultValue)
key
- key of java script object to get.defaultValue
- default value if the property is missingprotected boolean isConsistent()
true
if the context is consistent.true
if the context is consistentprotected boolean checkIfPropertyIsValid(Key property)
property
- property to use to store a custom attributetrue
if the property can be used to store an attribute.