public boolean isCanceled() { return delegate.isCanceled(); }
/** * @param progress * @param writer */ private void reportProgress(float progress, ImageWriter writer) { monitor.progress(progress); if (monitor.isCanceled()) writer.abort(); }
/** * @param progress * @param writer */ private void reportProgress(float progress, ImageReader reader) { monitor.progress(progress); if (monitor.isCanceled()) reader.abort(); } }
public final Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor) { if (started) throw new IllegalStateException("Process can only be run once"); started = true; if (monitor == null) monitor = new NullProgressListener(); try { if (monitor.isCanceled()) return null; // respect isCanceled this.input = input; result = new HashMap<String, Object>(); process(); return result; } catch (Throwable eek) { monitor.exceptionOccurred(eek); return null; } finally { monitor.complete(); } }
public DiskMarkFeatureIterator( List<Feature> features, FeatureIterator fi, SimpleFeatureType schema, ProgressListener listener) throws IOException { File file = File.createTempFile("z-ordered-", ".features"); this.io = new SimpleFeatureIO(file, schema); // dump all the features in memory for (Feature feature : features) { if (listener.isCanceled()) { break; } io.write((SimpleFeature) feature); featureCount++; } // dump all the subsequent ones while (fi.hasNext() && !listener.isCanceled()) { Feature feature = fi.next(); io.write((SimpleFeature) feature); featureCount++; } // do not close the iterator, the caller does that // reset to the beginning of the file io.seek(0); }
if (progress == null) progress = new NullProgressListener(); featureCollection.accepts(uniqueVisit, progress); if (progress.isCanceled()) return null;
private Object calculate(SimpleFeatureCollection featureCollection) { FeatureCalc quantityVisitor = getListVisitor(); if (progress == null) progress = new NullProgressListener(); try { featureCollection.accepts(quantityVisitor, progress); } catch (IOException e) { LOGGER.log( Level.SEVERE, "QuantileFunction calculate(SimpleFeatureCollection) failed", e); return null; } if (progress.isCanceled()) return null; CalcResult calcResult = quantityVisitor.getResult(); if (calcResult == null || calcResult == CalcResult.NULL_RESULT) { return null; } List[] bin = (List[]) calcResult.getValue(); // generate the min and max values, and round off if applicable/necessary Comparable globalMin = (Comparable) bin[0].toArray()[0]; Object lastBin[] = bin[bin.length - 1].toArray(); if (lastBin.length == 0) { return null; } Comparable globalMax = (Comparable) lastBin[lastBin.length - 1]; if ((globalMin instanceof Number) && (globalMax instanceof Number)) { return calculateNumerical(bin, globalMin, globalMax); } else { return calculateNonNumerical(bin, globalMin, globalMax); } }
if (progress == null) progress = new NullProgressListener(); featureCollection.accepts(minVisit, progress); if (progress.isCanceled()) return null; globalMin = (Comparable) minVisit.getResult().getValue(); if (progress.isCanceled()) return null; globalMax = (Comparable) maxVisit.getResult().getValue();
if (listener.isCanceled()) { return null;
public boolean isCanceled() { return delegate.isCanceled(); }
if (progress != null && progress.isCanceled()) { return null;
progress.started(); iterator = collection.features(); while (!progress.isCanceled() && iterator.hasNext()) { Feature feature = null; try {
private void checkCancelled() { if (listener.isCanceled()) { throw new ProcessDismissedException(listener); } }
private void checkCancelled() { if (listener.isCanceled()) { throw new ProcessDismissedException(listener); } }
@Override public void progress(final String pId, final Double progress) { if (pId.equals(pid)) { listener.progress(progress.floatValue()); } if (listener.isCanceled()) { doneSignal.countDown(); } }
public Object get(Object key) { // make sure we just kill the process is a dismiss happened if (listener.isCanceled()) { throw new ProcessDismissedException(listener); } // lazy parse inputs parseInputs(); // return the value return values.get(key); }
/** * @param progress * @param writer * */ private void reportProgress(float progress, ImageWriter writer) { monitor.progress(progress); if(monitor.isCanceled()) writer.abort(); }
/** * @param progress * @param writer * */ private void reportProgress(float progress, ImageReader reader) { monitor.progress(progress); if(monitor.isCanceled()) reader.abort(); }
private void checkForCancellation(ProgressListener listener) { if (listener.isCanceled()) { throw new ProcessException(listener.getTask().toString()); } }
public void getNotification(ProcessingEvent event) { listener.setTask(new SimpleInternationalString(event.getMessage())); if (event.getPercentage() >= 0) { listener.progress((float) event.getPercentage()); } // stop requested? if (listener.isCanceled()) { oef.stopThread(); } }