public class BasicLayerFactory extends BasicFactory
Layer
instances.Constructor and Description |
---|
BasicLayerFactory()
Creates an instance of BasicLayerFactory; otherwise does nothing.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createFromConfigSource(java.lang.Object configSource,
AVList params)
Creates a layer or layer list from a general configuration source.
|
protected Layer |
createFromLayerDocument(org.w3c.dom.Element domElement,
AVList params)
Create a layer described by an XML layer description.
|
protected LayerList |
createLayerList(org.w3c.dom.Element[] layerElements,
AVList params)
Create a list of layers described by an array of XML layer description elements.
|
protected LayerList[] |
createLayerLists(org.w3c.dom.Element[] elements,
AVList params)
Create a collection of layer lists and their included layers described by an array of XML layer-list description
elements.
|
protected Layer |
createShapefileLayer(org.w3c.dom.Element domElement,
AVList params)
Creates a shapefile layer described by an XML layer description.
|
protected Layer |
createTiledImageLayer(org.w3c.dom.Element domElement,
AVList params)
Create a
TiledImageLayer layer described by an XML layer description. |
protected Layer |
doCreateFromCapabilities(OGCCapabilities caps,
AVList params)
Implemented by subclasses to perform the actual object creation.
|
protected java.lang.Object |
doCreateFromElement(org.w3c.dom.Element domElement,
AVList params)
Create the objects described in an XML element containing layer and/or layer-list descriptions.
|
create, create, createFromCapabilities, doCreateFromCapabilities
public BasicLayerFactory()
public java.lang.Object createFromConfigSource(java.lang.Object configSource, AVList params)
URL
File
InputStream
Element
String
holding a file name, a name of a resource on the classpath, or a string
representation of a URL
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:
createFromConfigSource
in interface Factory
createFromConfigSource
in class BasicFactory
configSource
- the configuration source. See above for supported types.params
- key-value parameters to override or supplement the information provided in the specified
configuration source. May be null.java.lang.IllegalArgumentException
- if the configuration file name is null or an empty string.WWUnrecognizedException
- if the layer service type is unrecognized.WWRuntimeException
- if object creation fails. The exception indicating the source of the failure is
included as the Throwable.initCause(Throwable)
.protected Layer createFromLayerDocument(org.w3c.dom.Element domElement, AVList params)
domElement
- the XML element describing the layer to create.params
- any parameters to apply when creating the layer.WWUnrecognizedException
- if the layer type or service type given in the describing element is
unrecognized.createTiledImageLayer(org.w3c.dom.Element, gov.nasa.worldwind.avlist.AVList)
protected LayerList createLayerList(org.w3c.dom.Element[] layerElements, AVList params)
Any exceptions occurring during creation of the layers are logged and not re-thrown. The layers associated with the exceptions are not included in the returned layer list.
layerElements
- the XML elements describing the layers to create.params
- any parameters to apply when creating the layers.protected LayerList[] createLayerLists(org.w3c.dom.Element[] elements, AVList params)
Any exceptions occurring during creation of the layer lists or their included layers are logged and not re-thrown. The layers associated with the exceptions are not included in the returned layer list.
elements
- the XML elements describing the layer lists to create.params
- any parameters to apply when creating the included layers.protected Layer createShapefileLayer(org.w3c.dom.Element domElement, AVList params)
domElement
- the XML element describing the layer to create. The element must contain the shapefile
location, and may contain elements specifying shapefile attribute mappings, shape attributes to
assign to created shapes, and layer properties.params
- any parameters to apply when creating the layer.protected Layer createTiledImageLayer(org.w3c.dom.Element domElement, AVList params)
TiledImageLayer
layer described by an XML layer description.domElement
- the XML element describing the layer to create. The element must inculde a service name
identifying the type of service to use to retrieve layer data. Recognized service types are
"Offline", "WWTileService" and "OGC:WMS".params
- any parameters to apply when creating the layer.WWUnrecognizedException
- if the service type given in the describing element is unrecognized.protected Layer doCreateFromCapabilities(OGCCapabilities caps, AVList params)
BasicFactory
doCreateFromCapabilities
in class BasicFactory
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.protected java.lang.Object doCreateFromElement(org.w3c.dom.Element domElement, AVList params) throws java.lang.Exception
doCreateFromElement
in class BasicFactory
domElement
- an XML element describing the layers and/or layer lists.params
- any properties to apply when creating the included layers.Layer
, LayerList
or array of LayerList
s, as described by the
specified description.java.lang.Exception
- if an exception occurs during creation. Exceptions occurring during creation of internal layers
or layer lists are not re-thrown but are logged. The layer or layer list associated with the
exception is not contained in the returned object.