Class Callout


  • public final class Callout
    extends AbstractNode
    Implements a CALLOUT to apply on a LABEL annotation.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • DEFAULT_DISPLAY

        public static final boolean DEFAULT_DISPLAY
        Default callout display, false.
        See Also:
        Constant Field Values
      • DEFAULT_BORDER_WIDTH

        public static final int DEFAULT_BORDER_WIDTH
        Default callout border width, 1.
        See Also:
        Constant Field Values
      • DEFAULT_BORDER_CAP_STYLE

        public static final CapStyle DEFAULT_BORDER_CAP_STYLE
        Default callout border cap style, CapStyle.BUTT.
      • DEFAULT_BORDER_JOIN_STYLE

        public static final JoinStyle DEFAULT_BORDER_JOIN_STYLE
        Default callout border join style, JoinStyle.MITER.
      • DEFAULT_BORDER_DASH_OFFSET

        public static final int DEFAULT_BORDER_DASH_OFFSET
        Default callout border dash offset, 0.
        See Also:
        Constant Field Values
      • DEFAULT_MARGIN

        public static final int DEFAULT_MARGIN
        Default amount of pixels between the label and the callout separator, 5.
        See Also:
        Constant Field Values
      • DEFAULT_SIDE

        public static final int DEFAULT_SIDE
        Default width of the starter line of callout pointer, 5.
        See Also:
        Constant Field Values
      • DEFAULT_START

        public static final int DEFAULT_START
        Default the separator dimension in pixels to use as starting point for callout pointer, Undefined.INTEGER.
        See Also:
        Constant Field Values
      • DEFAULT_START_AS_PERCENTAGE

        public static final double DEFAULT_START_AS_PERCENTAGE
        Default the percentage of the separator dimension to use as starting point for callout pointer, 0.5.
        See Also:
        Constant Field Values
    • Method Detail

      • getBorderOptionsHandler

        public org.pepstock.charba.client.annotation.BorderOptionsHandler getBorderOptionsHandler()
      • getExtendedBorderOptionsHandler

        public org.pepstock.charba.client.annotation.ExtendedBorderOptionsHandler getExtendedBorderOptionsHandler()
      • setDisplay

        public void setDisplay​(boolean display)
        Sets true whether the label should be displayed.
        Parameters:
        display - true whether the label should be displayed
      • isDisplay

        public boolean isDisplay()
        Returns true whether the label should be displayed.
        Returns:
        true whether the label should be displayed
      • setMargin

        public void setMargin​(int margin)
        Sets the amount of pixels between the label and the callout separator.
        Parameters:
        margin - the amount of pixels between the label and the callout separator
      • getMargin

        public int getMargin()
        Returns the amount of pixels between the label and the callout separator.
        Returns:
        the amount of pixels between the label and the callout separator.
      • setSide

        public void setSide​(int side)
        Sets the width of the starter line of callout pointer.
        Parameters:
        side - the width of the starter line of callout pointer
      • getSide

        public int getSide()
        Returns the width of the starter line of callout pointer.
        Returns:
        the width of the starter line of callout pointer
      • setStart

        public void setStart​(int start)
        Sets the separator dimension in pixels to use as starting point for callout pointer.
        Parameters:
        start - the separator dimension in pixels to use as starting point for callout pointer
      • getStart

        public int getStart()
        Returns the separator dimension in pixels to use as starting point for callout pointer.
        Returns:
        the separator dimension in pixels to use as starting point for callout pointer
      • setStartAsPercentage

        public void setStartAsPercentage​(double start)
        Sets the percentage of the separator dimension to use as starting point for callout pointer.
        Parameters:
        start - the percentage of the separator dimension to use as starting point for callout pointer
      • getStartAsPercentage

        public double getStartAsPercentage()
        Returns the percentage of the separator dimension to use as starting point for callout pointer.
        Returns:
        the percentage of the separator dimension to use as starting point for callout pointer
      • setPosition

        public void setPosition​(CalloutPosition position)
        Sets the position of callout, with respect to the label.
        Parameters:
        position - the position of callout, with respect to the label
      • getPosition

        public CalloutPosition getPosition()
        Returns the position of callout, with respect to the label.
        Returns:
        the position of callout, with respect to the label.
      • getDisplayCallback

        public DisplayCallback<AnnotationContext> getDisplayCallback()
        Returns the callback called to set whether the label should be displayed.
        Returns:
        the callback called to set whether the label should be displayed
      • setDisplay

        public void setDisplay​(DisplayCallback<AnnotationContext> displayCallback)
        Sets the callback to set whether the label should be displayed.
        Parameters:
        displayCallback - to set whether the label should be displayed
      • setDisplay

        public void setDisplay​(NativeCallback displayCallback)
        Sets the callback to set whether the label should be displayed.
        Parameters:
        displayCallback - to set whether the label should be displayed
      • getMarginCallback

        public MarginCallback getMarginCallback()
        Returns the callback to set the amount of pixels between the label and the callout separator.
        Returns:
        the callback to set the amount of pixels between the label and the callout separator
      • setMargin

        public void setMargin​(MarginCallback marginCallback)
        Sets the callback to set the amount of pixels between the label and the callout separator.
        Parameters:
        marginCallback - the callback to set the amount of pixels between the label and the callout separator
      • setMargin

        public void setMargin​(NativeCallback marginCallback)
        Sets the callback to set the amount of pixels between the label and the callout separator.
        Parameters:
        marginCallback - the callback to set the amount of pixels between the label and the callout separator
      • getSideCallback

        public SideCallback getSideCallback()
        Returns the callback to set the width of the starter line of callout pointer.
        Returns:
        the callback to set the width of the starter line of callout pointer
      • setSide

        public void setSide​(SideCallback sideCallback)
        Sets the callback to set the width of the starter line of callout pointer.
        Parameters:
        sideCallback - the callback to set the width of the starter line of callout pointer
      • setSide

        public void setSide​(NativeCallback sideCallback)
        Sets the callback to set the width of the starter line of callout pointer.
        Parameters:
        sideCallback - the callback to set the width of the starter line of callout pointer
      • getStartCallback

        public StartCallback getStartCallback()
        Returns the callback to set the separator dimension to use as starting point for callout pointer.
        Returns:
        the callback to set the separator dimension to use as starting point for callout pointer
      • setStart

        public void setStart​(StartCallback startCallback)
        Sets the callback to set the separator dimension to use as starting point for callout pointer.
        Parameters:
        startCallback - the callback to set the separator dimension to use as starting point for callout pointer
      • setStart

        public void setStart​(NativeCallback startCallback)
        Sets the callback to set the separator dimension to use as starting point for callout pointer.
        Parameters:
        startCallback - the callback to set the separator dimension to use as starting point for callout pointer
      • getPositionCallback

        public CalloutPositionCallback getPositionCallback()
        Returns the callback to set the position of callout, with respect to the label.
        Returns:
        the callback to set the position of callout, with respect to the label
      • setPosition

        public void setPosition​(CalloutPositionCallback positionCallback)
        Sets the callback to set the position of callout, with respect to the label.
        Parameters:
        positionCallback - the callback to set the position of callout, with respect to the label
      • setPosition

        public void setPosition​(NativeCallback positionCallback)
        Sets the callback to set the position of callout, with respect to the label.
        Parameters:
        positionCallback - the callback to set the position of callout, with respect to the label
      • setBorderColor

        public default void setBorderColor​(IsColor borderColor)
        Sets the color of the border of annotation.
        Parameters:
        borderColor - the color of the border of annotation
      • setBorderColor

        public default void setBorderColor​(String borderColor)
        Sets the color of the border of annotation.
        Parameters:
        borderColor - the color of the border of annotation
      • getBorderColorAsString

        public default String getBorderColorAsString()
        Returns the color of the border of annotation.
        Returns:
        the color of the border of annotation
      • getBorderColor

        public default IsColor getBorderColor()
        Returns the color of the border of annotation.
        Returns:
        the color of the border of annotation
      • setBorderWidth

        public default void setBorderWidth​(int borderWidth)
        Sets the width of the border in pixels.
        Parameters:
        borderWidth - the width of the border in pixels.
      • getBorderWidth

        public default int getBorderWidth()
        Returns the width of the border in pixels.
        Returns:
        the width of the border in pixels.
      • setBorderDash

        public default 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 default 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 default void setBorderDashOffset​(double borderDashOffset)
        Sets the line dash pattern offset.
        Parameters:
        borderDashOffset - the line dash pattern offset.
      • getBorderDashOffset

        public default double getBorderDashOffset()
        Returns the line dash pattern offset.
        Returns:
        the line dash pattern offset.
      • getBorderColorCallback

        public default 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 default 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 default 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 default 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 default 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 default 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 default 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 default 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 default 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 default 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 default 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 default void setBorderDashOffset​(NativeCallback borderDashOffsetCallback)
        Sets the callback to set the line dash pattern offset.
        Parameters:
        borderDashOffsetCallback - to set the line dash pattern offset
      • setBorderCapStyle

        public default void setBorderCapStyle​(CapStyle borderCapStyle)
        Sets how the end points of every line are drawn.
        Parameters:
        borderCapStyle - how the end points of every line are drawn.
      • getBorderCapStyle

        public default CapStyle getBorderCapStyle()
        Returns how the end points of every line are drawn.
        Returns:
        how the end points of every line are drawn.
      • setBorderJoinStyle

        public default void setBorderJoinStyle​(JoinStyle borderJoinStyle)
        Sets how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).
        Parameters:
        borderJoinStyle - how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
      • getBorderJoinStyle

        public default JoinStyle getBorderJoinStyle()
        Returns how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).
        Returns:
        how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
      • getBorderCapStyleCallback

        public default CapStyleCallback<AnnotationContext> getBorderCapStyleCallback()
        Returns the border capstyle callback, if set, otherwise null.
        Returns:
        the border capstyle callback, if set, otherwise null.
      • setBorderCapStyle

        public default void setBorderCapStyle​(CapStyleCallback<AnnotationContext> borderCapStyleCallback)
        Sets the border capstyle callback.
        Parameters:
        borderCapStyleCallback - the border capstyle callback.
      • setBorderCapStyle

        public default void setBorderCapStyle​(NativeCallback borderCapStyleCallback)
        Sets the border capstyle callback.
        Parameters:
        borderCapStyleCallback - the border capstyle callback.
      • getBorderJoinStyleCallback

        public default JoinStyleCallback<AnnotationContext> getBorderJoinStyleCallback()
        Returns the border join style callback, if set, otherwise null.
        Returns:
        the border join style callback, if set, otherwise null.
      • setBorderJoinStyle

        public default void setBorderJoinStyle​(JoinStyleCallback<AnnotationContext> borderJoinStyleCallback)
        Sets the border join style callback.
        Parameters:
        borderJoinStyleCallback - the border join style callback.
      • setBorderJoinStyle

        public default void setBorderJoinStyle​(NativeCallback borderJoinStyleCallback)
        Sets the border join style callback.
        Parameters:
        borderJoinStyleCallback - the border join style callback.