@Override public void run() { taskMonitor.setProgress(progress); StringBuilder buf = new StringBuilder(Messages.getString("MinCollectionZprojection.operation")); //$NON-NLS-1$ buf.append(StringUtil.COLON_AND_SPACE); buf.append(progress); buf.append("/"); //$NON-NLS-1$ buf.append(taskMonitor.getMaximum()); taskMonitor.setNote(buf.toString()); } });
protected void stopCurrentProcess() { final MipProcess t = process; if (t != null) { process = null; t.taskMonitor.setAborting(true); // Close won't stop the process immediately t.taskMonitor.close(); t.interrupt(); } }
public boolean isAborting() { return aborting || isCanceled(); }
private void incrementProgressBar(final int progress) { if (taskMonitor == null) { return; } if (taskMonitor.isAborting()) { throw new TaskInterruptionException("Operation from " + this.getClass().getName() + " has been canceled"); //$NON-NLS-1$ //$NON-NLS-2$ } if (taskMonitor.isShowProgression()) { GuiExecutor.instance().execute(() -> { taskMonitor.setProgress(progress); StringBuilder buf = new StringBuilder(Messages.getString("MaxCollectionZprojection.operation")); //$NON-NLS-1$ buf.append(StringUtil.COLON_AND_SPACE); buf.append(progress); buf.append("/"); //$NON-NLS-1$ buf.append(taskMonitor.getMaximum()); taskMonitor.setNote(buf.toString()); }); } }
int maxImg = fullSeries ? series.size(filter) - extend : curImg; if (fullSeries) { taskMonitor.setMaximum(maxImg - minImg); taskMonitor.setShowProgression(false); taskMonitor.setShowProgression(true); FileUtil.delete(raw.getFile()); if (taskMonitor.isAborting()) { throw new TaskInterruptionException("Rebuilding MIP series has been canceled!"); //$NON-NLS-1$ if (taskMonitor.isAborting()) { throw new TaskInterruptionException("Rebuilding MIP series has been canceled!"); //$NON-NLS-1$ taskMonitor.setProgress(progress); StringBuilder buf = new StringBuilder(Messages.getString("SeriesBuilder.image")); //$NON-NLS-1$ buf.append(StringUtil.COLON_AND_SPACE); buf.append(progress); buf.append("/"); //$NON-NLS-1$ buf.append(taskMonitor.getMaximum()); taskMonitor.setNote(buf.toString()); });
private void incrementProgressBar(final int progress) { if (taskMonitor == null) { return; } if (taskMonitor.isAborting()) { throw new TaskInterruptionException("Operation from " + this.getClass().getName() + " has been canceled"); //$NON-NLS-1$ //$NON-NLS-2$ } if (taskMonitor.isShowProgression()) { GuiExecutor.instance().execute(new Runnable() { @Override public void run() { taskMonitor.setProgress(progress); StringBuilder buf = new StringBuilder(Messages.getString("MinCollectionZprojection.operation")); //$NON-NLS-1$ buf.append(StringUtil.COLON_AND_SPACE); buf.append(progress); buf.append("/"); //$NON-NLS-1$ buf.append(taskMonitor.getMaximum()); taskMonitor.setNote(buf.toString()); } }); } }
TaskMonitor taskMonitor = new TaskMonitor(dialog == null ? view : dialog, Messages.getString("MipView.monitoring_proc"), Messages.getString("MipView.init"), 0, 2 * extend + 1); //$NON-NLS-1$//$NON-NLS-2$ Runnable runnable = () -> { final List<DicomImageElement> dicoms = new ArrayList<>(); try { taskMonitor.setMillisToPopup(1250); SeriesBuilder.applyMipParameters(taskMonitor, view, ser, dicoms, mipType, extend, fullSeries); } catch (TaskInterruptionException e) { taskMonitor.close();
private void incrementProgressBar(final int progress) { if (taskMonitor == null) { return; } if (taskMonitor.isAborting()) { throw new TaskInterruptionException("Operation from " + this.getClass().getName() + " has been canceled"); //$NON-NLS-1$ //$NON-NLS-2$ } if (taskMonitor.isShowProgression()) { GuiExecutor.instance().execute(() -> { taskMonitor.setProgress(progress); StringBuilder buf = new StringBuilder(Messages.getString("MeanCollectionZprojection.operation")); //$NON-NLS-1$ buf.append(StringUtil.COLON_AND_SPACE); buf.append(progress); buf.append("/"); //$NON-NLS-1$ buf.append(taskMonitor.getMaximum()); taskMonitor.setNote(buf.toString()); }); } }