Search in sources :

Example 6 with DialogComponentString

use of org.knime.core.node.defaultnodesettings.DialogComponentString in project knime-core by knime.

the class DBTableCreatorNodeDialog method createTableSettingsPanel.

/**
 * @return a newly created table settings panel
 */
private JPanel createTableSettingsPanel() {
    final JPanel panel = new JPanel(new BorderLayout());
    final JPanel tablePanel = new JPanel();
    tablePanel.setLayout(new BoxLayout(tablePanel, BoxLayout.Y_AXIS));
    tablePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Table Settings"));
    final Box box = new Box(BoxLayout.Y_AXIS);
    final DialogComponentString schemaComp = new DialogComponentString(m_config.getSchemaSettingsModel(), "Schema: ");
    box.add(schemaComp.getComponentPanel());
    box.add(Box.createVerticalGlue());
    final DialogComponentString tableNameComp = new DialogComponentString(m_config.getTableNameSettingsModel(), "Table name: ");
    box.add(tableNameComp.getComponentPanel());
    box.add(Box.createVerticalGlue());
    final DialogComponentBoolean tempTableComp = new DialogComponentBoolean(m_config.getTempTableSettingsModel(), "Create temporary table");
    box.add(tempTableComp.getComponentPanel());
    box.add(Box.createVerticalGlue());
    final DialogComponentBoolean ifNotExistsComp = new DialogComponentBoolean(m_config.getIfNotExistsSettingsModel(), "Create table if it does not exist");
    box.add(ifNotExistsComp.getComponentPanel());
    box.add(Box.createVerticalGlue());
    tablePanel.add(box);
    final JPanel dynamicPanel = new JPanel(new BorderLayout());
    dynamicPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Dynamic Settings"));
    final DialogComponentBoolean useDynamicSettingsComp = new DialogComponentBoolean(m_config.getUseDynamicSettingsModel(), "Use dynamic settings");
    dynamicPanel.add(useDynamicSettingsComp.getComponentPanel());
    panel.add(tablePanel, BorderLayout.CENTER);
    panel.add(dynamicPanel, BorderLayout.SOUTH);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) BoxLayout(javax.swing.BoxLayout) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) Box(javax.swing.Box)

Example 7 with DialogComponentString

use of org.knime.core.node.defaultnodesettings.DialogComponentString in project knime-core by knime.

the class DBGroupByNodeDialog2 method createAdvancedOptionsPanel.

private JComponent createAdvancedOptionsPanel() {
    final JPanel panel = new JPanel(new GridBagLayout());
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), " Advanced settings "));
    final GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.anchor = GridBagConstraints.FIRST_LINE_START;
    c.fill = GridBagConstraints.NONE;
    final DialogComponentStringSelection colNamePolicy = new DialogComponentStringSelection(m_columnNamePolicy, "Column naming:", ColumnNamePolicy.getPolicyLabels());
    panel.add(colNamePolicy.getComponentPanel(), c);
    c.gridx++;
    panel.add(new DialogComponentBoolean(m_addCountStar, "Add COUNT(*)").getComponentPanel(), c);
    c.gridx++;
    panel.add(new DialogComponentString(m_countStarColName, "column name: ", true, 15).getComponentPanel(), c);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Example 8 with DialogComponentString

use of org.knime.core.node.defaultnodesettings.DialogComponentString in project knime-core by knime.

the class PredictorHelper method addProbabilitySuffix.

/**
 * Adds {@code suffixModel} to {@code dialog}.
 *
 * @param dialog A {@link DefaultNodeSettingsPane}.
 * @param suffixModel The {@link SettingsModelString} to use for the newly created {@link DialogComponentString} for
 *            the probability columns' suffices.
 * @return The newly created {@link DialogComponentString} for the probability columns' suffices.
 */
public DialogComponentString addProbabilitySuffix(final DefaultNodeSettingsPane dialog, final SettingsModelString suffixModel) {
    DialogComponentString ret = new DialogComponentString(suffixModel, "Suffix for probability columns");
    ret.setToolTipText("This suffix will be appended after the \"P ([trainingColumn]=[value])\" columns.");
    dialog.addDialogComponent(ret);
    return ret;
}
Also used : DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString)

Example 9 with DialogComponentString

use of org.knime.core.node.defaultnodesettings.DialogComponentString 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 10 with DialogComponentString

use of org.knime.core.node.defaultnodesettings.DialogComponentString 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

DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)10 DialogComponentBoolean (org.knime.core.node.defaultnodesettings.DialogComponentBoolean)9 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)4 JPanel (javax.swing.JPanel)3 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)3 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Box (javax.swing.Box)2 DialogComponent (org.knime.core.node.defaultnodesettings.DialogComponent)2 DialogComponentNumber (org.knime.core.node.defaultnodesettings.DialogComponentNumber)2 DialogComponentStringSelection (org.knime.core.node.defaultnodesettings.DialogComponentStringSelection)2 SettingsModelInteger (org.knime.core.node.defaultnodesettings.SettingsModelInteger)2 BorderLayout (java.awt.BorderLayout)1 BoxLayout (javax.swing.BoxLayout)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 DialogComponentButtonGroup (org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup)1