Search in sources :

Example 1 with DialogComponentNumberEdit

use of org.knime.core.node.defaultnodesettings.DialogComponentNumberEdit in project knime-core by knime.

the class NumericOutliersNodeDialogPane method createSettingsDialog.

/**
 * Creates the settings panel.
 *
 * @return the settings panel
 */
private JPanel createSettingsDialog() {
    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;
    // add panel border
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), SETTINGS_BORDER_TITLE));
    // add IQR scale dialog
    m_scalarDialog = new DialogComponentNumberEdit(NumericOutliersNodeModel.createScalarModel(), QUARTILE_RANGE_MULT);
    panel.add(m_scalarDialog.getComponentPanel(), gbc);
    ++gbc.gridy;
    // add the update domain dialog
    m_updateDomainDialog = new DialogComponentBoolean(NumericOutliersNodeModel.createDomainModel(), DOMAIN_POLICY);
    panel.add(m_updateDomainDialog.getComponentPanel(), gbc);
    ++gbc.gridy;
    // add the heuristic dialog
    m_heuristicDialog = new DialogComponentBoolean(NumericOutliersNodeModel.createHeuristicModel(), HEURISTIC_LABEL);
    panel.add(m_heuristicDialog.getComponentPanel(), gbc);
    ++gbc.gridy;
    // add a component to select the percentile estimation type
    List<String> eTypes = Arrays.stream(EstimationType.values()).map(val -> val.toString()).collect(Collectors.toList());
    m_estimationDialog = new DialogComponentStringSelection(NumericOutliersNodeModel.createEstimationModel(), ESTIMATION_TYPE, eTypes);
    panel.add(m_estimationDialog.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) DialogComponentNumberEdit(org.knime.core.node.defaultnodesettings.DialogComponentNumberEdit) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Aggregations

Component (java.awt.Component)1 Dimension (java.awt.Dimension)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 BorderFactory (javax.swing.BorderFactory)1 JPanel (javax.swing.JPanel)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 EstimationType (org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType)1 NumericOutliersDetectionOption (org.knime.base.algorithms.outlier.options.NumericOutliersDetectionOption)1 NumericOutliersReplacementStrategy (org.knime.base.algorithms.outlier.options.NumericOutliersReplacementStrategy)1 NumericOutliersTreatmentOption (org.knime.base.algorithms.outlier.options.NumericOutliersTreatmentOption)1 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)1 NodeDialogPane (org.knime.core.node.NodeDialogPane)1 NodeSettingsRO (org.knime.core.node.NodeSettingsRO)1 NodeSettingsWO (org.knime.core.node.NodeSettingsWO)1