Search in sources :

Example 1 with DialogComponentStringSelection

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;
}
Also used : Insets(java.awt.Insets) Arrays(java.util.Arrays) NodeSettingsRO(org.knime.core.node.NodeSettingsRO) NumericOutliersReplacementStrategy(org.knime.base.algorithms.outlier.options.NumericOutliersReplacementStrategy) InvalidSettingsException(org.knime.core.node.InvalidSettingsException) DialogComponent(org.knime.core.node.defaultnodesettings.DialogComponent) NodeDialogPane(org.knime.core.node.NodeDialogPane) NotConfigurableException(org.knime.core.node.NotConfigurableException) NumericOutliersDetectionOption(org.knime.base.algorithms.outlier.options.NumericOutliersDetectionOption) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) EstimationType(org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType) ChangeListener(javax.swing.event.ChangeListener) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) ChangeEvent(javax.swing.event.ChangeEvent) NumericOutliersTreatmentOption(org.knime.base.algorithms.outlier.options.NumericOutliersTreatmentOption) DialogComponentColumnFilter2(org.knime.core.node.defaultnodesettings.DialogComponentColumnFilter2) PortObjectSpec(org.knime.core.node.port.PortObjectSpec) BorderFactory(javax.swing.BorderFactory) GridBagConstraints(java.awt.GridBagConstraints) Component(java.awt.Component) Collectors(java.util.stream.Collectors) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString) NodeSettingsWO(org.knime.core.node.NodeSettingsWO) Dimension(java.awt.Dimension) List(java.util.List) GridBagLayout(java.awt.GridBagLayout) JPanel(javax.swing.JPanel) DialogComponentNumberEdit(org.knime.core.node.defaultnodesettings.DialogComponentNumberEdit) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection)

Example 2 with DialogComponentStringSelection

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;
}
Also used : DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) Box(javax.swing.Box)

Example 3 with DialogComponentStringSelection

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;
}
Also used : SettingsModelInteger(org.knime.core.node.defaultnodesettings.SettingsModelInteger) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentNumber(org.knime.core.node.defaultnodesettings.DialogComponentNumber) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) DialogComponent(org.knime.core.node.defaultnodesettings.DialogComponent)

Example 4 with DialogComponentStringSelection

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;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection)

Example 5 with DialogComponentStringSelection

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;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Aggregations

DialogComponentStringSelection (org.knime.core.node.defaultnodesettings.DialogComponentStringSelection)6 GridBagConstraints (java.awt.GridBagConstraints)5 GridBagLayout (java.awt.GridBagLayout)5 JPanel (javax.swing.JPanel)5 DialogComponentBoolean (org.knime.core.node.defaultnodesettings.DialogComponentBoolean)4 DialogComponent (org.knime.core.node.defaultnodesettings.DialogComponent)3 Component (java.awt.Component)2 Dimension (java.awt.Dimension)2 Insets (java.awt.Insets)2 Arrays (java.util.Arrays)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 BorderFactory (javax.swing.BorderFactory)2 ChangeEvent (javax.swing.event.ChangeEvent)2 ChangeListener (javax.swing.event.ChangeListener)2 EstimationType (org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType)2 NumericOutliersDetectionOption (org.knime.base.algorithms.outlier.options.NumericOutliersDetectionOption)2 NumericOutliersReplacementStrategy (org.knime.base.algorithms.outlier.options.NumericOutliersReplacementStrategy)2 NumericOutliersTreatmentOption (org.knime.base.algorithms.outlier.options.NumericOutliersTreatmentOption)2 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)2