use of eu.ggnet.saft.runtime.HiddenMonitorDisplayTask.Progress in project dwoss by gg-net.
the class HiddenMonitorDisplayTask method process.
@Override
protected void process(List<Progress> chunks) {
Progress last = chunks.get(chunks.size() - 1);
if (!progressBar.isVisible())
progressBar.setVisible(true);
if (last.getProgress() > 0 && progressBar.isIndeterminate())
progressBar.setIndeterminate(false);
messageBar.setText(last.getMessage());
progressBar.setValue(last.getProgress());
}
use of eu.ggnet.saft.runtime.HiddenMonitorDisplayTask.Progress in project dwoss by gg-net.
the class HiddenMonitorDisplayTask method doInBackground.
@Override
@SuppressWarnings("SleepWhileInLoop")
protected Void doInBackground() throws Exception {
// Hint: the supplied Monitor has a length of 100;
HiddenMonitor hm = Dl.remote().lookup(ProgressObserver.class).getMonitor(key);
while (hm != null && !hm.isFinished()) {
int progress = 100 - hm.getAbsolutRemainingTicks();
if (progress < 0)
progress = 0;
if (progress > 100)
progress = 100;
publish(new Progress(progress, hm.getTitle() + ":" + StringUtils.defaultIfBlank(hm.getMessage(), "")));
Thread.sleep(250);
hm = Dl.remote().lookup(ProgressObserver.class).getMonitor(key);
}
publish(new Progress(100, ""));
keys.remove(key);
return null;
}
Aggregations