NASA World Wind

gov.nasa.worldwindx.examples.dataimport
Class InstallImageryAndElevationsDemo

java.lang.Object
  extended by gov.nasa.worldwindx.examples.ApplicationTemplate
      extended by gov.nasa.worldwindx.examples.dataimport.InstallImageryAndElevationsDemo

public class InstallImageryAndElevationsDemo
extends ApplicationTemplate

Illustrates a simple application that installs imagery and elevation data for use in World Wind. The application enables the user to locate and install imagery or elevation data on the local hard drive. Once installed, the data is visualized in World Wind either as a TiledImageLayer or an ElevationModel. The application also illustrates how to visualize data that has been installed during a previous session.

For the simplest possible examples of installing imagery and elevation data, see the examples InstallImagery and InstallElevations.


Nested Class Summary
static class InstallImageryAndElevationsDemo.AppFrame
           
protected static class InstallImageryAndElevationsDemo.InstallableDataFilter
           
static class InstallImageryAndElevationsDemo.InstalledDataFrame
           
 
Nested classes/interfaces inherited from class gov.nasa.worldwindx.examples.ApplicationTemplate
ApplicationTemplate.AppPanel
 
Constructor Summary
InstallImageryAndElevationsDemo()
           
 
Method Summary
protected static void addInstalledData(Document dataConfig, AVList params, InstalledDataPanel panel)
           
protected static void appendProperties(Element context, AVList properties)
          Append Property elements to a context element.
protected static void appendSource(Element sources, CachedDataRaster raster)
          Append Source element to a Sources element.
protected static String askForDatasetName(String suggestedName)
           
protected static Document createDataStore(File[] files, FileStore fileStore, DataStoreProducer producer)
           
protected static DataStoreProducer createDataStoreProducerFromFiles(File[] files)
          Creates an instance of the DataStoreProducer basing on raster type.
protected static void createRasterServerConfigDoc(FileStore fileStore, DataStoreProducer producer)
           
protected static Document installDataFromFiles(Component parentComponent, File[] files, FileStore fileStore)
           
protected static void loadInstalledDataFromDirectory(File dir, InstalledDataPanel panel)
           
protected static void loadInstalledDataFromFileStore(FileStore fileStore, InstalledDataPanel panel)
           
static void main(String[] args)
           
protected static void setFallbackParams(Document dataConfig, String filename, AVList params)
           
protected static String suggestDatasetName(File[] files)
          Suggests a name for a dataset based on pathnames of the passed files.
 
Methods inherited from class gov.nasa.worldwindx.examples.ApplicationTemplate
insertAfterPlacenames, insertBeforeCompass, insertBeforeLayerName, insertBeforePlacenames, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstallImageryAndElevationsDemo

public InstallImageryAndElevationsDemo()
Method Detail

addInstalledData

protected static void addInstalledData(Document dataConfig,
                                       AVList params,
                                       InstalledDataPanel panel)

appendProperties

protected static void appendProperties(Element context,
                                       AVList properties)
Append Property elements to a context element.

Parameters:
context - the context on which to append new element(s)
properties - AVList with properties to append.

appendSource

protected static void appendSource(Element sources,
                                   CachedDataRaster raster)
                            throws WWRuntimeException
Append Source element to a Sources element.

Parameters:
sources - the Sources element on which to append the new Source element
raster - instance of the CachedDataRaster
Throws:
WWRuntimeException - if cannot retrieve or understand the data source

askForDatasetName

protected static String askForDatasetName(String suggestedName)

createDataStore

protected static Document createDataStore(File[] files,
                                          FileStore fileStore,
                                          DataStoreProducer producer)
                                   throws Exception
Throws:
Exception

createDataStoreProducerFromFiles

protected static DataStoreProducer createDataStoreProducerFromFiles(File[] files)
                                                             throws IllegalArgumentException
Creates an instance of the DataStoreProducer basing on raster type. Also validates that all rasters are the same types.

Parameters:
files - Array of raster files
Returns:
instance of the DataStoreProducer
Throws:
IllegalArgumentException, - if types of rasters do not match, or array of raster files is null or empty
IllegalArgumentException

createRasterServerConfigDoc

protected static void createRasterServerConfigDoc(FileStore fileStore,
                                                  DataStoreProducer producer)

installDataFromFiles

protected static Document installDataFromFiles(Component parentComponent,
                                               File[] files,
                                               FileStore fileStore)
                                        throws Exception
Throws:
Exception

loadInstalledDataFromDirectory

protected static void loadInstalledDataFromDirectory(File dir,
                                                     InstalledDataPanel panel)

loadInstalledDataFromFileStore

protected static void loadInstalledDataFromFileStore(FileStore fileStore,
                                                     InstalledDataPanel panel)

main

public static void main(String[] args)

setFallbackParams

protected static void setFallbackParams(Document dataConfig,
                                        String filename,
                                        AVList params)

suggestDatasetName

protected static String suggestDatasetName(File[] files)
Suggests a name for a dataset based on pathnames of the passed files.

Attempts to extract all common words that files' path can share, removes all non-alpha-numeric chars

Parameters:
files - Array of raster files
Returns:
A suggested name

NASA World Wind