use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class NumericOutliersNodeDialogPane method getGroupSelectionPanel.
/**
* Creates the groups selection panel.
*
* @return the group selection dialog
*/
private JPanel getGroupSelectionPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
final GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.LINE_START;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1.0;
// add panel border
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), GROUP_SELECTION_BORDER_TITLE));
// add apply to groups selection dialog
m_useGroupsDialog = new DialogComponentBoolean(NumericOutliersNodeModel.createUseGroupsModel(), APPLY_TO_GROUPS);
panel.add(m_useGroupsDialog.getComponentPanel(), gbc);
gbc.insets = INSET;
++gbc.gridy;
gbc.weighty = 1.0;
gbc.fill = GridBagConstraints.BOTH;
m_groupsDialog = new DialogComponentColumnFilter2(NumericOutliersNodeModel.createGroupFilterModel(), 0);
panel.add(m_groupsDialog.getComponentPanel(), gbc);
return panel;
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class NumericOutliersNodeDialogPane method getMemoryPanel.
private JPanel getMemoryPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
final GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.LINE_START;
gbc.fill = GridBagConstraints.NONE;
gbc.weightx = 1;
// add panel border
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), MEMORY_BORDER_TITLE));
// add memory policy dialog
m_memoryDialog = new DialogComponentBoolean(NumericOutliersNodeModel.createMemoryModel(), MEMORY_POLICY);
panel.add(m_memoryDialog.getComponentPanel(), gbc);
return panel;
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class ExtractDurationPeriodFieldsNodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
m_dialogCompColSelect.loadSettingsFrom(settings, specs);
for (final DialogComponentBoolean dc : m_dialogCompsDurationFields) {
dc.loadSettingsFrom(settings, specs);
}
for (final DialogComponentBoolean dc : m_dialogCompsPeriodFields) {
dc.loadSettingsFrom(settings, specs);
}
m_dialogCompSubSecond.loadSettingsFrom(settings, specs);
m_dialogCompSubsecondUnits.loadSettingsFrom(settings, specs);
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class AbstractFieldExtractorNodeDialog method createUIComponentWithFormatSelection.
/**
* Creates the necessary {@link SettingsModel}s, adds the listener to the
* checkbox and creates the UI component with a horizontally oriented group
* containing the checkbox and text field for the new column name.
* Then closes the group.
*
* @param timeField name of the time field for which a checkbox,
* a text field and a format selection (int or string) should be created
*/
protected void createUIComponentWithFormatSelection(final String timeField) {
// create the settings models and add listener
SettingsModelBoolean checkBoxModel = createUseTimeFieldModel(timeField);
SettingsModelString colNameModel = createTimeFieldColumnNameModel(timeField);
SettingsModelString formatModel = createRepresentationModelFor(timeField);
addListener(checkBoxModel, colNameModel);
addListener(checkBoxModel, formatModel);
createNewGroup("");
setHorizontalPlacement(true);
addDialogComponent(new DialogComponentBoolean(checkBoxModel, timeField));
// add radio buttons for string or int representation
addDialogComponent(new DialogComponentButtonGroup(formatModel, true, "Value as", AS_STRING, AS_INT));
addDialogComponent(new DialogComponentString(colNameModel, "Column name:", true, 20));
closeCurrentGroup();
setHorizontalPlacement(false);
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class FromDecisionTreeNodeDialog method createScoreDistribution.
/**
* {@inheritDoc}
*/
@Override
protected void createScoreDistribution(final FromDecisionTreeSettings settings) {
createNewGroup("Score distribution");
setHorizontalPlacement(true);
// Record count
m_scorePmmlRecordCount = settings.getScorePmmlRecordCount();
final SettingsModelBoolean scoreTableRecordCount = settings.getScoreTableRecordCount();
final SettingsModelString scoreTableRecordCountPrefix = settings.getScoreTableRecordCountPrefix();
addDialogComponent(new DialogComponentBoolean(m_scorePmmlRecordCount, "Provide score distibution record count in PMML"));
addDialogComponent(new DialogComponentBoolean(scoreTableRecordCount, "Provide score distibution record count in table with column name prefix:"));
addDialogComponent(new DialogComponentString(scoreTableRecordCountPrefix, ""));
setHorizontalPlacement(false);
setHorizontalPlacement(true);
// Probability
final SettingsModelBoolean scorePmmlProbability = settings.getScorePmmlProbability();
final SettingsModelBoolean scoreTableProbability = settings.getScoreTableProbability();
final SettingsModelString scoreTableProbabilityPrefix = settings.getScoreTableProbabilityPrefix();
addDialogComponent(new DialogComponentBoolean(scorePmmlProbability, "Provide score distibution probability in PMML"));
addDialogComponent(new DialogComponentBoolean(scoreTableProbability, "Provide score distibution probability in table with column name prefix:"));
addDialogComponent(new DialogComponentString(scoreTableProbabilityPrefix, ""));
m_scorePmmlRecordCount.addChangeListener(c -> scoreTableRecordCount.setEnabled(m_scorePmmlRecordCount.getBooleanValue()));
m_scorePmmlRecordCount.addChangeListener(c -> scorePmmlProbability.setEnabled(m_scorePmmlRecordCount.getBooleanValue()));
scoreTableRecordCount.addChangeListener(c -> scoreTableRecordCountPrefix.setEnabled(scoreTableRecordCount.isEnabled() && scoreTableRecordCount.getBooleanValue()));
scorePmmlProbability.addChangeListener(c -> scoreTableProbability.setEnabled(scorePmmlProbability.isEnabled() && scorePmmlProbability.getBooleanValue()));
scoreTableProbability.addChangeListener(c -> scoreTableProbabilityPrefix.setEnabled(scoreTableProbability.isEnabled() && scoreTableProbability.getBooleanValue()));
}
Aggregations