use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class AutoBinnerLearnNodeDialogPane method loadSettingsFrom.
/**
* @param settings to read intervals from
* @param specs The input table spec
* @see NodeDialogPane#loadSettingsFrom(NodeSettingsRO, PortObjectSpec[])
* @throws NotConfigurableException if the spec contains no columns
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
m_settings.loadSettingsForDialog(settings, (DataTableSpec) specs[0]);
DataColumnSpecFilterConfiguration config = m_settings.getFilterConfiguration();
m_filterPanel.loadConfiguration(config, (DataTableSpec) specs[0]);
m_methodFixedNumber.setSelected(m_settings.getMethod().equals(Method.fixedNumber));
m_methodSampleQuantiles.setSelected(m_settings.getMethod().equals(Method.sampleQuantiles));
m_numBins.setEnabled(!m_methodSampleQuantiles.isSelected());
m_equalityMethod.setEnabled(!m_methodSampleQuantiles.isSelected());
m_sampleQuantiles.setEnabled(m_methodSampleQuantiles.isSelected());
m_numBins.setValue(m_settings.getBinCount());
m_equalityMethod.setSelectedItem(m_settings.getEqualityMethod());
m_sampleQuantiles.setText(implode(m_settings.getSampleQuantiles()));
m_binNamingNumbered.setSelected(m_settings.getBinNaming().equals(BinNaming.numbered));
m_binNamingEdges.setSelected(m_settings.getBinNaming().equals(BinNaming.edges));
m_binNamingMidpoints.setSelected(m_settings.getBinNaming().equals(BinNaming.midpoints));
m_replaceColumn.setSelected(m_settings.getReplaceColumn());
m_integerBounds.setSelected(m_settings.getIntegerBounds());
m_defaultFormatting.setSelected(!m_settings.getAdvancedFormatting());
m_advancedFormatting.setSelected(m_settings.getAdvancedFormatting());
m_outputFormat.setEnabled(m_settings.getAdvancedFormatting());
m_precision.setEnabled(m_settings.getAdvancedFormatting());
m_precisionMode.setEnabled(m_settings.getAdvancedFormatting());
m_roundingMode.setEnabled(m_settings.getAdvancedFormatting());
m_outputFormat.setSelectedItem(m_settings.getOutputFormat());
m_precision.setValue(m_settings.getPrecision());
m_precisionMode.setSelectedItem(m_settings.getPrecisionMode());
m_roundingMode.setSelectedItem(m_settings.getRoundingMode());
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class ColCombine2NodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
m_spec = specs[0];
if (m_spec.getNumColumns() == 0) {
throw new NotConfigurableException("No input data available");
}
DataColumnSpecFilterConfiguration conf = ColCombine2NodeModel.createDCSFilterConfiguration();
conf.loadConfigurationInDialog(settings, m_spec);
m_filterPanel.loadConfiguration(conf, m_spec);
String delimiter = settings.getString(ColCombine2NodeModel.CFG_DELIMITER_STRING, ",");
boolean isQuoting = settings.getBoolean(ColCombine2NodeModel.CFG_IS_QUOTING, true);
char quote = settings.getChar(ColCombine2NodeModel.CFG_QUOTE_CHAR, '"');
String replaceDelim = "";
if (!isQuoting) {
replaceDelim = settings.getString(ColCombine2NodeModel.CFG_REPLACE_DELIMITER_STRING, replaceDelim);
}
String newColBase = "combined string";
String newColName = newColBase;
newColName = DataTableSpec.getUniqueColumnName(m_spec, newColName);
newColName = settings.getString(ColCombine2NodeModel.CFG_NEW_COLUMN_NAME, newColName);
m_delimTextField.setText(delimiter);
m_appendColNameField.setText(newColName);
if (isQuoting) {
m_quoteCharRadioButton.doClick();
m_quoteCharField.setValue(Character.valueOf(quote));
boolean isQuotingAlways = settings.getBoolean(ColCombine2NodeModel.CFG_IS_QUOTING_ALWAYS, true);
m_quoteAlwaysChecker.setSelected(isQuotingAlways);
} else {
m_replaceDelimRadioButton.doClick();
m_replaceDelimStringField.setText(replaceDelim);
}
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class ColCombine2NodeModel method loadValidatedSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
DataColumnSpecFilterConfiguration conf = createDCSFilterConfiguration();
conf.loadConfigurationInModel(settings);
m_filterConf = conf;
m_newColName = settings.getString(CFG_NEW_COLUMN_NAME);
m_delimString = settings.getString(CFG_DELIMITER_STRING);
m_isQuoting = settings.getBoolean(CFG_IS_QUOTING);
if (m_isQuoting) {
m_quoteChar = settings.getChar(CFG_QUOTE_CHAR);
m_isQuotingAlways = settings.getBoolean(CFG_IS_QUOTING_ALWAYS);
} else {
m_replaceDelimString = settings.getString(CFG_REPLACE_DELIMITER_STRING);
}
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class DomainNodeModel method loadValidatedSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
DataColumnSpecFilterConfiguration possConfig = createDCSFilterConfigurationPossVals();
possConfig.loadConfigurationInModel(settings);
m_possValConfig = possConfig;
DataColumnSpecFilterConfiguration minMaxConfig = createDCSFilterConfigurationMinMax();
minMaxConfig.loadConfigurationInModel(settings);
m_minMaxConfig = minMaxConfig;
m_maxPossValues = settings.getInt(CFG_MAX_POSS_VALUES);
m_minMaxRetainUnselected = settings.getBoolean(CFG_MIN_MAX_RETAIN_UNSELECTED);
m_possValRetainUnselected = settings.getBoolean(CFG_POSSVAL_RETAIN_UNSELECTED);
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class LowVarFilter2NodeDialogPane method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
final DataTableSpec spec = specs[0];
if (spec == null || spec.getNumColumns() == 0) {
throw new NotConfigurableException("No columns available for " + "selection.");
}
List<String> defIncludes = new ArrayList<String>();
for (DataColumnSpec s : specs[0]) {
if (s.getType().isCompatible(DoubleValue.class)) {
defIncludes.add(s.getName());
}
}
double threshold = settings.getDouble(LowVarFilter2NodeModel.CFG_KEY_MAX_VARIANCE, 0.0);
m_varianceSpinner.setValue(threshold);
DataColumnSpecFilterConfiguration config = createColFilterConf();
config.loadConfigurationInDialog(settings, spec);
m_colFilterPanel.loadConfiguration(config, spec);
}
Aggregations