com.bc.ceres.core.ProgressMonitor.done()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中com.bc.ceres.core.ProgressMonitor.done()方法的一些代码示例,展示了ProgressMonitor.done()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProgressMonitor.done()方法的具体详情如下:
包路径:com.bc.ceres.core.ProgressMonitor
类名称:ProgressMonitor
方法名:done

ProgressMonitor.done介绍

暂无

代码示例

代码示例来源:origin: senbox-org/s2tbx

@Override
protected void readBandRasterDataImpl(int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight, int sourceStepX, int sourceStepY, Band destBand, int destOffsetX, int destOffsetY, int destWidth, int destHeight, ProductData destBuffer, ProgressMonitor pm) throws IOException {
  if (this.gdalReader == null) {
    pm.beginTask("Reading band data...", 3);
    NITFReaderWrapper reader = readerMap.get(destBand);
    try {
      reader.readBandData(sourceOffsetX, sourceOffsetY, sourceWidth, sourceHeight, sourceStepX, sourceStepY, destBuffer, pm);
    } finally {
      pm.done();
    }
  }
}

代码示例来源:origin: bcdev/beam

@Override
void setUpRows(ProgressMonitor pm) {
  pm.beginTask("Exporting pin data as csv-file...", pins.size());
  for (Placemark pin : pins) {
    for (List<Band> bandList : variablesList) {
      if (!bandList.isEmpty()) {
        rows.add(setUpRow(pin, bandList));
      }
    }
    pm.worked(1);
  }
  pm.done();
}

代码示例来源:origin: senbox-org/s2tbx

@Override
protected void readBandRasterDataImpl(int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight, int sourceStepX, int sourceStepY, Band destBand, int destOffsetX, int destOffsetY, int destWidth, int destHeight, ProductData destBuffer, ProgressMonitor pm) throws IOException {
  pm.beginTask("Reading band data...", 3);
  try {
    reader.readBandData(sourceOffsetX, sourceOffsetY, sourceWidth, sourceHeight, sourceStepX, sourceStepY, destBuffer, pm);
  } finally {
    pm.done();
  }
}

代码示例来源:origin: bcdev/beam

@Override
  protected Product doInBackground(ProgressMonitor pm) throws Exception {
    pm.beginTask("Binning...", 100);
    final Map<String, Object> parameters = new HashMap<>();
    updateParameterMap(parameters);
    final Product targetProduct = GPF.createProduct("Binning", parameters, formModel.getSourceProducts());
    pm.done();
    return targetProduct;
  }
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
  protected Product doInBackground(ProgressMonitor pm) throws Exception {
    pm.beginTask("Binning...", 100);
    final Map<String, Object> parameters = new HashMap<>();
    updateParameterMap(parameters);
    final Product targetProduct = GPF.createProduct("Binning", parameters, formModel.getSourceProducts());
    pm.done();
    return targetProduct;
  }
}

代码示例来源:origin: bcdev/beam

public void export(KmlFeature kmlFeature, ZipOutputStream zipOutputStream, final ProgressMonitor pm) throws
                                                   IOException {
  final int numOverlaysToExport = getNumOverlaysToExport(kmlFeature);
  pm.beginTask("Exporting KMZ...", numOverlaysToExport);
  try {
    exportImages(kmlFeature, zipOutputStream, pm);
    zipOutputStream.putNextEntry(new ZipEntry(OVERLAY_KML));
    final String kml = createKml(kmlFeature);
    zipOutputStream.write(kml.getBytes());
    pm.isCanceled();
  } finally {
    zipOutputStream.close();
    pm.done();
  }
}

代码示例来源:origin: bcdev/beam

@Override
  protected Void doInBackground(ProgressMonitor pm) throws Exception {
    pm.beginTask("Collecting data...", ProgressMonitor.UNKNOWN);
    try {
      fillClipboardWithJsonCode(product, new Random(123546));
    } catch (Exception e) {
      e.printStackTrace();
      BeamLogManager.getSystemLogger().severe(e.getMessage());
      VisatApp.getApp().showErrorDialog(e.getMessage());
    } finally {
      pm.done();
    }
    return null;
  }
};

代码示例来源:origin: bcdev/beam

public boolean exportMetadata(final PrintWriter out, ProgressMonitor pm) {
  pm.beginTask("Export Metadata", 1);
  try {
    writeHeaderLine(out, metadataTable);
    writeAttributes(out, rootElement);
    pm.worked(1);
  } finally {
    pm.done();
  }
  return true;
}

代码示例来源:origin: senbox-org/snap-desktop

public boolean exportMetadata(final PrintWriter out, ProgressMonitor pm) {
  pm.beginTask("Export Metadata", 1);
  try {
    writeHeaderLine(out);
    writeAttributes(out, rootElement);
    pm.worked(1);
  } finally {
    pm.done();
  }
  return true;
}

代码示例来源:origin: bcdev/beam

public static FeatureCollection<SimpleFeatureType, SimpleFeature> loadShapefileForProduct(File file,
                                             Product product,
                                             FeatureCrsProvider crsProvider, ProgressMonitor pm) throws IOException {
  pm.beginTask("Loading Shapefile", 100);
  try {
    FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = loadFeatureCollectionFromShapefile(file);
    pm.worked(10);
    return clipFeatureCollectionToProductBounds(featureCollection, product, crsProvider, pm);
  } finally {
    pm.done();
  }
}

代码示例来源:origin: bcdev/beam

@Override
protected void readBandRasterDataImpl(int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight,
                   int sourceStepX, int sourceStepY, Band destBand, int destOffsetX,
                   int destOffsetY, int destWidth, int destHeight, ProductData destBuffer,
                   ProgressMonitor pm) throws IOException {
  BeamLogManager.getSystemLogger().log(Level.FINEST, MessageFormat.format(
      "reading band data (" + destBand.getName() + ") from {0} to {1}",
      destOffsetY * destWidth, sourceOffsetY * destWidth + destWidth * destHeight));
  pm.beginTask("reading band data...", destWidth * destHeight);
  Object[] values;
  synchronized (parser) {
    values = parser.parseRecords(destOffsetY * destWidth, destWidth * destHeight, destBand.getName());
  }
  getProductData(values, destBuffer);
  pm.done();
}

代码示例来源:origin: bcdev/beam

private PixelIter createPixelIter(Rectangle rectangle, ProgressMonitor pm) {
  final Tile[] sourceTiles = new Tile[sourceBands.length];
  try {
    pm.beginTask("Extracting data points...", sourceBands.length);
    for (int i = 0; i < sourceBands.length; i++) {
      sourceTiles[i] = getSourceTile(sourceBands[i], rectangle);
      pm.worked(1);
    }
  } finally {
    pm.done();
  }
  return new PixelIter(sourceTiles, roi);
}

代码示例来源:origin: bcdev/beam

private PixelIter createPixelIter(Rectangle rectangle, ProgressMonitor pm) {
  final Tile[] sourceTiles = new Tile[sourceBands.length];
  try {
    pm.beginTask("Extracting data points...", sourceBands.length);
    for (int i = 0; i < sourceBands.length; i++) {
      sourceTiles[i] = getSourceTile(sourceBands[i], rectangle);
      pm.worked(1);
    }
  } finally {
    pm.done();
  }
  return new PixelIter(sourceTiles, roi);
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
protected Boolean doInBackground() throws Exception {
  try {
    if(operationType.equals(TYPE.REMOVE)) {
      removeProducts();
    } else if(operationType.equals(TYPE.QUERY)) {
      dbPane.fullQuery(pm);
    } else if(operationType.equals(TYPE.EXECUTEACTION)) {
      action.performAction(pm);
    }
  } catch (Throwable e) {
    SystemUtils.LOG.severe("DB Worker Exception\n" + e.getMessage());
  } finally {
    pm.done();
  }
  return true;
}

代码示例来源:origin: bcdev/beam

private void storeProductsInMap(ProgressMonitor pm) {
  pm.beginTask("Loading time series...", 2);
  try {
    final List<Product> allProducts = getAllProducts(new SubProgressMonitor(pm, 1));
    reprojectProducts(allProducts, new SubProgressMonitor(pm, 1));
  } finally {
    pm.done();
  }
}

代码示例来源:origin: senbox-org/s1tbx

private IfgStack[] setupIfgStack(CplxContainer[] cplxContainers, ProgressMonitor pm) {
  // construct pairs from data in containers
  IfgStack[] ifgStack = new IfgStack[numOfImages];
  IfgPair[][] ifgPair = new IfgPair[numOfImages][numOfImages];
  pm.beginTask("Computing...", numOfImages);
  for (int i = 0; i < numOfImages; i++) {
    CplxContainer master = cplxContainers[i];
    for (int j = 0; j < numOfImages; j++) {
      CplxContainer slave = cplxContainers[j];
      ifgPair[i][j] = new IfgPair(master, slave);
    }
    ifgStack[i] = new IfgStack(master, ifgPair[i]);
    ifgStack[i].meanCoherence();
    pm.worked(1);
  }
  pm.done();
  return ifgStack;
}

代码示例来源:origin: bcdev/beam

public void prepareImageInfos(RasterDataNode[] rasterDataNodes, ProgressMonitor pm) {
  int numTaskSteps = 0;
  for (RasterDataNode raster : rasterDataNodes) {
    numTaskSteps += raster.getImageInfo() == null ? 1 : 0;
  }
  pm.beginTask("Computing image statistics", numTaskSteps);
  try {
    for (final RasterDataNode raster : rasterDataNodes) {
      final ImageInfo imageInfo = raster.getImageInfo();
      if (imageInfo == null) {
        raster.getImageInfo(SubProgressMonitor.create(pm, 1));
      }
    }
  } finally {
    pm.done();
  }
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
protected Void doInBackground(ProgressMonitor pm) throws Exception {
  pm.beginTask("Computing pixel values...", -1);
  AbstractButton runButton = getButton(ID_OK);
  runButton.setEnabled(false);
  try {
    GPF.createProduct("PixEx", parameterMap, ioForm.getSourceProducts());
    pm.worked(1);
  } finally {
    pm.done();
  }
  return null;
}

代码示例来源:origin: bcdev/beam

@Override
protected Void doInBackground(ProgressMonitor pm) throws Exception {
  pm.beginTask("Computing pixel values...", -1);
  AbstractButton runButton = getButton(ID_OK);
  runButton.setEnabled(false);
  try {
    GPF.createProduct("PixEx", parameterMap, ioForm.getSourceProducts());
    pm.worked(1);
  } finally {
    pm.done();
  }
  return null;
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
protected Object doInBackground(ProgressMonitor pm) throws Exception {
  UIUtils.setRootFrameWaitCursor(ImageInfoEditor2.this);
  if (parentForm.getFormModel().isValid()) {
    final RasterDataNode[] rasters = parentForm.getFormModel().getRasters();
    try {
      pm.beginTask("Computing statistics", rasters.length);
      for (RasterDataNode raster : rasters) {
        raster.getStx(true, SubProgressMonitor.create(pm, 1));
      }
    } finally {
      pm.done();
    }
  }
  return null;
}

相关文章