@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(); } });
static private VectorDataLayer showSelectLayerDialog(ProductSceneView productSceneView, List<Layer> layers) { String[] layerNames = new String[layers.size()]; for (int i = 0; i < layerNames.length; i++) { layerNames[i] = layers.get(i).getName(); } JList<String> listBox = new JList<>(layerNames); JPanel panel = new JPanel(new BorderLayout(4, 4)); panel.add(new JLabel("Please select a vector data container:"), BorderLayout.NORTH); panel.add(new JScrollPane(listBox), BorderLayout.CENTER); ModalDialog dialog = new ModalDialog(SwingUtilities.getWindowAncestor(productSceneView), "Select Vector Data Container", ModalDialog.ID_OK_CANCEL_HELP, ""); dialog.setContent(panel); int i = dialog.show(); if (i == ModalDialog.ID_OK) { final int index = listBox.getSelectedIndex(); if (index >= 0) { return (VectorDataLayer) layers.get(index); } } return null; }
private void showSystemDialog() { final ModalDialog modalDialog = new ModalDialog(getJDialog(), "System Info", ID_OK, null); final Object[][] sysInfo = getSystemInfo(); final JTable sysTable = new JTable(sysInfo, new String[]{"Property", "Value"}); /*I18N*/ final JScrollPane systemScroll = new JScrollPane(sysTable); systemScroll.setPreferredSize(new Dimension(400, 400)); modalDialog.setContent(systemScroll); modalDialog.show(); }
content.setPreferredSize(new Dimension(300, 150)); final ModalDialog detailsWindow = new ModalDialog(parentWindow, TITLE + " - Details",
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; }
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(); }
private void showCreditsDialog() { final ModalDialog modalDialog = new ModalDialog(getJDialog(), "Credits", ID_OK, null); /*I18N*/ final String credits = getCreditsHtml(); final JLabel creditsPane = new JLabel(credits); /*I18N*/ modalDialog.setContent(creditsPane); modalDialog.show(); }
private void invokeExpressionEditor(final int colorIndex) { final Window window = SwingUtilities.getWindowAncestor(this); final String title = "Edit " + COLOR_COMP_NAMES[colorIndex] + " Expression"; if (product != null) { final ExpressionPane pane; pane = ProductExpressionPane.createGeneralExpressionPane(new Product[]{product}, product, preferences); pane.setCode(getExpression(colorIndex)); int status = pane.showModalDialog(window, title); if (status == ModalDialog.ID_OK) { setExpression(colorIndex, pane.getCode()); } } else { final JTextArea textArea = new JTextArea(8, 48); textArea.setFont(EXPRESSION_FONT); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); textArea.setText(getExpression(colorIndex)); final ModalDialog modalDialog = new ModalDialog(window, title, ModalDialog.ID_OK_CANCEL, ""); final JPanel panel = new JPanel(new BorderLayout(2, 2)); panel.add(new JLabel("Expression:"), BorderLayout.NORTH); panel.add(new JScrollPane(textArea), BorderLayout.CENTER); modalDialog.setContent(panel); final int status = modalDialog.show(); if (status == ModalDialog.ID_OK) { setExpression(colorIndex, textArea.getText()); } } }
@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(); } } });
final ModalDialog dialog = new ModalDialog(getParent(), VisatApp.getApp().getAppName() + " - Colour Legend Preview", imageDisplay, ID_OK, null); dialog.getJDialog().setResizable(false);
@Override public void actionPerformed(ActionEvent e) { final String operationName = model.operationWrapper.getName(); final ModalDialog modalDialog = new ModalDialog(parent, operationName + " - Parameters", ModalDialog.ID_OK_CANCEL, null); final ParameterValueGroup workCopy = model.parameters.clone(); final PropertyContainer propertyContainer = createValueContainer(workCopy); modalDialog.setContent(new PropertyPane(propertyContainer).createPanel()); if (modalDialog.show() == AbstractDialog.ID_OK) { vc.setValue(PARAMETERS, workCopy); } } }
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 modalDialog = new ModalDialog(visatApp.getApplicationWindow(), DLG_TITLE, ModalDialog.ID_OK_CANCEL, null); modalDialog.setContent(contentPanel); modalDialog.center();
outputDemCorrectedBandsChecker.setEnabled(ortorectifiable); final ModalDialog dialog = new ModalDialog(VisatApp.getApp().getMainFrame(), DIALOG_TITLE, ModalDialog.ID_OK_CANCEL, getHelpId()); dialog.setContent(parameterPanel); if (dialog.show() == ModalDialog.ID_OK) {
JComboBox maskCombo = new JComboBox(maskNames); panel.add(maskCombo); ModalDialog modalDialog = new ModalDialog(VisatApp.getApp().getApplicationWindow(), DIALOG_TITLE, panel, ModalDialog.ID_OK_CANCEL | ModalDialog.ID_HELP, getHelpId()); if (modalDialog.show() == AbstractDialog.ID_OK) {
private void showResults(MaskAreaStatistics areaStatistics) { final double roundFactor = 10000.0; final double maskAreaR = MathUtils.round(areaStatistics.getMaskArea(), roundFactor); final double meanPixelAreaR = MathUtils.round(areaStatistics.getMaskArea() / areaStatistics.getNumPixels(), roundFactor); final double pixelAreaMinR = MathUtils.round(areaStatistics.getPixelAreaMin(), roundFactor); final double pixelAreaMaxR = MathUtils.round(areaStatistics.getPixelAreaMax(), roundFactor); final JPanel content = GridBagUtils.createPanel(); final GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.WEST; gbc.insets.right = 4; gbc.gridy = 0; gbc.weightx = 0; gbc.insets.top = 2; addField(content, gbc, "Number of Mask pixels:", String.format("%15d", areaStatistics.getNumPixels()), ""); addField(content, gbc, "Mask area:", String.format("%15.3f", maskAreaR), "km^2"); addField(content, gbc, "Mean pixel area:", String.format("%15.3f", meanPixelAreaR), "km^2"); addField(content, gbc, "Minimum pixel area:", String.format("%15.3f", pixelAreaMinR), "km^2"); addField(content, gbc, "Maximum pixel area:", String.format("%15.3f", pixelAreaMaxR), "km^2"); gbc.insets.top = 8; addField(content, gbc, "Mean earth radius:", String.format("%15.3f", areaStatistics.getEarthRadius()), "km"); final ModalDialog dialog = new ModalDialog(VisatApp.getApp().getMainFrame(), DIALOG_TITLE + " - " + mask.getDisplayName(), content, ModalDialog.ID_OK | ModalDialog.ID_HELP, getHelpId()); dialog.show(); }
JComboBox maskCombo = new JComboBox(maskNames); panel.add(maskCombo); ModalDialog modalDialog = new ModalDialog(VisatApp.getApp().getApplicationWindow(), DLG_TITLE, panel, ModalDialog.ID_OK_CANCEL | ModalDialog.ID_HELP, getHelpId()); if (modalDialog.show() == AbstractDialog.ID_OK) {