Search in sources :

Example 16 with DialogComponentBoolean

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;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) DialogComponentColumnFilter2(org.knime.core.node.defaultnodesettings.DialogComponentColumnFilter2)

Example 17 with DialogComponentBoolean

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;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Example 18 with DialogComponentBoolean

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);
}
Also used : DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Example 19 with DialogComponentBoolean

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);
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) DialogComponentButtonGroup(org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 20 with DialogComponentBoolean

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()));
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Aggregations

DialogComponentBoolean (org.knime.core.node.defaultnodesettings.DialogComponentBoolean)20 DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)9 JPanel (javax.swing.JPanel)7 GridBagConstraints (java.awt.GridBagConstraints)5 GridBagLayout (java.awt.GridBagLayout)5 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)5 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)4 Box (javax.swing.Box)3 DialogComponent (org.knime.core.node.defaultnodesettings.DialogComponent)3 DialogComponentNumber (org.knime.core.node.defaultnodesettings.DialogComponentNumber)3 DialogComponentStringSelection (org.knime.core.node.defaultnodesettings.DialogComponentStringSelection)3 BorderLayout (java.awt.BorderLayout)2 ChangeEvent (javax.swing.event.ChangeEvent)2 ChangeListener (javax.swing.event.ChangeListener)2 DialogComponentColumnFilter2 (org.knime.core.node.defaultnodesettings.DialogComponentColumnFilter2)2 SettingsModelInteger (org.knime.core.node.defaultnodesettings.SettingsModelInteger)2 Component (java.awt.Component)1 Dimension (java.awt.Dimension)1 Insets (java.awt.Insets)1 Arrays (java.util.Arrays)1