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 Color
circleColor
Circle colorprotected Color
circleFillColor
Circle fill colorprotected float
circleStrokeWidth
Circle stroke widthprotected Color
textColor
Text colorprotected String
textFont
Text fontprotected int
textSize
Text sizeprotected Color
tileBorderColor
Tile Border colorprotected float
tileBorderStrokeWidth
Tile Border stroke widthprotected Color
tileFillColor
Tile fill color
-
Constructor Summary
Constructors Constructor Description NumberFeaturesTile()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferedImage
drawTile(int tileWidth, int tileHeight, long tileFeatureCount, FeatureIndexResults geometryIndexResults)
Draw a custom tileBufferedImage
drawUnindexedTile(int tileWidth, int tileHeight, long totalFeatureCount, FeatureResultSet allFeatureResults)
Draw a custom tile when the number of features within the tile is unknown.Color
getCircleColor()
Get the circle colorColor
getCircleFillColor()
Get the circle fill colorfloat
getCirclePaddingPercentage()
Get the circle padding percentage around the textfloat
getCircleStrokeWidth()
Get the circle stroke widthColor
getTextColor()
Get the text colorint
getTextSize()
Get the text sizeColor
getTileBorderColor()
Get the tile border colorfloat
getTileBorderStrokeWidth()
Get the tile border stroke widthColor
getTileFillColor()
Get the tile fill colorboolean
isDrawUnindexedTiles()
Is the draw unindexed tiles option enabledvoid
setCircleColor(Color circleColor)
Set the circle colorvoid
setCircleFillColor(Color circleFillColor)
Set the circle fill colorvoid
setCirclePaddingPercentage(float circlePaddingPercentage)
Set the circle padding percentage to pad around the text, value between 0.0 and 1.0void
setCircleStrokeWidth(float circleStrokeWidth)
Set the circle stroke widthvoid
setDrawUnindexedTiles(boolean drawUnindexedTiles)
Set the draw unindexed tiles optionvoid
setTextColor(Color textColor)
Set the text colorvoid
setTextSize(int textSize)
Set the text sizevoid
setTileBorderColor(Color tileBorderColor)
Set the tile border colorvoid
setTileBorderStrokeWidth(float tileBorderStrokeWidth)
Set the tile border stroke widthvoid
setTileFillColor(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:
drawTile
in 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:
drawUnindexedTile
in 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
-
-