Class NumberFeaturesTile
- java.lang.Object
-
- mil.nga.geopackage.tiles.features.custom.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 Summary
Fields Modifier and Type Field Description protected ColorcircleColorCircle colorprotected ColorcircleFillColorCircle fill colorprotected floatcircleStrokeWidthCircle stroke widthprotected ColortextColorText colorprotected StringtextFontText fontprotected inttextSizeText sizeprotected ColortileBorderColorTile Border colorprotected floattileBorderStrokeWidthTile Border stroke widthprotected ColortileFillColorTile fill color
-
Constructor Summary
Constructors Constructor Description NumberFeaturesTile()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferedImagedrawTile(int tileWidth, int tileHeight, long tileFeatureCount, FeatureIndexResults geometryIndexResults)Draw a custom tileBufferedImagedrawUnindexedTile(int tileWidth, int tileHeight, long totalFeatureCount, FeatureResultSet allFeatureResults)Draw a custom tile when the number of features within the tile is unknown.ColorgetCircleColor()Get the circle colorColorgetCircleFillColor()Get the circle fill colorfloatgetCirclePaddingPercentage()Get the circle padding percentage around the textfloatgetCircleStrokeWidth()Get the circle stroke widthColorgetTextColor()Get the text colorintgetTextSize()Get the text sizeColorgetTileBorderColor()Get the tile border colorfloatgetTileBorderStrokeWidth()Get the tile border stroke widthColorgetTileFillColor()Get the tile fill colorbooleanisDrawUnindexedTiles()Is the draw unindexed tiles option enabledvoidsetCircleColor(Color circleColor)Set the circle colorvoidsetCircleFillColor(Color circleFillColor)Set the circle fill colorvoidsetCirclePaddingPercentage(float circlePaddingPercentage)Set the circle padding percentage to pad around the text, value between 0.0 and 1.0voidsetCircleStrokeWidth(float circleStrokeWidth)Set the circle stroke widthvoidsetDrawUnindexedTiles(boolean drawUnindexedTiles)Set the draw unindexed tiles optionvoidsetTextColor(Color textColor)Set the text colorvoidsetTextSize(int textSize)Set the text sizevoidsetTileBorderColor(Color tileBorderColor)Set the tile border colorvoidsetTileBorderStrokeWidth(float tileBorderStrokeWidth)Set the tile border stroke widthvoidsetTileFillColor(Color tileFillColor)Set the tile fill color
-
-
-
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
-
-
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:
drawTilein interfaceCustomFeaturesTile- Parameters:
tileWidth- tile width to drawtileHeight- tile height to drawtileFeatureCount- count of features in the requested tilegeometryIndexResults- 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:
drawUnindexedTilein interfaceCustomFeaturesTile- Parameters:
tileWidth- tile width to drawtileHeight- tile height to drawtotalFeatureCount- count of total features in the feature tableallFeatureResults- results in a feature result set- Returns:
- custom image, or null
-
-