public void actionPerformed(ActionEvent e) { Product product = getSourceProduct(); if (product == null) { return; } ProductSubsetDialog dialog = new ProductSubsetDialog(parent, product, subsetDef); if (dialog.show() == ProductSubsetDialog.ID_OK) { if (dialog.getProductSubsetDef().isEntireProductSelected()) { subsetDef = null; } else { subsetDef = dialog.getProductSubsetDef(); } } updateUI(); } };
private void collectNotIncludedReferences(final RasterDataNode rasterDataNode, final Set<String> notIncludedNames) { final RasterDataNode[] referencedNodes = getReferencedNodes(rasterDataNode); for (final RasterDataNode referencedNode : referencedNodes) { final String name = referencedNode.getName(); if (!productSubsetDef.isNodeAccepted(name) && !notIncludedNames.contains(name)) { notIncludedNames.add(name); collectNotIncludedReferences(referencedNode, notIncludedNames); } } }
setComponentName(tabbedPane, "TabbedPane"); spatialSubsetPane = createSpatialSubsetPane(); setComponentName(spatialSubsetPane, "SpatialSubsetPane"); if (spatialSubsetPane != null) { tabbedPane.addTab("Spatial Subset", spatialSubsetPane); /*I18N*/ bandSubsetPane = createBandSubsetPane(); setComponentName(bandSubsetPane, "BandSubsetPane"); if (bandSubsetPane != null) { tabbedPane.addTab("Band Subset", bandSubsetPane); tiePointGridSubsetPane = createTiePointGridSubsetPane(); setComponentName(tiePointGridSubsetPane, "TiePointGridSubsetPane"); if (tiePointGridSubsetPane != null) { tabbedPane.addTab("Tie-Point Grid Subset", tiePointGridSubsetPane); metadataSubsetPane = createAnnotationSubsetPane(); setComponentName(metadataSubsetPane, "MetadataSubsetPane"); if (metadataSubsetPane != null) { tabbedPane.addTab("Metadata Subset", metadataSubsetPane); setComponentName(contentPane, "ContentPane"); setContent(contentPane); updateSubsetDefNodeNameList();
@Override protected void onOK() { boolean ok; ok = checkReferencedRastersIncluded(); if (!ok) { return; } ok = checkFlagDatasetIncluded(); if (!ok) { return; } spatialSubsetPane.cancelThumbnailLoader(); if (productSubsetDef != null && productSubsetDef.isEntireProductSelected()) { productSubsetDef = null; } super.onOK(); }
final RasterDataNode rasterDataNode = product.getRasterDataNode(nodeName); if (rasterDataNode != null) { collectNotIncludedReferences(rasterDataNode, notIncludedNames); "subset definition?\n"; /*I18N*/ final MessageFormat format = new MessageFormat(pattern); int status = JOptionPane.showConfirmDialog(getJDialog(), format.format(new Object[]{nameListText.toString()}), "Incomplete Subset Definition", /*I18N*/
private boolean openProductSubsetDialog(Product product, String newProductName) { clearCurrentSubsetProduct(); if (product != null) { if (product.isMultiSize()) { Dialogs.showError("No subset can be created of a multi-size products."); return false; } ProductSubsetDialog productSubsetDialog = new ProductSubsetDialog(SnapApp.getDefault().getMainFrame(), product); if (productSubsetDialog.show() == ProductSubsetDialog.ID_OK) { try { subsetProduct = product.createSubset(productSubsetDialog.getProductSubsetDef(), newProductName, null); if (getCurrentFilename() != null && !getCurrentFilename().startsWith("subset_")) { setCurrentFilename("subset_" + getCurrentFilename()); } return true; } catch (IOException e) { Dialogs.showError("Could not create subset:\n" + e.getMessage()); } } } return false; }
initSubset.addNodeNames(sourceProduct.getTiePointGridNames()); initSubset.setIgnoreMetadata(false); final ProductSubsetDialog subsetDialog = new ProductSubsetDialog(SnapApp.getDefault().getMainFrame(), sourceProduct, initSubset); if (subsetDialog.show() != ProductSubsetDialog.ID_OK) { return; final ProductSubsetDef subsetDef = subsetDialog.getProductSubsetDef(); if (subsetDef == null) { Dialogs.showInformation(Bundle.CTL_CreateSubsetFromViewAction_Title(),