Package xplanetconfigurator.downloader

Examples of xplanetconfigurator.downloader.DownloadTimer


    }

    private void cleanUpDownloadStarter() {
        this.logger.finer("Cleaning up DownloadStarter...");
        if (this.downloadStarter != null) {
            DownloadTimer downloadTimer = this.downloadStarter.getTimer();
            if (downloadTimer != null) {
                downloadTimer.stopRuning();
            }
            this.logger.finer("About to cancel xPlanetStarter...");
            this.downloadStarter.cancel(true);
        }
    }
View Full Code Here


            if (this.downloadStarter == null) {
                this.logger.warning("Download timer could not be initialised.");
                return "";
            }
        }
        DownloadTimer timer = this.downloadStarter.getTimer();
        String parameters = timer.getConfiguration();
        return parameters;
    }
View Full Code Here

    public void startDownloader(String typeId, List typeIDs, boolean startOnceAndLeave) {
        // Use a new instance of the downloader
        // Otherwise it will get problems if more than one download is
        // started by the user via the GUI to test the download.
        // The second download would not start.
        DownloadTimer timer = this.initDownloader(); // Creates a new instance
        // Set the Downloader. It will do all the work started as Thread.
        timer.setFeedbackReceiver(this);
        // Choose how often the timer checks if something has to be downloaded
        timer.setSeconds(300)// Every 5 minutes
        timer.setCurrentDownloadTypeId(typeId);
        // Set the list of type Ids, e.g. maps.earth or maps.moon
        // If null the downloader will ignore the list and take the type.id
        timer.setCurrentDownloadTypeIDs(typeIDs);
        timer.setRunOnceAndLeave(startOnceAndLeave);
        // The starter is needed due to the SwingWorkerStuff. Main Purpose:
        // the GUI must not freeze.
        DownloadStarter starter = new DownloadStarter();
        starter.setTimer(timer);
        starter.execute();
View Full Code Here

    private DownloadTimer initDownloader() {
        this.cleanUpDownloadStarter();
        XPlanetRessourceFinder f = new XPlanetRessourceFinder();
        String dirOnDisc = f.getRessourceDirectory("downloader");
        String cfgFileDownload = dirOnDisc + File.separator + MainFrame.FILE_NAME_DOWNLOADER_CONFIG;
        DownloadTimer downloadTimer = new DownloadTimer(cfgFileDownload);
        this.downloadStarter = new DownloadStarter();
        this.downloadStarter.setTimer(downloadTimer);
        // Fill the text area
        this.refreshDownloaderTextArea();
        return downloadTimer;
View Full Code Here

                        System.exit(0);
                    } else if (arg.toLowerCase().startsWith("-nogui") || arg.toLowerCase().startsWith("-n")) {
                        XPlanetRessourceFinder f = new XPlanetRessourceFinder();
                        String dirOnDisc = f.getRessourceDirectory("downloader");
                        String fileOnDisc = dirOnDisc + File.separator + MainFrame.FILE_NAME_DOWNLOADER_CONFIG;
                        DownloadTimer timer = new DownloadTimer(fileOnDisc);
                        timer.run();
                    } else {
                        System.err.println("Found no valid parameter");
                        System.exit(0);
                    }
                }
View Full Code Here

TOP

Related Classes of xplanetconfigurator.downloader.DownloadTimer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.