@Override public String getPresentationName() { return "Editing " + placemarkDescriptor.getRoleLabel(); }
@Override public String getPresentationName() { return "Insert " + placemarkDescriptor.getRoleLabel(); }
@Override public String getPresentationName() { return "Copying " + placemarkDescriptor.getRoleLabel(); }
@Override public String getPresentationName() { return "Removing " + placemarkDescriptor.getRoleLabel(); }
@Override public int compare(PlacemarkDescriptor o1, PlacemarkDescriptor o2) { return o1.getRoleLabel().compareTo(o2.getRoleLabel()); } });
private void makePlacemarkNameUnique(Placemark newPlacemark) { if (makePlacemarkNameUnique0(newPlacemark, product)) { Dialogs.showWarning(MessageFormat.format("{0} has been renamed to ''{1}'',\n" + "because a {2} with the former name already exists.", StringUtils.firstLetterUp(placemarkDescriptor.getRoleLabel()), newPlacemark.getName(), placemarkDescriptor.getRoleLabel())); } }
void importPlacemarks(boolean allPlacemarks) { List<Placemark> placemarks; try { placemarks = loadPlacemarksFromFile(); } catch (IOException e) { e.printStackTrace(); Dialogs.showError(MessageFormat.format("I/O error, failed to import {0}s:\n{1}", /*I18N*/ placemarkDescriptor.getRoleLabel(), e.getMessage())); return; } if (placemarks.isEmpty()) { return; } addPlacemarksToProduct(placemarks, product, allPlacemarks); }
private void writePlacemarkDataTableText(final Writer writer) { String[] additionalColumnNames = placemarkTableModel.getAdditionalColumnNames(); String[] standardColumnNames = placemarkTableModel.getStandardColumnNames(); int columnCount = placemarkTableModel.getColumnCount(); List<Placemark> placemarkList = new ArrayList<>(); List<Object[]> valueList = new ArrayList<>(); for (int sortedRow = 0; sortedRow < placemarkTable.getRowCount(); ++sortedRow) { ListSelectionModel selectionModel = placemarkTable.getSelectionModel(); if (selectionModel.isSelectionEmpty() || selectionModel.isSelectedIndex(sortedRow)) { final int modelRow = placemarkTable.convertRowIndexToModel(sortedRow); placemarkList.add(placemarkTableModel.getPlacemarkAt(modelRow)); Object[] values = new Object[columnCount]; for (int col = 0; col < columnCount; col++) { values[col] = placemarkTableModel.getValueAt(modelRow, col); } valueList.add(values); } } PlacemarkIO.writePlacemarksWithAdditionalData(writer, placemarkDescriptor.getRoleLabel(), product.getName(), placemarkList, valueList, standardColumnNames, additionalColumnNames); }
@Override protected void onOK() { if (ProductNode.isValidNodeName(getName())) { super.onOK(); } else { showInformationDialog("'" + getName() + "' is not a valid " + placemarkDescriptor.getRoleLabel() + " name."); /*I18N*/ } }
buttons.add(createButton("<html>Interpret each point as <b>" + descriptor.getRoleLabel() + "</br></html>", false, InterpretationMethod.APPLY_DESCRIPTOR,
void exportPlacemarkDataTable() { final SnapFileChooser fileChooser = new SnapFileChooser(); fileChooser.setDialogTitle(MessageFormat.format("Export {0} Data Table", /*I18N*/ StringUtils.firstLetterUp(placemarkDescriptor.getRoleLabel()))); setComponentName(fileChooser, "Export_Data_Table"); fileChooser.setFileFilter(PlacemarkIO.createTextFileFilter()); final File ioDir = getIODir(); fileChooser.setCurrentDirectory(ioDir); fileChooser.setSelectedFile(new File(ioDir, "Data")); int result = fileChooser.showSaveDialog(SwingUtilities.getWindowAncestor(this)); if (result == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); if (file != null) { if (Boolean.TRUE.equals(Dialogs.requestOverwriteDecision(getTitle(), file))) { setIODir(file.getAbsoluteFile().getParentFile()); file = FileUtils.ensureExtension(file, PlacemarkIO.FILE_EXTENSION_FLAT_TEXT); try { try (Writer writer = new FileWriter(file)) { writePlacemarkDataTableText(writer); } } catch (IOException ignored) { Dialogs.showError(MessageFormat.format("I/O Error.\nFailed to export {0} data table.", /*I18N*/ placemarkDescriptor.getRoleLabel())); } } } } }
Dialogs.showWarning(MessageFormat.format( "One or more {0}s have not been imported,\n{1}because they can not be assigned to a product without a geo-coding.", placemarkDescriptor.getRoleLabel(), intoProductMessage)); placemarkDescriptor.getRoleLabel(), intoProductMessage)); MessageFormat.format( "No {0}s have been imported,\n{1}because their pixel positions\nare outside the product''s bounds.", placemarkDescriptor.getRoleLabel(), intoProductMessage) ); } else { MessageFormat.format( "{0} {1}s have not been imported,\n{2}because their pixel positions\nare outside the product''s bounds.", numPinsOutOfBounds, placemarkDescriptor.getRoleLabel(), intoProductMessage) );
private List<Placemark> loadPlacemarksFromFile() throws IOException { final SnapFileChooser fileChooser = new SnapFileChooser(); String roleLabel = StringUtils.firstLetterUp(placemarkDescriptor.getRoleLabel()); fileChooser.setDialogTitle("Import " + roleLabel + "s"); /*I18N*/ setComponentName(fileChooser, "Import"); fileChooser.addChoosableFileFilter(PlacemarkIO.createTextFileFilter()); fileChooser.setFileFilter(PlacemarkIO.createPlacemarkFileFilter()); fileChooser.setCurrentDirectory(getIODir()); int result = fileChooser.showOpenDialog(SwingUtilities.getWindowAncestor(this)); if (result == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); if (file != null) { setIODir(file.getAbsoluteFile().getParentFile()); GeoCoding geoCoding = null; if (product != null) { geoCoding = product.getSceneGeoCoding(); } return PlacemarkIO.readPlacemarks(new FileReader(file), geoCoding, placemarkDescriptor); } } return Collections.emptyList(); }
void exportPlacemarks() { final SnapFileChooser fileChooser = new SnapFileChooser(); fileChooser.setDialogTitle(MessageFormat.format("Export {0}(s)", StringUtils.firstLetterUp(placemarkDescriptor.getRoleLabel()))); setComponentName(fileChooser, "Export_Selected"); fileChooser.addChoosableFileFilter(PlacemarkIO.createTextFileFilter()); placemarkDescriptor.getRoleLabel(), ioe.getMessage())); ioe.printStackTrace();
public PlacemarkDialog(final Window parent, final Product product, final PlacemarkDescriptor placemarkDescriptor, boolean switchGeoAndPixelPositionsEditable) { super(parent, "New " + placemarkDescriptor.getRoleLabel(), ModalDialog.ID_OK_CANCEL, null); /*I18N*/ Guardian.assertNotNull("product", product); this.product = product;
final String placemarkLabel = topComponent.getPlacemarkDescriptor().getRoleLabel(); newButton.setToolTipText("Create and add new " + placemarkLabel + "."); /*I18N*/ newButton.addActionListener(new ActionListener() {
boolean belongsToProduct = placemark.getProduct() != null; String titlePrefix = belongsToProduct ? "Edit" : "New"; String roleLabel = StringUtils.firstLetterUp(placemarkDescriptor.getRoleLabel());