Package mil.nga.geopackage.map.features
Class StyleCache
- java.lang.Object
-
- mil.nga.geopackage.map.features.StyleCache
-
public class StyleCache extends Object
Style utilities for populating markers and shapes. Caches icons for a single GeoPackage- Since:
- 3.2.0
-
-
Constructor Summary
Constructors Constructor Description StyleCache(FeatureStyleExtension featureStyleExtension, float density)ConstructorStyleCache(FeatureStyleExtension featureStyleExtension, float density, int iconCacheSize)ConstructorStyleCache(GeoPackage geoPackage, float density)ConstructorStyleCache(GeoPackage geoPackage, float density, int iconCacheSize)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the cacheBitmapcreateIcon(IconRow icon)Create the icon bitmapMarkerOptionscreateMarkerOptions(FeatureStyle featureStyle)Create new marker options populated with the feature style (icon or style)MarkerOptionscreateMarkerOptions(IconRow icon)Create new marker options populated with the iconMarkerOptionscreateMarkerOptions(StyleRow style)Create new marker options populated with the styleMarkerOptionscreateMarkerOptions(FeatureRow featureRow)Create new marker options populated with the feature row style (icon or style)PolygonOptionscreatePolygonOptions(FeatureStyle featureStyle)Create new polygon options populated with the feature stylePolygonOptionscreatePolygonOptions(StyleRow style)Create new polygon options populated with the stylePolygonOptionscreatePolygonOptions(FeatureRow featureRow)Create new polygon options populated with the feature row stylePolylineOptionscreatePolylineOptions(FeatureStyle featureStyle)Create new polyline options populated with the feature stylePolylineOptionscreatePolylineOptions(StyleRow style)Create new polyline options populated with the stylePolylineOptionscreatePolylineOptions(FeatureRow featureRow)Create new polyline options populated with the feature row stylefloatgetDensity()Get the display densityFeatureStyleExtensiongetFeatureStyleExtension()Get the feature style extensionvoidsetDensity(float density)Set the display densitybooleansetFeatureStyle(MarkerOptions markerOptions, FeatureStyle featureStyle)Set the feature style (icon or style) into the marker optionsbooleansetFeatureStyle(MarkerOptions markerOptions, FeatureRow featureRow)Set the feature row style (icon or style) into the marker optionsbooleansetFeatureStyle(PolygonOptions polygonOptions, FeatureStyle featureStyle)Set the feature style into the polygon optionsbooleansetFeatureStyle(PolygonOptions polygonOptions, FeatureRow featureRow)Set the feature row style into the polygon optionsbooleansetFeatureStyle(PolylineOptions polylineOptions, FeatureStyle featureStyle)Set the feature style into the polyline optionsbooleansetFeatureStyle(PolylineOptions polylineOptions, FeatureRow featureRow)Set the feature row style into the polyline optionsbooleansetIcon(MarkerOptions markerOptions, IconRow icon)Set the icon into the marker optionsbooleansetStyle(MarkerOptions markerOptions, StyleRow style)Set the style into the marker optionsbooleansetStyle(PolygonOptions polygonOptions, StyleRow style)Set the style into the polygon optionsbooleansetStyle(PolylineOptions polylineOptions, StyleRow style)Set the style into the polyline options
-
-
-
Constructor Detail
-
StyleCache
public StyleCache(GeoPackage geoPackage, float density)
Constructor- Parameters:
geoPackage- GeoPackagedensity- display density:DisplayMetrics.density
-
StyleCache
public StyleCache(GeoPackage geoPackage, float density, int iconCacheSize)
Constructor- Parameters:
geoPackage- GeoPackagedensity- display density:DisplayMetrics.densityiconCacheSize- number of icon bitmaps to cache
-
StyleCache
public StyleCache(FeatureStyleExtension featureStyleExtension, float density)
Constructor- Parameters:
featureStyleExtension- feature style extensiondensity- display density:DisplayMetrics.density
-
StyleCache
public StyleCache(FeatureStyleExtension featureStyleExtension, float density, int iconCacheSize)
Constructor- Parameters:
featureStyleExtension- feature style extensiondensity- display density:DisplayMetrics.densityiconCacheSize- number of icon bitmaps to cache
-
-
Method Detail
-
clear
public void clear()
Clear the cache
-
getFeatureStyleExtension
public FeatureStyleExtension getFeatureStyleExtension()
Get the feature style extension- Returns:
- feature style extension
-
getDensity
public float getDensity()
Get the display density- Returns:
- density
-
setDensity
public void setDensity(float density)
Set the display density- Parameters:
density- density
-
createMarkerOptions
public MarkerOptions createMarkerOptions(FeatureRow featureRow)
Create new marker options populated with the feature row style (icon or style)- Parameters:
featureRow- feature row- Returns:
- marker options populated with the feature style
-
setFeatureStyle
public boolean setFeatureStyle(MarkerOptions markerOptions, FeatureRow featureRow)
Set the feature row style (icon or style) into the marker options- Parameters:
markerOptions- marker optionsfeatureRow- feature row- Returns:
- true if icon or style was set into the marker options
-
createMarkerOptions
public MarkerOptions createMarkerOptions(FeatureStyle featureStyle)
Create new marker options populated with the feature style (icon or style)- Parameters:
featureStyle- feature style- Returns:
- marker options populated with the feature style
-
setFeatureStyle
public boolean setFeatureStyle(MarkerOptions markerOptions, FeatureStyle featureStyle)
Set the feature style (icon or style) into the marker options- Parameters:
markerOptions- marker optionsfeatureStyle- feature style- Returns:
- true if icon or style was set into the marker options
-
createMarkerOptions
public MarkerOptions createMarkerOptions(IconRow icon)
Create new marker options populated with the icon- Parameters:
icon- icon row- Returns:
- marker options populated with the icon
-
setIcon
public boolean setIcon(MarkerOptions markerOptions, IconRow icon)
Set the icon into the marker options- Parameters:
markerOptions- marker optionsicon- icon row- Returns:
- true if icon was set into the marker options
-
createIcon
public Bitmap createIcon(IconRow icon)
Create the icon bitmap- Parameters:
icon- icon row- Returns:
- icon bitmap
-
createMarkerOptions
public MarkerOptions createMarkerOptions(StyleRow style)
Create new marker options populated with the style- Parameters:
style- style row- Returns:
- marker options populated with the style
-
setStyle
public boolean setStyle(MarkerOptions markerOptions, StyleRow style)
Set the style into the marker options- Parameters:
markerOptions- marker optionsstyle- style row- Returns:
- true if style was set into the marker options
-
createPolylineOptions
public PolylineOptions createPolylineOptions(FeatureRow featureRow)
Create new polyline options populated with the feature row style- Parameters:
featureRow- feature row- Returns:
- polyline options populated with the feature style
-
setFeatureStyle
public boolean setFeatureStyle(PolylineOptions polylineOptions, FeatureRow featureRow)
Set the feature row style into the polyline options- Parameters:
polylineOptions- polyline optionsfeatureRow- feature row- Returns:
- true if style was set into the polyline options
-
createPolylineOptions
public PolylineOptions createPolylineOptions(FeatureStyle featureStyle)
Create new polyline options populated with the feature style- Parameters:
featureStyle- feature style- Returns:
- polyline options populated with the feature style
-
setFeatureStyle
public boolean setFeatureStyle(PolylineOptions polylineOptions, FeatureStyle featureStyle)
Set the feature style into the polyline options- Parameters:
polylineOptions- polyline optionsfeatureStyle- feature style- Returns:
- true if style was set into the polyline options
-
createPolylineOptions
public PolylineOptions createPolylineOptions(StyleRow style)
Create new polyline options populated with the style- Parameters:
style- style row- Returns:
- polyline options populated with the style
-
setStyle
public boolean setStyle(PolylineOptions polylineOptions, StyleRow style)
Set the style into the polyline options- Parameters:
polylineOptions- polyline optionsstyle- style row- Returns:
- true if style was set into the polyline options
-
createPolygonOptions
public PolygonOptions createPolygonOptions(FeatureRow featureRow)
Create new polygon options populated with the feature row style- Parameters:
featureRow- feature row- Returns:
- polygon options populated with the feature style
-
setFeatureStyle
public boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureRow featureRow)
Set the feature row style into the polygon options- Parameters:
polygonOptions- polygon optionsfeatureRow- feature row- Returns:
- true if style was set into the polygon options
-
createPolygonOptions
public PolygonOptions createPolygonOptions(FeatureStyle featureStyle)
Create new polygon options populated with the feature style- Parameters:
featureStyle- feature style- Returns:
- polygon options populated with the feature style
-
setFeatureStyle
public boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureStyle featureStyle)
Set the feature style into the polygon options- Parameters:
polygonOptions- polygon optionsfeatureStyle- feature style- Returns:
- true if style was set into the polygon options
-
createPolygonOptions
public PolygonOptions createPolygonOptions(StyleRow style)
Create new polygon options populated with the style- Parameters:
style- style row- Returns:
- polygon options populated with the style
-
setStyle
public boolean setStyle(PolygonOptions polygonOptions, StyleRow style)
Set the style into the polygon options- Parameters:
polygonOptions- polygon optionsstyle- style row- Returns:
- true if style was set into the polygon options
-
-