public class BasicTiledImageLayer extends TiledImageLayer implements BulkRetrievable
Modifier and Type | Class and Description |
---|---|
protected static class |
BasicTiledImageLayer.DownloadPostProcessor |
protected static class |
BasicTiledImageLayer.RequestTask |
TiledImageLayer.CompositionRetrievalPostProcessor, TiledImageLayer.LevelComparer
Modifier and Type | Field and Description |
---|---|
protected Object |
fileLock |
protected static int |
RESOURCE_ID_OGC_CAPABILITIES |
atMaxResolution, currentResourceTile, currentTiles, detailHint, detailHintOrigin, drawBoundingVolumes, drawTileBoundaries, forceLevelZeroLoads, levelComparer, levels, levelZeroLoaded, requestQ, retainLevelZeroTiles, supportedImageFormats, textureFormat, tileCountName, topLevels, useMipMaps, useTransparentTextures
Constructor and Description |
---|
BasicTiledImageLayer(AVList params) |
BasicTiledImageLayer(Document dom,
AVList params) |
BasicTiledImageLayer(Element domElement,
AVList params) |
BasicTiledImageLayer(LevelSet levelSet) |
BasicTiledImageLayer(String restorableStateInXml) |
Modifier and Type | Method and Description |
---|---|
protected void |
addTileToCache(TextureTile tile) |
protected Document |
createConfigurationDocument(AVList params) |
protected BasicTiledImageLayer.DownloadPostProcessor |
createDownloadPostProcessor(TextureTile tile) |
protected BasicTiledImageLayer.RequestTask |
createRequestTask(TextureTile tile) |
protected void |
doGetRestorableState(RestorableSupport rs,
RestorableSupport.StateObject context) |
protected void |
doRestoreState(RestorableSupport rs,
RestorableSupport.StateObject context) |
protected void |
doRestoreStateForObject(RestorableSupport rs,
RestorableSupport.StateObject so) |
protected void |
doWriteConfigurationParams(FileStore fileStore,
String fileName,
AVList params) |
protected void |
forceTextureLoad(TextureTile tile) |
protected AVList |
getConfigurationParams(AVList params) |
long |
getEstimatedMissingDataSize(Sector sector,
double resolution)
Get the estimated size in bytes of the imagery not in the World Wind file cache for the given sector and
resolution.
|
long |
getEstimatedMissingDataSize(Sector sector,
double resolution,
FileStore fileStore)
Get the estimated size in bytes of the imagery not in a specified file store for a specified sector and
resolution.
|
protected static AVList |
getParamsFromDocument(Element domElement,
AVList params) |
String |
getRestorableState()
Returns an XML document string describing the object's state.
|
void |
getRestorableStateForAVPair(String key,
Object value,
RestorableSupport rs,
RestorableSupport.StateObject context) |
protected void |
initFromOGCCapabilitiesResource(WMSCapabilities caps,
AVList params)
Initializes this Layer's expiry time property from the specified WMS Capabilities document and parameter list
describing the WMS layer names associated with this Layer.
|
protected boolean |
isRetrieveResources()
Returns a boolean value indicating if this Layer should retrieve any non-tile resources, either online or in the
local filesystem, and initialize itself using those resources.
|
protected boolean |
isTextureFileExpired(TextureTile tile,
URL textureURL,
FileStore fileStore) |
protected boolean |
loadTexture(TextureTile tile,
URL textureURL) |
BulkRetrievalThread |
makeLocal(Sector sector,
double resolution,
BulkRetrievalListener listener)
Start a new
BulkRetrievalThread that downloads all imagery for a given sector and resolution to the
current World Wind file cache, without downloading imagery that is already in the cache. |
BulkRetrievalThread |
makeLocal(Sector sector,
double resolution,
FileStore fileStore,
BulkRetrievalListener listener)
Start a new
BulkRetrievalThread that downloads all imagery for a given sector and resolution to a
specified FileStore , without downloading imagery that is already in the file store. |
protected boolean |
needsConfigurationFile(FileStore fileStore,
String fileName,
AVList params,
boolean removeIfExpired) |
protected TextureData |
readTexture(URL url,
String textureFormat,
boolean useMipMaps)
Reads and returns the texture data at the specified URL, optionally converting it to the specified format and
generating mip-maps.
|
protected void |
requestTexture(DrawContext dc,
TextureTile tile) |
protected static AVList |
restorableStateToParams(String stateInXml) |
void |
restoreState(String stateInXml)
Restores the object's state to what is described in the specified XML document string.
|
protected static void |
restoreStateForParams(RestorableSupport rs,
RestorableSupport.StateObject context,
AVList params) |
protected void |
retrieveLocalTexture(TextureTile tile,
BasicTiledImageLayer.DownloadPostProcessor postProcessor) |
protected void |
retrieveRemoteTexture(TextureTile tile,
BasicTiledImageLayer.DownloadPostProcessor postProcessor) |
protected String |
retrieveResources()
Retrieves any non-tile resources associated with this Layer, either online or in the local filesystem, and
initializes properties of this Layer using those resources.
|
protected void |
retrieveTexture(TextureTile tile,
BasicTiledImageLayer.DownloadPostProcessor postProcessor) |
protected static void |
setFallbacks(AVList params) |
protected void |
startResourceRetrieval()
Starts retrieving non-tile resources associated with this Layer in a non-rendering thread.
|
protected void |
writeConfigurationFile(FileStore fileStore) |
protected void |
writeConfigurationParams(FileStore fileStore,
AVList params) |
addTile, addTileOrDescendants, addTileToCurrent, assembleTiles, atMaxLevel, checkTextureExpiration, composeImageForSector, computeLevelForResolution, computeReferencePoint, countImagesInSector, countImagesInSector, createTiledImageLayerConfigDocument, createTiledImageLayerConfigElements, createTopLevelTiles, doRender, downloadImage, draw, drawBoundingVolumes, drawTileIDs, getAvailableImageFormats, getDefaultImageFormat, getDetailFactor, getDetailHint, getImage, getLegacyTiledImageLayerConfigParams, getLevels, getMaxEffectiveAltitude, getMinEffectiveAltitude, getReferencePoint, getRequestQ, getTextureFormat, getTiledImageLayerConfigParams, getTilesInSector, getTopLevels, getValue, isAtMaxResolution, isDrawBoundingVolumes, isDrawTileBoundaries, isDrawTileIDs, isForceLevelZeroLoads, isImageFormatAvailable, isLayerInView, isMultiResolution, isRetainLevelZeroTiles, isTileVisible, isUseMipMaps, isUseTransparentTextures, loadAllTopLevelTextures, meetsRenderCriteria, needToSplit, render, requestImage, retrieveLocalImage, retrieveRemoteImage, sendRequests, setAvailableImageFormats, setBlendingFunction, setDetailHint, setDrawBoundingVolumes, setDrawTileBoundaries, setDrawTileIDs, setExpiryTime, setForceLevelZeroLoads, setName, setRetainLevelZeroTiles, setTextureFormat, setUseMipMaps, setUseTransparentTextures, setValue
createLayerConfigElements, dispose, doPick, doPreRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getScale, getScreenCredit, isEnabled, isLayerActive, isLayerConfigDocument, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, setDataFileStore, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, toString
onMessage, propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
propertyChange
onMessage
protected final Object fileLock
protected static final int RESOURCE_ID_OGC_CAPABILITIES
public BasicTiledImageLayer(AVList params)
public BasicTiledImageLayer(LevelSet levelSet)
public BasicTiledImageLayer(String restorableStateInXml)
protected void addTileToCache(TextureTile tile)
protected BasicTiledImageLayer.DownloadPostProcessor createDownloadPostProcessor(TextureTile tile)
protected BasicTiledImageLayer.RequestTask createRequestTask(TextureTile tile)
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
protected void doRestoreStateForObject(RestorableSupport rs, RestorableSupport.StateObject so)
protected void doWriteConfigurationParams(FileStore fileStore, String fileName, AVList params)
protected void forceTextureLoad(TextureTile tile)
forceTextureLoad
in class TiledImageLayer
public long getEstimatedMissingDataSize(Sector sector, double resolution)
getEstimatedMissingDataSize
in interface BulkRetrievable
sector
- the sector to estimate.resolution
- the target resolution, provided in radians of latitude per texel.IllegalArgumentException
- if the sector is null or the resolution is less than zero.public long getEstimatedMissingDataSize(Sector sector, double resolution, FileStore fileStore)
getEstimatedMissingDataSize
in interface BulkRetrievable
sector
- the sector to estimate.resolution
- the target resolution, provided in radians of latitude per texel.fileStore
- the file store to examine. If null the current World Wind file cache is used.IllegalArgumentException
- if the sector is null or the resolution is less than zero.protected static AVList getParamsFromDocument(Element domElement, AVList params)
public String getRestorableState()
Restorable
restoreState
and passing the XML document.getRestorableState
in interface Restorable
getRestorableState
in class AbstractLayer
public void getRestorableStateForAVPair(String key, Object value, RestorableSupport rs, RestorableSupport.StateObject context)
getRestorableStateForAVPair
in class AVListImpl
protected void initFromOGCCapabilitiesResource(WMSCapabilities caps, AVList params)
SwingUtilities.invokeLater(Runnable)
.caps
- the WMS Capabilities document retrieved from this Layer's WMS server.params
- the parameter list describing the WMS layer names associated with this Layer.IllegalArgumentException
- if either the Capabilities or the parameter list is null.protected boolean isRetrieveResources()
true
if this Layer should retrieve any non-tile resources, and false
otherwise.protected boolean isTextureFileExpired(TextureTile tile, URL textureURL, FileStore fileStore)
protected boolean loadTexture(TextureTile tile, URL textureURL)
public BulkRetrievalThread makeLocal(Sector sector, double resolution, BulkRetrievalListener listener)
BulkRetrievalThread
that downloads all imagery for a given sector and resolution to the
current World Wind file cache, without downloading imagery that is already in the cache.
This method creates and starts a thread to perform the download. A reference to the thread is returned. To create
a downloader that has not been started, construct a BasicTiledImageLayerBulkDownloader
.
Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in
meters divided by the globe radius.makeLocal
in interface BulkRetrievable
sector
- the sector to download imagery for.resolution
- the target resolution, provided in radians of latitude per texel.listener
- an optional retrieval listener. May be null.BulkRetrievalThread
executing the retrieval or null
if the specified sector does
not intersect the layer bounding sector.IllegalArgumentException
- if the sector is null or the resolution is less than zero.BasicTiledImageLayerBulkDownloader
public BulkRetrievalThread makeLocal(Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener)
BulkRetrievalThread
that downloads all imagery for a given sector and resolution to a
specified FileStore
, without downloading imagery that is already in the file store.
This method creates and starts a thread to perform the download. A reference to the thread is returned. To create
a downloader that has not been started, construct a BasicTiledImageLayerBulkDownloader
.
Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in
meters divided by the globe radius.makeLocal
in interface BulkRetrievable
sector
- the sector to download data for.resolution
- the target resolution, provided in radians of latitude per texel.fileStore
- the file store in which to place the downloaded imagery. If null the current World Wind file
cache is used.listener
- an optional retrieval listener. May be null.BulkRetrievalThread
executing the retrieval or null
if the specified sector does
not intersect the layer bounding sector.IllegalArgumentException
- if the sector is null or the resolution is less than zero.BasicTiledImageLayerBulkDownloader
protected boolean needsConfigurationFile(FileStore fileStore, String fileName, AVList params, boolean removeIfExpired)
protected TextureData readTexture(URL url, String textureFormat, boolean useMipMaps)
textureFormat
is a recognized mime type, this returns the texture data in
the specified format. Otherwise, this returns the texture data in its native format. If useMipMaps
is true, this generates mip maps for any non-DDS texture data, and uses any mip-maps contained in DDS texture
data.
Supported texture formats are as follows: image/dds
- Returns DDS texture data, converting
the data to DDS if necessary. If the data is already in DDS format it's returned as-is.url
- the URL referencing the texture data to read.textureFormat
- the texture data format to return.useMipMaps
- true to generate mip-maps for the texture data or use mip maps already in the texture data,
and false to read the texture data without generating or using mip-maps.protected void requestTexture(DrawContext dc, TextureTile tile)
requestTexture
in class TiledImageLayer
public void restoreState(String stateInXml)
Restorable
restoreState
in interface Restorable
restoreState
in class AbstractLayer
stateInXml
- an XML document string describing an object's state.protected static void restoreStateForParams(RestorableSupport rs, RestorableSupport.StateObject context, AVList params)
protected void retrieveLocalTexture(TextureTile tile, BasicTiledImageLayer.DownloadPostProcessor postProcessor)
protected void retrieveRemoteTexture(TextureTile tile, BasicTiledImageLayer.DownloadPostProcessor postProcessor)
protected String retrieveResources()
AVKey.RETRIEVAL_STATE_SUCCESSFUL
indicates the retrieval succeeded, AVKey.RETRIEVAL_STATE_ERROR
indicates the retrieval failed with errors, and
null
indicates the retrieval state is unknown. This method may invoke blocking I/O operations, and
therefore should not be executed from the rendering thread.AVKey.RETRIEVAL_STATE_SUCCESSFUL
if the retrieval succeeded, AVKey.RETRIEVAL_STATE_ERROR
if the retrieval failed with errors, and null
if the retrieval state is unknown.protected void retrieveTexture(TextureTile tile, BasicTiledImageLayer.DownloadPostProcessor postProcessor)
protected static void setFallbacks(AVList params)
protected void startResourceRetrieval()
protected void writeConfigurationFile(FileStore fileStore)