Search in sources :

Example 6 with ColumnSelectionPanel

use of org.knime.core.node.util.ColumnSelectionPanel 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;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) DoubleValue(org.knime.core.data.DoubleValue) JLabel(javax.swing.JLabel) ColumnSelectionComboxBox(org.knime.core.node.util.ColumnSelectionComboxBox) ColumnSelectionPanel(org.knime.core.node.util.ColumnSelectionPanel) StringValue(org.knime.core.data.StringValue) DataValueColumnFilter(org.knime.core.node.util.DataValueColumnFilter) Border(javax.swing.border.Border)

Example 7 with ColumnSelectionPanel

use of org.knime.core.node.util.ColumnSelectionPanel in project knime-core by knime.

the class RuleEngine2PortsNodeDialog method addAppendOrReplace.

/**
 * {@inheritDoc} it adds the replace or append controls (radiobuttons, textfield and column selector).
 */
@Override
protected void addAppendOrReplace(final JPanel panel, final GridBagConstraints gbc) {
    m_append = new JRadioButton("Append column");
    panel.add(m_append, gbc);
    gbc.gridx++;
    gbc.weightx = 1;
    gbc.gridwidth = 4;
    m_appendColumn = Util.createTextFieldWithWatermark("Prediction", 22, "Computed column name");
    panel.add(m_appendColumn, gbc);
    gbc.gridy++;
    gbc.weightx = 0;
    gbc.gridx = 0;
    gbc.gridwidth = 1;
    m_replace = new JRadioButton("Replace column");
    panel.add(m_replace, gbc);
    gbc.gridx++;
    gbc.weightx = 1;
    gbc.gridwidth = 4;
    m_replaceColumn = new ColumnSelectionPanel((String) null);
    panel.add(m_replaceColumn, gbc);
    gbc.gridy++;
}
Also used : JRadioButton(javax.swing.JRadioButton) ColumnSelectionPanel(org.knime.core.node.util.ColumnSelectionPanel)

Example 8 with ColumnSelectionPanel

use of org.knime.core.node.util.ColumnSelectionPanel in project knime-core by knime.

the class OneWayANOVANodeDialog method createPanel.

/**
 * Create the configuration panel.
 */
@SuppressWarnings("unchecked")
private Component createPanel() {
    JPanel p = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.BASELINE;
    c.insets = new Insets(2, 2, 2, 2);
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    Insets leftInsets = new Insets(3, 8, 3, 8);
    Insets rightInsets = new Insets(3, 0, 3, 8);
    Insets leftCategoryInsets = new Insets(11, 8, 3, 8);
    Insets rightCategoryInsets = new Insets(11, 0, 3, 8);
    c.gridx = 0;
    c.insets = leftCategoryInsets;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    p.add(new JLabel("Grouping column:"), c);
    c.gridx++;
    c.insets = rightCategoryInsets;
    m_groupingColumn = new ColumnSelectionPanel(NominalValue.class, DoubleValue.class);
    m_groupingColumn.setBorder(null);
    p.add(m_groupingColumn, c);
    c.gridx = 0;
    c.gridy++;
    c.insets = leftInsets;
    c.weightx = 0;
    p.add(new JLabel("Confidence Interval (in %):"), c);
    c.gridx++;
    c.insets = rightInsets;
    m_confidenceIntervalProb = new JTextField("95");
    p.add(m_confidenceIntervalProb, c);
    c.gridx = 0;
    c.gridy++;
    c.insets = leftInsets;
    c.gridwidth = 3;
    c.weighty = 1;
    c.weightx = 1;
    m_testColumns = new DataColumnSpecFilterPanel(DoubleValue.class);
    m_testColumns.setBorder(BorderFactory.createTitledBorder("Test columns"));
    p.add(m_testColumns, c);
    // dummy panel to make the controls smaller above the last component
    // (the DataColumnSpecFilterPanel).
    c.gridheight = c.gridy;
    c.gridx = 2;
    c.gridy = 0;
    c.weighty = 1;
    c.weightx = 1;
    c.gridwidth = 1;
    p.add(new JPanel(), c);
    return p;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) DataColumnSpecFilterPanel(org.knime.core.node.util.filter.column.DataColumnSpecFilterPanel) DoubleValue(org.knime.core.data.DoubleValue) NominalValue(org.knime.core.data.NominalValue) JLabel(javax.swing.JLabel) ColumnSelectionPanel(org.knime.core.node.util.ColumnSelectionPanel) JTextField(javax.swing.JTextField)

Example 9 with ColumnSelectionPanel

use of org.knime.core.node.util.ColumnSelectionPanel in project knime-core by knime.

the class TwoSampleTTestNodeDialog method createPanel.

/**
 * Create the configuration panel.
 */
@SuppressWarnings("unchecked")
private Component createPanel() {
    JPanel p = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.BASELINE;
    c.insets = new Insets(2, 2, 2, 2);
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    Insets leftInsets = new Insets(3, 8, 3, 8);
    Insets rightInsets = new Insets(3, 0, 3, 8);
    Insets leftCategoryInsets = new Insets(11, 8, 3, 8);
    Insets rightCategoryInsets = new Insets(11, 0, 3, 8);
    c.gridx = 0;
    c.insets = leftCategoryInsets;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    p.add(new JLabel("Grouping column:"), c);
    c.gridx++;
    c.insets = rightCategoryInsets;
    m_groupingColumn = new ColumnSelectionPanel(NominalValue.class, DoubleValue.class);
    m_groupingColumn.setBorder(null);
    m_groupingColumn.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            initGroupComboBoxes();
        }
    });
    p.add(m_groupingColumn, c);
    c.gridx = 0;
    c.gridy++;
    c.insets = leftInsets;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    p.add(new JLabel("Group one:"), c);
    c.gridx++;
    c.weightx = 0.5;
    c.insets = rightInsets;
    m_groupOne = new JComboBox();
    m_groupOne.setEditable(true);
    p.add(m_groupOne, c);
    c.gridx = 0;
    c.gridy++;
    c.insets = leftInsets;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    p.add(new JLabel("Group two:"), c);
    c.gridx++;
    c.weightx = 0.5;
    c.insets = rightInsets;
    m_groupTwo = new JComboBox();
    m_groupTwo.setEditable(true);
    p.add(m_groupTwo, c);
    c.gridx = 0;
    c.gridy++;
    c.insets = leftInsets;
    c.weightx = 0;
    p.add(new JLabel("Confidence Interval (in %):"), c);
    c.gridx++;
    c.insets = rightInsets;
    m_confidenceIntervalProb = new JTextField("95");
    p.add(m_confidenceIntervalProb, c);
    c.gridx = 0;
    c.gridy++;
    c.insets = leftInsets;
    c.gridwidth = 3;
    c.weighty = 1;
    c.weightx = 1;
    m_testColumns = new DataColumnSpecFilterPanel(DoubleValue.class);
    m_testColumns.setBorder(BorderFactory.createTitledBorder("Test columns"));
    p.add(m_testColumns, c);
    // dummy panel to make the controls smaller above the last component
    // (the DataColumnSpecFilterPanel).
    c.gridheight = c.gridy;
    c.gridx = 2;
    c.gridy = 0;
    c.weighty = 1;
    c.weightx = 1;
    c.gridwidth = 1;
    p.add(new JPanel(), c);
    return p;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) NominalValue(org.knime.core.data.NominalValue) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) ActionListener(java.awt.event.ActionListener) DataColumnSpecFilterPanel(org.knime.core.node.util.filter.column.DataColumnSpecFilterPanel) DoubleValue(org.knime.core.data.DoubleValue) ColumnSelectionPanel(org.knime.core.node.util.ColumnSelectionPanel)

Aggregations

ColumnSelectionPanel (org.knime.core.node.util.ColumnSelectionPanel)9 JLabel (javax.swing.JLabel)7 JPanel (javax.swing.JPanel)6 GridBagConstraints (java.awt.GridBagConstraints)5 GridBagLayout (java.awt.GridBagLayout)5 Insets (java.awt.Insets)5 ActionEvent (java.awt.event.ActionEvent)5 ActionListener (java.awt.event.ActionListener)5 JCheckBox (javax.swing.JCheckBox)5 JTextField (javax.swing.JTextField)4 JRadioButton (javax.swing.JRadioButton)3 Border (javax.swing.border.Border)3 DoubleValue (org.knime.core.data.DoubleValue)3 NominalValue (org.knime.core.data.NominalValue)3 ItemEvent (java.awt.event.ItemEvent)2 ItemListener (java.awt.event.ItemListener)2 ButtonGroup (javax.swing.ButtonGroup)2 JComboBox (javax.swing.JComboBox)2 EmptyBorder (javax.swing.border.EmptyBorder)2 DataCell (org.knime.core.data.DataCell)2