use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class ColumnAutoTypeCasterNodeDialogPane method loadSettingsFrom.
/**
* Calls the update method of the underlying filter panel.
* @param settings the node settings to read from
* @param specs the input specs
* @throws NotConfigurableException if no columns are available for
* filtering
*/
@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.");
}
DataColumnSpecFilterConfiguration config = ColumnAutoTypeCasterNodeModel.createDCSFilterConfiguration();
config.loadConfigurationInDialog(settings, specs[0]);
m_filterPanel.loadConfiguration(config, specs[0]);
m_dateBox.setSelectedItem(settings.getString(CFGKEY_DATEFORMAT, "dd.MM.yy"));
m_missValueChooser.setSelectedItem(settings.getString(CFGKEY_MISSVALPAT, "<none>"));
m_quickScanCheckBox.setSelected(settings.getBoolean(CFGKEY_QUICKSANBOOLEAN, false));
m_numberOfRowsSpinner.setValue(settings.getInt(CFGKEY_QUICKSCANROWS, 1000));
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class ColumnAutoTypeCasterNodeModel method loadValidatedSettingsFrom.
/**
* @param settings NodeSettings
* @see org.knime.core.node.NodeModel#loadValidatedSettingsFrom(org.knime.core.node.NodeSettingsRO)
* @throws InvalidSettingsException invalid settings exception
*/
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
DataColumnSpecFilterConfiguration conf = createDCSFilterConfiguration();
conf.loadConfigurationInModel(settings);
m_conf = conf;
m_dateFormat = settings.getString(CFGKEY_DATEFORMAT);
m_missValPat = settings.getString(CFGKEY_MISSVALPAT);
if (m_missValPat.equals("<none>")) {
m_missValPat = null;
} else if (m_missValPat.equals("<empty>")) {
m_missValPat = "";
}
m_quickScan = settings.getBoolean(CFGKEY_QUICKSANBOOLEAN);
m_numberOfRows = settings.getInt(CFGKEY_QUICKSCANROWS);
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class ColumnAutoTypeCasterNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
DataColumnSpecFilterConfiguration conf = createDCSFilterConfiguration();
conf.loadConfigurationInModel(settings);
String tmpDateFormat = settings.getString("dateFormat");
try {
new SimpleDateFormat(tmpDateFormat);
} catch (IllegalArgumentException e) {
throw new InvalidSettingsException(e.getMessage(), e);
}
try {
settings.getBoolean(CFGKEY_QUICKSANBOOLEAN);
} catch (IllegalArgumentException e1) {
throw new InvalidSettingsException(e1.getMessage(), e1);
}
try {
int tmpQuickScanRows = settings.getInt(CFGKEY_QUICKSCANROWS);
if (tmpQuickScanRows < 1) {
throw new InvalidSettingsException("Number of rows for quickscan is to small.");
}
} catch (IllegalArgumentException e2) {
throw new InvalidSettingsException(e2.getMessage(), e2);
}
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class LowVarFilter2NodeDialogPane method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
double threshold = ((Number) m_varianceSpinner.getValue()).doubleValue();
settings.addDouble(LowVarFilter2NodeModel.CFG_KEY_MAX_VARIANCE, threshold);
DataColumnSpecFilterConfiguration config = createColFilterConf();
m_colFilterPanel.saveConfiguration(config);
config.saveConfiguration(settings);
}
use of org.knime.core.node.util.filter.column.DataColumnSpecFilterConfiguration in project knime-core by knime.
the class LowVarFilter2NodeModel method loadValidatedSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
m_varianceThreshold = settings.getDouble(CFG_KEY_MAX_VARIANCE);
DataColumnSpecFilterConfiguration conf = createColFilterConf();
conf.loadConfigurationInModel(settings);
m_conf = conf;
}
Aggregations