Modifier and Type | Class and Description |
---|---|
private static class |
WmsCache.CacheEntry |
private static class |
WmsCache.ProjectionEntries |
Modifier and Type | Field and Description |
---|---|
private Set<ProjectionBounds> |
areaToCache |
private File |
cacheDir |
private Map<String,WmsCache.ProjectionEntries> |
entries |
private static String |
INDEX_FILENAME |
private static String |
LAYERS_INDEX_FILENAME |
private Map<WmsCache.CacheEntry,SoftReference<BufferedImage>> |
memoryCache |
private static StringProperty |
PROP_CACHE_PATH |
private int |
tileSize |
private int |
totalFileSize |
private boolean |
totalFileSizeDirty |
Modifier and Type | Method and Description |
---|---|
protected String |
cacheDirPath() |
private int |
calculateTotalFileSize() |
void |
cleanSmallFiles(int size) |
private WmsCache.CacheEntry |
findEntry(WmsCache.ProjectionEntries projectionEntries,
double pixelPerDegree,
double east,
double north) |
private String |
generateFileName(WmsCache.ProjectionEntries projectionEntries,
double pixelPerDegree,
Projection projection,
double east,
double north,
String mimeType) |
private String |
getCacheDirectory(String url) |
BufferedImage |
getExactMatch(Projection projection,
double pixelPerDegree,
double east,
double north) |
private File |
getImageFile(WmsCache.ProjectionEntries projection,
WmsCache.CacheEntry entry) |
BufferedImage |
getPartialMatch(Projection projection,
double pixelPerDegree,
double east,
double north) |
private WmsCache.ProjectionEntries |
getProjectionEntries(Projection projection) |
private WmsCache.ProjectionEntries |
getProjectionEntries(String projection,
String cacheDirectory) |
boolean |
hasExactMatch(Projection projection,
double pixelPerDegree,
double east,
double north) |
private boolean |
isInsideAreaToCache(WmsCache.CacheEntry cacheEntry) |
private BufferedImage |
loadImage(WmsCache.ProjectionEntries projectionEntries,
WmsCache.CacheEntry entry) |
void |
loadIndex() |
static String |
printDate(Calendar c) |
private void |
removeNonReferencedFiles() |
void |
saveIndex() |
void |
saveToCache(BufferedImage img,
InputStream imageData,
Projection projection,
double pixelPerDegree,
double east,
double north) |
void |
setAreaToCache(Set<ProjectionBounds> areaToCache) |
private static final StringProperty PROP_CACHE_PATH
private static final String INDEX_FILENAME
private static final String LAYERS_INDEX_FILENAME
private final Map<String,WmsCache.ProjectionEntries> entries
private final int tileSize
private int totalFileSize
private boolean totalFileSizeDirty
private Map<WmsCache.CacheEntry,SoftReference<BufferedImage>> memoryCache
private Set<ProjectionBounds> areaToCache
protected String cacheDirPath()
private String getCacheDirectory(String url)
private WmsCache.ProjectionEntries getProjectionEntries(Projection projection)
private WmsCache.ProjectionEntries getProjectionEntries(String projection, String cacheDirectory)
public void loadIndex()
private void removeNonReferencedFiles()
private int calculateTotalFileSize()
public void saveIndex()
private File getImageFile(WmsCache.ProjectionEntries projection, WmsCache.CacheEntry entry)
private BufferedImage loadImage(WmsCache.ProjectionEntries projectionEntries, WmsCache.CacheEntry entry) throws IOException
IOException
private WmsCache.CacheEntry findEntry(WmsCache.ProjectionEntries projectionEntries, double pixelPerDegree, double east, double north)
public boolean hasExactMatch(Projection projection, double pixelPerDegree, double east, double north)
public BufferedImage getExactMatch(Projection projection, double pixelPerDegree, double east, double north)
public BufferedImage getPartialMatch(Projection projection, double pixelPerDegree, double east, double north)
private String generateFileName(WmsCache.ProjectionEntries projectionEntries, double pixelPerDegree, Projection projection, double east, double north, String mimeType)
public void saveToCache(BufferedImage img, InputStream imageData, Projection projection, double pixelPerDegree, double east, double north) throws IOException
img
- Used only when overlapping is used, when not used, used raw from imageDataimageData
- projection
- pixelPerDegree
- east
- north
- IOException
public void cleanSmallFiles(int size)
private boolean isInsideAreaToCache(WmsCache.CacheEntry cacheEntry)
public void setAreaToCache(Set<ProjectionBounds> areaToCache)