@Test public void testCreateOpTab() { JComponent component = sourceUI.CreateOpTab("testOp", parameterMap, appContext); assertNotNull(component); assertEquals(sourceUI.sourceProductSelector.getProductNameComboBox().getModel().getSize(), 2); }
@Override public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) { paramMap = parameterMap; sourceProductSelector = new SourceProductSelector(appContext); final TableLayout tableLayout = new TableLayout(1); tableLayout.setTableAnchor(TableLayout.Anchor.WEST); tableLayout.setTableWeightX(1.0); tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL); tableLayout.setTablePadding(3, 3); final JPanel sourcePanel = sourceProductSelector.createDefaultPanel(); formatNameComboBox = new JComboBox<>(); formatNameComboBox.setToolTipText("Select 'Any Format' to let SNAP decide"); final JPanel formatPanel = new JPanel(); formatPanel.add(new JLabel("Data Format: ")); formatPanel.add(formatNameComboBox); sourcePanel.add(formatPanel); final JPanel ioParametersPanel = new JPanel(tableLayout); ioParametersPanel.add(sourcePanel); ioParametersPanel.add(tableLayout.createVerticalSpacer()); sourceProductSelector.initProducts(); sourceProductSelector.addSelectionChangeListener(new SourceSelectionChangeListener()); final Product selectedProduct = sourceProductSelector.getSelectedProduct(); if(selectedProduct != null) { updateFormatNamesCombo(selectedProduct.getFileLocation()); } initParameters(); return ioParametersPanel; }
SourceUI extends BaseOperatorUI { @Override public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) { paramMap = parameterMap; sourceProductSelector = new SourceProductSelector(appContext); final TableLayout tableLayout = new TableLayout(1); tableLayout.setTableAnchor(TableLayout.Anchor.WEST); tableLayout.setTableWeightX(1.0); tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL); tableLayout.setTablePadding(3, 3); final JPanel sourcePanel = sourceProductSelector.createDefaultPanel(); formatNameComboBox = new JComboBox<>(); formatNameComboBox.setToolTipText("Select 'Any Format' to let SNAP decide"); final JPanel formatPanel = new JPanel(); formatPanel.add(new JLabel("Data Format: ")); formatPanel.add(formatNameComboBox); sourcePanel.add(formatPanel); final JPanel ioParametersPanel = new JPanel(tableLayout); ioParametersPanel.add(sourcePanel); ioParametersPanel.add(tableLayout.createVerticalSpacer()); sourceProductSelector.initProducts(); sourceProductSelector.addSelectionChangeListener(new SourceSelectionChangeListener()); final Product selectedProduct = sourceProductSelector.getSelectedProduct(); if(selectedProduct != null) { updateFormatNamesCombo(selectedProduct.getFileLocation()); } initParameters(); return ioParametersPanel; } }
SourceUI extends BaseOperatorUI { @Override public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) { paramMap = parameterMap; sourceProductSelector = new SourceProductSelector(appContext); final TableLayout tableLayout = new TableLayout(1); tableLayout.setTableAnchor(TableLayout.Anchor.WEST); tableLayout.setTableWeightX(1.0); tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL); tableLayout.setTablePadding(3, 3); final JPanel sourcePanel = sourceProductSelector.createDefaultPanel(); formatNameComboBox = new JComboBox<>(); formatNameComboBox.setToolTipText("Select 'Any Format' to let SNAP decide"); final JPanel formatPanel = new JPanel(); formatPanel.add(new JLabel("Data Format: ")); formatPanel.add(formatNameComboBox); sourcePanel.add(formatPanel); final JPanel ioParametersPanel = new JPanel(tableLayout); ioParametersPanel.add(sourcePanel); ioParametersPanel.add(tableLayout.createVerticalSpacer()); sourceProductSelector.initProducts(); sourceProductSelector.addSelectionChangeListener(new SourceSelectionChangeListener()); final Product selectedProduct = sourceProductSelector.getSelectedProduct(); if(selectedProduct != null) { updateFormatNamesCombo(selectedProduct.getFileLocation()); } initParameters(); return ioParametersPanel; }  }
SourceUI extends BaseOperatorUI { @Override public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) { paramMap = parameterMap; sourceProductSelector = new SourceProductSelector(appContext); final TableLayout tableLayout = new TableLayout(1); tableLayout.setTableAnchor(TableLayout.Anchor.WEST); tableLayout.setTableWeightX(1.0); tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL); tableLayout.setTablePadding(3, 3); final JPanel sourcePanel = sourceProductSelector.createDefaultPanel(); formatNameComboBox = new JComboBox<>(); formatNameComboBox.setToolTipText("Select 'Any Format' to let SNAP decide"); final JPanel formatPanel = new JPanel(); formatPanel.add(new JLabel("Data Format: ")); formatPanel.add(formatNameComboBox); sourcePanel.add(formatPanel); final JPanel ioParametersPanel = new JPanel(tableLayout); ioParametersPanel.add(sourcePanel); ioParametersPanel.add(tableLayout.createVerticalSpacer()); sourceProductSelector.initProducts(); sourceProductSelector.addSelectionChangeListener(new SourceSelectionChangeListener()); final Product selectedProduct = sourceProductSelector.getSelectedProduct(); if(selectedProduct != null) { updateFormatNamesCombo(selectedProduct.getFileLocation()); } initParameters(); return ioParametersPanel; }  @Override JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext); @Override void initParameters(); @Override UIValidation validateParameters(); @Override void updateParameters(); void setSourceProduct(final Product product); }
SourceUI extends BaseOperatorUI { @Override public JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext) { paramMap = parameterMap; sourceProductSelector = new SourceProductSelector(appContext); final TableLayout tableLayout = new TableLayout(1); tableLayout.setTableAnchor(TableLayout.Anchor.WEST); tableLayout.setTableWeightX(1.0); tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL); tableLayout.setTablePadding(3, 3); final JPanel sourcePanel = sourceProductSelector.createDefaultPanel(); formatNameComboBox = new JComboBox<>(); formatNameComboBox.setToolTipText("Select 'Any Format' to let SNAP decide"); final JPanel formatPanel = new JPanel(); formatPanel.add(new JLabel("Data Format: ")); formatPanel.add(formatNameComboBox); sourcePanel.add(formatPanel); final JPanel ioParametersPanel = new JPanel(tableLayout); ioParametersPanel.add(sourcePanel); ioParametersPanel.add(tableLayout.createVerticalSpacer()); sourceProductSelector.initProducts(); sourceProductSelector.addSelectionChangeListener(new SourceSelectionChangeListener()); final Product selectedProduct = sourceProductSelector.getSelectedProduct(); if(selectedProduct != null) { updateFormatNamesCombo(selectedProduct.getFileLocation()); } initParameters(); return ioParametersPanel; }  @Override JComponent CreateOpTab(String operatorName, Map<String, Object> parameterMap, AppContext appContext); @Override void initParameters(); @Override UIValidation validateParameters(); @Override void updateParameters(); void setSourceProduct(final Product product);  }