コード例 #1
0
ファイル: LoadingPanel.java プロジェクト: fparisotto/Weasis
 public int getDownloadTaskNumber() {
   int i = 0;
   for (ExplorerTask explorerTask : tasks) {
     if (explorerTask.isSubTask()) {
       i++;
     }
   }
   return i;
 }
コード例 #2
0
ファイル: LoadingPanel.java プロジェクト: fparisotto/Weasis
 public boolean addTask(ExplorerTask task) {
   boolean update = false;
   if (task != null && !tasks.contains(task)) {
     tasks.add(task);
     if (task.isSubTask()) {
       if (getComponentZOrder(globalDownloadTask) == -1) {
         this.add(globalDownloadTask);
         update = true;
       }
       globalDownloadTask.setMessage(task.getMessage());
     } else {
       JPanel taskPanel = new LoadingTaskPanel(task);
       this.add(taskPanel);
       update = true;
     }
   }
   return update;
 }
コード例 #3
0
ファイル: LoadingPanel.java プロジェクト: fparisotto/Weasis
  public boolean removeTask(ExplorerTask task) {
    boolean update = false;
    if (task != null) {
      tasks.remove(task);
      if (task.isSubTask()) {
        if (getDownloadTaskNumber() == 0) {
          this.remove(globalDownloadTask);
          update = true;
        }
      } else {
        for (Component c : getComponents()) {
          if (c instanceof LoadingTaskPanel && task.equals(((LoadingTaskPanel) c).getTask())) {
            remove(c);
            update = true;
          }
        }
      }
    }

    return update;
  }