Search in sources :

Example 1 with DomainOverflowPolicy

use of org.knime.base.node.preproc.domain.editnumeric.EditNumericDomainNodeModel.DomainOverflowPolicy in project knime-core by knime.

the class EditNumericDomainNodeDialogPane method createMinMaxTab.

private void createMinMaxTab() {
    m_filterPanel = new DataColumnSpecFilterPanel();
    m_filterPanel.setIncludeTitle(" Include ");
    m_filterPanel.setExcludeTitle(" Exclude ");
    m_lowerBField = createTextField("0.0");
    m_upperBField = createTextField("1.0");
    JPanel retainMinMaxPanel = new JPanel(new GridLayout(2, 2));
    retainMinMaxPanel.setBorder(BorderFactory.createTitledBorder("Domain"));
    createBoundedBox(retainMinMaxPanel, m_lowerBField, LOWER_B + ": ");
    createBoundedBox(retainMinMaxPanel, m_upperBField, UPPER_B + ": ");
    Box outOfDomainBox = Box.createVerticalBox();
    outOfDomainBox.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Out of Domain Policy"));
    m_buttonGrp = new ButtonGroup();
    for (final DomainOverflowPolicy handler : DomainOverflowPolicy.values()) {
        JRadioButton jRadioButton = new JRadioButton(handler.getDescription());
        jRadioButton.setActionCommand(handler.toString());
        jRadioButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent e) {
                m_handler = handler;
            }
        });
        m_buttonGrp.add(jRadioButton);
        outOfDomainBox.add(jRadioButton, Component.LEFT_ALIGNMENT);
    }
    JPanel tabpanel = new JPanel();
    tabpanel.setLayout(new BorderLayout());
    tabpanel.add(m_filterPanel, BorderLayout.NORTH);
    tabpanel.add(retainMinMaxPanel, BorderLayout.WEST);
    outOfDomainBox.add(Box.createHorizontalGlue());
    tabpanel.add(outOfDomainBox, BorderLayout.SOUTH);
    addTab("Edit Domain", tabpanel);
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JRadioButton(javax.swing.JRadioButton) DataColumnSpecFilterPanel(org.knime.core.node.util.filter.column.DataColumnSpecFilterPanel) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) ButtonGroup(javax.swing.ButtonGroup) ActionEvent(java.awt.event.ActionEvent) Box(javax.swing.Box) DomainOverflowPolicy(org.knime.base.node.preproc.domain.editnumeric.EditNumericDomainNodeModel.DomainOverflowPolicy)

Aggregations

BorderLayout (java.awt.BorderLayout)1 GridLayout (java.awt.GridLayout)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 Box (javax.swing.Box)1 ButtonGroup (javax.swing.ButtonGroup)1 JPanel (javax.swing.JPanel)1 JRadioButton (javax.swing.JRadioButton)1 DomainOverflowPolicy (org.knime.base.node.preproc.domain.editnumeric.EditNumericDomainNodeModel.DomainOverflowPolicy)1 DataColumnSpecFilterPanel (org.knime.core.node.util.filter.column.DataColumnSpecFilterPanel)1