use of org.knime.core.node.defaultnodesettings.DialogComponentStringSelection in project knime-core by knime.
the class NumericOutliersNodeDialogPane method createTreatmentDialog.
/**
* Creates the treatment dialog.
*
* @return the treatment dialog
*/
private JPanel createTreatmentDialog() {
final JPanel panel = new JPanel(new GridBagLayout());
final GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.LINE_START;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1;
gbc.weighty = 0;
gbc.fill = GridBagConstraints.NONE;
// add panel border
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), TREATMENT_BORDER_TITLE));
// create component to select the outlier treatment option
m_outlierTreatmentDialog = new DialogComponentStringSelection(NumericOutliersNodeModel.createOutlierTreatmentModel(), "Treatment option", Arrays.stream(NumericOutliersTreatmentOption.values()).map(val -> val.toString()).toArray(String[]::new));
// create component to restrict the outlier treatment
m_restrictionDialog = new DialogComponentStringSelection(NumericOutliersNodeModel.createOutlierDetectionModel(), RESTRICTION_BORDER_TITLE, Arrays.stream(NumericOutliersDetectionOption.values()).map(val -> val.toString()).toArray(String[]::new));
// add component to select the outlier replacement strategy
m_outlierReplacementDialog = new DialogComponentStringSelection(NumericOutliersNodeModel.createOutlierReplacementModel(), REPLACEMENT_STRATEGY, Arrays.stream(NumericOutliersReplacementStrategy.values()).map(val -> val.toString()).toArray(String[]::new));
updatePrefSize(0, 10, m_outlierTreatmentDialog.getComponentPanel(), m_restrictionDialog.getComponentPanel(), m_outlierReplacementDialog.getComponentPanel());
updatePrefSize(1, 0, m_outlierTreatmentDialog.getComponentPanel(), m_restrictionDialog.getComponentPanel(), m_outlierReplacementDialog.getComponentPanel());
// add all dialogs
panel.add(m_outlierTreatmentDialog.getComponentPanel(), gbc);
++gbc.gridy;
panel.add(m_restrictionDialog.getComponentPanel(), gbc);
++gbc.gridy;
panel.add(m_outlierReplacementDialog.getComponentPanel(), gbc);
return panel;
}
use of org.knime.core.node.defaultnodesettings.DialogComponentStringSelection in project knime-core by knime.
the class DBGroupByNodeDialog method createAdvancedOptionsBox.
private JComponent createAdvancedOptionsBox() {
// general option box
final Box generalBox = new Box(BoxLayout.X_AXIS);
final DialogComponentStringSelection colNamePolicy = new DialogComponentStringSelection(m_columnNamePolicy, "Column naming:", ColumnNamePolicy.getPolicyLabels());
generalBox.add(colNamePolicy.getComponentPanel());
// Advanced settings box
final Box box = new Box(BoxLayout.Y_AXIS);
box.add(generalBox);
box.setMaximumSize(box.getPreferredSize());
final Box rootBox = new Box(BoxLayout.X_AXIS);
rootBox.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), " Advanced settings "));
rootBox.add(Box.createHorizontalGlue());
rootBox.add(box);
rootBox.add(Box.createHorizontalGlue());
return rootBox;
}
use of org.knime.core.node.defaultnodesettings.DialogComponentStringSelection in project knime-core by knime.
the class GroupByNodeDialog method createAdvancedOptionsBox.
private JComponent createAdvancedOptionsBox() {
final DialogComponent maxNoneNumericVals = new DialogComponentNumber(m_maxUniqueValues, "Maximum unique values per group", new Integer(1000), 5);
maxNoneNumericVals.setToolTipText("All groups with more unique values " + "will be skipped and replaced by a missing value");
final DialogComponentStringSelection colNamePolicy = new DialogComponentStringSelection(m_columnNamePolicy, "Column naming:", ColumnNamePolicy.getPolicyLabels());
final DialogComponent enableHilite = new DialogComponentBoolean(m_enableHilite, "Enable hiliting");
final DialogComponentString valueDelimiter = new DialogComponentString(m_valueDelimiter, "Value delimiter", false, 2);
final DialogComponent inMemory = new DialogComponentBoolean(m_inMemory, "Process in memory");
inMemory.setToolTipText("Processes all data in memory.");
final DialogComponent retainOrder = new DialogComponentBoolean(m_retainOrder, "Retain row order");
retainOrder.setToolTipText("Retains the original row order of the input table.");
final JPanel rootPanel = new JPanel(new GridBagLayout());
rootPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), " Advanced settings "));
final GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.LINE_START;
c.weightx = 0;
c.weighty = 0;
c.fill = GridBagConstraints.NONE;
c.gridx = 0;
c.gridy = 0;
rootPanel.add(colNamePolicy.getComponentPanel(), c);
c.gridx++;
rootPanel.add(enableHilite.getComponentPanel(), c);
c.gridx++;
rootPanel.add(inMemory.getComponentPanel(), c);
c.gridx++;
rootPanel.add(retainOrder.getComponentPanel(), c);
c.gridy++;
c.gridx = 0;
c.anchor = GridBagConstraints.FIRST_LINE_START;
rootPanel.add(maxNoneNumericVals.getComponentPanel(), c);
c.gridx++;
c.anchor = GridBagConstraints.LINE_START;
c.fill = GridBagConstraints.HORIZONTAL;
c.gridwidth = GridBagConstraints.REMAINDER;
final JPanel fakePanel = new JPanel(new GridBagLayout());
final GridBagConstraints gc = new GridBagConstraints();
gc.anchor = GridBagConstraints.LINE_START;
gc.gridx = 0;
gc.gridy = 0;
gc.fill = GridBagConstraints.NONE;
fakePanel.add(valueDelimiter.getComponentPanel(), gc);
gc.fill = GridBagConstraints.HORIZONTAL;
gc.weightx = 1;
gc.gridy++;
fakePanel.add(new JPanel(), gc);
rootPanel.add(fakePanel, c);
return rootPanel;
}
use of org.knime.core.node.defaultnodesettings.DialogComponentStringSelection in project knime-core by knime.
the class DBPivotNodeDialog method createAdvancedOptionsPanel.
private JComponent createAdvancedOptionsPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), " Advanced settings "));
final GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.FIRST_LINE_START;
c.fill = GridBagConstraints.NONE;
final DialogComponentStringSelection colNamePolicy = new DialogComponentStringSelection(m_columnNamePolicy, "Column naming:", ColumnNamePolicy.getPolicyLabels());
panel.add(colNamePolicy.getComponentPanel(), c);
return panel;
}
use of org.knime.core.node.defaultnodesettings.DialogComponentStringSelection in project knime-core by knime.
the class DBGroupByNodeDialog2 method createAdvancedOptionsPanel.
private JComponent createAdvancedOptionsPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), " Advanced settings "));
final GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.FIRST_LINE_START;
c.fill = GridBagConstraints.NONE;
final DialogComponentStringSelection colNamePolicy = new DialogComponentStringSelection(m_columnNamePolicy, "Column naming:", ColumnNamePolicy.getPolicyLabels());
panel.add(colNamePolicy.getComponentPanel(), c);
c.gridx++;
panel.add(new DialogComponentBoolean(m_addCountStar, "Add COUNT(*)").getComponentPanel(), c);
c.gridx++;
panel.add(new DialogComponentString(m_countStarColName, "column name: ", true, 15).getComponentPanel(), c);
return panel;
}
Aggregations