Class ExtendedOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.AbstractModel<Options,IsDefaultOptions>
-
- org.pepstock.charba.client.options.Options
-
- org.pepstock.charba.client.options.ScaledOptions
-
- org.pepstock.charba.client.options.ExtendedOptions
-
- All Implemented Interfaces:
HasCallbackScope
,IsDefaultAnimationContainer
,IsDefaultAnimationTransition
,IsDefaultEventHandler
,IsDefaultOptions
,IsDefaultScaledOptions
,HasAnimationOptions
,HasEvents
,HasSpanGaps
public final class ExtendedOptions extends ScaledOptions
Options used internally inside the chart configuration.
This is the root element of configuration.
Extends the normal options (with scales) with all methods to add callbacks and events.
It provides also the method to set the CHARBA id when new chart is created.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pepstock.charba.client.options.Options
Options.CommonProperty
-
-
Constructor Summary
Constructors Constructor Description ExtendedOptions(IsChart chart, IsDefaultScaledOptions defaultValues, ChartEnvelop<NativeObject> envelop)
Creates an options with default provider.ExtendedOptions(IsChart chart, IsDefaultScaledOptions defaultValues, ConfigurationEnvelop<NativeObject> envelop)
Creates an options with default provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsChart
getChart()
Returns the chart instance which is using the options.<T extends NativeObjectContainer>
TgetRemappedOptions(ControllerMapperFactory<T> factory)
Returns the options, mapped with a custom object, used for controllers to map the options.
It uses a factory instance to create a customized options.
If factory argument is not consistent,null
is returned.ExtendedScales
getScales()
Returns the scale/axis defaults.Segment
getSegment()
Returns the segment configuration forLineOptions
.
Line segment styles can be overridden by scriptable options in the segment object..void
setCallback(ConfigurationEnvelop<AbstractNode> envelop, Key property, NativeCallback callback)
Adds a native callback function to a element node instance.void
setCallback(ConfigurationEnvelop<AbstractNode> envelop, Key property, CallbackProxy.Proxy proxy)
Adds a callback proxy function to a element node instance.void
setCharbaId(String id)
Sets the CHARBA id when new chart instance is created.void
setEvent(AbstractNode node, Key property, ConfigurationEnvelop<CallbackProxy.Proxy> envelop)
Adds a event proxy function to animation element instance.-
Methods inherited from class org.pepstock.charba.client.options.Options
getAnimation, getAnimationContainer, getAspectRatio, getBackgroundColor, getBackgroundColorAsString, getBorderColor, getBorderColorAsString, getCharbaId, getCircumference, getColor, getColorAsString, getCutout, getCutoutPercentage, getDatasets, getDecimation, getDevicePixelRatio, getElements, getEventsOptionHandler, getFiller, getFont, getHover, getIndexAxis, getInteraction, getLayout, getLegend, getLocale, getPlugins, getRadius, getRadiusPercentage, getResizeDelay, getRotation, getScope, getSpanGapHandler, getSubtitle, getTitle, getTooltips, isDestroyOnDetach, isDrawOnAttach, isMaintainAspectRatio, isResponsive, isShowLine, isSkipNull, isSpanGaps, setAspectRatio, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setCircumference, setColor, setColor, setCutout, setCutoutPercentage, setDestroyOnDetach, setDevicePixelRatio, setDrawOnAttach, setIndexAxis, setLocale, setMaintainAspectRatio, setRadius, setRadiusPercentage, setResizeDelay, setResponsive, setRotation, setShowLine, setSkipNull
-
Methods inherited from class org.pepstock.charba.client.options.AbstractModel
getDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.HasAnimationOptions
getAnimations, getTransitions, isAnimationEnabled, setAnimationEnabled
-
Methods inherited from interface org.pepstock.charba.client.options.HasEvents
getEvents, setEvents, setEvents
-
Methods inherited from interface org.pepstock.charba.client.options.HasSpanGaps
getSpanGaps, setSpanGaps, setSpanGaps
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultOptions
getAspectRatio, getBackgroundColorAsString, getBorderColorAsString, getCircumference, getColorAsString, getCutout, getCutoutPercentage, getDatasets, getDecimation, getDevicePixelRatio, getElements, getFiller, getFont, getHover, getIndexAxis, getInteraction, getLayout, getLegend, getLocale, getPlugins, getRadius, getRadiusPercentage, getResizeDelay, getRotation, getSubtitle, getTitle, getTooltips, isDestroyOnDetach, isDrawOnAttach, isMaintainAspectRatio, isResponsive, isShowLine, isSkipNull, isSpanGaps
-
-
-
-
Constructor Detail
-
ExtendedOptions
public ExtendedOptions(IsChart chart, IsDefaultScaledOptions defaultValues, ConfigurationEnvelop<NativeObject> envelop)
Creates an options with default provider.- Parameters:
chart
- chart instancedefaultValues
- default provider.envelop
- the envelop for options as native options
-
ExtendedOptions
public ExtendedOptions(IsChart chart, IsDefaultScaledOptions defaultValues, ChartEnvelop<NativeObject> envelop)
Creates an options with default provider.- Parameters:
chart
- chart instancedefaultValues
- default providerenvelop
- the envelop for options as native options
-
-
Method Detail
-
getChart
public IsChart getChart()
Returns the chart instance which is using the options.- Returns:
- the chart instance which is using the options
-
setCharbaId
public void setCharbaId(String id)
Sets the CHARBA id when new chart instance is created.- Parameters:
id
- CHARBA id.
-
getScales
public ExtendedScales getScales()
Description copied from interface:IsDefaultScaledOptions
Returns the scale/axis defaults.- Specified by:
getScales
in interfaceIsDefaultScaledOptions
- Overrides:
getScales
in classScaledOptions
- Returns:
- the scale/axis defaults.
-
getSegment
public Segment getSegment()
Returns the segment configuration forLineOptions
.
Line segment styles can be overridden by scriptable options in the segment object..- Returns:
- the segment configuration for
LineOptions
-
setCallback
public void setCallback(ConfigurationEnvelop<AbstractNode> envelop, Key property, CallbackProxy.Proxy proxy)
Adds a callback proxy function to a element node instance.- Parameters:
envelop
- contains the element node to updateproperty
- property nameproxy
- the function proxy to activate
-
setCallback
public void setCallback(ConfigurationEnvelop<AbstractNode> envelop, Key property, NativeCallback callback)
Adds a native callback function to a element node instance.- Parameters:
envelop
- contains the element node to updateproperty
- property namecallback
- the function callback to activate
-
setEvent
public void setEvent(AbstractNode node, Key property, ConfigurationEnvelop<CallbackProxy.Proxy> envelop)
Adds a event proxy function to animation element instance.- Parameters:
node
- options node element instance.property
- property name.envelop
- contains the function proxy to activate.
-
getRemappedOptions
public final <T extends NativeObjectContainer> T getRemappedOptions(ControllerMapperFactory<T> factory)
Returns the options, mapped with a custom object, used for controllers to map the options.
It uses a factory instance to create a customized options.
If factory argument is not consistent,null
is returned.- Type Parameters:
T
- type of customized options to return- Parameters:
factory
- factory instance to create a customized options- Returns:
- customized options.
If factory argument is not consistent,null
is returned.
-
-