public class BasicTiledImageLayerBulkDownloader extends BulkRetrievalThread
Thread
and is meant to operate in its own thread.
The sector and resolution associated with the downloader are specified during construction and are final.
Modifier and Type | Class and Description |
---|---|
protected class |
BasicTiledImageLayerBulkDownloader.BulkDownloadPostProcessor |
Modifier and Type | Field and Description |
---|---|
protected static long |
DEFAULT_AVERAGE_FILE_SIZE |
protected BasicTiledImageLayer |
layer |
protected int |
level |
protected static int |
MAX_TILE_COUNT_PER_REGION |
protected java.util.ArrayList<TextureTile> |
missingTiles |
fileStore, progress, resolution, retrievable, RETRIEVAL_SERVICE_POLL_DELAY, retrievalListeners, sector
Constructor and Description |
---|
BasicTiledImageLayerBulkDownloader(BasicTiledImageLayer layer,
Sector sector,
double resolution,
BulkRetrievalListener listener)
Constructs a downloader to retrieve imagery not currently available in the WorldWind file cache.
|
BasicTiledImageLayerBulkDownloader(BasicTiledImageLayer layer,
Sector sector,
double resolution,
FileStore fileStore,
BulkRetrievalListener listener)
Constructs a downloader to retrieve imagery not currently available in a specified file store.
|
Modifier and Type | Method and Description |
---|---|
protected void |
callRetrievalListeners(Retriever retriever,
TextureTile tile) |
protected long |
computeAverageTileSize(java.io.File dir) |
protected Sector[] |
computeRandomRegions(Sector sector,
int div,
int numRegions) |
protected int |
computeRegionDivisions(Sector sector,
int levelNumber,
int maxCount) |
protected BasicTiledImageLayer.DownloadPostProcessor |
createBulkDownloadPostProcessor(TextureTile tile) |
protected long |
estimateAverageTileSize() |
protected long |
estimateMissingTilesCount(int numSamples) |
protected long |
getEstimatedMissingDataSize()
Get the estimated size in byte of the missing imagery for the object's
Sector , resolution and file store. |
protected java.util.ArrayList<TextureTile> |
getMissingTilesInSector(Sector sector,
int levelNumber) |
protected java.util.Iterator<Sector> |
getRegionIterator(Sector sector,
int div) |
protected boolean |
isTileLocalOrAbsent(TextureTile tile) |
protected void |
normalizeProgress() |
protected void |
removeAbsentTile(TextureTile tile) |
protected void |
removeRetrievedTile(TextureTile tile) |
void |
run() |
protected void |
submitMissingTilesRequests() |
addRetrievalListener, callRetrievalListeners, getFileStore, getProgress, getResolution, getRetrievable, getSector, hasRetrievalListeners, removeRetrievalListener
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected static final long DEFAULT_AVERAGE_FILE_SIZE
protected final BasicTiledImageLayer layer
protected final int level
protected static final int MAX_TILE_COUNT_PER_REGION
protected java.util.ArrayList<TextureTile> missingTiles
public BasicTiledImageLayerBulkDownloader(BasicTiledImageLayer layer, Sector sector, double resolution, BulkRetrievalListener listener)
The thread returned is not started during construction, the caller must start the thread.
layer
- the layer for which to download imagery.sector
- the sector to download data for. This value is final.resolution
- the target resolution, provided in radians of latitude per texel. This value is final.listener
- an optional retrieval listener. May be null.java.lang.IllegalArgumentException
- if either the layer or sector are null, or the resolution is less than zero.public BasicTiledImageLayerBulkDownloader(BasicTiledImageLayer layer, Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
The thread returned is not started during construction, the caller must start the thread.
layer
- the layer for which to download imagery.sector
- the sector to download data for. This value is final.resolution
- the target resolution, provided in radians of latitude per texel. This value is final.fileStore
- the file store in which to place the downloaded elevations.listener
- an optional retrieval listener. May be null.java.lang.IllegalArgumentException
- if either the layer, the sector or file store are null, or the resolution is
less than zero.protected void callRetrievalListeners(Retriever retriever, TextureTile tile)
protected long computeAverageTileSize(java.io.File dir)
protected Sector[] computeRandomRegions(Sector sector, int div, int numRegions)
protected int computeRegionDivisions(Sector sector, int levelNumber, int maxCount)
protected BasicTiledImageLayer.DownloadPostProcessor createBulkDownloadPostProcessor(TextureTile tile)
protected long estimateAverageTileSize()
protected long estimateMissingTilesCount(int numSamples)
protected long getEstimatedMissingDataSize()
Sector
, resolution and file store.
Note that the target resolution must be provided in radian latitude per texel - which is the resolution in meter
divided by the globe radius.protected java.util.ArrayList<TextureTile> getMissingTilesInSector(Sector sector, int levelNumber) throws java.lang.InterruptedException
java.lang.InterruptedException
protected boolean isTileLocalOrAbsent(TextureTile tile)
protected void normalizeProgress()
protected void removeAbsentTile(TextureTile tile)
protected void removeRetrievedTile(TextureTile tile)
public void run()
run
in interface java.lang.Runnable
run
in class BulkRetrievalThread
protected void submitMissingTilesRequests() throws java.lang.InterruptedException
java.lang.InterruptedException