Class AbstractAnnotation
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.annotation.AbstractAnnotation
-
- Direct Known Subclasses:
BoxAnnotation,EllipseAnnotation,LineAnnotation,PointAnnotation
public abstract class AbstractAnnotation extends AbstractNode
Base class to define an annotation in theAnnotationPlugin.IDplugin.
It contains all commons properties to define an annotation.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ADJUST_SCALE_RANGEDefault annotation adjust scale range, true.static booleanDEFAULT_DISPLAYDefault annotation display, true.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Default Methods Modifier and Type Method Description AdjustScaleRangeCallbackgetAdjustScaleRangeCallback()Returns the callback called to set whether the scale range should be adjusted if this annotation is out of range.IsColorgetBorderColor()Returns the color of the border of annotation.default StringgetBorderColorAsString()Returns the color of the border of annotation.ColorCallback<AnnotationContext>getBorderColorCallback()Returns the callback called to set the color of the border of annotation.List<Integer>getBorderDash()Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.BorderDashCallback<AnnotationContext>getBorderDashCallback()Returns the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.doublegetBorderDashOffset()Returns the line dash pattern offset.BorderDashOffsetCallback<AnnotationContext>getBorderDashOffsetCallback()Returns the callback called to set the line dash pattern offset.intgetBorderWidth()Returns the width of the border in pixels.WidthCallback<AnnotationContext>getBorderWidthCallback()Returns the callback called to set the width of the border in pixels.ClickCallbackgetClickCallback()Returns the callback called when a "click" event is occurring.DisplayCallback<AnnotationContext>getDisplayCallback()Returns the callback called to set whether the annotation should be displayed.DoubleClickCallbackgetDoubleClickCallback()Returns the callback called when a "dblclick" event is occurring.DrawTimegetDrawTime()Returns the draw time which defines when the annotations are drawn.DrawTimeCallbackgetDrawTimeCallback()Returns the callback called to set the draw time which defines when the annotations are drawn.EnterCallbackgetEnterCallback()Returns the callback called when a "enter" event is occurring.AnnotationIdgetId()Returns the id of annotation.LeaveCallbackgetLeaveCallback()Returns the callback called when a "leave" event is occurring.AnnotationTypegetType()Returns the type of annotation.booleanisAdjustScaleRange()Returnstruewhether the scale range should be adjusted if this annotation is out of range.booleanisDisplay()Returnstruewhether the annotation should be displayed.voidsetAdjustScaleRange(boolean display)Setstruewhether the scale range should be adjusted if this annotation is out of range.voidsetAdjustScaleRange(AdjustScaleRangeCallback adjustScaleRangeCallback)Sets the callback to set whether the scale range should be adjusted if this annotation is out of range.voidsetAdjustScaleRange(NativeCallback adjustScaleRangeCallback)Sets the callback to set whether the scale range should be adjusted if this annotation is out of range.voidsetBorderColor(String borderColor)Sets the color of the border of annotation.voidsetBorderColor(ColorCallback<AnnotationContext> borderColorCallback)Sets the callback to set the color of the border of annotation.voidsetBorderColor(NativeCallback borderColorCallback)Sets the callback to set the color of the border of annotation.voidsetBorderColor(IsColor borderColor)Sets the color of the border of annotation.voidsetBorderDash(int... borderDash)Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.voidsetBorderDash(BorderDashCallback<AnnotationContext> borderDashCallback)Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.voidsetBorderDash(NativeCallback borderDashCallback)Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.voidsetBorderDashOffset(double borderDashOffset)Sets the line dash pattern offset.voidsetBorderDashOffset(BorderDashOffsetCallback<AnnotationContext> borderDashOffsetCallback)Sets the callback to set the line dash pattern offset.voidsetBorderDashOffset(NativeCallback borderDashOffsetCallback)Sets the callback to set the line dash pattern offset.voidsetBorderWidth(int borderWidth)Sets the width of the border in pixels.voidsetBorderWidth(NativeCallback borderWidthCallback)Sets the callback to set the color of the width of the border in pixels.voidsetBorderWidth(WidthCallback<AnnotationContext> borderWidthCallback)Sets the callback to set the color of the width of the border in pixels.voidsetClickCallback(ClickCallback clickCallback)Sets the callback called when a "click" event is occurring.voidsetDisplay(boolean display)Setstruewhether the annotation should be displayed.voidsetDisplay(DisplayCallback<AnnotationContext> displayCallback)Sets the callback to set whether the annotation should be displayed.voidsetDisplay(NativeCallback displayCallback)Sets the callback to set whether the annotation should be displayed.voidsetDoubleClickCallback(DoubleClickCallback dblclickCallback)Sets the callback called when a "dblclick" event is occurring.voidsetDrawTime(DrawTimeCallback drawTimeCallback)Sets the callback to set the draw time which defines when the annotations are drawn.voidsetDrawTime(DrawTime drawTime)Sets the draw time which defines when the annotations are drawn.voidsetDrawTime(NativeCallback drawTimeCallback)Sets the callback to set the draw time which defines when the annotations are drawn.voidsetEnterCallback(EnterCallback enterCallback)Sets the callback called when a "enter" event is occurring.voidsetLeaveCallback(LeaveCallback leaveCallback)Sets the callback called when a "leave" event is occurring.-
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, 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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Field Detail
-
DEFAULT_DISPLAY
public static final boolean DEFAULT_DISPLAY
Default annotation display, true.- See Also:
- Constant Field Values
-
DEFAULT_ADJUST_SCALE_RANGE
public static final boolean DEFAULT_ADJUST_SCALE_RANGE
Default annotation adjust scale range, true.- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public final AnnotationId getId()
Returns the id of annotation.- Returns:
- the id of annotation
-
getType
public final AnnotationType getType()
Returns the type of annotation.- Returns:
- the type of annotation
-
setDisplay
public final void setDisplay(boolean display)
Setstruewhether the annotation should be displayed.- Parameters:
display-truewhether the annotation should be displayed
-
isDisplay
public final boolean isDisplay()
Returnstruewhether the annotation should be displayed.- Returns:
truewhether the annotation should be displayed
-
setAdjustScaleRange
public final void setAdjustScaleRange(boolean display)
Setstruewhether the scale range should be adjusted if this annotation is out of range.- Parameters:
display-truewhether the scale range should be adjusted if this annotation is out of range
-
isAdjustScaleRange
public final boolean isAdjustScaleRange()
Returnstruewhether the scale range should be adjusted if this annotation is out of range.- Returns:
truewhether the scale range should be adjusted if this annotation is out of range
-
setDrawTime
public final 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
-
getDrawTime
public final DrawTime getDrawTime()
Returns the draw time which defines when the annotations are drawn.- Returns:
- the draw time which defines when the annotations are drawn
-
setBorderColor
public final void setBorderColor(IsColor borderColor)
Sets the color of the border of annotation.- Parameters:
borderColor- the color of the border of annotation
-
setBorderColor
public final void setBorderColor(String borderColor)
Sets the color of the border of annotation.- Parameters:
borderColor- the color of the border of annotation
-
getBorderColor
public final IsColor getBorderColor()
Returns the color of the border of annotation.- Returns:
- the color of the border of annotation
-
setBorderWidth
public final void setBorderWidth(int borderWidth)
Sets the width of the border in pixels.- Parameters:
borderWidth- the width of the border in pixels.
-
setBorderDash
public final void setBorderDash(int... borderDash)
Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
borderDash- the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
-
getBorderDash
public final List<Integer> getBorderDash()
Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Returns:
- the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
-
setBorderDashOffset
public final void setBorderDashOffset(double borderDashOffset)
Sets the line dash pattern offset.- Parameters:
borderDashOffset- the line dash pattern offset.
-
getBorderDashOffset
public final double getBorderDashOffset()
Returns the line dash pattern offset.- Returns:
- the line dash pattern offset.
-
getDrawTimeCallback
public final DrawTimeCallback getDrawTimeCallback()
Returns the callback called to set the draw time which defines when the annotations are drawn.- Returns:
- the callback called to set the draw time which defines when the annotations are drawn
-
setDrawTime
public final void setDrawTime(DrawTimeCallback drawTimeCallback)
Sets the callback to set the draw time which defines when the annotations are drawn.- Parameters:
drawTimeCallback- to set the draw time which defines when the annotations are drawn
-
setDrawTime
public final void setDrawTime(NativeCallback drawTimeCallback)
Sets the callback to set the draw time which defines when the annotations are drawn.- Parameters:
drawTimeCallback- to set the draw time which defines when the annotations are drawn
-
getDisplayCallback
public final DisplayCallback<AnnotationContext> getDisplayCallback()
Returns the callback called to set whether the annotation should be displayed.- Returns:
- the callback called to set whether the annotation should be displayed
-
setDisplay
public final void setDisplay(DisplayCallback<AnnotationContext> displayCallback)
Sets the callback to set whether the annotation should be displayed.- Parameters:
displayCallback- to set whether the annotation should be displayed
-
setDisplay
public final void setDisplay(NativeCallback displayCallback)
Sets the callback to set whether the annotation should be displayed.- Parameters:
displayCallback- to set whether the annotation should be displayed
-
getBorderColorCallback
public final ColorCallback<AnnotationContext> getBorderColorCallback()
Returns the callback called to set the color of the border of annotation.- Returns:
- the callback called to set the color of the border of annotation
-
setBorderColor
public final void setBorderColor(ColorCallback<AnnotationContext> borderColorCallback)
Sets the callback to set the color of the border of annotation.- Parameters:
borderColorCallback- to set the color of the border of annotation
-
setBorderColor
public final void setBorderColor(NativeCallback borderColorCallback)
Sets the callback to set the color of the border of annotation.- Parameters:
borderColorCallback- to set the color of the border of annotation
-
getBorderWidthCallback
public final WidthCallback<AnnotationContext> getBorderWidthCallback()
Returns the callback called to set the width of the border in pixels.- Returns:
- the callback called to set the width of the border in pixels
-
setBorderWidth
public final void setBorderWidth(WidthCallback<AnnotationContext> borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.- Parameters:
borderWidthCallback- to set the width of the border in pixels
-
setBorderWidth
public final void setBorderWidth(NativeCallback borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.- Parameters:
borderWidthCallback- to set the width of the border in pixels
-
getBorderDashCallback
public final BorderDashCallback<AnnotationContext> getBorderDashCallback()
Returns the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Returns:
- the callback called to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
-
setBorderDash
public final void setBorderDash(BorderDashCallback<AnnotationContext> borderDashCallback)
Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
borderDashCallback- to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
-
setBorderDash
public final void setBorderDash(NativeCallback borderDashCallback)
Sets the callback to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
borderDashCallback- to set the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern
-
getBorderDashOffsetCallback
public final BorderDashOffsetCallback<AnnotationContext> getBorderDashOffsetCallback()
Returns the callback called to set the line dash pattern offset.- Returns:
- the callback called to set the line dash pattern offset
-
setBorderDashOffset
public final void setBorderDashOffset(BorderDashOffsetCallback<AnnotationContext> borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.- Parameters:
borderDashOffsetCallback- to set the line dash pattern offset
-
setBorderDashOffset
public final void setBorderDashOffset(NativeCallback borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.- Parameters:
borderDashOffsetCallback- to set the line dash pattern offset
-
getAdjustScaleRangeCallback
public final AdjustScaleRangeCallback getAdjustScaleRangeCallback()
Returns the callback called to set whether the scale range should be adjusted if this annotation is out of range.- Returns:
- the callback called to set whether the scale range should be adjusted if this annotation is out of range
-
setAdjustScaleRange
public final void setAdjustScaleRange(AdjustScaleRangeCallback adjustScaleRangeCallback)
Sets the callback to set whether the scale range should be adjusted if this annotation is out of range.- Parameters:
adjustScaleRangeCallback- to set whether the scale range should be adjusted if this annotation is out of range
-
setAdjustScaleRange
public final void setAdjustScaleRange(NativeCallback adjustScaleRangeCallback)
Sets the callback to set whether the scale range should be adjusted if this annotation is out of range.- Parameters:
adjustScaleRangeCallback- to set whether the scale range should be adjusted if this annotation is out of range
-
getEnterCallback
public final EnterCallback getEnterCallback()
Returns the callback called when a "enter" event is occurring.- Returns:
- the callback called when a "enter" event is occurring
-
setEnterCallback
public final 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
-
getLeaveCallback
public final LeaveCallback getLeaveCallback()
Returns the callback called when a "leave" event is occurring.- Returns:
- the callback called when a "leave" event is occurring
-
setLeaveCallback
public final 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
-
getClickCallback
public final ClickCallback getClickCallback()
Returns the callback called when a "click" event is occurring.- Returns:
- the callback called when a "click" event is occurring
-
setClickCallback
public final 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
-
getDoubleClickCallback
public final DoubleClickCallback getDoubleClickCallback()
Returns the callback called when a "dblclick" event is occurring.- Returns:
- the callback called when a "dblclick" event is occurring
-
setDoubleClickCallback
public final void setDoubleClickCallback(DoubleClickCallback dblclickCallback)
Sets the callback called when a "dblclick" event is occurring.- Parameters:
dblclickCallback- the callback called when a "dblclick" event is occurring
-
getBorderColorAsString
public default String getBorderColorAsString()
Returns the color of the border of annotation.- Returns:
- the color of the border of annotation
-
getBorderWidth
public abstract int getBorderWidth()
Returns the width of the border in pixels.- Returns:
- the width of the border in pixels.
-
-