本文整理汇总了Java中com.bc.ceres.core.ProgressMonitor.worked方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressMonitor.worked方法的具体用法?Java ProgressMonitor.worked怎么用?Java ProgressMonitor.worked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bc.ceres.core.ProgressMonitor
的用法示例。
在下文中一共展示了ProgressMonitor.worked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeTileStack
import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle targetRectangle, ProgressMonitor pm) throws OperatorException {
Rectangle srcRec = getSourceRectangle(targetRectangle, pixelWindow);
if (!containsTileValidData(srcRec)) {
setInvalidTargetSamples(targetTiles);
return;
}
Map<String, Tile> sourceTiles = new HashMap<>();
sourceTiles.putAll(getSourceTiles(reflectanceBandNames, srcRec, borderExt));
sourceTiles.putAll(getSourceTiles(InstrumentConsts.GEOM_NAMES, srcRec, borderExt));
sourceTiles.putAll(getSourceTiles(auxRasterDataNodeNames, srcRec, borderExt));
for (int y = targetRectangle.y; y < targetRectangle.y + targetRectangle.height; y++) {
checkForCancellation();
for (int x = targetRectangle.x; x < targetRectangle.x + targetRectangle.width; x++) {
processSuperPixel(sourceTiles, x, y, targetTiles);
}
pm.worked(1);
}
pm.done();
}
示例2: 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();
}
}
示例3: reprojectSourceProducts
import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private void reprojectSourceProducts(ProgressMonitor pm) {
final ProductLocationsPaneModel productLocationsModel = getAssistantModel().getProductLocationsModel();
final List<ProductLocation> productLocations = productLocationsModel.getProductLocations();
pm.beginTask("Reprojecting...", productLocations.size());
for (ProductLocation productLocation : productLocations) {
final Map<String, Product> products = productLocation.getProducts(ProgressMonitor.NULL);
final Product crsReferenceProduct = getCrsReferenceProduct();
for (Map.Entry<String, Product> productEntry : products.entrySet()) {
final Product product = productEntry.getValue();
if (!product.isCompatibleProduct(crsReferenceProduct, 0.1E-4f)) {
Product reprojectedProduct = createProjectedProduct(product, crsReferenceProduct);
productEntry.setValue(reprojectedProduct);
}
}
pm.worked(1);
}
pm.done();
}
示例4: getAllProducts
import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private List<Product> getAllProducts(ProgressMonitor pm) {
List<Product> result = new ArrayList<>();
pm.beginTask("Scanning product locations ...", productLocationList.size());
try {
for (ProductLocation productLocation : productLocationList) {
if (pm.isCanceled()) {
break;
}
for (Product product : productLocation.getProducts(ProgressMonitor.NULL).values()) {
result.add(product);
}
pm.worked(1);
}
} finally {
pm.done();
}
return result;
}
示例5: 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();
}
}
示例6: createThumbNailImage
import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
private BufferedImage createThumbNailImage(Dimension imgSize, ProgressMonitor pm) {
Assert.notNull(pm, "pm");
String thumbNailBandName = getThumbnailBandName();
Band thumbNailBand = product.getBand(thumbNailBandName);
Debug.trace("ProductSubsetDialog: Reading thumbnail data for band '" + thumbNailBandName + "'...");
pm.beginTask("Creating thumbnail image", 5);
BufferedImage image = null;
try {
MultiLevelSource multiLevelSource = ColoredBandImageMultiLevelSource.create(thumbNailBand,
SubProgressMonitor.create(pm, 1));
final ImageLayer imageLayer = new ImageLayer(multiLevelSource);
final int imageWidth = imgSize.width;
final int imageHeight = imgSize.height;
final int imageType = BufferedImage.TYPE_3BYTE_BGR;
image = new BufferedImage(imageWidth, imageHeight, imageType);
Viewport snapshotVp = new DefaultViewport(isModelYAxisDown(imageLayer));
final BufferedImageRendering imageRendering = new BufferedImageRendering(image, snapshotVp);
final Graphics2D graphics = imageRendering.getGraphics();
graphics.setColor(getBackground());
graphics.fillRect(0, 0, imageWidth, imageHeight);
snapshotVp.zoom(imageLayer.getModelBounds());
snapshotVp.moveViewDelta(snapshotVp.getViewBounds().x, snapshotVp.getViewBounds().y);
imageLayer.render(imageRendering);
pm.worked(4);
} finally {
pm.done();
}
return image;
}
示例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 MTCI", rectangle.height);
try {
Tile redB4Tile = getSourceTile(getSourceProduct().getBand(redSourceBand4), rectangle);
Tile redB5Tile = getSourceTile(getSourceProduct().getBand(redSourceBand5), rectangle);
Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);
Tile mtci = targetTiles.get(targetProduct.getBand(BAND_NAME));
Tile mtciFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));
float mtciValue;
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);
mtciValue = (nir - redB5) / (redB5 - redB4);
mtci.setSample(x, y, computeFlag(x, y, mtciValue, mtciFlags));
}
checkForCancellation();
pm.worked(1);
}
} finally {
pm.done();
}
}
示例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();
}
}
示例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 BI", rectangle.height);
try {
Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
Tile greenTile = getSourceTile(getSourceProduct().getBand(greenSourceBand), rectangle);
Tile bi = targetTiles.get(targetProduct.getBand(BAND_NAME));
Tile biFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));
float biValue;
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);
biValue = (float) Math.sqrt( ( (red * red) + (green * green) ) / 2.0f );
bi.setSample(x, y, computeFlag(x, y, biValue, biFlags));
}
checkForCancellation();
pm.worked(1);
}
} finally {
pm.done();
}
}
示例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 PSSRa", rectangle.height);
try {
Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);
Tile pssra = targetTiles.get(targetProduct.getBand(BAND_NAME));
Tile pssraFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));
float pssraValue;
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);
pssraValue = nir / red;
pssra.setSample(x, y, computeFlag(x, y, pssraValue, pssraFlags));
}
checkForCancellation();
pm.worked(1);
}
} finally {
pm.done();
}
}
示例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 RVI", rectangle.height);
try {
Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);
Tile rvi = targetTiles.get(targetProduct.getBand(BAND_NAME));
Tile rviFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));
float rviValue;
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);
rviValue = nir / red;
rvi.setSample(x, y, computeFlag(x, y, rviValue, rviFlags));
}
checkForCancellation();
pm.worked(1);
}
} finally {
pm.done();
}
}
示例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 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();
}
}
示例13: doInBackground
import com.bc.ceres.core.ProgressMonitor; //导入方法依赖的package包/类
@Override
protected Object doInBackground(ProgressMonitor pm) throws Exception {
try {
final String message = String.format("Saving image as %s...", file.getPath());
pm.beginTask(message, view.isRGB() ? 4 : 3);
snapApp.setStatusBarMessage(message);
snapApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
final Dimension dimension = new Dimension(view.getProduct().getSceneRasterWidth(),
view.getProduct().getSceneRasterHeight());
RenderedImage image = ExportImageAction.createImage(view, true, dimension, true, true);
pm.worked(1);
try (ZipOutputStream outStream = new ZipOutputStream(new FileOutputStream(file))) {
outStream.putNextEntry(new ZipEntry(OVERLAY_KML));
final String kmlContent = formatKML(view, OVERLAY_PNG);
outStream.write(kmlContent.getBytes());
pm.worked(1);
outStream.putNextEntry(new ZipEntry(OVERLAY_PNG));
ImageEncoder encoder = ImageCodec.createImageEncoder(IMAGE_TYPE, outStream, null);
encoder.encode(image);
pm.worked(1);
if (!view.isRGB()) {
outStream.putNextEntry(new ZipEntry(LEGEND_PNG));
encoder = ImageCodec.createImageEncoder(IMAGE_TYPE, outStream, null);
encoder.encode(createImageLegend(view.getRaster()));
pm.worked(1);
}
}
} catch (OutOfMemoryError ignored) {
Dialogs.showOutOfMemoryError("The image could not be exported."); /*I18N*/
} catch (Throwable e) {
snapApp.handleError("The image could not be exported", e);
} finally {
snapApp.getMainFrame().setCursor(Cursor.getDefaultCursor());
snapApp.setStatusBarMessage("");
pm.done();
}
return null;
}
示例14: 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();
}
示例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 TNDVI", rectangle.height);
try {
Tile redTile = getSourceTile(getSourceProduct().getBand(redSourceBand), rectangle);
Tile nirTile = getSourceTile(getSourceProduct().getBand(nirSourceBand), rectangle);
Tile tndvi = targetTiles.get(targetProduct.getBand(BAND_NAME));
Tile tndviFlags = targetTiles.get(targetProduct.getBand(FLAGS_BAND_NAME));
float tndviValue;
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);
tndviValue = (float) Math.sqrt( (nir - red)/(nir + red) + 0.5f );
tndvi.setSample(x, y, computeFlag(x, y, tndviValue, tndviFlags));
}
checkForCancellation();
pm.worked(1);
}
} finally {
pm.done();
}
}