当前位置: 首页>>代码示例>>Java>>正文


Java ProgressMonitor.done方法代码示例

本文整理汇总了Java中com.bc.ceres.core.ProgressMonitor.done方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressMonitor.done方法的具体用法?Java ProgressMonitor.done怎么用?Java ProgressMonitor.done使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.bc.ceres.core.ProgressMonitor的用法示例。


在下文中一共展示了ProgressMonitor.done方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reprojectProducts

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private void reprojectProducts(List<Product> allProducts, ProgressMonitor pm) {
    pm.beginTask("Reprojecting source products...", allProducts.size());
    try {
        for (Product product : allProducts) {
            if (pm.isCanceled()) {
                return;
            }
            if (!product.isCompatibleProduct(tsProduct, LAT_LON_EPSILON)) {
                HashMap<String, Product> productToBeReprojectedMap = new HashMap<>();
                productToBeReprojectedMap.put("source", product);
                productToBeReprojectedMap.put("collocateWith", tsProduct);
                final Product collocatedProduct = GPF.createProduct("Reproject", createProjectionParameters(), productToBeReprojectedMap);
                collocatedProduct.setStartTime(product.getStartTime());
                collocatedProduct.setEndTime(product.getEndTime());
                product = collocatedProduct;
            }
            productTimeMap.put(formatTimeString(product), product);
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:24,代码来源:TimeSeriesImpl.java

示例2: createProductSceneImageRGB

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private ProductSceneImage createProductSceneImageRGB(String name, final Product product, String[] rgbaExpressions,
                                                     ProgressMonitor pm) throws Exception {
    Band[] rgbBands = null;
    boolean errorOccurred = false;
    ProductSceneImage productSceneImage = null;
    try {
        pm.beginTask("Creating RGB image...", 2);
        rgbBands = allocateRgbBands(product, rgbaExpressions);
        productSceneImage = new ProductSceneImage(name, rgbBands[0],
                                                  rgbBands[1],
                                                  rgbBands[2],
                                                  SnapApp.getDefault().getPreferencesPropertyMap(),
                                                  SubProgressMonitor.create(pm, 1));
        productSceneImage.initVectorDataCollectionLayer();
        productSceneImage.initMaskCollectionLayer();
    } catch (Exception e) {
        errorOccurred = true;
        throw e;
    } finally {
        pm.done();
        if (rgbBands != null) {
            releaseRgbBands(rgbBands, errorOccurred);
        }
    }
    return productSceneImage;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:27,代码来源:OpenRGBImageViewAction.java

示例3: computeTile

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTile(Band targetBand, Tile targetTile, ProgressMonitor pm) throws OperatorException {
    final GeoCoding geoCoding = sourceProduct.getSceneGeoCoding();
    final Rectangle targetRect = targetTile.getRectangle();
    final Tile altitudeTile = getAltitudeTile(targetRect, sourceProduct, useDEM);
    final Band visibilityBand = visibilityProduct.getBand(ScapeMConstants.VISIBILITY_BAND_NAME);
    final Tile visibilityTile = getSourceTile(visibilityBand, targetRect);
    final double[][] hsurfArrayCell;

    pm.beginTask("Processing frame...", targetRect.height + 1);
    try {
        if (useDEM && altitudeTile == null) {
            hsurfArrayCell = ScapeMAlgorithm.getHsurfArrayCell(targetRect, geoCoding, elevationModel, scapeMLut);
        } else {
            hsurfArrayCell = ScapeMAlgorithm.getHsurfArrayCell(targetRect, geoCoding, altitudeTile, scapeMLut);
        }

        for (int y = targetRect.y; y < targetRect.y + targetRect.height; y++) {
            for (int x = targetRect.x; x < targetRect.x + targetRect.width; x++) {
                final double visibility = visibilityTile.getSampleDouble(x, y);
                if (visibility != ScapeMConstants.VISIBILITY_NODATA_VALUE) {
                    final double aot550 = ScapeMAlgorithm.getCellAot550(visibility,
                            hsurfArrayCell[x - targetRect.x][y - targetRect.y],
                            scapeMLut);
                    targetTile.setSample(x, y, aot550);
                } else {
                    targetTile.setSample(x, y, ScapeMConstants.AOT_NODATA_VALUE);
                }
            }
            pm.worked(1);
        }
    } catch (OperatorException e) {
        // todo
        e.printStackTrace();
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s3tbx-scape-m,代码行数:39,代码来源:ScapeMVis2AotOp.java

示例4: doInBackground

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
protected com.bc.ceres.glayer.Layer doInBackground(ProgressMonitor pm) throws Exception {

    try {
        pm.beginTask("Loading layer from WMS", ProgressMonitor.UNKNOWN);

        final LayerType wmsType = LayerTypeRegistry.getLayerType(WmsLayerType.class.getName());
        final PropertySet template = wmsType.createLayerConfig(getContext().getLayerContext());

        final RasterDataNode raster = SnapApp.getDefault().getSelectedProductSceneView().getRaster();
        template.setValue(WmsLayerType.PROPERTY_NAME_RASTER, raster);
        template.setValue(WmsLayerType.PROPERTY_NAME_IMAGE_SIZE, mapImageSize);
        URL wmsUrl = (URL) context.getPropertyValue(WmsLayerSource.PROPERTY_NAME_WMS_URL);
        template.setValue(WmsLayerType.PROPERTY_NAME_URL, wmsUrl);
        StyleImpl selectedStyle = (StyleImpl) context.getPropertyValue(WmsLayerSource.PROPERTY_NAME_SELECTED_STYLE);
        String styleName = null;
        if (selectedStyle != null) {
            styleName = selectedStyle.getName();
        }
        template.setValue(WmsLayerType.PROPERTY_NAME_STYLE_NAME, styleName);
        WebMapServer wms = (WebMapServer) context.getPropertyValue(WmsLayerSource.PROPERTY_NAME_WMS);
        final List<Layer> layerList = wms.getCapabilities().getLayerList();
        Layer selectedLayer = (Layer) context.getPropertyValue(WmsLayerSource.PROPERTY_NAME_SELECTED_LAYER);
        template.setValue(WmsLayerType.PROPERTY_NAME_LAYER_INDEX, layerList.indexOf(selectedLayer));
        CRSEnvelope crsEnvelope = (CRSEnvelope) context.getPropertyValue(WmsLayerSource.PROPERTY_NAME_CRS_ENVELOPE);
        template.setValue(WmsLayerType.PROPERTY_NAME_CRS_ENVELOPE, crsEnvelope);
        final com.bc.ceres.glayer.Layer layer = wmsType.createLayer(getContext().getLayerContext(), template);
        layer.setName(selectedLayer.getName());
        return layer;
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:34,代码来源:WmsWorker.java

示例5: exportTransectPixels

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
/**
 * Writes all pixel values of the given product within the given ROI to the specified out.
 *
 * @param out     the data output writer
 * @param product the product providing the pixel values
 * @return {@code true} for success, {@code false} if export has been terminated (by user)
 */
private boolean exportTransectPixels(final PrintWriter out,
                                     final Product product,
                                     final TransectProfileData transectProfileData,
                                     final int numTransectPixels,
                                     ProgressMonitor pm) {

    final Band[] bands = product.getBands();
    final TiePointGrid[] tiePointGrids = product.getTiePointGrids();
    final GeoCoding geoCoding = product.getSceneGeoCoding();
    if (mustCreateHeader) {
        writeFileHeader(out, bands);
    }
    writeTableHeader(out, geoCoding, bands, mustExportTiePoints, tiePointGrids, mustExportWavelengthsAndSF);
    final Point2D[] pixelPositions = transectProfileData.getPixelPositions();

    pm.beginTask("Writing pixel data...", numTransectPixels);
    try {
        for (Point2D pixelPosition : pixelPositions) {
            int x = (int) Math.floor(pixelPosition.getX());
            int y = (int) Math.floor(pixelPosition.getY());
            if (x >= 0 && x < product.getSceneRasterWidth()
                    && y >= 0 && y < product.getSceneRasterHeight()) {
                writeDataLine(out, geoCoding, bands, mustExportTiePoints, tiePointGrids, x, y);
                pm.worked(1);
                if (pm.isCanceled()) {
                    return false;
                }
            }
        }
    } finally {
        pm.done();
    }

    return true;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:43,代码来源:ExportTransectPixelsAction.java

示例6: computeTileStack

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm) throws OperatorException {
    pm.beginTask("Computing S2REP", rectangle.height);
    try {
        Tile redB4Tile = getSourceTile(getSourceProduct().getBand(redSourceBand4), rectangle);
        Tile redB5Tile = getSourceTile(getSourceProduct().getBand(redSourceBand5), rectangle);
        Tile redB6Tile = getSourceTile(getSourceProduct().getBand(redSourceBand6), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile s2rep = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile s2repFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float s2repValue;

        for (int y = rectangle.y; y < rectangle.y + rectangle.height; y++) {
            for (int x = rectangle.x; x < rectangle.x + rectangle.width; x++) {

                final float nir = nirFactor * nirTile.getSampleFloat(x, y);
                final float redB4 = redB4Factor * redB4Tile.getSampleFloat(x, y);
                final float redB5 = redB5Factor * redB5Tile.getSampleFloat(x, y);
                final float redB6 = redB6Factor * redB6Tile.getSampleFloat(x, y);

                s2repValue = 705.0f + 35.0f * ( ( ( (nir + redB4) / 2.0f ) - redB5 ) / (redB6 - redB5) );

                s2rep.setSample(x, y, computeFlag(x, y, s2repValue, s2repFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:34,代码来源:S2repOp.java

示例7: computeTileStack

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm) throws OperatorException {
    pm.beginTask("Computing GNDVI", rectangle.height);
    try {
        Tile greenTile = getSourceTile(getSourceProduct().getBand(greenSourceBand), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile gndvi = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile gndviFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float gndviValue;

        for (int y = rectangle.y; y < rectangle.y + rectangle.height; y++) {
            for (int x = rectangle.x; x < rectangle.x + rectangle.width; x++) {

                final float nir = nirFactor * nirTile.getSampleFloat(x, y);
                final float green = greenFactor * greenTile.getSampleFloat(x, y);

                gndviValue = (nir - green)/(nir + green);

                gndvi.setSample(x, y, computeFlag(x, y, gndviValue, gndviFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:30,代码来源:GndviOp.java

示例8: createProductSceneImageHSV

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private static ProductSceneImage createProductSceneImageHSV(final String name, final Product product,
                                                            final String[] hsvExpressions,
                                                            final ProgressMonitor pm) throws Exception {
    UIUtils.setRootFrameWaitCursor(SnapApp.getDefault().getMainFrame());
    Band[] rgbBands = null;
    boolean errorOccured = false;
    ProductSceneImage productSceneImage = null;
    try {
        pm.beginTask("Creating HSV image...", 2);
        final String[] rgbaExpressions = convertHSVToRGBExpressions(hsvExpressions);
        rgbBands = OpenRGBImageViewAction.allocateRgbBands(product, rgbaExpressions);

        productSceneImage = new ProductSceneImage(name,
                                                  rgbBands[0],
                                                  rgbBands[1],
                                                  rgbBands[2],
                                                  SnapApp.getDefault().getPreferencesPropertyMap(),
                                                  SubProgressMonitor.create(pm, 1));
        productSceneImage.initVectorDataCollectionLayer();
        productSceneImage.initMaskCollectionLayer();
    } catch (Exception e) {
        errorOccured = true;
        throw e;
    } finally {
        pm.done();
        if (rgbBands != null) {
            OpenRGBImageViewAction.releaseRgbBands(rgbBands, errorOccured);
        }
    }
    return productSceneImage;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:32,代码来源:OpenHSVImageViewAction.java

示例9: computeTileStack

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm) throws OperatorException {
    pm.beginTask("Computing NDWI", rectangle.height);
    try {
        Tile mirTile = getSourceTile(getSourceProduct().getBand(mirSourceBand), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile ndwi = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile ndwiFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float ndwiValue;

        for (int y = rectangle.y; y < rectangle.y + rectangle.height; y++) {
            for (int x = rectangle.x; x < rectangle.x + rectangle.width; x++) {

                final float nir = nirFactor * nirTile.getSampleFloat(x, y);
                final float mir = mirFactor * mirTile.getSampleFloat(x, y);

                ndwiValue = (nir - mir)/(nir + mir);

                ndwi.setSample(x, y, computeFlag(x, y, ndwiValue, ndwiFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:30,代码来源:NdwiOp.java

示例10: computeTileStack

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm) throws OperatorException {
    pm.beginTask("Computing RI", rectangle.height);
    try {

        Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
        Tile greenTile = getSourceTile(getSourceProduct().getBand(greenSourceBand), rectangle);

        Tile ri = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile riFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float riValue;

        for (int y = rectangle.y; y < rectangle.y + rectangle.height; y++) {
            for (int x = rectangle.x; x < rectangle.x + rectangle.width; x++) {

                final float red = redFactor * redTile.getSampleFloat(x, y);
                final float green = greenFactor * greenTile.getSampleFloat(x, y);

                riValue = (red * red)/(green * green * green);

                ri.setSample(x, y, computeFlag(x, y, riValue, riFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:31,代码来源:RiOp.java

示例11: restoreViews

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private ProductNodeView[] restoreViews(ProductManager productManager,
                                       PropertyMap applicationPreferences,
                                       ProgressMonitor pm,
                                       List<Exception> problems) {
    ArrayList<ProductNodeView> views = new ArrayList<ProductNodeView>();
    try {
        pm.beginTask("Restoring views", viewRefs.length);
        for (ViewRef viewRef : viewRefs) {
            try {
                if (ProductSceneView.class.getName().equals(viewRef.type)) {
                    collectSceneView(viewRef, productManager, applicationPreferences, pm, problems, views);
                } else if (MetadataViewTopComponent.class.getName().equals(viewRef.type)) {
                    collectMetadataView(viewRef, productManager, views);
                    // todo - flag and index coding views (rq-20100618)
                } else {
                    throw new Exception("Unknown view type: " + viewRef.type);
                }
            } catch (Exception e) {
                problems.add(e);
            } finally {
                pm.worked(1);
            }
        }
    } finally {
        pm.done();
    }
    return views.toArray(new ProductNodeView[views.size()]);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:29,代码来源:Session.java

示例12: computeTileStack

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm) throws OperatorException {
    pm.beginTask("Computing IRECI", rectangle.height);
    try {
        Tile redB4Tile = getSourceTile(getSourceProduct().getBand(redSourceBand4), rectangle);
        Tile redB5Tile = getSourceTile(getSourceProduct().getBand(redSourceBand5), rectangle);
        Tile redB6Tile = getSourceTile(getSourceProduct().getBand(redSourceBand6), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile ireci = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile ireciFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float ireciValue;

        for (int y = rectangle.y; y < rectangle.y + rectangle.height; y++) {
            for (int x = rectangle.x; x < rectangle.x + rectangle.width; x++) {

                final float nir = nirFactor * nirTile.getSampleFloat(x, y);
                final float redB4 = redB4Factor * redB4Tile.getSampleFloat(x, y);
                final float redB5 = redB5Factor * redB5Tile.getSampleFloat(x, y);
                final float redB6 = redB6Factor * redB6Tile.getSampleFloat(x, y);

                ireciValue = (nir - redB4) / (redB5 / redB6);

                ireci.setSample(x, y, computeFlag(x, y, ireciValue, ireciFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:34,代码来源:IreciOp.java

示例13: storeProductsInMap

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:10,代码来源:TimeSeriesImpl.java

示例14: computeTileStack

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm) throws OperatorException {
    pm.beginTask("Computing savi", rectangle.height);
    try {
        Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile savi = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile saviFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float saviValue;

        for (int y = rectangle.y; y < rectangle.y + rectangle.height; y++) {
            for (int x = rectangle.x; x < rectangle.x + rectangle.width; x++) {
                final float nir = nirFactor * nirTile.getSampleFloat(x, y);
                final float red = redFactor * redTile.getSampleFloat(x, y);

                saviValue = (nir - red) / (nir + red + soilCorrectionFactor) * (1 + soilCorrectionFactor);

                savi.setSample(x, y, computeFlag(x, y, saviValue, saviFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:29,代码来源:SaviOp.java

示例15: computeTileStack

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm) throws OperatorException {
    pm.beginTask("Computing BI2", rectangle.height);
    try {

        Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
        Tile greenTile = getSourceTile(getSourceProduct().getBand(greenSourceBand), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile bi2 = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile bi2Flags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float bi2Value;

        for (int y = rectangle.y; y < rectangle.y + rectangle.height; y++) {
            for (int x = rectangle.x; x < rectangle.x + rectangle.width; x++) {

                final float red = redFactor * redTile.getSampleFloat(x, y);
                final float green = greenFactor * greenTile.getSampleFloat(x, y);
                final float nir = nirFactor * nirTile.getSampleFloat(x, y);

                bi2Value = (float) Math.sqrt( ( (red * red) + (green * green) + (nir * nir) ) / 3.0f );

                bi2.setSample(x, y, computeFlag(x, y, bi2Value, bi2Flags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:33,代码来源:Bi2Op.java


注:本文中的com.bc.ceres.core.ProgressMonitor.done方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。