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 classTiledImageLayer.CompositionRetrievalPostProcessorprotected static classTiledImageLayer.LevelComparer
-
Field Summary
Fields Modifier and Type Field Description protected booleanatMaxResolutionprotected TextureTilecurrentResourceTileprotected java.util.ArrayList<TextureTile>currentTilesprotected doubledetailHintprotected doubledetailHintOriginprotected booleandrawBoundingVolumesprotected booleandrawTileBoundariesprotected booleanforceLevelZeroLoadsprotected static TiledImageLayer.LevelComparerlevelComparerprotected LevelSetlevelsprotected booleanlevelZeroLoadedprotected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable>requestQprotected booleanretainLevelZeroTilesprotected java.util.ArrayList<java.lang.String>supportedImageFormatsprotected java.lang.StringtextureFormatprotected java.lang.StringtileCountNameprotected java.util.ArrayList<TextureTile>topLevelsprotected booleanuseMipMapsprotected booleanuseTransparentTextures
-
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 voidaddTile(DrawContext dc, TextureTile tile)protected voidaddTileOrDescendants(DrawContext dc, TextureTile tile)protected voidaddTileToCurrent(TextureTile tile)protected voidassembleTiles(DrawContext dc)protected booleanatMaxLevel(DrawContext dc)protected voidcheckTextureExpiration(DrawContext dc, java.util.List<TextureTile> tiles)java.awt.image.BufferedImagecomposeImageForSector(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.intcomputeLevelForResolution(Sector sector, double resolution)protected Vec4computeReferencePoint(DrawContext dc)longcountImagesInSector(Sector sector)longcountImagesInSector(Sector sector, int levelNumber)static org.w3c.dom.DocumentcreateTiledImageLayerConfigDocument(AVList params)Creates a configuration document for a TiledImageLayer described by the specified params.static org.w3c.dom.ElementcreateTiledImageLayerConfigElements(AVList params, org.w3c.dom.Element context)Appends TiledImageLayer configuration parameters as elements to the specified context.protected voidcreateTopLevelTiles()protected voiddoRender(DrawContext dc)protected voiddownloadImage(TextureTile tile, java.lang.String mimeType, int timeout)protected voiddraw(DrawContext dc)protected voiddrawBoundingVolumes(DrawContext dc, java.util.ArrayList<TextureTile> tiles)protected voiddrawTileIDs(DrawContext dc, java.util.ArrayList<TextureTile> tiles)protected abstract voidforceTextureLoad(TextureTile tile)java.util.List<java.lang.String>getAvailableImageFormats()java.lang.StringgetDefaultImageFormat()protected doublegetDetailFactor()doublegetDetailHint()Indicates the layer's detail hint, which is described insetDetailHint(double).protected java.awt.image.BufferedImagegetImage(TextureTile tile, java.lang.String mimeType, int timeout)protected static AVListgetLegacyTiledImageLayerConfigParams(org.w3c.dom.Element domElement, AVList params)Parses TiledImageLayer configuration parameters from previous versions of configuration documents.LevelSetgetLevels()java.lang.DoublegetMaxEffectiveAltitude(java.lang.Double radius)Indicates the altitude above which this layer likely has low value or is not expected to be active.java.lang.DoublegetMinEffectiveAltitude(java.lang.Double radius)Indicates the altitude below which this layer likely has low value or is not expected to be active.protected Vec4getReferencePoint(DrawContext dc)protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable>getRequestQ()java.lang.StringgetTextureFormat()Returns the format used to store images in texture memory, or null if images are stored in their native format.static AVListgetTiledImageLayerConfigParams(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.ObjectgetValue(java.lang.String key)Returns the value for a specified key.booleanisAtMaxResolution()Indicates whether the most recent rendering of the layer rendered the highest resolution imagery or other data available.booleanisDrawBoundingVolumes()booleanisDrawTileBoundaries()booleanisDrawTileIDs()booleanisForceLevelZeroLoads()booleanisImageFormatAvailable(java.lang.String imageFormat)booleanisLayerInView(DrawContext dc)Indicates whether the layer is in the view.booleanisMultiResolution()Indicates whether the layer provides multiple resolutions of imagery or other data.booleanisRetainLevelZeroTiles()protected booleanisTileVisible(DrawContext dc, TextureTile tile)booleanisUseMipMaps()booleanisUseTransparentTextures()protected voidloadAllTopLevelTextures(DrawContext dc)protected booleanmeetsRenderCriteria(DrawContext dc, TextureTile tile)protected booleanneedToSplit(DrawContext dc, Sector sector, Level level)voidrender(DrawContext dc)Cause the layer to draw its representation.protected java.awt.image.BufferedImagerequestImage(TextureTile tile, java.lang.String mimeType)protected abstract voidrequestTexture(DrawContext dc, TextureTile tile)protected voidretrieveLocalImage(TextureTile tile, java.lang.String mimeType, int timeout)protected voidretrieveRemoteImage(TextureTile tile, java.lang.String mimeType, int timeout)protected voidsendRequests()protected voidsetAvailableImageFormats(java.lang.String[] formats)protected voidsetBlendingFunction(DrawContext dc)voidsetDetailHint(double detailHint)Modifies the default relationship of image resolution to screen resolution as the viewing altitude changes.voidsetDrawBoundingVolumes(boolean drawBoundingVolumes)voidsetDrawTileBoundaries(boolean drawTileBoundaries)voidsetDrawTileIDs(boolean drawTileIDs)voidsetExpiryTime(long expiryTime)Specifies the time of the layer's most recent dataset update, beyond which cached data is invalid.voidsetForceLevelZeroLoads(boolean forceLevelZeroLoads)voidsetName(java.lang.String name)Set the layer's name.voidsetRetainLevelZeroTiles(boolean retainLevelZeroTiles)voidsetTextureFormat(java.lang.String textureFormat)Specifies the format used to store images in texture memory, or null to store images in their native format.voidsetUseMipMaps(boolean useMipMaps)voidsetUseTransparentTextures(boolean useTransparentTextures)java.lang.ObjectsetValue(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:AVListAdds a key/value pair to the list. Replaces an existing key/value pair if the list already contains the key.- Specified by:
setValuein interfaceAVList- Overrides:
setValuein 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:AVListReturns the value for a specified key.- Specified by:
getValuein interfaceAVList- Overrides:
getValuein 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:LayerSet 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:
setNamein interfaceLayer- Overrides:
setNamein 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:LayerIndicates whether the layer provides multiple resolutions of imagery or other data.- Specified by:
isMultiResolutionin interfaceLayer- Overrides:
isMultiResolutionin classAbstractLayer- Returns:
trueif the layer provides multiple resolutions, elsefalse.
-
isAtMaxResolution
public boolean isAtMaxResolution()
Description copied from interface:LayerIndicates 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 returnfalsefromLayer.isMultiResolution().- Specified by:
isAtMaxResolutionin interfaceLayer- Overrides:
isAtMaxResolutionin classAbstractLayer- Returns:
trueif 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:
setExpiryTimein interfaceLayer- Overrides:
setExpiryTimein 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:LayerIndicates 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:
getMinEffectiveAltitudein interfaceLayer- Overrides:
getMinEffectiveAltitudein classAbstractLayer- Parameters:
radius- the radius of theGlobethe 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:LayerIndicates 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:
getMaxEffectiveAltitudein interfaceLayer- Overrides:
getMaxEffectiveAltitudein classAbstractLayer- Parameters:
radius- the radius of theGlobethe 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:LayerCause the layer to draw its representation.- Specified by:
renderin interfaceLayer- Overrides:
renderin classAbstractLayer- Parameters:
dc- the current draw context
-
doRender
protected final void doRender(DrawContext dc)
- Specified by:
doRenderin 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:LayerIndicates 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:
isLayerInViewin interfaceLayer- Overrides:
isLayerInViewin classAbstractLayer- Parameters:
dc- the current draw context- Returns:
trueif the layer is in the view,falseotherwise.
-
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:
This also writes common layer and LevelSet configuration parameters by invokingParameters Parameter Element Path Type AVKey.SERVICE_NAMEService/@serviceName String AVKey.IMAGE_FORMATImageFormat String AVKey.AVAILABLE_IMAGE_FORMATSAvailableImageFormats/ImageFormat String array AVKey.FORCE_LEVEL_ZERO_LOADSForceLevelZeroLoads Boolean AVKey.RETAIN_LEVEL_ZERO_TILESRetainLevelZeroTiles Boolean AVKey.TEXTURE_FORMATTextureFormat String AVKey.USE_MIP_MAPSUseMipMaps Boolean AVKey.USE_TRANSPARENT_TEXTURESUseTransparentTextures Boolean AVKey.URL_CONNECT_TIMEOUTRetrievalTimeouts/ConnectTimeout/Time Integer milliseconds AVKey.URL_READ_TIMEOUTRetrievalTimeouts/ReadTimeout/Time Integer milliseconds AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMITRetrievalTimeouts/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:
This also parses common layer and LevelSet configuration parameters by invokingSupported Names Parameter Element Path Type AVKey.SERVICE_NAMEService/@serviceName String AVKey.IMAGE_FORMATImageFormat String AVKey.AVAILABLE_IMAGE_FORMATSAvailableImageFormats/ImageFormat String array AVKey.FORCE_LEVEL_ZERO_LOADSForceLevelZeroLoads Boolean AVKey.RETAIN_LEVEL_ZERO_TILESRetainLevelZeroTiles Boolean AVKey.TEXTURE_FORMATTextureFormat Boolean AVKey.USE_MIP_MAPSUseMipMaps Boolean AVKey.USE_TRANSPARENT_TEXTURESUseTransparentTextures Boolean AVKey.URL_CONNECT_TIMEOUTRetrievalTimeouts/ConnectTimeout/Time Integer milliseconds AVKey.URL_READ_TIMEOUTRetrievalTimeouts/ReadTimeout/Time Integer milliseconds AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMITRetrievalTimeouts/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_FORMATCompressTextures "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.URISyntaxExceptionjava.io.InterruptedIOExceptionjava.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, aBufferedImagein which to place the image. If null, a new buffered image is created. The image must be the width and height specified in thecanvasWidthandcanvasHeightarguments.timeout- The amount of time to allow for reading the image from the server.- Returns:
- image the assembled image, of size indicated by the
canvasWidthandcanvasHeight. 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 theimageargument was non-null, that buffered image is returned. - Throws:
java.lang.IllegalArgumentException- ifsectoris 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
-
-