Search in sources :

Example 1 with AlgType

use of edu.cmu.tetrad.annotation.AlgType in project tetrad by cmu-phil.

the class GeneralAlgorithmEditor method populateAlgoTypeOptions.

/**
 * Create new radio buttons and add them to both the radio button list and
 * radio button group.
 *
 * @param radioButtons
 */
private void populateAlgoTypeOptions(List<JRadioButton> radioButtons) {
    JRadioButton showAllRadBtn = new JRadioButton("show all");
    showAllRadBtn.setActionCommand("all");
    showAllRadBtn.addActionListener((e) -> {
        algoTypeSelectAction(e);
    });
    radioButtons.add(showAllRadBtn);
    algoFilterBtnGrp.add(showAllRadBtn);
    for (AlgType item : AlgType.values()) {
        String name = item.name();
        JRadioButton radioButton = new JRadioButton(name.replace("_", " "));
        radioButton.setActionCommand(name);
        radioButton.addActionListener((e) -> {
            algoTypeSelectAction(e);
        });
        radioButtons.add(radioButton);
        algoFilterBtnGrp.add(radioButton);
    }
}
Also used : JRadioButton(javax.swing.JRadioButton) AlgType(edu.cmu.tetrad.annotation.AlgType)

Aggregations

AlgType (edu.cmu.tetrad.annotation.AlgType)1 JRadioButton (javax.swing.JRadioButton)1