private void showInformationDialog(String title, Component component) { final ModalDialog modalDialog = new ModalDialog(UIUtils.getRootWindow(parentComponent), title, AbstractDialog.ID_OK, null); /*I18N*/ modalDialog.setContent(component); modalDialog.show(); }
@Override protected void onOK() { updateCodeHistory(); super.onOK(); }
public boolean showDialog(Window parent, String title, String helpId) { ModalDialog modalDialog = new ModalDialog(parent, title, ModalDialog.ID_OK_CANCEL_HELP, helpId); modalDialog.setContent(this); final int status = modalDialog.show(); modalDialog.getJDialog().dispose(); return status == ModalDialog.ID_OK; }
/** * This method is called, when the user clicks the "cancel" button or the "close" button of * the top bar of the dialog window. It can also be called directly. * The method sets the button identifier to {@link #ID_CANCEL} and calls {@link #onCancel()}. */ @Override public void close() { setButtonID(ID_CANCEL); onCancel(); }
@Override public void actionPerformed(ActionEvent e) { final Window parentWindow = SwingUtilities.getWindowAncestor(detailsButton); createDetailsDialog(parentWindow, distanceData).show(); } });
@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(); } });
contentPanel.add(new JLabel("Geometry CRS: " + targetCrs.getName().toString()), BorderLayout.SOUTH); ModalDialog modalDialog = new ModalDialog(VisatApp.getApp().getApplicationWindow(), DLG_TITLE, ModalDialog.ID_OK, null); modalDialog.setContent(contentPanel); modalDialog.center(); modalDialog.show();
final ModalDialog outputParametersDialog = new OutputParametersDialog(appContext.getApplicationWindow(), sourceProduct, workCopy); outputParametersDialog.setContent(form); if (outputParametersDialog.show() == ModalDialog.ID_OK) { outputGeometryModel = workCopy; updateProductSize();
final ModalDialog dialog = new ModalDialog(getParent(), VisatApp.getApp().getAppName() + " - Colour Legend Preview", imageDisplay, ID_OK, null); dialog.getJDialog().setResizable(false); dialog.show();
content.setPreferredSize(new Dimension(300, 150)); final ModalDialog detailsWindow = new ModalDialog(parentWindow, TITLE + " - Details", detailsWindow.setContent(content); return detailsWindow;
@Override protected void onOK() { final String lonValue = (String) _lonBox.getSelectedItem(); _selectedLonBand = findBandName(lonValue); final String latValue = (String) _latBox.getSelectedItem(); _selectedLatBand = findBandName(latValue); if (_selectedLatBand == null || _selectedLonBand == null || _selectedLatBand == _selectedLonBand) { VisatApp.getApp().showWarningDialog(super.getJDialog().getTitle(), "You have to select two different bands for the Pixel Geo-Coding."); /*I18N*/ } else { super.onOK(); } }
@Override protected void onCancel() { super.onCancel(); _resultProduct = null; }
public ModalDialog(Window parent, String title, Object content, int buttonMask, Object[] otherButtons, String helpID) { this(parent, title, buttonMask, otherButtons, helpID); setContent(content); }
@Override protected boolean verifyUserInput() { boolean b = super.verifyUserInput(); String name = _paramNewName.getValueAsText(); return b && (name != null && name.length() > 0); }
final Term term = new ParserImpl(namespace, false).parse(expression); if (!term.isB()) { JOptionPane.showMessageDialog(dialog.getJDialog(), "The expression must be of boolean type."); /*I18N*/ return false; JOptionPane.showMessageDialog(dialog.getJDialog(), "Invalid expression syntax:\n" + e.getMessage()); /*I18N*/ return false; BandArithmetic.getValidMaskExpression(expression, products, defaultProductIndex, null); } catch (ParseException e) { JOptionPane.showMessageDialog(dialog.getJDialog(), "Invalid expression syntax:\n" + e.getMessage()); /*I18N*/ return false;
/** * Shows VISAT's about box. */ public void showAboutBox() { final ModalDialog box = createAboutBox(); box.show(); }
@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(); } } });
ModalDialog modalDialog = new ModalDialog(visatApp.getApplicationWindow(), DLG_TITLE, ModalDialog.ID_OK_CANCEL, null); modalDialog.setContent(contentPanel); modalDialog.center(); if (modalDialog.show() == ModalDialog.ID_OK) { String wellKnownText = textArea.getText(); if (wellKnownText == null || wellKnownText.isEmpty()) {
public VectorDataNode run() { Product product = VisatApp.getApp().getSelectedProduct(); DialogData dialogData = new DialogData(product.getVectorDataGroup()); PropertySet propertySet = PropertyContainer.createObjectBacked(dialogData); propertySet.getDescriptor("name").setNotNull(true); propertySet.getDescriptor("name").setNotEmpty(true); propertySet.getDescriptor("name").setValidator(new NameValidator(product)); propertySet.getDescriptor("description").setNotNull(true); final PropertyPane propertyPane = new PropertyPane(propertySet); JPanel panel = propertyPane.createPanel(); panel.setPreferredSize(new Dimension(400, 100)); ModalDialog dialog = new MyModalDialog(propertyPane); dialog.setContent(panel); int i = dialog.show(); if (i == ModalDialog.ID_OK) { return createDefaultVectorDataNode(product, dialogData.name, dialogData.description); } else { return null; } }
@Override protected void onCancel() { _selectedLatBand = null; _selectedLonBand = null; super.onCancel(); }