use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.
the class RowKeyNodeModel2 method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
assert (settings != null);
final SettingsModelBoolean replaceRowKeyModel = m_replaceKey.createCloneWithValidatedValue(settings);
final SettingsModelBoolean appendRowKeyModel = m_appendRowKey.createCloneWithValidatedValue(settings);
final SettingsModelString newRowKeyModel = m_newRowKeyColumn.createCloneWithValidatedValue(settings);
final SettingsModelString newColNameModel = m_newColumnName.createCloneWithValidatedValue(settings);
validateInput(null, appendRowKeyModel.getBooleanValue(), newColNameModel.getStringValue(), replaceRowKeyModel.getBooleanValue(), newRowKeyModel.getStringValue(), appendRowKeyModel.getBooleanValue());
}
use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.
the class NumericRowSplitterNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
m_columnSelection.validateSettings(settings);
m_lowerBound.validateSettings(settings);
m_lowerBoundCheck.validateSettings(settings);
m_lowerBoundValue.validateSettings(settings);
m_upperBound.validateSettings(settings);
m_upperBoundCheck.validateSettings(settings);
m_upperBoundValue.validateSettings(settings);
SettingsModelBoolean lowerBoundCheck = m_lowerBoundCheck.createCloneWithValidatedValue(settings);
SettingsModelBoolean upperBoundCheck = m_upperBoundCheck.createCloneWithValidatedValue(settings);
if (lowerBoundCheck.getBooleanValue() && upperBoundCheck.getBooleanValue()) {
SettingsModelDouble lowerBoundValue = m_lowerBoundValue.createCloneWithValidatedValue(settings);
double low = lowerBoundValue.getDoubleValue();
SettingsModelDouble upperBoundValue = m_upperBoundValue.createCloneWithValidatedValue(settings);
double upp = upperBoundValue.getDoubleValue();
if (low > upp) {
throw new InvalidSettingsException("Check lower and upper " + "bound values: " + low + " > " + upp);
}
if (low == upp) {
SettingsModelString lowerBound = m_lowerBound.createCloneWithValidatedValue(settings);
boolean inclLow = NumericRowSplitterNodeDialogPane.includeLowerBound(lowerBound);
SettingsModelString upperBound = m_upperBound.createCloneWithValidatedValue(settings);
boolean inclUpp = NumericRowSplitterNodeDialogPane.includeUpperBound(upperBound);
if ((inclLow ^ inclUpp) || (!inclLow & !inclUpp)) {
throw new InvalidSettingsException("Lower and upper bounds " + "are inconsistent with borders!");
}
}
}
}
use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.
the class DecisionTreeLearnerNodeDialog method createSettingsSkipNominalColumnsWithoutDomain.
/**
* @return binary nominal split mode
*/
static SettingsModelBoolean createSettingsSkipNominalColumnsWithoutDomain() {
SettingsModelBoolean setting = new SettingsModelBoolean(DecisionTreeLearnerNodeModel.KEY_SKIP_COLUMNS, DecisionTreeLearnerNodeModel.DEFAULT_BINARY_NOMINAL_SPLIT_MODE);
setting.setBooleanValue(true);
return setting;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.
the class DecisionTreeLearnerNodeDialog method createSettingsFilterNominalValuesFromParent.
/**
* @param skipNominalColumnsWithoutDomainModel model to listen to for
* enablement (only enable if binary nominal splits)
* @return model representing {@link
* DecisionTreeLearnerNodeModel#KEY_FILTER_NOMINAL_VALUES_FROM_PARENT}
*/
static SettingsModelBoolean createSettingsFilterNominalValuesFromParent(final SettingsModelBoolean skipNominalColumnsWithoutDomainModel) {
final SettingsModelBoolean model = new SettingsModelBoolean(DecisionTreeLearnerNodeModel.KEY_FILTER_NOMINAL_VALUES_FROM_PARENT, false);
skipNominalColumnsWithoutDomainModel.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(final ChangeEvent e) {
model.setEnabled(skipNominalColumnsWithoutDomainModel.getBooleanValue());
}
});
return model;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelBoolean in project knime-core by knime.
the class AbstractDifferenceChecker method createIgnoreDomainPossibleValuesOrderingModel.
private static final SettingsModelBoolean createIgnoreDomainPossibleValuesOrderingModel(final SettingsModelBoolean ignoreDomainsModel) {
SettingsModelBoolean result = new SettingsModelBoolean("ignoreDomainPossibleValuesOrdering", false);
ignoreDomainsModel.addChangeListener(e -> result.setEnabled(!ignoreDomainsModel.getBooleanValue()));
result.setEnabled(!ignoreDomainsModel.getBooleanValue());
return result;
}
Aggregations