示例#1
0
 /**
  * Called when a ProgressEvent is fired.
  *
  * @see org.argouml.taskmgmt.ProgressListener#progress(org.argouml.taskmgmt.ProgressEvent)
  * @throws InterruptedException if thread is interrupted
  */
 public void progress(ProgressEvent event) throws InterruptedException {
   ThreadUtils.checkIfInterrupted();
   int percentPhasesLeft = 100 - percentPhasesComplete;
   long position = event.getPosition();
   long length = event.getLength();
   long proportion = (position * percentPhasesLeft) / length;
   fireProgressEvent(percentPhasesComplete + proportion);
 }
示例#2
0
 protected void nextPhase() throws InterruptedException {
   ThreadUtils.checkIfInterrupted();
   ++phasesCompleted;
   percentPhasesComplete = (phasesCompleted * 100) / numberOfPhases;
   fireProgressEvent(percentPhasesComplete);
 }