Class InstallImageryAndElevationsDemo


  • public class InstallImageryAndElevationsDemo
    extends ApplicationTemplate
    Illustrates a simple application that installs imagery and elevation data for use in WorldWind. 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 WorldWind 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.

    • Constructor Detail

      • InstallImageryAndElevationsDemo

        public InstallImageryAndElevationsDemo()
    • Method Detail

      • addInstalledData

        protected static void addInstalledData​(org.w3c.dom.Document dataConfig,
                                               AVList params,
                                               InstalledDataPanel panel)
      • loadInstalledDataFromDirectory

        protected static void loadInstalledDataFromDirectory​(java.io.File dir,
                                                             InstalledDataPanel panel)
      • loadInstalledDataFromFileStore

        protected static void loadInstalledDataFromFileStore​(FileStore fileStore,
                                                             InstalledDataPanel panel)
      • setFallbackParams

        protected static void setFallbackParams​(org.w3c.dom.Document dataConfig,
                                                java.lang.String filename,
                                                AVList params)
      • installDataFromFiles

        protected static org.w3c.dom.Document installDataFromFiles​(java.awt.Component parentComponent,
                                                                   java.io.File[] files,
                                                                   FileStore fileStore)
                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createDataStore

        protected static org.w3c.dom.Document createDataStore​(java.io.File[] files,
                                                              FileStore fileStore,
                                                              DataStoreProducer producer)
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • askForDatasetName

        protected static java.lang.String askForDatasetName​(java.lang.String suggestedName)
      • suggestDatasetName

        protected static java.lang.String suggestDatasetName​(java.io.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
      • createDataStoreProducerFromFiles

        protected static DataStoreProducer createDataStoreProducerFromFiles​(java.io.File[] files)
                                                                     throws java.lang.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:
        java.lang.IllegalArgumentException - if types of rasters do not match, or array of raster files is null or empty
      • main

        public static void main​(java.lang.String[] args)