private CoordinateReferenceSystem promptForFeatureCrs(Product product) { final FeatureCrsDialog dialog = new FeatureCrsDialog(product, "Import " + getVectorDataType() + " Data"); featureCrsDialogResult = dialog.show(); if (featureCrsDialogResult == ModalDialog.ID_OK) { return dialog.getFeatureCrs(); } return DefaultGeographicCRS.WGS84; }
@Override protected void onOK() { super.onOK(); getParent().setVisible(true); // todo: Visat main window disappears otherwise, find better solution }
public FeatureCrsDialog(Product product, String title) { super(SnapApp.getDefault().getMainFrame(), title, ModalDialog.ID_OK_CANCEL_HELP, "importCSV"); this.product = product; this.title = title; createUI(); }
private void createUI() { final ProductCrsForm productCrsForm = new ProductCrsForm(SnapApp.getDefault().getAppContext(), product); final CustomCrsForm customCrsForm = new CustomCrsForm(SnapApp.getDefault().getAppContext()); final PredefinedCrsForm predefinedCrsForm = new PredefinedCrsForm(SnapApp.getDefault().getAppContext()); crsSelectionPanel = new CrsSelectionPanel(productCrsForm, customCrsForm, predefinedCrsForm); final TableLayout tableLayout = new TableLayout(1); tableLayout.setTableWeightX(1.0); tableLayout.setTableFill(TableLayout.Fill.BOTH); tableLayout.setTablePadding(4, 4); tableLayout.setCellPadding(0, 0, new Insets(4, 10, 4, 4)); final JPanel contentPanel = new JPanel(tableLayout); final JLabel label = new JLabel(); label.setText("<html><b>" + "The vector data are not associated with a coordinate reference system (CRS).<br/>" + "Please specify a CRS so that coordinates can be interpreted correctly.</b>"); contentPanel.add(label); contentPanel.add(crsSelectionPanel); setContent(contentPanel); }
@Override protected void onCancel() { super.onCancel(); getParent().setVisible(true); // todo: Visat main window disappears otherwise, find better solution }