Search in sources :

Example 41 with DataColumnSpecFilterConfiguration

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

the class ColumnListLoopStartNodeModel method loadValidatedSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration conf = createDCSFilterConfiguration();
    conf.loadConfigurationInModel(settings);
    m_filterConfig = conf;
    // added in 3.2
    m_noColumnsSettings.setBooleanValue(settings.getBoolean(CFG_NO_COLUMNS_POLICY, true));
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 42 with DataColumnSpecFilterConfiguration

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

the class AutoBinnerLearnSettings method loadSettingsForDialog.

/**
 * Loads the settings from the node settings object using default values if some settings are missing.
 *
 * @param settings a node settings object
 */
public void loadSettingsForDialog(final NodeSettingsRO settings, final DataTableSpec spec) {
    DataColumnSpecFilterConfiguration config = AutoBinnerLearnNodeModel.createDCSFilterConfiguration();
    config.loadConfigurationInDialog(settings, spec);
    m_filterConfiguration = config;
    m_method = Method.valueOf(settings.getString(CFG_METHOD, Method.fixedNumber.toString()));
    m_binCount = settings.getInt(CFG_BIN_COUNT, 5);
    m_equalityMethod = EqualityMethod.valueOf(settings.getString(CFG_EQUALITY_METHOD, EqualityMethod.width.name()));
    m_integerBounds = settings.getBoolean(CFG_INTEGER_BOUNDS, false);
    m_sampleQuantiles = settings.getDoubleArray(CFG_SAMPLE_QUANTILES, new double[] { 0, 0.25, 0.5, 0.75, 1 });
    m_binNaming = BinNaming.valueOf(settings.getString(CFG_BIN_NAMING, BinNaming.numbered.toString()));
    m_replaceColumn = settings.getBoolean(CFG_REPLACE_COLUMN, false);
    m_advancedFormatting = settings.getBoolean(CFG_ADVANCED_FORMATTING, false);
    m_outputFormat = OutputFormat.valueOf(settings.getString(CFG_OUTPUT_FORMAT, OutputFormat.Standard.name()));
    m_precision = settings.getInt(CFG_PRECISION, 3);
    m_precisionMode = PrecisionMode.valueOf(settings.getString(CFG_PRECISION_MODE, PrecisionMode.Decimal.name()));
    m_roundingMode = RoundingMode.valueOf(settings.getString(CFG_ROUNDING_MODE, RoundingMode.HALF_UP.name()));
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 43 with DataColumnSpecFilterConfiguration

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

the class AutoBinnerLearnSettings method loadSettings.

/**
 * Loads the settings from the node settings object.
 *
 * @param settings a node settings object
 * @throws InvalidSettingsException if some settings are missing
 */
public void loadSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration config = AutoBinnerLearnNodeModel.createDCSFilterConfiguration();
    config.loadConfigurationInModel(settings);
    m_filterConfiguration = config;
    m_method = Method.valueOf(settings.getString(CFG_METHOD));
    m_binCount = settings.getInt(CFG_BIN_COUNT);
    m_equalityMethod = EqualityMethod.valueOf(settings.getString(CFG_EQUALITY_METHOD));
    m_integerBounds = settings.getBoolean(CFG_INTEGER_BOUNDS);
    m_sampleQuantiles = settings.getDoubleArray(CFG_SAMPLE_QUANTILES);
    m_binNaming = BinNaming.valueOf(settings.getString(CFG_BIN_NAMING));
    m_replaceColumn = settings.getBoolean(CFG_REPLACE_COLUMN);
    m_advancedFormatting = settings.getBoolean(CFG_ADVANCED_FORMATTING);
    m_outputFormat = OutputFormat.valueOf(settings.getString(CFG_OUTPUT_FORMAT));
    m_precision = settings.getInt(CFG_PRECISION);
    m_precisionMode = PrecisionMode.valueOf(settings.getString(CFG_PRECISION_MODE));
    m_roundingMode = RoundingMode.valueOf(settings.getString(CFG_ROUNDING_MODE));
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration)

Example 44 with DataColumnSpecFilterConfiguration

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

the class CreateBitVectorNodeModel method validateSettings.

/**
 * {@inheritDoc}
 */
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    final ColumnType columnType = ColumnType.getType(((SettingsModelString) m_columnType.createCloneWithValidatedValue(settings)).getStringValue());
    final DataColumnSpecFilterConfiguration tmpMultiColumnConfig = createMultiColumnConfig(null);
    tmpMultiColumnConfig.loadConfigurationInModel(settings);
    m_mscPattern.validateSettings(settings);
    m_mscHasWildcards.validateSettings(settings);
    m_mscCaseSensitiv.validateSettings(settings);
    m_mscRegex.validateSettings(settings);
    SetMatching.get(((SettingsModelString) m_mscSetMatching.createCloneWithValidatedValue(settings)).getStringValue());
    m_threshold.validateSettings(settings);
    m_useMean.validateSettings(settings);
    m_meanPercentage.validateSettings(settings);
    final String singleCol = ((SettingsModelString) m_singleColumn.createCloneWithValidatedValue(settings)).getStringValue();
    if (!columnType.isMultiColumn() && singleCol == null) {
        throw new InvalidSettingsException("Please select the single column to process");
    }
    m_singleStringColumnType.validateSettings(settings);
    m_remove.validateSettings(settings);
    final String outCol = ((SettingsModelString) m_outputColumn.createCloneWithValidatedValue(settings)).getStringValue();
    if (outCol == null || outCol.trim().isEmpty()) {
        throw new InvalidSettingsException("Please specify the name of the output column");
    }
    m_failOnError.validateSettings(settings);
    BitVectorType.getType(((SettingsModelString) m_vectorType.createCloneWithValidatedValue(settings)).getStringValue());
}
Also used : DataColumnSpecFilterConfiguration(org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration) InvalidSettingsException(org.knime.core.node.InvalidSettingsException) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 45 with DataColumnSpecFilterConfiguration

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

the class ColumnAutoTypeCasterNodeDialogPane method saveSettingsTo.

/**
 * Sets the list of columns to exclude inside the corresponding
 * <code>NodeModel</code> which are retrieved from the filter panel.
 * @param settings the node settings to write into
 * @throws InvalidSettingsException if one of the settings is not valid
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    DataColumnSpecFilterConfiguration config = ColumnAutoTypeCasterNodeModel.createDCSFilterConfiguration();
    m_filterPanel.saveConfiguration(config);
    config.saveConfiguration(settings);
    settings.addString(CFGKEY_DATEFORMAT, m_dateBox.getEditor().getItem().toString());
    settings.addString(CFGKEY_MISSVALPAT, m_missValueChooser.getEditor().getItem().toString());
    settings.addBoolean(CFGKEY_QUICKSANBOOLEAN, m_quickScanCheckBox.isSelected());
    settings.addInt(CFGKEY_QUICKSCANROWS, (int) m_numberOfRowsSpinner.getValue());
}
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