/**
         * Constructs a downloader to retrieve elevations not currently available in a specified file store.
         * <p/>
         * The thread returned is not started during construction, the caller must start the thread.
         *
         * @param elevationModel the elevation model for which to download elevations.
         * @param sector         the sector to download data for. This value is final.
         * @param resolution     the target resolution, provided in radians of latitude per texel. This value is final.
         * @param fileStore      the file store in which to place the downloaded elevations.
         * @param listener       an optional retrieval listener. May be null.
         *
         * @throws ArgumentException if either the elevation model, the sector or file store are null, or the
         *                                  resolution is less than zero.
         */
        public BasicElevationModelBulkDownloader(BasicElevationModel elevationModel, Sector sector, double resolution,
                                                 FileStore fileStore, BulkRetrievalListener listener)
        {
            // Arguments checked in parent constructor
            super(elevationModel, sector, resolution, fileStore, listener);

            this.elevationModel = elevationModel;
            this.level          = computeLevelForResolution(sector, resolution);
        }
        /**
         * Constructs a downloader to retrieve imagery not currently available in a specified file store.
         * <p/>
         * The thread returned is not started during construction, the caller must start the thread.
         *
         * @param layer      the layer for which to download imagery.
         * @param sector     the sector to download data for. This value is final.
         * @param resolution the target resolution, provided in radians of latitude per texel. This value is final.
         * @param fileStore  the file store in which to place the downloaded elevations.
         * @param listener   an optional retrieval listener. May be null.
         *
         * @throws ArgumentException if either the layer, the sector or file store are null, or the resolution is
         *                                  less than zero.
         */
        public BasicTiledImageLayerBulkDownloader(BasicTiledImageLayer layer, Sector sector, double resolution,
                                                  FileStore fileStore, BulkRetrievalListener listener)
        {
            // Arguments checked in parent constructor
            super(layer, sector, resolution, fileStore, listener);

            this.layer = layer;
            this.level = this.layer.computeLevelForResolution(sector, resolution);
        }
Esempio n. 3
0
        /**
         * Construct a thread that attempts to download to a specified {@link FileStore} a retrievable's data for a given
         * {@link Sector} and resolution.
         * <p/>
         * This method creates and starts a thread to perform the download. A reference to the thread is returned. To create
         * a downloader that has not been started, construct a {@link SharpEarth.terrain.BasicElevationModelBulkDownloader}.
         * <p/>
         * Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in
         * meters divided by the globe radius.
         *
         * @param retrievable the retrievable to retrieve data for.
         * @param sector      the sector of interest.
         * @param resolution  the target resolution, provided in radians of latitude per texel.
         * @param fileStore   the file store to examine.
         * @param listener    an optional retrieval listener. May be null.
         *
         * @throws ArgumentException if either the retrievable, sector or file store are null, or the resolution is
         *                                  less than or equal to zero.
         */
        public BulkRetrievalThread(BulkRetrievable retrievable, Sector sector, double resolution, FileStore fileStore,
                                   BulkRetrievalListener listener)
        {
            if (retrievable == null)
            {
                String msg = Logging.getMessage("nullValue.RetrievableIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            if (sector == null)
            {
                String msg = Logging.getMessage("nullValue.SectorIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            if (fileStore == null)
            {
                String msg = Logging.getMessage("nullValue.FileStoreIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }
//
//        if (resolution <= 0)
//        {
//            String msg = Logging.getMessage("generic.ResolutionInvalid", resolution);
//            Logging.logger().severe(msg);
//            throw new ArgumentException(msg);
//        }

            this.retrievable = retrievable;
            this.sector      = sector;
            this.resolution  = resolution;
            this.fileStore   = fileStore;
            this.progress    = new Progress();

            if (listener != null)
            {
                this.addRetrievalListener(listener);
            }
        }
Esempio n. 4
0
 public void addRetrievalListener(BulkRetrievalListener listener)
 {
     if (listener != null)
     {
         this.retrievalListeners.add(BulkRetrievalListener.class, listener);