private synchronized void addPlacemark(final Placemark pin) { targetGCPGroup.add(pin); }
private void makeMaskVisible(Mask mask) { if (visibleBand != null) { visibleBand.getOverlayMaskGroup().add(mask); } }
protected void addQuicklook(final Product product, final String name, final File qlFile) { if(qlFile != null) { product.getQuicklookGroup().add(new Quicklook(product, name, qlFile)); } }
private void addQuicklook(final Product product, final File qlFile) { if (qlFile != null) { product.getQuicklookGroup().add(new Quicklook(product, Quicklook.DEFAULT_QUICKLOOK_NAME, qlFile)); } }
private void addMaskToProductIfPossible(Mask mask, Product product) throws Exception { if (mask.getImageType().canTransferMask(mask, product)) { product.getMaskGroup().add(mask); } else { throw new Exception(String.format("Cannot add mask '%s' to selected product.", mask.getName())); } } }
private void addQuicklooks(Product product) { try { String[] files = null; files = virtualDir.listAll(); for (String file : files) { if (file.matches(MuscateConstants.QUICKLOOK_PATTERN)) { product.getQuicklookGroup().add(new Quicklook(product, Quicklook.DEFAULT_QUICKLOOK_NAME, virtualDir.getFile(file))); } } } catch (IOException e) { logger.warning(String.format("Unable to add quicklook to product %s", product.getName())); } }
public void addMask(Mask mask, int index) { getProduct().getMaskGroup().add(index, mask); makeMaskVisible(mask); fireTableDataChanged(); }
void addMask(Mask mask) { getProduct().getMaskGroup().add(mask); makeMaskVisible(mask); fireTableDataChanged(); }
private void addMasks(Product target, ImageMetadata metadata) { ProductNodeGroup<Mask> maskGroup = target.getMaskGroup(); if (!maskGroup.contains(Spot6Constants.NODATA)) { int noDataValue = metadata.getNoDataValue(); maskGroup.add(Mask.BandMathsType.create(Spot6Constants.NODATA, Spot6Constants.NODATA, target.getSceneRasterWidth(), target.getSceneRasterHeight(), String.valueOf(noDataValue), Color.BLACK, 0.5)); } if (!maskGroup.contains(Spot6Constants.SATURATED)) { int saturatedValue = metadata.getSaturatedValue(); maskGroup.add(Mask.BandMathsType.create(Spot6Constants.SATURATED, Spot6Constants.SATURATED, target.getSceneRasterWidth(), target.getSceneRasterHeight(), String.valueOf(saturatedValue), Color.ORANGE, 0.5)); } }
private void addMasks(Product target, ImageMetadata metadata) { ProductNodeGroup<Mask> maskGroup = target.getMaskGroup(); if (!maskGroup.contains(Constants.NODATA)) { int noDataValue = metadata.getNoDataValue(); maskGroup.add(Mask.BandMathsType.create(Constants.NODATA, Constants.NODATA, target.getSceneRasterWidth(), target.getSceneRasterHeight(), String.valueOf(noDataValue), Color.BLACK, 0.5)); } if (!maskGroup.contains(Constants.SATURATED)) { int saturatedValue = metadata.getSaturatedValue(); maskGroup.add(Mask.BandMathsType.create(Constants.SATURATED, Constants.SATURATED, target.getSceneRasterWidth(), target.getSceneRasterHeight(), String.valueOf(saturatedValue), Color.ORANGE, 0.5)); } }
private static void addPauliQuicklooks(final Product product) { final InputProductValidator validator = new InputProductValidator(product); if(validator.isFullPolSLC()) { final Band[] pauliBands = pauliVirtualBands(product); product.getQuicklookGroup().add(new Quicklook(product, "Pauli", pauliBands)); } }
private void ensureMaskVisible(ProductSceneView view) { Product product = view.getProduct(); ProductNodeGroup<Mask> overlayMaskGroup = view.getRaster().getOverlayMaskGroup(); Mask mask = overlayMaskGroup.getByDisplayName(MagicWandModel.MAGIC_WAND_MASK_NAME); if (mask == null) { mask = product.getMaskGroup().get(MagicWandModel.MAGIC_WAND_MASK_NAME); if (mask != null) { overlayMaskGroup.add(mask); } } }
/** * Copy GCPs of the first target band to current target band. * * @param firstTargetBand First target band. * @param targetBand Current target band. */ private static void copyFirstTargetBandGCPs(final Band firstTargetBand, final Band targetBand) { final ProductNodeGroup<Placemark> firstTargetBandGcpGroup = GCPManager.instance().getGcpGroup(firstTargetBand); final ProductNodeGroup<Placemark> currentTargetBandGCPGroup = GCPManager.instance().getGcpGroup(targetBand); final int numberOfGCPs = firstTargetBandGcpGroup.getNodeCount(); for (int i = 0; i < numberOfGCPs; ++i) { currentTargetBandGCPGroup.add(firstTargetBandGcpGroup.get(i)); } }
protected FlagCoding createFlagCoding(Product product) { FlagCoding flagCoding = new FlagCoding("unusable_data"); flagCoding.addFlag(RapidEyeConstants.FLAG_BLACK_FILL, 1, "area was not imaged by spacecraft"); flagCoding.addFlag(RapidEyeConstants.FLAG_CLOUDS, 2, "cloud covered"); flagCoding.addFlag(RapidEyeConstants.FLAG_MISSING_BLUE_DATA, 4, "missing/suspect data in blue band"); flagCoding.addFlag(RapidEyeConstants.FLAG_MISSING_GREEN_DATA, 8, "missing/suspect data in green band"); flagCoding.addFlag(RapidEyeConstants.FLAG_MISSING_RED_DATA, 16, "missing/suspect data in red band"); flagCoding.addFlag(RapidEyeConstants.FLAG_MISSING_RED_EDGE_DATA, 32, "missing/suspect data in red edge band"); flagCoding.addFlag(RapidEyeConstants.FLAG_MISSING_NIR_DATA, 64, "missing/suspect data in nir band"); product.getFlagCodingGroup().add(flagCoding); return flagCoding; }
private void refreshGroup() { final ProductNodeGroup<Mask> productMaskGroup = product.getMaskGroup(); if (group != productMaskGroup) { final Product.AutoGrouping autoGrouping = product.getAutoGrouping(); if (autoGrouping != null) { final int groupIndex = autoGrouping.indexOf(group.getDisplayName()); group.removeAll(); for (int i = 0; i < productMaskGroup.getNodeCount(); i++) { final Mask mask = productMaskGroup.get(i); if (autoGrouping.indexOf(mask.getName()) == groupIndex) { group.add(mask); } } } } }
private void refreshGroup() { final ProductNodeGroup<Band> productBandGroup = product.getBandGroup(); if (group != productBandGroup) { final Product.AutoGrouping autoGrouping = product.getAutoGrouping(); if (autoGrouping != null) { final int groupIndex = autoGrouping.indexOf(group.getDisplayName()); group.removeAll(); for (int i = 0; i < productBandGroup.getNodeCount(); i++) { final Band band = productBandGroup.get(i); if (autoGrouping.indexOf(band.getName()) == groupIndex) { group.add(band); } } } } }
private void refreshGroup() { final ProductNodeGroup<TiePointGrid> productTiePointGridGroup = product.getTiePointGridGroup(); if (group != productTiePointGridGroup) { final Product.AutoGrouping autoGrouping = product.getAutoGrouping(); if (autoGrouping != null) { final int groupIndex = autoGrouping.indexOf(group.getDisplayName()); group.removeAll(); for (int i = 0; i < productTiePointGridGroup.getNodeCount(); i++) { final TiePointGrid tiePointGrid = productTiePointGridGroup.get(i); if (autoGrouping.indexOf(tiePointGrid.getName()) == groupIndex) { group.add(tiePointGrid); } } } } }
public static VectorDataNode createDefaultVectorDataNode(Product product, String name, String description) { CoordinateReferenceSystem modelCrs = product.getSceneCRS(); SimpleFeatureType type = PlainFeatureFactory.createDefaultFeatureType(modelCrs); VectorDataNode vectorDataNode = new VectorDataNode(name, type); vectorDataNode.setDescription(description); product.getVectorDataGroup().add(vectorDataNode); vectorDataNode.getPlacemarkGroup(); String oldLayerId = selectVectorDataLayer(vectorDataNode); UndoRedo.Manager undoManager = SnapApp.getDefault().getUndoManager(product); if (undoManager != null) { undoManager.addEdit(new UndoableVectorDataNodeInsertion(product, vectorDataNode, oldLayerId)); } return vectorDataNode; }