Class TilesFactory


  • public final class TilesFactory
    extends Object
    Builds tiles creating a CHARBA pattern or canvas pattern passing all needed arguments and leveraging on tiles factory defaults.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • getDefaults

        public static TilesFactoryDefaults getDefaults()
        Returns the default values of tiles configuration.
        Returns:
        the default values of tiles configuration
      • createTile

        public static CanvasPatternItem createTile()
        Returns a canvas pattern, using default values, shape is square, background color, shape color and size.
        Returns:
        a tile as canvas pattern
      • createTile

        public static CanvasPatternItem createTile​(IsShape shape)
        Returns a canvas pattern, using the shape as argument and the other default values, background color, shape color and size.
        Parameters:
        shape - shape to apply to canvas pattern
        Returns:
        a tile as canvas pattern
      • createTile

        public static CanvasPatternItem createTile​(IsShape shape,
                                                   IsColor backgroundColor)
        Returns a canvas pattern, using the shape and back ground color as arguments and the other default values, shape color and size.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        Returns:
        a tile as canvas pattern
      • createTile

        public static CanvasPatternItem createTile​(IsShape shape,
                                                   String backgroundColor)
        Returns a canvas pattern, using the shape and back ground color as arguments and the other default values, shape color and size.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        Returns:
        a tile as canvas pattern
      • createTile

        public static CanvasPatternItem createTile​(IsShape shape,
                                                   String backgroundColor,
                                                   String shapeColor)
        Returns a canvas pattern, using the shape, back ground color and shape color as arguments and the size as default value.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        Returns:
        a tile as canvas pattern
      • createTile

        public static CanvasPatternItem createTile​(IsShape shape,
                                                   IsColor backgroundColor,
                                                   IsColor shapeColor)
        Returns a canvas pattern, using the shape, back ground color and shape color as arguments and the size as default value.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        Returns:
        a tile as canvas pattern
      • createTile

        public static CanvasPatternItem createTile​(IsShape shape,
                                                   IsColor backgroundColor,
                                                   IsColor shapeColor,
                                                   int size)
        Returns a canvas pattern, using the shape, back ground color, shape color and size as arguments.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        size - size of canvas pattern
        Returns:
        a tile as canvas pattern
      • createTile

        public static CanvasPatternItem createTile​(IsShape shape,
                                                   String backgroundColor,
                                                   String shapeColor,
                                                   int size)
        Returns a canvas pattern, using the shape, back ground color, shape color and size as arguments.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        size - size of canvas pattern
        Returns:
        a tile as canvas pattern
      • createPattern

        public static Pattern createPattern()
        Returns a CHARBA pattern, using default values, shape is square, background color, shape color and size.
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(IsShape shape)
        Returns a CHARBA pattern, using the shape as argument and the other default values, background color, shape color and size.
        Parameters:
        shape - shape to apply to canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(IsShape shape,
                                            IsColor backgroundColor)
        Returns a CHARBA pattern, using the shape and back ground color as arguments and the other default values, shape color and size.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(IsShape shape,
                                            String backgroundColor)
        Returns a CHARBA pattern, using the shape and back ground color as arguments and the other default values, shape color and size.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(IsShape shape,
                                            String backgroundColor,
                                            String shapeColor)
        Returns a CHARBA pattern, using the shape, back ground color and shape color as arguments and the size as default value.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(IsShape shape,
                                            IsColor backgroundColor,
                                            IsColor shapeColor)
        Returns a CHARBA pattern, using the shape, back ground color and shape color as arguments and the size as default value.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(IsShape shape,
                                            String backgroundColor,
                                            String shapeColor,
                                            int size)
        Returns a CHARBA pattern, using the shape, back ground color, shape color and size as arguments.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        size - size of canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(IsShape shape,
                                            IsColor backgroundColor,
                                            IsColor shapeColor,
                                            int size)
        Returns a CHARBA pattern, using the shape, back ground color, shape color and size as arguments.
        Parameters:
        shape - shape to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        size - size of canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(PointStyle style)
        Returns a CHARBA pattern, using the point style as argument and the other default values, background color, shape color and size.
        Parameters:
        style - point style to apply to canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(PointStyle style,
                                            IsColor backgroundColor)
        Returns a CHARBA pattern, using the point style and back ground color as arguments and the other default values, shape color and size.
        Parameters:
        style - point style to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(PointStyle style,
                                            String backgroundColor)
        Returns a CHARBA pattern, using the point style and back ground color as arguments and the other default values, shape color and size.
        Parameters:
        style - point style to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(PointStyle style,
                                            String backgroundColor,
                                            String shapeColor)
        Returns a CHARBA pattern, using the point style, back ground color and shape color as arguments and the size as default value.
        Parameters:
        style - point style to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(PointStyle style,
                                            IsColor backgroundColor,
                                            IsColor shapeColor)
        Returns a CHARBA pattern, using the point style, back ground color and shape color as arguments and the size as default value.
        Parameters:
        style - point style to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(PointStyle style,
                                            String backgroundColor,
                                            String shapeColor,
                                            int size)
        Returns a CHARBA pattern, using the point style, back ground color, shape color and size as arguments.
        Parameters:
        style - point style to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        size - size of canvas pattern
        Returns:
        a CHARBA pattern
      • createPattern

        public static Pattern createPattern​(PointStyle style,
                                            IsColor backgroundColor,
                                            IsColor shapeColor,
                                            int size)
        Returns a CHARBA pattern, using the point style, back ground color, shape color and size as arguments.
        Parameters:
        style - point style to apply to canvas pattern
        backgroundColor - background color of canvas pattern
        shapeColor - shape color
        size - size of canvas pattern
        Returns:
        a CHARBA pattern
      • createHtmlLegendItem

        public static String createHtmlLegendItem​(HtmlLegendItem htmlLegendItem)
        Returns a point style picture in base64 PNG format using the legend item as source.
        This is invoked ONLY from HtmlLegend plugin.
        Parameters:
        htmlLegendItem - the legend item instance to create the tile
        Returns:
        a point style picture in base64 PNG format
      • clearHtmlLegendItems

        public static void clearHtmlLegendItems​(HtmlLegendItem htmlLegendItem)
        Clears all cached instance of point style by chart instance, wrapper in the a legend item. This is invoked ONLY from HtmlLegend plugin.
        Parameters:
        htmlLegendItem - the legend item instance to create the tile