Class MultilineTextAnnotationBuilder


  • public final class MultilineTextAnnotationBuilder
    extends Object
    Utility to build a canvas, to add to a chart, which contains the content where fonts and colors can be applied for each row.
    Usually helpful to use in the AnnotationPlugin.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • setTextAlign

        public MultilineTextAnnotationBuilder setTextAlign​(TextAlign align)
        Sets the text alignment in the canvas.
        Parameters:
        align - the text alignment in the canvas
        Returns:
        builder instance
      • setFonts

        public MultilineTextAnnotationBuilder setFonts​(IsDefaultFont... fonts)
        Sets the fonts to apply to each row of the content.
        If the fonts are less than the content row count, the last font is used for the rest of the content.
        Parameters:
        fonts - the fonts to apply to each row of the content
        Returns:
        builder instance
      • setFonts

        public MultilineTextAnnotationBuilder setFonts​(List<IsDefaultFont> fonts)
        Sets the fonts to apply to each row of the content.
        If the fonts are less than the content row count, the last font is used for the rest of the content.
        Parameters:
        fonts - the fonts to apply to each row of the content
        Returns:
        builder instance
      • setColors

        public MultilineTextAnnotationBuilder setColors​(String... colors)
        Sets the colors to apply to each row of the content.
        If the colors are less than the content row count, the last color is used for the rest of the content.
        Parameters:
        colors - the colors to apply to each row of the content
        Returns:
        builder instance
      • setColors

        public MultilineTextAnnotationBuilder setColors​(IsColor... colors)
        Sets the colors to apply to each row of the content.
        If the colors are less than the content row count, the last color is used for the rest of the content.
        Parameters:
        colors - the colors to apply to each row of the content
        Returns:
        builder instance
      • setColors

        public MultilineTextAnnotationBuilder setColors​(List<IsColor> colors)
        Sets the colors to apply to each row of the content.
        If the colors are less than the content row count, the last color is used for the rest of the content.
        Parameters:
        colors - the colors to apply to each row of the content
        Returns:
        builder instance
      • build

        public Canvas build()
        Creates and returns the Canvas which contains the content which can be added to a chart.
        Returns:
        the Canvas which contains the content