Search in sources :

Example 1 with RankMode

use of org.knime.base.node.preproc.rank.RankNodeModel.RankMode in project knime-core by knime.

the class RankNodeDialog method initPanel.

private JPanel initPanel() {
    JPanel jp = new JPanel();
    jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
    Box rankColSelection = Box.createHorizontalBox();
    // add column list
    Box rankCols = initRankTableBox();
    rankColSelection.add(rankCols);
    // add buttons
    Box rankButtonBox = initRankButtonBox();
    rankColSelection.add(rankButtonBox);
    Box groupColSelection = Box.createHorizontalBox();
    groupColSelection.add(initGroupTableBox());
    groupColSelection.add(initGroupButtonBox());
    Box otherOptions = Box.createHorizontalBox();
    otherOptions.add(Box.createHorizontalGlue());
    Box modusBox = Box.createHorizontalBox();
    modusBox.setBorder(new TitledBorder("Ranking Mode"));
    modusBox.add(new JLabel("Mode:  "));
    Box radioPanel = Box.createVerticalBox();
    ButtonGroup modusGroup = new ButtonGroup();
    m_modusGroup = modusGroup;
    for (RankMode rankMode : RankMode.values()) {
        JRadioButton radio = new JRadioButton(rankMode.toString());
        modusGroup.add(radio);
        radioPanel.add(radio);
        if (m_rankMode.getStringValue().equals(radio.getText())) {
            radio.setSelected(true);
        }
    }
    modusBox.add(radioPanel);
    otherOptions.add(modusBox);
    otherOptions.add(Box.createHorizontalGlue());
    otherOptions.add(initOtherOptionsBox());
    otherOptions.add(Box.createHorizontalGlue());
    jp.add(rankColSelection);
    jp.add(groupColSelection);
    jp.add(otherOptions);
    otherOptions.revalidate();
    otherOptions.repaint();
    return jp;
}
Also used : JPanel(javax.swing.JPanel) JRadioButton(javax.swing.JRadioButton) ButtonGroup(javax.swing.ButtonGroup) RankMode(org.knime.base.node.preproc.rank.RankNodeModel.RankMode) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) TitledBorder(javax.swing.border.TitledBorder)

Aggregations

Box (javax.swing.Box)1 BoxLayout (javax.swing.BoxLayout)1 ButtonGroup (javax.swing.ButtonGroup)1 JCheckBox (javax.swing.JCheckBox)1 JComboBox (javax.swing.JComboBox)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JRadioButton (javax.swing.JRadioButton)1 TitledBorder (javax.swing.border.TitledBorder)1 RankMode (org.knime.base.node.preproc.rank.RankNodeModel.RankMode)1