NASA World Wind

gov.nasa.worldwind.layers
Class BasicLayerFactory

java.lang.Object
  extended by gov.nasa.worldwind.BasicFactory
      extended by gov.nasa.worldwind.layers.BasicLayerFactory
All Implemented Interfaces:
Factory

public class BasicLayerFactory
extends BasicFactory

A factory that creates Layer instances.


Constructor Summary
BasicLayerFactory()
          Creates an instance of BasicLayerFactory; otherwise does nothing.
 
Method Summary
 Object createFromConfigFile(String fileName)
          Creates a layer from a configuration file.
 Object createFromDataConfig(DataConfiguration dataConfig, AVList params)
          Creates a layer from a data configuration.
protected  Layer createFromLayerDocument(Element domElement, AVList params)
           
protected  Layer createTiledImageLayer(Element domElement, AVList params)
           
protected  Layer doCreateFromCapabilities(Capabilities caps, AVList params)
          Implemented by subclasses to perform the actual object creation.
protected  Layer doCreateFromDataConfig(DataConfiguration dataConfig, AVList params)
           
protected  Layer doCreateFromDocument(Element domElement, AVList params)
           
 
Methods inherited from class gov.nasa.worldwind.BasicFactory
createFromCapabilities, createFromClassName, createFromKeys, doCreateFromKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicLayerFactory

public BasicLayerFactory()
Creates an instance of BasicLayerFactory; otherwise does nothing.

Method Detail

createFromConfigFile

public Object createFromConfigFile(String fileName)
Creates a layer from a configuration file.

Maps the layerType attribute of the Layer element of the XML configuration file to the appropriate layer type. Layer types recognized are:

For tiled image layers, this maps the serviceName attribute of the Layer/Service element of the XML configuration file to the appropriate base tiled image layer type. Service types recognized are:

Specified by:
createFromConfigFile in interface Factory
Overrides:
createFromConfigFile in class BasicFactory
Parameters:
fileName - the path to the configuration file. The file must be either an absolute path or a relative path available on the classpath.
Returns:
a layer.
Throws:
IllegalArgumentException - if the configuration file name is null.
WWUnrecognizedException - if the service type is unrecognized.
WWRuntimeException - if object creation fails. The exception indicating the source of the failure is included as the Throwable.initCause(Throwable).

createFromDataConfig

public Object createFromDataConfig(DataConfiguration dataConfig,
                                   AVList params)
Creates a layer from a data configuration.

Maps the Layer/layerType configuration parameter to the appropriate layer type. Layer types recognized are:

For tiled image layers, this maps the Layer/Service/serviceName configuration property to the appropriate base tiled image layer type. Service types recognized are:

Specified by:
createFromDataConfig in interface Factory
Overrides:
createFromDataConfig in class BasicFactory
Parameters:
dataConfig - the configuration information describing the component.
params - key-value parameters which override or supplement the information provided in the specified configuration. A null reference is permitted.
Returns:
a layer.
Throws:
IllegalArgumentException - if the data configuration is null.
WWUnrecognizedException - if the service type is unrecognized.
WWRuntimeException - if object creation fails. The exception indicating the source of the failure is included as the Throwable.initCause(Throwable).

createFromLayerDocument

protected Layer createFromLayerDocument(Element domElement,
                                        AVList params)

createTiledImageLayer

protected Layer createTiledImageLayer(Element domElement,
                                      AVList params)

doCreateFromCapabilities

protected Layer doCreateFromCapabilities(Capabilities 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.

doCreateFromDataConfig

protected Layer doCreateFromDataConfig(DataConfiguration dataConfig,
                                       AVList params)
                                throws Exception
Throws:
Exception

doCreateFromDocument

protected Layer doCreateFromDocument(Element domElement,
                                     AVList params)
                              throws Exception
Throws:
Exception

NASA World Wind