void (final @NlsContexts.ProgressText String scanningPackagesMessage, final boolean indeterminate, final double ffraction) { if (myPaintInQueue) return; checkCanceled(); myPaintInQueue = true; myAlarm.cancel(false); myAlarm = EdtExecutorService.getScheduledExecutorInstance().schedule(() -> { myPaintInQueue = false; myProgressPanel.myTextLabel.setText(scanningPackagesMessage); int fraction = (int)(ffraction * 99 + 0.5); myProgressPanel.myFractionLabel.setText(fraction + "%"); if (fraction != -1) { myProgressPanel.myFractionProgress.setValue(fraction); } myProgressPanel.myFractionProgress.setIndeterminate(indeterminate); }, 10, TimeUnit.MILLISECONDS); }