Class TilesBuilder


  • public final class TilesBuilder
    extends Object
    Comfortable object to create tiles (as CHARBA pattern or canvas pattern) by a builder.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • create

        public static TilesBuilder create()
        Returns new tiles builder instance.
        Returns:
        tiles builder instance
      • setShape

        public TilesBuilder setShape​(IsShape shape)
        Sets the shape of the tile.
        Parameters:
        shape - the shape of tile
        Returns:
        tiles builder instance
      • setPointStyle

        public TilesBuilder setPointStyle​(PointStyle pointStyle)
        Sets the point style as shape of the tile.
        Parameters:
        pointStyle - the point style as shape of the tile
        Returns:
        tiles builder instance
      • setSize

        public TilesBuilder setSize​(int size)
        Sets the size of the tile, minimum size is the default size.
        Parameters:
        size - the size to set
        Returns:
        tiles builder instance
      • setBackgroundColor

        public TilesBuilder setBackgroundColor​(String backgroundColor)
        Sets the background color of tile as string.
        Parameters:
        backgroundColor - the background color of tile as string
        Returns:
        tiles builder instance
      • setBackgroundColor

        public TilesBuilder setBackgroundColor​(IsColor backgroundColor)
        Sets the background color of tile.
        Parameters:
        backgroundColor - the background color of tile
        Returns:
        tiles builder instance
      • setShapeColor

        public TilesBuilder setShapeColor​(String shapeColor)
        Sets the shape color of tile.
        Parameters:
        shapeColor - the shape color of tile
        Returns:
        tiles builder instance
      • setShapeColor

        public TilesBuilder setShapeColor​(IsColor shapeColor)
        Sets the shape color of tile.
        Parameters:
        shapeColor - the shape color of tile
        Returns:
        tiles builder instance
      • asTile

        public CanvasPatternItem asTile()
        Returns a canvas pattern, using the shape, background color, shape color and size.
        Returns:
        a tile as canvas pattern
      • asPattern

        public Pattern asPattern()
        Returns a CHARBA pattern, using the shape, background color, shape color and size.
        Returns:
        a tile as CHARBA pattern