@Override public void actionPerformed(ActionEvent e) { JTextArea wktArea = new JTextArea(30, 40); wktArea.setEditable(false); wktArea.setText(wkt); final JScrollPane scrollPane = new JScrollPane(wktArea); final ModalDialog dialog = new ModalDialog(appContext.getApplicationWindow(), "Coordinate reference system as well known text", scrollPane, ModalDialog.ID_OK, null); dialog.show(); } });
@Override protected JComponent createCrsComponent() { final CustomCrsPanel panel = new CustomCrsPanel(getAppContext().getApplicationWindow()); panel.addPropertyChangeListener("crs", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { fireCrsChanged(); } }); return panel; }
@Override public void actionPerformed(CommandEvent event) { super.actionPerformed(event); final OpendapAccessPanel opendapAccessPanel = new OpendapAccessPanel(getAppContext(), event.getCommand().getHelpId()); final JDialog jDialog = new JDialog(getAppContext().getApplicationWindow(), "OPeNDAP Access"); jDialog.setContentPane(opendapAccessPanel); jDialog.pack(); final Dimension size = jDialog.getSize(); jDialog.setPreferredSize(size); jDialog.setVisible(true); } }
@Override public void actionPerformed(ActionEvent e) { final ModalDialog dialog = new ModalDialog(getAppContext().getApplicationWindow(), "Select Coordinate Reference System", predefinedCrsForm, ModalDialog.ID_OK_CANCEL, null); if (dialog.show() == ModalDialog.ID_OK) { selectedCrsInfo = predefinedCrsForm.getSelectedCrsInfo(); crsCodeField.setText(selectedCrsInfo.toString()); fireCrsChanged(); } } });
@Override public void actionPerformed(ActionEvent e) { ProductChooser productChooser = new ProductChooser(appContext.getApplicationWindow(), "Add product", ModalDialog.ID_OK_CANCEL, null, filterProducts()); if (productChooser.show() != ModalDialog.ID_OK) { return; } try { if (productChooser.getSelectedProducts().size() > 0) { listModel.addElements(productChooser.getSelectedProducts().toArray()); } } catch (ValidationException ve) { Debug.trace(ve); } }
final BandChooser bandChooser = new BandChooser(appContext.getApplicationWindow(), "Band Chooser", null,
int result = fileChooser.showDialog(appContext.getApplicationWindow(), "Select product(s)"); if (result != JFileChooser.APPROVE_OPTION) { return;
@Override public void actionPerformed(CommandEvent event) { super.actionPerformed(event); final TimeSeriesAssistantModel assistantModel = createModel(); final AssistantPane assistant = new AssistantPane(getAppContext().getApplicationWindow(), "New Time Series"); assistant.show(new TimeSeriesAssistantPage_SourceProducts(assistantModel)); }
private String editExpression(String expression) { final Product product = binningFormModel.getContextProduct(); if (product == null) { return null; } final ProductExpressionPane expressionPane; expressionPane = ProductExpressionPane.createBooleanExpressionPane(new Product[]{product}, product, appContext.getPreferences()); expressionPane.setCode(expression); final int i = expressionPane.showModalDialog(appContext.getApplicationWindow(), "Expression Editor"); if (i == ModalDialog.ID_OK) { return expressionPane.getCode(); } return null; }
@Override public void actionPerformed(ActionEvent e) { FolderChooser folderChooser = new FolderChooser(); folderChooser.setCurrentDirectory(new File(getDefaultOutputPath(appContext))); folderChooser.setDialogTitle("Select output directory"); folderChooser.setMultiSelectionEnabled(false); int result = folderChooser.showDialog(appContext.getApplicationWindow(), "Select"); /*I18N*/ if (result != JFileChooser.APPROVE_OPTION) { return; } File selectedFile = folderChooser.getSelectedFile(); setOutputDirPath(selectedFile.getAbsolutePath()); try { outputFileProperty.setValue(selectedFile); appContext.getPreferences().setPropertyString(LAST_OPEN_OUTPUT_DIR, selectedFile.getAbsolutePath()); } catch (ValidationException ve) { // not expected to ever come here appContext.handleError("Invalid input path", ve); } } });
final Window parent = appContext.getApplicationWindow();
private int editExpression(String[] value, final boolean booleanExpected) { Product product; try { product = mosaicModel.getReferenceProduct(); } catch (IOException ioe) { appContext.handleError(ioe.getMessage(), ioe); return 0; } if(product == null) { final String msg = "No source product specified."; appContext.handleError(msg, new IllegalStateException(msg)); return 0; } final ProductExpressionPane pep; if (booleanExpected) { pep = ProductExpressionPane.createBooleanExpressionPane(new Product[]{product}, product, appContext.getPreferences()); } else { pep = ProductExpressionPane.createGeneralExpressionPane(new Product[]{product}, product, appContext.getPreferences()); } pep.setCode(value[0]); final int i = pep.showModalDialog(appContext.getApplicationWindow(), value[0]); if (i == ModalDialog.ID_OK) { value[0] = pep.getCode(); } return i; }
PixelExtractionDialog(AppContext appContext, String title) { super(appContext.getApplicationWindow(), title, ID_OK | ID_CLOSE | ID_HELP, HELP_ID_JAVA_HELP);
protected SingleTargetProductDialog(AppContext appContext, String title, int buttonMask, String helpID, TargetProductSelectorModel model, boolean alwaysWriteOutput) { super(appContext.getApplicationWindow(), title, buttonMask, helpID); this.appContext = appContext; targetProductSelector = new TargetProductSelector(model, alwaysWriteOutput); String homeDirPath = SystemUtils.getUserHomeDir().getPath(); String saveDir = appContext.getPreferences().getPropertyString(BasicApp.PROPERTY_KEY_APP_LAST_SAVE_DIR, homeDirPath); targetProductSelector.getModel().setProductDir(new File(saveDir)); if (!alwaysWriteOutput) { targetProductSelector.getOpenInAppCheckBox().setText("Open in " + appContext.getApplicationName()); } targetProductSelector.getModel().getValueContainer().addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("saveToFileSelected") || evt.getPropertyName().equals("openInAppSelected")) { updateRunButton(); } } }); AbstractButton button = getButton(ID_APPLY); button.setText("Run"); button.setMnemonic('R'); updateRunButton(); }
final ModalDialog outputParametersDialog = new OutputParametersDialog(appContext.getApplicationWindow(), sourceProduct, workCopy); outputParametersDialog.setContent(form);