NASA World Wind

gov.nasa.worldwind.wms
Class WMSTiledImageLayer

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.layers.AbstractLayer
              extended by gov.nasa.worldwind.layers.TiledImageLayer
                  extended by gov.nasa.worldwind.layers.BasicTiledImageLayer
                      extended by gov.nasa.worldwind.wms.WMSTiledImageLayer
All Implemented Interfaces:
AVList, Disposable, MessageListener, Layer, Restorable, BulkRetrievable, WWObject, PropertyChangeListener, EventListener
Direct Known Subclasses:
BMNGWMSLayer, CountryBoundariesLayer, LandsatI3WMSLayer, ScankortDenmarkImageLayer, USDANAIPWMSImageLayer, USGSTopoHighRes, USGSTopoLowRes, USGSTopoMedRes

public class WMSTiledImageLayer
extends BasicTiledImageLayer


Nested Class Summary
protected static class WMSTiledImageLayer.ComposeImageTile
           
static class WMSTiledImageLayer.URLBuilder
           
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.BasicTiledImageLayer
BasicTiledImageLayer.DownloadPostProcessor, BasicTiledImageLayer.RequestTask
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.TiledImageLayer
TiledImageLayer.CompositionRetrievalPostProcessor, TiledImageLayer.LevelComparer
 
Field Summary
 
Fields inherited from class gov.nasa.worldwind.layers.BasicTiledImageLayer
fileLock, RESOURCE_ID_OGC_CAPABILITIES
 
Fields inherited from class gov.nasa.worldwind.layers.TiledImageLayer
atMaxResolution, currentResourceTile, currentTiles, detailHint, detailHintOrigin, drawBoundingVolumes, drawTileBoundaries, forceLevelZeroLoads, levelComparer, levels, levelZeroLoaded, requestQ, retainLevelZeroTiles, supportedImageFormats, textureFormat, tileCountName, topLevels, useMipMaps, useTransparentTextures
 
Constructor Summary
WMSTiledImageLayer(AVList params)
           
WMSTiledImageLayer(Document dom, AVList params)
           
WMSTiledImageLayer(Element domElement, AVList params)
           
WMSTiledImageLayer(String stateInXml)
           
WMSTiledImageLayer(WMSCapabilities caps, AVList params)
           
 
Method Summary
 BufferedImage composeImageForSector(Sector sector, int canvasWidth, int canvasHeight, double aspectRatio, int levelNumber, String mimeType, boolean abortOnError, BufferedImage image, int timeout)
          Create an image for the portion of this layer lying within a specified sector.
protected  Document createConfigurationDocument(AVList params)
          Appends WMS tiled image layer configuration elements to the superclass configuration document.
 void getRestorableStateForAVPair(String key, Object value, RestorableSupport rs, RestorableSupport.StateObject context)
           
protected static void legacyWmsRestoreStateToParams(RestorableSupport rs, RestorableSupport.StateObject context, AVList params)
           
static AVList wmsGetParamsFromCapsDoc(WMSCapabilities caps, AVList params)
          Extracts parameters necessary to configure the layer from a WMS capabilities document.
protected static AVList wmsGetParamsFromDocument(Element domElement, AVList params)
          Extracts parameters necessary to configure the layer from an XML DOM element.
static AVList wmsRestorableStateToParams(String stateInXml)
          Creates an attribute-value list from an xml document containing restorable state for this layer.
protected static void wmsRestoreStateToParams(RestorableSupport rs, RestorableSupport.StateObject context, AVList params)
           
 
Methods inherited from class gov.nasa.worldwind.layers.BasicTiledImageLayer
addTileToCache, createDownloadPostProcessor, createRequestTask, doGetRestorableState, doRestoreState, doRestoreStateForObject, doWriteConfigurationParams, forceTextureLoad, getConfigurationParams, getEstimatedMissingDataSize, getEstimatedMissingDataSize, getParamsFromDocument, getRestorableState, initFromOGCCapabilitiesResource, isRetrieveResources, isTextureFileExpired, loadTexture, makeLocal, makeLocal, needsConfigurationFile, readTexture, requestTexture, restorableStateToParams, restoreState, restoreStateForParams, retrieveLocalTexture, retrieveRemoteTexture, retrieveResources, retrieveTexture, setFallbacks, startResourceRetrieval, writeConfigurationFile, writeConfigurationParams
 
Methods inherited from class gov.nasa.worldwind.layers.TiledImageLayer
addTile, addTileOrDescendants, addTileToCurrent, assembleTiles, atMaxLevel, checkTextureExpiration, 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
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
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
 
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, getStringValue, getStringValue, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.retrieve.BulkRetrievable
getName
 
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 java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
 

Constructor Detail

WMSTiledImageLayer

public WMSTiledImageLayer(AVList params)

WMSTiledImageLayer

public WMSTiledImageLayer(Document dom,
                          AVList params)

WMSTiledImageLayer

public WMSTiledImageLayer(Element domElement,
                          AVList params)

WMSTiledImageLayer

public WMSTiledImageLayer(String stateInXml)

WMSTiledImageLayer

public WMSTiledImageLayer(WMSCapabilities caps,
                          AVList params)
Method Detail

composeImageForSector

public BufferedImage composeImageForSector(Sector sector,
                                           int canvasWidth,
                                           int canvasHeight,
                                           double aspectRatio,
                                           int levelNumber,
                                           String mimeType,
                                           boolean abortOnError,
                                           BufferedImage image,
                                           int timeout)
                                    throws Exception
Description copied from class: TiledImageLayer
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.

Overrides:
composeImageForSector in class TiledImageLayer
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, a BufferedImage in which to place the image. If null, a new buffered image is created. The image must be the width and height specified in the canvasWidth and canvasHeight 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 and canvasHeight. 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 the image argument was non-null, that buffered image is returned.
Throws:
IllegalArgumentException - if sector is null.
Exception
See Also:
;

createConfigurationDocument

protected Document createConfigurationDocument(AVList params)
Appends WMS tiled image layer configuration elements to the superclass configuration document.

Overrides:
createConfigurationDocument in class BasicTiledImageLayer
Parameters:
params - configuration parameters describing this WMS tiled image layer.
Returns:
a WMS tiled image layer configuration document.

getRestorableStateForAVPair

public void getRestorableStateForAVPair(String key,
                                        Object value,
                                        RestorableSupport rs,
                                        RestorableSupport.StateObject context)
Overrides:
getRestorableStateForAVPair in class BasicTiledImageLayer

legacyWmsRestoreStateToParams

protected static void legacyWmsRestoreStateToParams(RestorableSupport rs,
                                                    RestorableSupport.StateObject context,
                                                    AVList params)

wmsGetParamsFromCapsDoc

public static AVList wmsGetParamsFromCapsDoc(WMSCapabilities caps,
                                             AVList params)
Extracts parameters necessary to configure the layer from a WMS capabilities document.

Parameters:
caps - the capabilities document.
params - an attribute-value list in which to place the extracted parameters. May be null, in which case a new attribute-value list is created and returned.
Returns:
the attribute-value list passed as the second parameter, or the list created if the second parameter is null.
Throws:
IllegalArgumentException - if the capabilities document reference is null.

wmsGetParamsFromDocument

protected static AVList wmsGetParamsFromDocument(Element domElement,
                                                 AVList params)
Extracts parameters necessary to configure the layer from an XML DOM element.

Parameters:
domElement - the element to search for parameters.
params - an attribute-value list in which to place the extracted parameters. May be null, in which case a new attribue-value list is created and returned.
Returns:
the attribute-value list passed as the second parameter, or the list created if the second parameter is null.
Throws:
IllegalArgumentException - if the DOM element is null.

wmsRestorableStateToParams

public static AVList wmsRestorableStateToParams(String stateInXml)
Creates an attribute-value list from an xml document containing restorable state for this layer.

Parameters:
stateInXml - an xml document specified in a String.
Returns:
an attribute-value list containing the parameters in the specified restorable state.
Throws:
IllegalArgumentException - if the state reference is null.

wmsRestoreStateToParams

protected static void wmsRestoreStateToParams(RestorableSupport rs,
                                              RestorableSupport.StateObject context,
                                              AVList params)

NASA World Wind