Package org.pepstock.charba.client.utils
Class MultilineTextAnnotationBuilder
- java.lang.Object
-
- org.pepstock.charba.client.utils.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 theAnnotationPlugin
.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Canvas
build()
Creates and returns theCanvas
which contains the content which can be added to a chart.static MultilineTextAnnotationBuilder
create(String... content)
Creates the builder.static MultilineTextAnnotationBuilder
create(List<String> content)
Creates the builder.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.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.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.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.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.MultilineTextAnnotationBuilder
setTextAlign(TextAlign align)
Sets the text alignment in the canvas.
-
-
-
Method Detail
-
create
public static MultilineTextAnnotationBuilder create(String... content)
Creates the builder.- Parameters:
content
- content of the label- Returns:
- builder instance
-
create
public static MultilineTextAnnotationBuilder create(List<String> content)
Creates the builder.- Parameters:
content
- content of the label- Returns:
- builder instance
-
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
-
-