Class AnnotationOptions
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.commons.AbstractNode
- 
- org.pepstock.charba.client.plugins.AbstractPluginOptions
- 
- org.pepstock.charba.client.annotation.AnnotationOptions
 
 
 
 
- 
- All Implemented Interfaces:
- HasCallbackScope,- IsDefaultEventHandler,- HasEvents
 
 public final class AnnotationOptions extends AbstractPluginOptions implements HasCallbackScope This is theAnnotationPlugin.IDplugin options where to set all configuration items needed to the plugin.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Field SummaryFields Modifier and Type Field Description static DrawTimeDEFAULT_DRAW_TIMEDefault draw time,DrawTime.AFTER_DATASETS_DRAW.
 - 
Constructor SummaryConstructors Constructor Description AnnotationOptions()Creates newAnnotationPlugin.IDplugin options.AnnotationOptions(IsChart chart)Creates newAnnotationPlugin.IDplugin options, relating to chart instance for default.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description voidaddAnnotations(AbstractAnnotation... annotations)Adds an annotations for plugin.protected voidapplyingDefaults()This is invoked before storing the plugins options as default.IsAnimationsgetAnimations()Returns the configuration to manage the annotation animationsAbstractAnnotationgetAnnotation(String id)Returns the annotation with the id passed as argument ornullif not exist.AbstractAnnotationgetAnnotation(AnnotationId id)Returns the annotation with the id passed as argument ornullif not exist.List<AbstractAnnotation>getAnnotations()Returns the collection of annotations.default ClickCallbackgetClickCallback()Returns the callback called when a "click" event is occurring.DrawTimegetDrawTime()Returns the draw time which defines when the annotations are drawn.default EnterCallbackgetEnterCallback()Returns the callback called when a "enter" event is occurring.org.pepstock.charba.client.annotation.EventsHandlergetEventsHandler()InteractiongetInteraction()Returns the configuration which events trigger plugin interactionsdefault LeaveCallbackgetLeaveCallback()Returns the callback called when a "leave" event is occurring.StringgetScope()Returns the scope of the options, which is the annotation plugin.booleanhasAnnotation(String id)Returnstrueif the annotation with the id passed as argument exists.booleanhasAnnotation(AnnotationId id)Returnstrueif the annotation with the id passed as argument exists.booleanisClip()Returns if clips relative to the chart area.voidremoveAnnotation(String id)Removes the annotation by the id passed as argument, if exists.voidremoveAnnotation(AnnotationId id)Removes the annotation by the id passed as argument, if exists.voidsetAnnotations(AbstractAnnotation... annotations)Sets a set of annotations for plugin.default voidsetClickCallback(ClickCallback clickCallback)Sets the callback called when a "click" event is occurring.voidsetClip(boolean clip)Sets how to clip relative to the chart area.
 Iffalseallows overflow, otherwisetrueclips that many pixels inside the chart area.voidsetDrawTime(DrawTime drawTime)Sets the draw time which defines when the annotations are drawn.default voidsetEnterCallback(EnterCallback enterCallback)Sets the callback called when a "enter" event is occurring.default voidsetLeaveCallback(LeaveCallback leaveCallback)Sets the callback called when a "leave" event is occurring.- 
Methods inherited from class org.pepstock.charba.client.plugins.AbstractPluginOptionsapplyingDefaults, getEventsOptionHandler, getId, getPluginId, loadGlobalsPluginOptions, store, store, store, store
 - 
Methods inherited from class org.pepstock.charba.client.commons.AbstractNodecheckAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, 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.NativeObjectContainercheckAndGetColor, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_DRAW_TIMEpublic static final DrawTime DEFAULT_DRAW_TIME Default draw time,DrawTime.AFTER_DATASETS_DRAW.
 
- 
 - 
Constructor Detail- 
AnnotationOptionspublic AnnotationOptions() Creates newAnnotationPlugin.IDplugin options.
 - 
AnnotationOptionspublic AnnotationOptions(IsChart chart) Creates newAnnotationPlugin.IDplugin options, relating to chart instance for default.- Parameters:
- chart- chart instance related to the plugin options
 
 
- 
 - 
Method Detail- 
applyingDefaultsprotected void applyingDefaults() Description copied from class:AbstractPluginOptionsThis is invoked before storing the plugins options as default.- Overrides:
- applyingDefaultsin class- AbstractPluginOptions
 
 - 
getEventsHandlerpublic org.pepstock.charba.client.annotation.EventsHandler getEventsHandler() 
 - 
getInteractionpublic Interaction getInteraction() Returns the configuration which events trigger plugin interactions- Returns:
- the configuration which events trigger plugin interactions
 
 - 
getAnimationspublic IsAnimations getAnimations() Returns the configuration to manage the annotation animations- Returns:
- the configuration to manage the annotation animations
 
 - 
getScopepublic String getScope() Returns the scope of the options, which is the annotation plugin.- Specified by:
- getScopein interface- HasCallbackScope
- Returns:
- the scope of the options
 
 - 
setClippublic void setClip(boolean clip) Sets how to clip relative to the chart area.
 Iffalseallows overflow, otherwisetrueclips that many pixels inside the chart area.- Parameters:
- clip- If- falseallows overflow, otherwise- trueclips that many pixels inside the chart area.
 
 - 
isClippublic boolean isClip() Returns if clips relative to the chart area.- Returns:
- trueif clips relative to the chart area.
 
 - 
setDrawTimepublic void setDrawTime(DrawTime drawTime) Sets the draw time which defines when the annotations are drawn.- Parameters:
- drawTime- the draw time which defines when the annotations are drawn
 
 - 
getDrawTimepublic DrawTime getDrawTime() Returns the draw time which defines when the annotations are drawn.- Returns:
- the draw time which defines when the annotations are drawn
 
 - 
hasAnnotationpublic boolean hasAnnotation(String id) Returnstrueif the annotation with the id passed as argument exists.- Parameters:
- id- annotation id to check
- Returns:
- trueif the annotation with the id passed as argument exists
 
 - 
hasAnnotationpublic boolean hasAnnotation(AnnotationId id) Returnstrueif the annotation with the id passed as argument exists.- Parameters:
- id- annotation id to check
- Returns:
- trueif the annotation with the id passed as argument exists
 
 - 
removeAnnotationpublic void removeAnnotation(String id) Removes the annotation by the id passed as argument, if exists.- Parameters:
- id- annotation id to check
 
 - 
removeAnnotationpublic void removeAnnotation(AnnotationId id) Removes the annotation by the id passed as argument, if exists.- Parameters:
- id- annotation id to check
 
 - 
addAnnotationspublic void addAnnotations(AbstractAnnotation... annotations) Adds an annotations for plugin.- Parameters:
- annotations- set of annotations.
 
 - 
setAnnotationspublic void setAnnotations(AbstractAnnotation... annotations) Sets a set of annotations for plugin. If argument isnull, removes all annotations.- Parameters:
- annotations- set of annotations. If- null, removes all annotations
 
 - 
getAnnotationspublic List<AbstractAnnotation> getAnnotations() Returns the collection of annotations.- Returns:
- the collection of annotations
 
 - 
getAnnotationpublic AbstractAnnotation getAnnotation(String id) Returns the annotation with the id passed as argument ornullif not exist.- Parameters:
- id- annotation id to use to retrieve the annotation
- Returns:
- the annotation or nullif not exist
 
 - 
getAnnotationpublic AbstractAnnotation getAnnotation(AnnotationId id) Returns the annotation with the id passed as argument ornullif not exist.- Parameters:
- id- annotation id to check
- Returns:
- the annotation with the id passed as argument or nullif not exist
 
 - 
getEnterCallbackpublic default EnterCallback getEnterCallback() Returns the callback called when a "enter" event is occurring.- Returns:
- the callback called when a "enter" event is occurring
 
 - 
setEnterCallbackpublic default void setEnterCallback(EnterCallback enterCallback) Sets the callback called when a "enter" event is occurring.- Parameters:
- enterCallback- the callback called when a "enter" event is occurring
 
 - 
getLeaveCallbackpublic default LeaveCallback getLeaveCallback() Returns the callback called when a "leave" event is occurring.- Returns:
- the callback called when a "leave" event is occurring
 
 - 
setLeaveCallbackpublic default void setLeaveCallback(LeaveCallback leaveCallback) Sets the callback called when a "leave" event is occurring.- Parameters:
- leaveCallback- the callback called when a "leave" event is occurring
 
 - 
getClickCallbackpublic default ClickCallback getClickCallback() Returns the callback called when a "click" event is occurring.- Returns:
- the callback called when a "click" event is occurring
 
 - 
setClickCallbackpublic default void setClickCallback(ClickCallback clickCallback) Sets the callback called when a "click" event is occurring.- Parameters:
- clickCallback- the callback called when a "click" event is occurring
 
 
- 
 
-