Class TiledImageLayer
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.layers.AbstractLayer
-
- gov.nasa.worldwind.layers.TiledImageLayer
-
- All Implemented Interfaces:
AVList
,Disposable
,MessageListener
,Layer
,Restorable
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
BasicTiledImageLayer
,RPFTiledImageLayer
public abstract class TiledImageLayer extends AbstractLayer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
TiledImageLayer.CompositionRetrievalPostProcessor
protected static class
TiledImageLayer.LevelComparer
-
Field Summary
Fields Modifier and Type Field Description protected boolean
atMaxResolution
protected TextureTile
currentResourceTile
protected java.util.ArrayList<TextureTile>
currentTiles
protected double
detailHint
protected double
detailHintOrigin
protected boolean
drawBoundingVolumes
protected boolean
drawTileBoundaries
protected boolean
forceLevelZeroLoads
protected static TiledImageLayer.LevelComparer
levelComparer
protected LevelSet
levels
protected boolean
levelZeroLoaded
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable>
requestQ
protected boolean
retainLevelZeroTiles
protected java.util.ArrayList<java.lang.String>
supportedImageFormats
protected java.lang.String
textureFormat
protected java.lang.String
tileCountName
protected java.util.ArrayList<TextureTile>
topLevels
protected boolean
useMipMaps
protected boolean
useTransparentTextures
-
Constructor Summary
Constructors Constructor Description TiledImageLayer(LevelSet levelSet)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addTile(DrawContext dc, TextureTile tile)
protected void
addTileOrDescendants(DrawContext dc, TextureTile tile)
protected void
addTileToCurrent(TextureTile tile)
protected void
assembleTiles(DrawContext dc)
protected boolean
atMaxLevel(DrawContext dc)
protected void
checkTextureExpiration(DrawContext dc, java.util.List<TextureTile> tiles)
java.awt.image.BufferedImage
composeImageForSector(Sector sector, int canvasWidth, int canvasHeight, double aspectRatio, int levelNumber, java.lang.String mimeType, boolean abortOnError, java.awt.image.BufferedImage image, int timeout)
Create an image for the portion of this layer lying within a specified sector.The image is created at a specified aspect ratio within a canvas of a specified size.int
computeLevelForResolution(Sector sector, double resolution)
protected Vec4
computeReferencePoint(DrawContext dc)
long
countImagesInSector(Sector sector)
long
countImagesInSector(Sector sector, int levelNumber)
static org.w3c.dom.Document
createTiledImageLayerConfigDocument(AVList params)
Creates a configuration document for a TiledImageLayer described by the specified params.static org.w3c.dom.Element
createTiledImageLayerConfigElements(AVList params, org.w3c.dom.Element context)
Appends TiledImageLayer configuration parameters as elements to the specified context.protected void
createTopLevelTiles()
protected void
doRender(DrawContext dc)
protected void
downloadImage(TextureTile tile, java.lang.String mimeType, int timeout)
protected void
draw(DrawContext dc)
protected void
drawBoundingVolumes(DrawContext dc, java.util.ArrayList<TextureTile> tiles)
protected void
drawTileIDs(DrawContext dc, java.util.ArrayList<TextureTile> tiles)
protected abstract void
forceTextureLoad(TextureTile tile)
java.util.List<java.lang.String>
getAvailableImageFormats()
java.lang.String
getDefaultImageFormat()
protected double
getDetailFactor()
double
getDetailHint()
Indicates the layer's detail hint, which is described insetDetailHint(double)
.protected java.awt.image.BufferedImage
getImage(TextureTile tile, java.lang.String mimeType, int timeout)
protected static AVList
getLegacyTiledImageLayerConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses TiledImageLayer configuration parameters from previous versions of configuration documents.LevelSet
getLevels()
java.lang.Double
getMaxEffectiveAltitude(java.lang.Double radius)
Indicates the altitude above which this layer likely has low value or is not expected to be active.java.lang.Double
getMinEffectiveAltitude(java.lang.Double radius)
Indicates the altitude below which this layer likely has low value or is not expected to be active.protected Vec4
getReferencePoint(DrawContext dc)
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable>
getRequestQ()
java.lang.String
getTextureFormat()
Returns the format used to store images in texture memory, or null if images are stored in their native format.static AVList
getTiledImageLayerConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses TiledImageLayer configuration parameters from the specified DOM document.TextureTile[][]
getTilesInSector(Sector sector, int levelNumber)
java.util.List<TextureTile>
getTopLevels()
java.lang.Object
getValue(java.lang.String key)
Returns the value for a specified key.boolean
isAtMaxResolution()
Indicates whether the most recent rendering of the layer rendered the highest resolution imagery or other data available.boolean
isDrawBoundingVolumes()
boolean
isDrawTileBoundaries()
boolean
isDrawTileIDs()
boolean
isForceLevelZeroLoads()
boolean
isImageFormatAvailable(java.lang.String imageFormat)
boolean
isLayerInView(DrawContext dc)
Indicates whether the layer is in the view.boolean
isMultiResolution()
Indicates whether the layer provides multiple resolutions of imagery or other data.boolean
isRetainLevelZeroTiles()
protected boolean
isTileVisible(DrawContext dc, TextureTile tile)
boolean
isUseMipMaps()
boolean
isUseTransparentTextures()
protected void
loadAllTopLevelTextures(DrawContext dc)
protected boolean
meetsRenderCriteria(DrawContext dc, TextureTile tile)
protected boolean
needToSplit(DrawContext dc, Sector sector, Level level)
void
render(DrawContext dc)
Cause the layer to draw its representation.protected java.awt.image.BufferedImage
requestImage(TextureTile tile, java.lang.String mimeType)
protected abstract void
requestTexture(DrawContext dc, TextureTile tile)
protected void
retrieveLocalImage(TextureTile tile, java.lang.String mimeType, int timeout)
protected void
retrieveRemoteImage(TextureTile tile, java.lang.String mimeType, int timeout)
protected void
sendRequests()
protected void
setAvailableImageFormats(java.lang.String[] formats)
protected void
setBlendingFunction(DrawContext dc)
void
setDetailHint(double detailHint)
Modifies the default relationship of image resolution to screen resolution as the viewing altitude changes.void
setDrawBoundingVolumes(boolean drawBoundingVolumes)
void
setDrawTileBoundaries(boolean drawTileBoundaries)
void
setDrawTileIDs(boolean drawTileIDs)
void
setExpiryTime(long expiryTime)
Specifies the time of the layer's most recent dataset update, beyond which cached data is invalid.void
setForceLevelZeroLoads(boolean forceLevelZeroLoads)
void
setName(java.lang.String name)
Set the layer's name.void
setRetainLevelZeroTiles(boolean retainLevelZeroTiles)
void
setTextureFormat(java.lang.String textureFormat)
Specifies the format used to store images in texture memory, or null to store images in their native format.void
setUseMipMaps(boolean useMipMaps)
void
setUseTransparentTextures(boolean useTransparentTextures)
java.lang.Object
setValue(java.lang.String key, java.lang.Object value)
Adds a key/value pair to the list.-
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPick, doPreRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getRestorableState, getScale, getScreenCredit, isEnabled, isLayerActive, isLayerConfigDocument, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, restoreState, setDataFileStore, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, toString
-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
-
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Field Detail
-
levelComparer
protected static final TiledImageLayer.LevelComparer levelComparer
-
levels
protected final LevelSet levels
-
topLevels
protected java.util.ArrayList<TextureTile> topLevels
-
forceLevelZeroLoads
protected boolean forceLevelZeroLoads
-
levelZeroLoaded
protected boolean levelZeroLoaded
-
retainLevelZeroTiles
protected boolean retainLevelZeroTiles
-
tileCountName
protected java.lang.String tileCountName
-
detailHintOrigin
protected double detailHintOrigin
-
detailHint
protected double detailHint
-
useMipMaps
protected boolean useMipMaps
-
useTransparentTextures
protected boolean useTransparentTextures
-
supportedImageFormats
protected java.util.ArrayList<java.lang.String> supportedImageFormats
-
textureFormat
protected java.lang.String textureFormat
-
drawTileBoundaries
protected boolean drawTileBoundaries
-
drawBoundingVolumes
protected boolean drawBoundingVolumes
-
currentTiles
protected java.util.ArrayList<TextureTile> currentTiles
-
currentResourceTile
protected TextureTile currentResourceTile
-
atMaxResolution
protected boolean atMaxResolution
-
requestQ
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable> requestQ
-
-
Constructor Detail
-
TiledImageLayer
public TiledImageLayer(LevelSet levelSet)
-
-
Method Detail
-
requestTexture
protected abstract void requestTexture(DrawContext dc, TextureTile tile)
-
forceTextureLoad
protected abstract void forceTextureLoad(TextureTile tile)
-
setValue
public java.lang.Object setValue(java.lang.String key, java.lang.Object value)
Description copied from interface:AVList
Adds a key/value pair to the list. Replaces an existing key/value pair if the list already contains the key.- Specified by:
setValue
in interfaceAVList
- Overrides:
setValue
in classAVListImpl
- Parameters:
key
- the attribute name. May not benull
.value
- the attribute value. May benull
, in which case any existing value for the key is removed from the collection.- Returns:
- previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.
-
getValue
public java.lang.Object getValue(java.lang.String key)
Description copied from interface:AVList
Returns the value for a specified key.- Specified by:
getValue
in interfaceAVList
- Overrides:
getValue
in classAVListImpl
- Parameters:
key
- the attribute name. May not benull
.- Returns:
- the attribute value if one exists in the collection, otherwise
null
.
-
setName
public void setName(java.lang.String name)
Description copied from interface:Layer
Set the layer's name. The name is a convenience attribute typically used to identify the layer in user interfaces. By default, a layer has no name.- Specified by:
setName
in interfaceLayer
- Overrides:
setName
in classAbstractLayer
- Parameters:
name
- the name to assign to the layer.
-
isForceLevelZeroLoads
public boolean isForceLevelZeroLoads()
-
setForceLevelZeroLoads
public void setForceLevelZeroLoads(boolean forceLevelZeroLoads)
-
isRetainLevelZeroTiles
public boolean isRetainLevelZeroTiles()
-
setRetainLevelZeroTiles
public void setRetainLevelZeroTiles(boolean retainLevelZeroTiles)
-
isDrawTileIDs
public boolean isDrawTileIDs()
-
setDrawTileIDs
public void setDrawTileIDs(boolean drawTileIDs)
-
isDrawTileBoundaries
public boolean isDrawTileBoundaries()
-
setDrawTileBoundaries
public void setDrawTileBoundaries(boolean drawTileBoundaries)
-
isDrawBoundingVolumes
public boolean isDrawBoundingVolumes()
-
setDrawBoundingVolumes
public void setDrawBoundingVolumes(boolean drawBoundingVolumes)
-
getDetailHint
public double getDetailHint()
Indicates the layer's detail hint, which is described insetDetailHint(double)
.- Returns:
- the detail hint
- See Also:
setDetailHint(double)
-
setDetailHint
public void setDetailHint(double detailHint)
Modifies the default relationship of image resolution to screen resolution as the viewing altitude changes. Values greater than 0 cause imagery to appear at higher resolution at greater altitudes than normal, but at an increased performance cost. Values less than 0 decrease the default resolution at any given altitude. The default value is 0. Values typically range between -0.5 and 0.5.Note: The resolution-to-height relationship is defined by a scale factor that specifies the approximate size of discernible lengths in the image relative to eye distance. The scale is specified as a power of 10. A value of 3, for example, specifies that 1 meter on the surface should be distinguishable from an altitude of 10^3 meters (1000 meters). The default scale is 1/10^2.8, (1 over 10 raised to the power 2.8). The detail hint specifies deviations from that default. A detail hint of 0.2 specifies a scale of 1/1000, i.e., 1/10^(2.8 + .2) = 1/10^3. Scales much larger than 3 typically cause the applied resolution to be higher than discernible for the altitude. Such scales significantly decrease performance.
- Parameters:
detailHint
- the degree to modify the default relationship of image resolution to screen resolution with changing view altitudes. Values greater than 1 increase the resolution. Values less than zero decrease the resolution. The default value is 0.
-
getLevels
public LevelSet getLevels()
-
getRequestQ
protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable> getRequestQ()
-
isMultiResolution
public boolean isMultiResolution()
Description copied from interface:Layer
Indicates whether the layer provides multiple resolutions of imagery or other data.- Specified by:
isMultiResolution
in interfaceLayer
- Overrides:
isMultiResolution
in classAbstractLayer
- Returns:
true
if the layer provides multiple resolutions, elsefalse
.
-
isAtMaxResolution
public boolean isAtMaxResolution()
Description copied from interface:Layer
Indicates whether the most recent rendering of the layer rendered the highest resolution imagery or other data available. Some layers do not track resolution. For those layers this value will always betrue
. Typically such layers also returnfalse
fromLayer.isMultiResolution()
.- Specified by:
isAtMaxResolution
in interfaceLayer
- Overrides:
isAtMaxResolution
in classAbstractLayer
- Returns:
true
if the layer is at maximum resolution, otherwisefalse
.
-
getTextureFormat
public java.lang.String getTextureFormat()
Returns the format used to store images in texture memory, or null if images are stored in their native format.- Returns:
- the texture image format; null if images are stored in their native format.
- See Also:
setTextureFormat(String)
-
setTextureFormat
public void setTextureFormat(java.lang.String textureFormat)
Specifies the format used to store images in texture memory, or null to store images in their native format. Supported texture formats are as follows:image/dds
- Stores images in the compressed DDS format. If the image is already in DDS format it's stored as-is.
- Parameters:
textureFormat
- the texture image format; null to store images in their native format.
-
isUseMipMaps
public boolean isUseMipMaps()
-
setUseMipMaps
public void setUseMipMaps(boolean useMipMaps)
-
isUseTransparentTextures
public boolean isUseTransparentTextures()
-
setUseTransparentTextures
public void setUseTransparentTextures(boolean useTransparentTextures)
-
setExpiryTime
public void setExpiryTime(long expiryTime)
Specifies the time of the layer's most recent dataset update, beyond which cached data is invalid. If greater than zero, the layer ignores and eliminates any in-memory or on-disk cached data older than the time specified, and requests new information from the data source. If zero, the default, the layer applies any expiry times associated with its individual levels, but only for on-disk cached data. In-memory cached data is expired only when the expiry time is specified with this method and is greater than zero. This method also overwrites the expiry times of the layer's individual levels if the value specified to the method is greater than zero.- Specified by:
setExpiryTime
in interfaceLayer
- Overrides:
setExpiryTime
in classAbstractLayer
- Parameters:
expiryTime
- the expiry time of any cached data, expressed as a number of milliseconds beyond the epoch. The default expiry time is zero.- See Also:
for a description of milliseconds beyond the epoch.
-
getTopLevels
public java.util.List<TextureTile> getTopLevels()
-
createTopLevelTiles
protected void createTopLevelTiles()
-
loadAllTopLevelTextures
protected void loadAllTopLevelTextures(DrawContext dc)
-
assembleTiles
protected void assembleTiles(DrawContext dc)
-
addTileOrDescendants
protected void addTileOrDescendants(DrawContext dc, TextureTile tile)
-
addTile
protected void addTile(DrawContext dc, TextureTile tile)
-
addTileToCurrent
protected void addTileToCurrent(TextureTile tile)
-
isTileVisible
protected boolean isTileVisible(DrawContext dc, TextureTile tile)
-
meetsRenderCriteria
protected boolean meetsRenderCriteria(DrawContext dc, TextureTile tile)
-
getDetailFactor
protected double getDetailFactor()
-
needToSplit
protected boolean needToSplit(DrawContext dc, Sector sector, Level level)
-
getMinEffectiveAltitude
public java.lang.Double getMinEffectiveAltitude(java.lang.Double radius)
Description copied from interface:Layer
Indicates the altitude below which this layer likely has low value or is not expected to be active. This value is independent of the minimum active altitude,Layer.setMinActiveAltitude(double)
and does not reflect it.The returned altitude is valid when the field of view indicated by
View.getFieldOfView()
is set to its default value. Changing the field of view to any value other than the default may change this layer's minimum effective altitude, but the returned altitude will not reflect that change.- Specified by:
getMinEffectiveAltitude
in interfaceLayer
- Overrides:
getMinEffectiveAltitude
in classAbstractLayer
- Parameters:
radius
- the radius of theGlobe
the layer is associated with. May be null, in which case the Earth's equatorial radius is used,Earth.WGS84_EQUATORIAL_RADIUS
.- Returns:
- the layer's minimum effective altitude.
-
getMaxEffectiveAltitude
public java.lang.Double getMaxEffectiveAltitude(java.lang.Double radius)
Description copied from interface:Layer
Indicates the altitude above which this layer likely has low value or is not expected to be active. This value is independent of the maximum active altitude,Layer.setMaxActiveAltitude(double)
and does not reflect it.The returned altitude is valid when the field of view indicated by
View.getFieldOfView()
is set to its default value. Changing the field of view to any value other than the default may change this layer's maximum effective altitude, but the returned altitude will not reflect that change.- Specified by:
getMaxEffectiveAltitude
in interfaceLayer
- Overrides:
getMaxEffectiveAltitude
in classAbstractLayer
- Parameters:
radius
- the radius of theGlobe
the layer is associated with. May be null, in which case the Earth's equatorial radius is used,Earth.WGS84_EQUATORIAL_RADIUS
.- Returns:
- the layer's maximum effective altitude.
-
atMaxLevel
protected boolean atMaxLevel(DrawContext dc)
-
render
public void render(DrawContext dc)
Description copied from interface:Layer
Cause the layer to draw its representation.- Specified by:
render
in interfaceLayer
- Overrides:
render
in classAbstractLayer
- Parameters:
dc
- the current draw context
-
doRender
protected final void doRender(DrawContext dc)
- Specified by:
doRender
in classAbstractLayer
-
draw
protected void draw(DrawContext dc)
-
checkTextureExpiration
protected void checkTextureExpiration(DrawContext dc, java.util.List<TextureTile> tiles)
-
setBlendingFunction
protected void setBlendingFunction(DrawContext dc)
-
sendRequests
protected void sendRequests()
-
isLayerInView
public boolean isLayerInView(DrawContext dc)
Description copied from interface:Layer
Indicates whether the layer is in the view. The method implemented here is a default indicating the layer is in view. Subclasses able to determine their presence in the view should override this implementation.- Specified by:
isLayerInView
in interfaceLayer
- Overrides:
isLayerInView
in classAbstractLayer
- Parameters:
dc
- the current draw context- Returns:
true
if the layer is in the view,false
otherwise.
-
computeReferencePoint
protected Vec4 computeReferencePoint(DrawContext dc)
-
getReferencePoint
protected Vec4 getReferencePoint(DrawContext dc)
-
drawTileIDs
protected void drawTileIDs(DrawContext dc, java.util.ArrayList<TextureTile> tiles)
-
drawBoundingVolumes
protected void drawBoundingVolumes(DrawContext dc, java.util.ArrayList<TextureTile> tiles)
-
createTiledImageLayerConfigDocument
public static org.w3c.dom.Document createTiledImageLayerConfigDocument(AVList params)
Creates a configuration document for a TiledImageLayer described by the specified params. The returned document may be used as a construction parameter toBasicTiledImageLayer
.- Parameters:
params
- parameters describing the TiledImageLayer.- Returns:
- a configuration document for the TiledImageLayer.
-
createTiledImageLayerConfigElements
public static org.w3c.dom.Element createTiledImageLayerConfigElements(AVList params, org.w3c.dom.Element context)
Appends TiledImageLayer configuration parameters as elements to the specified context. This appends elements for the following parameters:Parameters Parameter Element Path Type AVKey.SERVICE_NAME
Service/@serviceName String AVKey.IMAGE_FORMAT
ImageFormat String AVKey.AVAILABLE_IMAGE_FORMATS
AvailableImageFormats/ImageFormat String array AVKey.FORCE_LEVEL_ZERO_LOADS
ForceLevelZeroLoads Boolean AVKey.RETAIN_LEVEL_ZERO_TILES
RetainLevelZeroTiles Boolean AVKey.TEXTURE_FORMAT
TextureFormat String AVKey.USE_MIP_MAPS
UseMipMaps Boolean AVKey.USE_TRANSPARENT_TEXTURES
UseTransparentTextures Boolean AVKey.URL_CONNECT_TIMEOUT
RetrievalTimeouts/ConnectTimeout/Time Integer milliseconds AVKey.URL_READ_TIMEOUT
RetrievalTimeouts/ReadTimeout/Time Integer milliseconds AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT
RetrievalTimeouts/StaleRequestLimit/Time Integer milliseconds AbstractLayer.createLayerConfigElements(gov.nasa.worldwind.avlist.AVList, org.w3c.dom.Element)
andDataConfigurationUtils.createLevelSetConfigElements(gov.nasa.worldwind.avlist.AVList, org.w3c.dom.Element)
.- Parameters:
params
- the key-value pairs which define the TiledImageLayer configuration parameters.context
- the XML document root on which to append TiledImageLayer configuration elements.- Returns:
- a reference to context.
- Throws:
java.lang.IllegalArgumentException
- if either the parameters or the context are null.
-
getTiledImageLayerConfigParams
public static AVList getTiledImageLayerConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses TiledImageLayer configuration parameters from the specified DOM document. This writes output as key-value pairs to params. If a parameter from the XML document already exists in params, that parameter is ignored. Supported key and parameter names are:Supported Names Parameter Element Path Type AVKey.SERVICE_NAME
Service/@serviceName String AVKey.IMAGE_FORMAT
ImageFormat String AVKey.AVAILABLE_IMAGE_FORMATS
AvailableImageFormats/ImageFormat String array AVKey.FORCE_LEVEL_ZERO_LOADS
ForceLevelZeroLoads Boolean AVKey.RETAIN_LEVEL_ZERO_TILES
RetainLevelZeroTiles Boolean AVKey.TEXTURE_FORMAT
TextureFormat Boolean AVKey.USE_MIP_MAPS
UseMipMaps Boolean AVKey.USE_TRANSPARENT_TEXTURES
UseTransparentTextures Boolean AVKey.URL_CONNECT_TIMEOUT
RetrievalTimeouts/ConnectTimeout/Time Integer milliseconds AVKey.URL_READ_TIMEOUT
RetrievalTimeouts/ReadTimeout/Time Integer milliseconds AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT
RetrievalTimeouts/StaleRequestLimit/Time Integer milliseconds AbstractLayer.getLayerConfigParams(org.w3c.dom.Element, gov.nasa.worldwind.avlist.AVList)
andDataConfigurationUtils.getLevelSetConfigParams(org.w3c.dom.Element, gov.nasa.worldwind.avlist.AVList)
.- Parameters:
domElement
- the XML document root to parse for TiledImageLayer configuration parameters.params
- the output key-value pairs which recieve the TiledImageLayer configuration parameters. A null reference is permitted.- Returns:
- a reference to params, or a new AVList if params is null.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getLegacyTiledImageLayerConfigParams
protected static AVList getLegacyTiledImageLayerConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses TiledImageLayer configuration parameters from previous versions of configuration documents. This writes output as key-value pairs to params. If a parameter from the XML document already exists in params, that parameter is ignored. Supported key and parameter names are:Supported Names Parameter Element Path Type AVKey.TEXTURE_FORMAT
CompressTextures "image/dds" if CompressTextures is "true"; null otherwise - Parameters:
domElement
- the XML document root to parse for legacy TiledImageLayer configuration parameters.params
- the output key-value pairs which recieve the TiledImageLayer configuration parameters. A null reference is permitted.- Returns:
- a reference to params, or a new AVList if params is null.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getAvailableImageFormats
public java.util.List<java.lang.String> getAvailableImageFormats()
-
isImageFormatAvailable
public boolean isImageFormatAvailable(java.lang.String imageFormat)
-
getDefaultImageFormat
public java.lang.String getDefaultImageFormat()
-
setAvailableImageFormats
protected void setAvailableImageFormats(java.lang.String[] formats)
-
requestImage
protected java.awt.image.BufferedImage requestImage(TextureTile tile, java.lang.String mimeType) throws java.net.URISyntaxException, java.io.InterruptedIOException, java.net.MalformedURLException
- Throws:
java.net.URISyntaxException
java.io.InterruptedIOException
java.net.MalformedURLException
-
downloadImage
protected void downloadImage(TextureTile tile, java.lang.String mimeType, int timeout) throws java.lang.Exception
- Throws:
java.lang.Exception
-
retrieveRemoteImage
protected void retrieveRemoteImage(TextureTile tile, java.lang.String mimeType, int timeout) throws java.lang.Exception
- Throws:
java.lang.Exception
-
retrieveLocalImage
protected void retrieveLocalImage(TextureTile tile, java.lang.String mimeType, int timeout) throws java.lang.Exception
- Throws:
java.lang.Exception
-
computeLevelForResolution
public int computeLevelForResolution(Sector sector, double resolution)
-
composeImageForSector
public java.awt.image.BufferedImage composeImageForSector(Sector sector, int canvasWidth, int canvasHeight, double aspectRatio, int levelNumber, java.lang.String mimeType, boolean abortOnError, java.awt.image.BufferedImage image, int timeout) throws java.lang.Exception
Create an image for the portion of this layer lying within a specified sector.The image is created at a specified aspect ratio within a canvas of a specified size. This returns the specified image if this layer has no content in the specified sector.- Parameters:
sector
- the sector of interest.canvasWidth
- the width of the canvas.canvasHeight
- the height of the canvas.aspectRatio
- the aspect ratio, width/height, of the window. If the aspect ratio is greater or equal to one, the full width of the canvas is used for the image; the height used is proportional to the inverse of the aspect ratio. If the aspect ratio is less than one, the full height of the canvas is used, and the width used is proportional to the aspect ratio.levelNumber
- the target level of the tiled image layer.mimeType
- the type of image to create, e.g., "png" and "jpg".abortOnError
- indicates whether to stop assembling the image if an error occurs. If false, processing continues until all portions of the layer that intersect the specified sector have been added to the image. Portions for which an error occurs will be blank.image
- if non-null, aBufferedImage
in which to place the image. If null, a new buffered image is created. The image must be the width and height specified in thecanvasWidth
andcanvasHeight
arguments.timeout
- The amount of time to allow for reading the image from the server.- Returns:
- image the assembled image, of size indicated by the
canvasWidth
andcanvasHeight
. If the specified aspect ratio is one, all pixels contain values. If the aspect ratio is greater than one, a full-width segment along the top of the canvas is blank. If the aspect ratio is less than one, a full-height segment along the right side of the canvase is blank. If theimage
argument was non-null, that buffered image is returned. - Throws:
java.lang.IllegalArgumentException
- ifsector
is null.java.lang.Exception
- Other errors.- See Also:
;
-
countImagesInSector
public long countImagesInSector(Sector sector)
-
countImagesInSector
public long countImagesInSector(Sector sector, int levelNumber)
-
getTilesInSector
public TextureTile[][] getTilesInSector(Sector sector, int levelNumber)
-
getImage
protected java.awt.image.BufferedImage getImage(TextureTile tile, java.lang.String mimeType, int timeout) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-