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