Class NumberFeaturesTile

  • All Implemented Interfaces:
    CustomFeaturesTile

    public class NumberFeaturesTile
    extends Object
    implements CustomFeaturesTile
    Draws a tile indicating the number of features that exist within the tile, visible when zoomed in closer. The number is drawn in the center of the tile and by default is surrounded by a colored circle with border. By default a tile border is drawn and the tile is colored (transparently most likely). The paint objects for each draw type can be modified to or set to null (except for the text paint object).
    Since:
    1.1.2
    Author:
    osbornb
    • Field Detail

      • textSize

        protected int textSize
        Text size
      • textFont

        protected String textFont
        Text font
      • textColor

        protected Color textColor
        Text color
      • circleStrokeWidth

        protected float circleStrokeWidth
        Circle stroke width
      • circleColor

        protected Color circleColor
        Circle color
      • circleFillColor

        protected Color circleFillColor
        Circle fill color
      • tileBorderStrokeWidth

        protected float tileBorderStrokeWidth
        Tile Border stroke width
      • tileBorderColor

        protected Color tileBorderColor
        Tile Border color
      • tileFillColor

        protected Color tileFillColor
        Tile fill color
    • Constructor Detail

      • NumberFeaturesTile

        public NumberFeaturesTile()
        Constructor
    • Method Detail

      • getTextSize

        public int getTextSize()
        Get the text size
        Returns:
        text size
      • setTextSize

        public void setTextSize​(int textSize)
        Set the text size
        Parameters:
        textSize - text size
      • getTextColor

        public Color getTextColor()
        Get the text color
        Returns:
        text color
      • setTextColor

        public void setTextColor​(Color textColor)
        Set the text color
        Parameters:
        textColor - text color
      • getCircleStrokeWidth

        public float getCircleStrokeWidth()
        Get the circle stroke width
        Returns:
        circle stroke width
      • setCircleStrokeWidth

        public void setCircleStrokeWidth​(float circleStrokeWidth)
        Set the circle stroke width
        Parameters:
        circleStrokeWidth - circle stroke width
      • getCircleColor

        public Color getCircleColor()
        Get the circle color
        Returns:
        circle color
      • setCircleColor

        public void setCircleColor​(Color circleColor)
        Set the circle color
        Parameters:
        circleColor - circle color
      • getCircleFillColor

        public Color getCircleFillColor()
        Get the circle fill color
        Returns:
        circle fill color
      • setCircleFillColor

        public void setCircleFillColor​(Color circleFillColor)
        Set the circle fill color
        Parameters:
        circleFillColor - circle fill color
      • getCirclePaddingPercentage

        public float getCirclePaddingPercentage()
        Get the circle padding percentage around the text
        Returns:
        circle padding percentage, 0.0 to 1.0
      • setCirclePaddingPercentage

        public void setCirclePaddingPercentage​(float circlePaddingPercentage)
        Set the circle padding percentage to pad around the text, value between 0.0 and 1.0
        Parameters:
        circlePaddingPercentage - circle padding percentage
      • getTileBorderStrokeWidth

        public float getTileBorderStrokeWidth()
        Get the tile border stroke width
        Returns:
        tile border stroke width
      • setTileBorderStrokeWidth

        public void setTileBorderStrokeWidth​(float tileBorderStrokeWidth)
        Set the tile border stroke width
        Parameters:
        tileBorderStrokeWidth - tile border stroke width
      • getTileBorderColor

        public Color getTileBorderColor()
        Get the tile border color
        Returns:
        tile border color
      • setTileBorderColor

        public void setTileBorderColor​(Color tileBorderColor)
        Set the tile border color
        Parameters:
        tileBorderColor - tile border color
      • getTileFillColor

        public Color getTileFillColor()
        Get the tile fill color
        Returns:
        tile fill color
      • setTileFillColor

        public void setTileFillColor​(Color tileFillColor)
        Set the tile fill color
        Parameters:
        tileFillColor - tile fill color
      • isDrawUnindexedTiles

        public boolean isDrawUnindexedTiles()
        Is the draw unindexed tiles option enabled
        Returns:
        true if drawing unindexed tiles
      • setDrawUnindexedTiles

        public void setDrawUnindexedTiles​(boolean drawUnindexedTiles)
        Set the draw unindexed tiles option
        Parameters:
        drawUnindexedTiles - draw unindexed tiles flag
      • drawTile

        public BufferedImage drawTile​(int tileWidth,
                                      int tileHeight,
                                      long tileFeatureCount,
                                      FeatureIndexResults geometryIndexResults)
        Draw a custom tile
        Specified by:
        drawTile in interface CustomFeaturesTile
        Parameters:
        tileWidth - tile width to draw
        tileHeight - tile height to draw
        tileFeatureCount - count of features in the requested tile
        geometryIndexResults - feature index results
        Returns:
        custom image, or null
      • drawUnindexedTile

        public BufferedImage drawUnindexedTile​(int tileWidth,
                                               int tileHeight,
                                               long totalFeatureCount,
                                               FeatureResultSet allFeatureResults)
        Draw a custom tile when the number of features within the tile is unknown. This is called when a feature table is not indexed and more total features exist than the max per tile.
        Specified by:
        drawUnindexedTile in interface CustomFeaturesTile
        Parameters:
        tileWidth - tile width to draw
        tileHeight - tile height to draw
        totalFeatureCount - count of total features in the feature table
        allFeatureResults - results in a feature result set
        Returns:
        custom image, or null