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.ID
plugin.
It contains all commons properties to define an annotation.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_ADJUST_SCALE_RANGE
Default annotation adjust scale range, true.static boolean
DEFAULT_DISPLAY
Default annotation display, true.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Default Methods Modifier and Type Method Description AdjustScaleRangeCallback
getAdjustScaleRangeCallback()
Returns the callback called to set whether the scale range should be adjusted if this annotation is out of range.IsColor
getBorderColor()
Returns the color of the border of annotation.default String
getBorderColorAsString()
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.double
getBorderDashOffset()
Returns the line dash pattern offset.BorderDashOffsetCallback<AnnotationContext>
getBorderDashOffsetCallback()
Returns the callback called to set the line dash pattern offset.int
getBorderWidth()
Returns the width of the border in pixels.WidthCallback<AnnotationContext>
getBorderWidthCallback()
Returns the callback called to set the width of the border in pixels.ClickCallback
getClickCallback()
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.DoubleClickCallback
getDoubleClickCallback()
Returns the callback called when a "dblclick" event is occurring.DrawTime
getDrawTime()
Returns the draw time which defines when the annotations are drawn.DrawTimeCallback
getDrawTimeCallback()
Returns the callback called to set the draw time which defines when the annotations are drawn.EnterCallback
getEnterCallback()
Returns the callback called when a "enter" event is occurring.AnnotationId
getId()
Returns the id of annotation.LeaveCallback
getLeaveCallback()
Returns the callback called when a "leave" event is occurring.AnnotationType
getType()
Returns the type of annotation.boolean
isAdjustScaleRange()
Returnstrue
whether the scale range should be adjusted if this annotation is out of range.boolean
isDisplay()
Returnstrue
whether the annotation should be displayed.void
setAdjustScaleRange(boolean display)
Setstrue
whether the scale range should be adjusted if this annotation is out of range.void
setAdjustScaleRange(AdjustScaleRangeCallback adjustScaleRangeCallback)
Sets the callback to set whether the scale range should be adjusted if this annotation is out of range.void
setAdjustScaleRange(NativeCallback adjustScaleRangeCallback)
Sets the callback to set whether the scale range should be adjusted if this annotation is out of range.void
setBorderColor(String borderColor)
Sets the color of the border of annotation.void
setBorderColor(ColorCallback<AnnotationContext> borderColorCallback)
Sets the callback to set the color of the border of annotation.void
setBorderColor(NativeCallback borderColorCallback)
Sets the callback to set the color of the border of annotation.void
setBorderColor(IsColor borderColor)
Sets the color of the border of annotation.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.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.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.void
setBorderDashOffset(double borderDashOffset)
Sets the line dash pattern offset.void
setBorderDashOffset(BorderDashOffsetCallback<AnnotationContext> borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.void
setBorderDashOffset(NativeCallback borderDashOffsetCallback)
Sets the callback to set the line dash pattern offset.void
setBorderWidth(int borderWidth)
Sets the width of the border in pixels.void
setBorderWidth(NativeCallback borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.void
setBorderWidth(WidthCallback<AnnotationContext> borderWidthCallback)
Sets the callback to set the color of the width of the border in pixels.void
setClickCallback(ClickCallback clickCallback)
Sets the callback called when a "click" event is occurring.void
setDisplay(boolean display)
Setstrue
whether the annotation should be displayed.void
setDisplay(DisplayCallback<AnnotationContext> displayCallback)
Sets the callback to set whether the annotation should be displayed.void
setDisplay(NativeCallback displayCallback)
Sets the callback to set whether the annotation should be displayed.void
setDoubleClickCallback(DoubleClickCallback dblclickCallback)
Sets the callback called when a "dblclick" event is occurring.void
setDrawTime(DrawTimeCallback drawTimeCallback)
Sets the callback to set the draw time which defines when the annotations are drawn.void
setDrawTime(DrawTime drawTime)
Sets the draw time which defines when the annotations are drawn.void
setDrawTime(NativeCallback drawTimeCallback)
Sets the callback to set the draw time which defines when the annotations are drawn.void
setEnterCallback(EnterCallback enterCallback)
Sets the callback called when a "enter" event is occurring.void
setLeaveCallback(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)
Setstrue
whether the annotation should be displayed.- Parameters:
display
-true
whether the annotation should be displayed
-
isDisplay
public final boolean isDisplay()
Returnstrue
whether the annotation should be displayed.- Returns:
true
whether the annotation should be displayed
-
setAdjustScaleRange
public final void setAdjustScaleRange(boolean display)
Setstrue
whether the scale range should be adjusted if this annotation is out of range.- Parameters:
display
-true
whether the scale range should be adjusted if this annotation is out of range
-
isAdjustScaleRange
public final boolean isAdjustScaleRange()
Returnstrue
whether the scale range should be adjusted if this annotation is out of range.- Returns:
true
whether 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.
-
-