Search in sources :

Example 11 with DialogComponentBoolean

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

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

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

the class ParameterizedDBQueryPanel method createOptionsPanel.

private JPanel createOptionsPanel() {
    final JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLoweredBevelBorder(), BorderFactory.createTitledBorder("Options")));
    final Box optionsBox = Box.createHorizontalBox();
    optionsBox.add(new DialogComponentBoolean(m_appendInputColsModel, "Append input columns").getComponentPanel());
    optionsBox.add(new DialogComponentBoolean(m_includeEmptyResultsModel, "Include empty results").getComponentPanel());
    optionsBox.add(new DialogComponentBoolean(m_retainAllColumnsModel, "Retain all columns").getComponentPanel());
    optionsBox.add(new DialogComponentBoolean(m_failIfExceptionModel, "Fail on error").getComponentPanel());
    panel.add(optionsBox, BorderLayout.CENTER);
    m_appendInputColsModel.addChangeListener(l -> {
        m_includeEmptyResultsModel.setEnabled(m_appendInputColsModel.getBooleanValue());
        m_retainAllColumnsModel.setEnabled(m_appendInputColsModel.getBooleanValue());
    });
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) Box(javax.swing.Box)

Example 14 with DialogComponentBoolean

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

the class AppendElementOperator method getDC.

/**
 * @return
 */
private DialogComponent getDC() {
    if (m_filterMissingDC == null) {
        m_filterMissingDC = new DialogComponentBoolean(m_filterMissing, "Filter missing collection elements");
        m_filterMissingDC.setToolTipText("Tick this option to filter missing collection elements");
    }
    return m_filterMissingDC;
}
Also used : DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Example 15 with DialogComponentBoolean

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

the class NumericOutliersNodeDialogPane method createSettingsDialog.

/**
 * Creates the settings panel.
 *
 * @return the settings panel
 */
private JPanel createSettingsDialog() {
    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;
    gbc.weighty = 0;
    // add panel border
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), SETTINGS_BORDER_TITLE));
    // add IQR scale dialog
    m_scalarDialog = new DialogComponentNumberEdit(NumericOutliersNodeModel.createScalarModel(), QUARTILE_RANGE_MULT);
    panel.add(m_scalarDialog.getComponentPanel(), gbc);
    ++gbc.gridy;
    // add the update domain dialog
    m_updateDomainDialog = new DialogComponentBoolean(NumericOutliersNodeModel.createDomainModel(), DOMAIN_POLICY);
    panel.add(m_updateDomainDialog.getComponentPanel(), gbc);
    ++gbc.gridy;
    // add the heuristic dialog
    m_heuristicDialog = new DialogComponentBoolean(NumericOutliersNodeModel.createHeuristicModel(), HEURISTIC_LABEL);
    panel.add(m_heuristicDialog.getComponentPanel(), gbc);
    ++gbc.gridy;
    // add a component to select the percentile estimation type
    List<String> eTypes = Arrays.stream(EstimationType.values()).map(val -> val.toString()).collect(Collectors.toList());
    m_estimationDialog = new DialogComponentStringSelection(NumericOutliersNodeModel.createEstimationModel(), ESTIMATION_TYPE, eTypes);
    panel.add(m_estimationDialog.getComponentPanel(), gbc);
    return panel;
}
Also used : Insets(java.awt.Insets) Arrays(java.util.Arrays) NodeSettingsRO(org.knime.core.node.NodeSettingsRO) NumericOutliersReplacementStrategy(org.knime.base.algorithms.outlier.options.NumericOutliersReplacementStrategy) InvalidSettingsException(org.knime.core.node.InvalidSettingsException) DialogComponent(org.knime.core.node.defaultnodesettings.DialogComponent) NodeDialogPane(org.knime.core.node.NodeDialogPane) NotConfigurableException(org.knime.core.node.NotConfigurableException) NumericOutliersDetectionOption(org.knime.base.algorithms.outlier.options.NumericOutliersDetectionOption) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) EstimationType(org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType) ChangeListener(javax.swing.event.ChangeListener) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) ChangeEvent(javax.swing.event.ChangeEvent) NumericOutliersTreatmentOption(org.knime.base.algorithms.outlier.options.NumericOutliersTreatmentOption) DialogComponentColumnFilter2(org.knime.core.node.defaultnodesettings.DialogComponentColumnFilter2) PortObjectSpec(org.knime.core.node.port.PortObjectSpec) BorderFactory(javax.swing.BorderFactory) GridBagConstraints(java.awt.GridBagConstraints) Component(java.awt.Component) Collectors(java.util.stream.Collectors) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString) NodeSettingsWO(org.knime.core.node.NodeSettingsWO) Dimension(java.awt.Dimension) List(java.util.List) GridBagLayout(java.awt.GridBagLayout) JPanel(javax.swing.JPanel) DialogComponentNumberEdit(org.knime.core.node.defaultnodesettings.DialogComponentNumberEdit) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DialogComponentNumberEdit(org.knime.core.node.defaultnodesettings.DialogComponentNumberEdit) DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) 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