use of org.knime.core.node.util.DataValueColumnFilter in project knime-core by knime.
the class RuleEngine2PortsNodeDialog method initControls.
/**
* Creates and adds most of the controls to the dialog.
*/
private void initControls() {
m_pmml = new JCheckBox("Enable PMML RuleSet generation (fails when result would not be a valid PMML RuleSet)");
m_ruleSelectionMethod = new JComboBox<>(new Vector<>(RuleEngine2PortsSettings.POSSIBLE_RULE_SELECTION_METHODS));
m_hasDefaultScore = new JCheckBox("Default value (when nothing matches): ");
m_defaultScore = Util.createTextFieldWithWatermark(RuleEngine2PortsSettings.DEFAULT_DEFAULT_SCORE, 22, "Default score/value when nothing matches");
m_hasDefaultConfidence = new JCheckBox("Default confidence value (when not specified in the confidence column): ");
m_defaultConfidence = new JSpinner(new SpinnerNumberModel(RuleEngine2PortsSettings.DEFAULT_DEFAULT_CONFIDENCE, 0d, 1d, .1));
@SuppressWarnings("unchecked") DataValueColumnFilter doubleValueFilter = new DataValueColumnFilter(DoubleValue.class);
m_ruleConfidenceColumn = new ColumnSelectionPanel((Border) null, doubleValueFilter, true);
m_hasDefaultWeight = new JCheckBox("Default weight value (when not specified in the weight column): ");
m_defaultWeight = new JSpinner(new SpinnerNumberModel(RuleEngine2PortsSettings.DEFAULT_DEFAULT_WEIGHT, 0d, 1e6, .1));
m_ruleWeightColumn = new ColumnSelectionPanel((Border) null, doubleValueFilter, true);
m_computeConfidence = new JCheckBox("Confidence column name: ");
m_predictionConfidenceColumn = Util.createTextFieldWithWatermark(RuleEngine2PortsSettings.DEFAULT_PREDICTION_CONFIDENCE_COLUMN, 22, "Computed confidence column name");
m_provideStatistics = new JCheckBox("Provide statistics");
@SuppressWarnings("unchecked") DataValueColumnFilter validationColumnFilter = new DataValueColumnFilter(StringValue.class, BooleanValue.class, DoubleValue.class);
m_validationColumn = new ColumnSelectionPanel(null, validationColumnFilter, true);
m_pmmlLabels = new ArrayList<>();
m_pmmlBorders = new ArrayList<>();
m_validateLabel = new JLabel("Validation column");
}
use of org.knime.core.node.util.DataValueColumnFilter in project knime-core by knime.
the class DateTimeDifferenceNodeDialog method updateDateTimeComponents.
@SuppressWarnings("unchecked")
private void updateDateTimeComponents(final SettingsModelDateTime dateTimeModel) {
if (m_dialogComp1stColSelect.getSelectedAsSpec() != null) {
final DataType type = m_dialogComp1stColSelect.getSelectedAsSpec().getType();
// adapt column filter of column selection for 2nd column
try {
final List<Class<? extends DataValue>> valueClasses = type.getValueClasses();
if (valueClasses.contains(ZonedDateTimeValue.class)) {
m_dialogComp2ndColSelect.setColumnFilter(new DataValueColumnFilter(ZonedDateTimeValue.class));
} else if (valueClasses.contains(LocalDateTimeValue.class)) {
m_dialogComp2ndColSelect.setColumnFilter(new DataValueColumnFilter(LocalDateTimeValue.class));
} else if (valueClasses.contains(LocalDateValue.class)) {
m_dialogComp2ndColSelect.setColumnFilter(new DataValueColumnFilter(LocalDateValue.class));
} else if (valueClasses.contains(LocalTimeValue.class)) {
m_dialogComp2ndColSelect.setColumnFilter(new DataValueColumnFilter(LocalTimeValue.class));
}
} catch (NotConfigurableException ex) {
// will never happen, because there is always at least the selected 1st column available
}
// adapt date&time component
dateTimeModel.setUseDate(!type.isCompatible(LocalTimeValue.class));
dateTimeModel.setUseTime(!type.isCompatible(LocalDateValue.class));
dateTimeModel.setUseZone(type.isCompatible(ZonedDateTimeValue.class));
}
updateWarningLabel();
}
use of org.knime.core.node.util.DataValueColumnFilter in project knime-core by knime.
the class CrosstabNodeDialog method createSettingsPanel.
@SuppressWarnings("unchecked")
private JPanel createSettingsPanel() {
JPanel p = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.WEST;
c.insets = new Insets(8, 3, 3, 3);
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 1;
c.weightx = 0;
c.weighty = 0;
c.fill = GridBagConstraints.BOTH;
p.add(new JLabel("Row variable:"), c);
c.gridx++;
c.weightx = 1;
m_rowVarColumn = new ColumnSelectionComboxBox(StringValue.class, DoubleValue.class);
m_rowVarColumn.setBorder(null);
p.add(m_rowVarColumn, c);
c.insets = new Insets(3, 3, 3, 3);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
p.add(new JLabel("Column variable:"), c);
c.gridx++;
c.weightx = 1;
m_colVarColumn = new ColumnSelectionComboxBox(StringValue.class, DoubleValue.class);
m_colVarColumn.setBorder(null);
p.add(m_colVarColumn, c);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
p.add(new JLabel("Weight column:"), c);
c.gridx++;
c.weightx = 1;
m_weightColumn = new ColumnSelectionPanel((Border) null, new DataValueColumnFilter(DoubleValue.class), true);
m_weightColumn.setBorder(null);
p.add(m_weightColumn, c);
c.gridx = 0;
c.gridy++;
c.gridwidth = 2;
m_enableHiliting = new JCheckBox("Enable hiliting");
p.add(m_enableHiliting, c);
c.gridy++;
c.gridx = 0;
c.weighty = 1;
p.add(new JPanel(), c);
return p;
}
Aggregations