Пример #1
0
 @Override
 public void progressChanged(PCGenTaskEvent event) {
   if (currentTask.getMaximum() == 0) {
     return;
   }
   Fraction progress = Fraction.getFraction(currentTask.getProgress(), currentTask.getMaximum());
   progress = progress.multiplyBy(progressMultiplier);
   progress = baseProgress.add(progress);
   setValues(currentTask.getMessage(), progress.getNumerator(), progress.getDenominator());
 }
Пример #2
0
 @Override
 public void execute() {
   progressMultiplier = Fraction.getFraction(1, tasks.size());
   while (!tasks.isEmpty()) {
     currentTask = tasks.poll();
     setValues(
         currentTask.getMessage(), baseProgress.getNumerator(), baseProgress.getDenominator());
     currentTask.addPCGenTaskListener(this);
     currentTask.execute();
     currentTask.removePCGenTaskListener(this);
     baseProgress = baseProgress.add(progressMultiplier);
   }
 }