Search in sources :

Example 51 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class DomainNodeDialogPane method saveSettingsTo.

/**
 * {@inheritDoc}
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration possConfig = DomainNodeModel.createDCSFilterConfigurationPossVals();
    DataColumnSpecFilterConfiguration minMaxConfig = DomainNodeModel.createDCSFilterConfigurationMinMax();
    m_filterPanelPossValues.saveConfiguration(possConfig);
    m_filterPanelMinMax.saveConfiguration(minMaxConfig);
    possConfig.saveConfiguration(settings);
    minMaxConfig.saveConfiguration(settings);
    int maxPossVals = m_maxValuesChecker.isSelected() ? (Integer) m_maxValuesSpinner.getValue() : -1;
    settings.addInt(DomainNodeModel.CFG_MAX_POSS_VALUES, maxPossVals);
    settings.addBoolean(DomainNodeModel.CFG_POSSVAL_RETAIN_UNSELECTED, m_possValUnselectedRetainButton.isSelected());
    settings.addBoolean(DomainNodeModel.CFG_MIN_MAX_RETAIN_UNSELECTED, m_minMaxUnselectedRetainButton.isSelected());
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 52 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class DomainNodeDialogPane method loadSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
    DataTableSpec spec = specs[0];
    if (spec.getNumColumns() == 0) {
        throw new NotConfigurableException("No data at input.");
    }
    DataColumnSpecFilterConfiguration possConfig = DomainNodeModel.createDCSFilterConfigurationPossVals();
    DataColumnSpecFilterConfiguration minMaxConfig = DomainNodeModel.createDCSFilterConfigurationMinMax();
    possConfig.loadConfigurationInDialog(settings, spec);
    minMaxConfig.loadConfigurationInDialog(settings, spec);
    m_filterPanelPossValues.loadConfiguration(possConfig, spec);
    m_filterPanelMinMax.loadConfiguration(minMaxConfig, spec);
    int maxPossValues = settings.getInt(DomainNodeModel.CFG_MAX_POSS_VALUES, DataContainer.MAX_POSSIBLE_VALUES);
    if ((maxPossValues >= 0) != m_maxValuesChecker.isSelected()) {
        m_maxValuesChecker.doClick();
    }
    m_maxValuesSpinner.setValue(maxPossValues >= 0 ? maxPossValues : DataContainer.MAX_POSSIBLE_VALUES);
    boolean possValRetainUnselected = settings.getBoolean(DomainNodeModel.CFG_POSSVAL_RETAIN_UNSELECTED, true);
    boolean minMaxRetainUnselected = settings.getBoolean(DomainNodeModel.CFG_MIN_MAX_RETAIN_UNSELECTED, true);
    if (possValRetainUnselected) {
        m_possValUnselectedRetainButton.doClick();
    } else {
        m_possValUnselectedDropButton.doClick();
    }
    if (minMaxRetainUnselected) {
        m_minMaxUnselectedRetainButton.doClick();
    } else {
        m_minMaxUnselectedDropButton.doClick();
    }
}
Also used : NotConfigurableException(org.knime.core.node.NotConfigurableException) DataTableSpec(org.knime.core.data.DataTableSpec) DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 53 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class DomainNodeModel method validateSettings.

/**
 * {@inheritDoc}
 */
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration config = createDCSFilterConfigurationPossVals();
    config.loadConfigurationInModel(settings);
    config = createDCSFilterConfigurationMinMax();
    config.loadConfigurationInModel(settings);
    settings.getInt(CFG_MAX_POSS_VALUES);
    settings.getBoolean(CFG_POSSVAL_RETAIN_UNSELECTED);
    settings.getBoolean(CFG_MIN_MAX_RETAIN_UNSELECTED);
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 54 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class EditNumericDomainConfiguration method loadConfigurationInDialog.

/**
 * Loads the configuration for the dialog with corresponding default values.
 *
 * @param settings the settings to load
 * @param spec the table specification
 */
void loadConfigurationInDialog(final NodeSettingsRO settings, final DataTableSpec spec) {
    m_lowerBound = settings.getDouble(MIN_KEY, Double.NaN);
    m_upperBound = settings.getDouble(MAX_KEY, Double.NaN);
    m_domainOverflowPolicy = toDomainHandler(settings.getString(DOMAIN_OVERFLOW_POLICY_KEY, DomainOverflowPolicy.THROW_EXCEPTION.toString()));
    DataColumnSpecFilterConfiguration dataColumnSpecFilterConfiguration = createDoubleSpecFilterConfig();
    dataColumnSpecFilterConfiguration.loadConfigurationInDialog(settings, spec);
    m_columnspecFilterConfig = dataColumnSpecFilterConfiguration;
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 55 with DataColumnSpecFilterConfiguration

use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.

the class EditNumericDomainConfiguration method setColumnspecFilterCofig.

/**
 * @param panel the DataColumnSpecFilterPanel to store the configuration from
 */
void setColumnspecFilterCofig(final DataColumnSpecFilterPanel panel) {
    DataColumnSpecFilterConfiguration dataColumnSpecFilterConfiguration = createDoubleSpecFilterConfig();
    panel.saveConfiguration(dataColumnSpecFilterConfiguration);
    m_columnspecFilterConfig = dataColumnSpecFilterConfiguration;
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Aggregations

DataColumnSpecFilterConfiguration (org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)75 DataTableSpec (org.knime.core.data.DataTableSpec)15 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)14 NotConfigurableException (org.knime.core.node.NotConfigurableException)9 ChangeEvent (javax.swing.event.ChangeEvent)4 ChangeListener (javax.swing.event.ChangeListener)4 DataColumnSpec (org.knime.core.data.DataColumnSpec)4 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)4 DatabaseConnectionSettings (org.knime.core.node.port.database.DatabaseConnectionSettings)4 EnforceOption (org.knime.core.node.util.filter.NameFilterConfiguration.EnforceOption)4 DatabaseConnectionPortObjectSpec (org.knime.core.node.port.database.DatabaseConnectionPortObjectSpec)2 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 Solver (org.knime.base.node.mine.regression.logistic.learner4.LogRegLearnerSettings.Solver)1 BinNaming (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.BinNaming)1 EqualityMethod (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.EqualityMethod)1 Method (org.knime.base.node.preproc.autobinner3.AutoBinnerLearnSettings.Method)1 DoubleValue (org.knime.core.data.DoubleValue)1 IntValue (org.knime.core.data.IntValue)1