Exemple #1
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);
            }
        }
Exemple #2
0
 /**
  * Creates a new event.
  *
  * @param source    the event source, typically either a tiled image layer, elevation model or placename layer.
  * @param eventType indicates success or failure. One of {@link #RETRIEVAL_SUCCEEDED} or {@link #RETRIEVAL_FAILED}.
  * @param item      the cache location of the item whose retrieval succeeded or failed.
  *
  * @see SharpEarth.retrieve.BulkRetrievable
  */
 public BulkRetrievalEvent(BulkRetrievable source, string eventType, string item) : base(source)
 {
     this.eventType = eventType;
     this.item      = item;
 }