NASA World Wind

gov.nasa.worldwind.terrain
Class BasicElevationModelFactory

java.lang.Object
  extended by gov.nasa.worldwind.BasicFactory
      extended by gov.nasa.worldwind.terrain.BasicElevationModelFactory
All Implemented Interfaces:
Factory

public class BasicElevationModelFactory
extends BasicFactory

A factory to create ElevationModels.


Constructor Summary
BasicElevationModelFactory()
           
 
Method Summary
protected  CompoundElevationModel createCompoundModel(Element[] elements, AVList params)
          Creates a compound elevation model and populates it with a specified list of elevation models.
 Object createFromConfigSource(Object configSource, AVList params)
          Creates an elevation model from a general configuration source.
protected  ElevationModel createNonCompoundModel(Element domElement, AVList params)
          Create a simple elevation model.
protected  ElevationModel doCreateFromCapabilities(OGCCapabilities caps, AVList params)
          Implemented by subclasses to perform the actual object creation.
protected  ElevationModel doCreateFromElement(Element domElement, AVList params)
          Creates an elevation model from an XML description.
 
Methods inherited from class gov.nasa.worldwind.BasicFactory
create, create, createFromCapabilities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicElevationModelFactory

public BasicElevationModelFactory()
Method Detail

createCompoundModel

protected CompoundElevationModel createCompoundModel(Element[] elements,
                                                     AVList params)
Creates a compound elevation model and populates it with a specified list of elevation models.

Any exceptions occurring during creation of the elevation models are logged and not re-thrown. The elevation models associated with the exceptions are not included in the returned compound model.

Parameters:
elements - the XML elements describing the models in the new elevation model.
params - any parameters to apply when creating the elevation models.
Returns:
a compound elevation model populated with the specified elevation models. The compound model will contain no elevation models if none were specified or exceptions occurred for all that were specified.
See Also:
createNonCompoundModel(org.w3c.dom.Element, gov.nasa.worldwind.avlist.AVList).

createFromConfigSource

public Object createFromConfigSource(Object configSource,
                                     AVList params)
Creates an elevation model from a general configuration source. The source can be one of the following:

For non-compound models, this method maps the serviceName attribute of the ElevationModel/Service element of the XML configuration document to the appropriate elevation-model type. Service types recognized are:"

Specified by:
createFromConfigSource in interface Factory
Overrides:
createFromConfigSource in class BasicFactory
Parameters:
configSource - the configuration source. See above for supported types.
params - properties to associate with the elevation model during creation.
Returns:
an elevation model.
Throws:
IllegalArgumentException - if the configuration file name is null or an empty string.
WWUnrecognizedException - if the source type is unrecognized or the requested elevation-model type is unrecognized.
WWRuntimeException - if object creation fails for other reasons. The exception identifying the source of the failure is included as the Throwable.initCause(Throwable).

createNonCompoundModel

protected ElevationModel createNonCompoundModel(Element domElement,
                                                AVList params)
Create a simple elevation model.

Parameters:
domElement - the XML element describing the elevation model to create. The element must inculde a service name identifying the type of service to use to retrieve elevation data. Recognized service types are "Offline", "WWTileService" and "OGC:WMS".
params - any parameters to apply when creating the elevation model.
Returns:
a new elevation model
Throws:
WWUnrecognizedException - if the service type given in the describing element is unrecognized.

doCreateFromCapabilities

protected ElevationModel doCreateFromCapabilities(OGCCapabilities caps,
                                                  AVList params)
Description copied from class: BasicFactory
Implemented by subclasses to perform the actual object creation. This default implementation always returns null.

Overrides:
doCreateFromCapabilities in class BasicFactory
Parameters:
caps - the capabilities document.
params - a list of configuration properties. These properties override any specified in the capabilities document. The list should contain the AVKey.LAYER_NAMES property for services that define layers, indicating which named layers described in the capabilities document to create. If this argumet is null or contains no layers, the first named layer is used.
Returns:
the requested object.

doCreateFromElement

protected ElevationModel doCreateFromElement(Element domElement,
                                             AVList params)
                                      throws Exception
Creates an elevation model from an XML description. An "href" link to an external elevation model description is followed if it exists.

Overrides:
doCreateFromElement in class BasicFactory
Parameters:
domElement - an XML element containing the elevation model description.
params - any parameters to apply when creating the elevation models.
Returns:
the requested elevation model, or null if the specified element does not describe an elevation model.
Throws:
Exception - if a problem occurs during creation.
See Also:
createNonCompoundModel(org.w3c.dom.Element, gov.nasa.worldwind.avlist.AVList).

NASA World Wind