@Override ProductExpressionPane getProductExpressionPane(Product currentProduct) { return ProductExpressionPane.createBooleanExpressionPane( new Product[]{currentProduct}, currentProduct, null); } }
@Override public void actionPerformed(ActionEvent e) { ProductExpressionPane pep = ProductExpressionPane.createBooleanExpressionPane(new Product[]{activeProduct}, activeProduct, appContext.getPreferences()); pep.setCode(expressionArea.getText()); final int i = pep.showModalDialog(parentWindow, "Expression Editor"); if (i == ModalDialog.ID_OK) { expressionArea.setText(pep.getCode()); } } }
private void invokeExpressionEditor() { SnapApp snapApp = SnapApp.getDefault(); final Window window = SwingUtilities.getWindowAncestor(snapApp.getMainFrame()); final ExpressionPane pane = ProductExpressionPane.createBooleanExpressionPane(new Product[]{product}, product, snapApp.getPreferencesPropertyMap()); pane.setCode(validMaskField.getText()); final int status = pane.showModalDialog(window, "Edit Valid Mask Expression"); if (status == ID_OK) { validMaskField.setText(pane.getCode()); validMaskField.setCaretPosition(0); } }
@Override String getCode(ActionEvent e) { Product product = getMaskForm().getProduct(); ProductExpressionPane expressionPane = ProductExpressionPane.createBooleanExpressionPane( new Product[]{product}, product, null); expressionPane.setEmptyExpressionAllowed(false); expressionPane.setCode(""); if (expressionPane.showModalDialog(null, "New Logical Band Maths Expression") == AbstractDialog.ID_OK) { final String code = expressionPane.getCode(); if (!code.isEmpty()) { return code; } } return null; }
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; }
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; }
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; }
@Override public void actionPerformed(ActionEvent e) { ProductExpressionPane expressionPane = ProductExpressionPane.createBooleanExpressionPane(new Product[]{contextProduct}, contextProduct, null); expressionPane.setCode(variableItem.variableConfig.getValidExpr()); int status = expressionPane.showModalDialog(getJDialog(), "Valid Expression Editor"); if (status == ModalDialog.ID_OK) { bindingContext.getBinding(PROPERTY_VALID_EXPRESSION).setPropertyValue(expressionPane.getCode()); } expressionPane.dispose(); } };
if (type == Mask.BandMathsType.INSTANCE) { Product product = getMaskForm().getProduct(); ProductExpressionPane expressionPane = ProductExpressionPane.createBooleanExpressionPane( new Product[]{product}, product, null); expressionPane.setEmptyExpressionAllowed(false);