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


Java ProgressMonitor.beginTask方法代码示例

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


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

示例1: doInBackground

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

示例2: 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

示例3: setUpRows

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

示例4: performAction

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
public void performAction(final ProgressMonitor pm) {

        outputFolder =  requestFolderForSave("Download product(s) to folder", "snap.download.folder");

        if (outputFolder == null) return;

        final ProductEntry[] selections = actionHandler.getSelectedProductEntries();
        pm.beginTask("Downloading...", selections.length);
        try {
            final OpenData openData = new OpenData(COPERNICUS_HOST, COPERNICUS_ODATA_ROOT);

            for(ProductEntry entry : selections) {
                if (pm.isCanceled()) {
                    SystemUtils.LOG.info("DownloadActionExt: Download is cancelled");
                    break;
                }
                OpenData.Entry oData = openData.getEntryByID(entry.getRefID());
                SystemUtils.LOG.info(oData.fileName);

                openData.getProduct(entry.getRefID(), oData, outputFolder, new SubProgressMonitor(pm, 1));
            }

            for (ActionExtListener listener : listenerList) {
                listener.notifyMSG(this, ActionExtListener.MSG.NEW_REPO);
            }

        } catch (Exception e) {
            Dialogs.showError("unable to download " + e.getMessage());
        } finally {
            pm.done();
        }
    }
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:33,代码来源:DownloadActionExt.java

示例5: 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 ARVI", rectangle.height);
    try {

        Tile blueTile = getSourceTile(getSourceProduct().getBand(blueSourceBand), rectangle);
        Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile arvi = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile arviFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float rbEquationValue;
        float arviValue;

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

                final float blue = blueFactor * blueTile.getSampleFloat(x, y);
                final float red = redFactor * redTile.getSampleFloat(x, y);
                final float nir = nirFactor * nirTile.getSampleFloat(x, y);

                rbEquationValue = red - gammaParameter * (blue - red);

                arviValue = (nir - rbEquationValue) / (nir + rbEquationValue);

                arvi.setSample(x, y, computeFlag(x, y, arviValue, arviFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:36,代码来源:ArviOp.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 CI", rectangle.height);
    try {

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

        Tile ci = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile ciFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float ciValue;

        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);

                ciValue = (red - green)/(red + green);

                ci.setSample(x, y, computeFlag(x, y, ciValue, ciFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:31,代码来源:CiOp.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 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

示例8: 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

示例9: getVariables

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private Variable[] getVariables(ProductLocationsPaneModel locationsModel, ProgressMonitor pm) {
            try {
                pm.beginTask("Scanning product locations...", locationsModel.getSize());
                for (int i = 0; i < locationsModel.getSize(); i++) {
                    final ProductLocation location = locationsModel.getElementAt(i);
                    location.loadProducts(new SubProgressMonitor(pm, 1));
                    final Collection<Product> products = location.getProducts(ProgressMonitor.NULL).values();
                    if (!products.isEmpty()) {
                        final Product product = products.iterator().next();
                        final String[] bandNames = product.getBandNames();
                        final Variable[] variables = new Variable[bandNames.length];
                        for (int j = 0; j < bandNames.length; j++) {
                            variables[j] = new Variable(bandNames[j]);
                        }
                        location.closeProducts();
// @todo se - ?? return variables ?? - really a shortcut after the first product?
// in this case only the variables of the first product are returned.
                        return variables;
                    } else {
                        location.closeProducts();
                    }
                }
            } finally {
                pm.done();
            }

            return new Variable[0];
        }
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:29,代码来源:TimeSeriesAssistantPage_SourceProducts.java

示例10: readBandRasterDataImpl

import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@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 {
    final int sourceMaxY = sourceOffsetY + sourceHeight - 1;
    Product product = destBand.getProduct();
    final int elemSize = destBuffer.getElemSize();

    final int bandIndex = product.getBandIndex(destBand.getName());

    final long lineSizeInBytes = (long)metadata.getRasterWidth() * (long)metadata.getRasterPixelSize();
    int numBands = product.getNumBands();

    pm.beginTask("Reading band '" + destBand.getName() + "'...", sourceMaxY - sourceOffsetY);
    try {
        int destPos = 0;
        for (int sourceY = sourceOffsetY; sourceY <= sourceMaxY; sourceY += sourceStepY) {
            if (pm.isCanceled()) {
                break;
            }
            synchronized (sharedLock) {
                long lineStartPos = sourceY * numBands * lineSizeInBytes + bandIndex * lineSizeInBytes;
                imageInputStream.seek(lineStartPos + elemSize * sourceOffsetX);
                destBuffer.readFrom(destPos, destWidth, imageInputStream);
                destPos += destWidth;
            }
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:31,代码来源:SpotViewProductReader.java

示例11: 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 NDPI", rectangle.height);
    try {
        Tile greenTile = getSourceTile(getSourceProduct().getBand(greenSourceBand), rectangle);
        Tile swirTile = getSourceTile(getSourceProduct().getBand(swirSourceBand), rectangle);

        Tile ndpi = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile ndpiFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float ndpiValue;

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

                final float swir = swirFactor * swirTile.getSampleFloat(x, y);
                final float green = greenFactor * greenTile.getSampleFloat(x, y);

                ndpiValue = (green - swir)/(green + swir);// (1 - green/swir)/(1 + green/swir)

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

示例12: doInBackground

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

    try {
        pm.beginTask("Reading shapes", ProgressMonitor.UNKNOWN);
        final ProductSceneView sceneView = SnapApp.getDefault().getSelectedProductSceneView();
        final Geometry clipGeometry = FeatureUtils.createGeoBoundaryPolygon(sceneView.getProduct());

        File file = new File((String) context.getPropertyValue(ShapefileLayerSource.PROPERTY_NAME_FILE_PATH));
        FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = getFeatureCollection(file);
        CoordinateReferenceSystem featureCrs = (CoordinateReferenceSystem) context.getPropertyValue(
                ShapefileLayerSource.PROPERTY_NAME_FEATURE_COLLECTION_CRS);


        Style[] styles = getStyles(file, featureCollection);
        Style selectedStyle = getSelectedStyle(styles);

        final LayerType type = LayerTypeRegistry.getLayerType(FeatureLayerType.class.getName());
        final PropertySet configuration = type.createLayerConfig(sceneView);
        configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_URL, file.toURI().toURL());
        configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION, featureCollection);
        configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_CRS, featureCrs);
        configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_CLIP_GEOMETRY, clipGeometry);
        configuration.setValue(FeatureLayerType.PROPERTY_NAME_SLD_STYLE, selectedStyle);
        Layer featureLayer = type.createLayer(sceneView, configuration);
        featureLayer.setName(file.getName());
        featureLayer.setVisible(true);
        return featureLayer;
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:33,代码来源:ShapefileLoader.java

示例13: 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

示例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 IPVI", rectangle.height);
    try {
        Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile ipvi = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile ipviFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float ipviValue;

        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);

                ipviValue = nir / (nir + red);

                ipvi.setSample(x, y, computeFlag(x, y, ipviValue, ipviFlags));
            }
            checkForCancellation();
            pm.worked(1);
        }
    } finally {
        pm.done();
    }
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:29,代码来源:IpviOp.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 PVI", rectangle.height);
    try {
        Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
        Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);

        Tile pvi = targetTiles.get(targetProduct.getBand(BAND_NAME));
        Tile pviFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));

        float pviValue;

        double radiansAngle = Math.toRadians(angleSoilLineNIRAxis);

        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);

                pviValue = (float) ((Math.sin(radiansAngle) * nir) - (Math.cos(radiansAngle) * red));

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


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