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));
}
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()));
}
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));
}
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());
}
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());
}
Aggregations