/** * 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); }
protected void nextPhase() throws InterruptedException { ThreadUtils.checkIfInterrupted(); ++phasesCompleted; percentPhasesComplete = (phasesCompleted * 100) / numberOfPhases; fireProgressEvent(percentPhasesComplete); }