Package util.ui.progress

Examples of util.ui.progress.ProgressMonitorGroup


  public void checkForAvailableGroupsAndChannels(ProgressMonitor monitor) {

    removeAllGroups();
    TvDataServiceProxy[] services = TvDataServiceProxyManager.getInstance().getDataServices();

    ProgressMonitorGroup progressGroup = new ProgressMonitorGroup(monitor, 30);

    ProgressMonitor curMon = progressGroup.getNextProgressMonitor(10);
    curMon.setMaximum(services.length);
    for (int i = 0; i < services.length; i++) {
      ChannelGroup[] groupArr = null;
      if (services[i].supportsDynamicChannelGroups()) {
        try {
          groupArr = services[i].checkForAvailableGroups(null);
        } catch (TvBrowserException e) {
          ErrorHandler.handle(e);
        }
      } else {
        groupArr = services[i].getAvailableGroups();
      }
      if (groupArr != null) {
        for (ChannelGroup aGroupArr : groupArr) {
          addGroup(services[i], aGroupArr);
        }
      }
      curMon.setValue(i + 1);
    }

    curMon = progressGroup.getNextProgressMonitor(20);
    curMon.setMaximum(services.length);

    int channelCount = 0;

    /*
 
View Full Code Here


    // Split the subsribed channels by data service
    Channel[] subscribedChannels = ChannelList.getSubscribedChannels();
    UpdateJob[] jobArr = toUpdateJobArr(subscribedChannels, services);

    // Create the ProgressMonitorGroup
    ProgressMonitorGroup monitorGroup
      = new ProgressMonitorGroup(progressBar, label, subscribedChannels.length + 1);

    // Work on the job list
    Throwable downloadException = null;
    for (int i = 0; (i < jobArr.length) && (!mStopDownloading); i++) {
      TvDataServiceProxy dataService = jobArr[i].getDataService();
      Channel[] channelArr = jobArr[i].getChannelList();
      ProgressMonitor monitor = monitorGroup.getNextProgressMonitor(channelArr.length);
      try {
        dataService.updateTvData(updateManager, channelArr, startDate,
                                 daysToDownload, monitor);
      }
      catch (Throwable thr) {
        mLog.log(Level.WARNING, "Updating the TV data for TV data service "
          + dataService.getInfo().getName() + " failed", thr);

        downloadException = thr;
      }
    }

    // Show the exception if there was one
    if (downloadException != null) {
      String msg = mLocalizer.msg("error.1", "Couldn't download the whole program!");
      ErrorHandler.handle(msg, downloadException);
    }

    // Reset the download flag
    mIsDownloading = false;

    checkLocalDateUsingNTP();

    ProgressMonitor monitor = monitorGroup.getNextProgressMonitor(subscribedChannels.length+1);
    monitor.setMessage(mLocalizer.msg("calculateEntries","Calculating new entries in the database"));
    TvDataBase.getInstance().reCalculateTvData(daysToDownload, monitor);
    TvDataBase.getInstance().updateTvDataBase();
    MarkedProgramsList.getInstance().revalidatePrograms();
View Full Code Here

TOP

Related Classes of util.ui.progress.ProgressMonitorGroup

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.