use of org.knime.base.node.viz.aggregation.AggregationMethod in project knime-core by knime.
the class PieNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
m_allRows.validateSettings(settings);
m_noOfRows.validateSettings(settings);
m_pieColumn.validateSettings(settings);
m_aggrMethod.validateSettings(settings);
final String aggrMethod = ((SettingsModelString) m_aggrMethod.createCloneWithValidatedValue(settings)).getStringValue();
final AggregationMethod method = AggregationMethod.getMethod4Command(aggrMethod);
m_aggrColumn.validateSettings(settings);
if (!AggregationMethod.COUNT.equals(method)) {
final String value = ((SettingsModelString) m_aggrColumn.createCloneWithValidatedValue(settings)).getStringValue();
if (value == null) {
throw new InvalidSettingsException("No aggregation column only valid for method count");
}
}
}
use of org.knime.base.node.viz.aggregation.AggregationMethod in project knime-core by knime.
the class PieNodeModel method getVizModel.
/**
* @return the {@link PieVizModel}. Could be null.
*/
public D getVizModel() {
D vizModel = null;
try {
vizModel = getVizModelInternal();
} catch (final TooManySectionsException e) {
setWarningMessage(e.getMessage());
LOGGER.error(e.getMessage());
}
if (vizModel == null) {
return null;
}
final AggregationMethod method = AggregationMethod.getMethod4Command(m_aggrMethod.getStringValue());
vizModel.setAggregationMethod(method);
return vizModel;
}
Aggregations