<commit_before>package beast.app.draw;

import javax.swing.Box;
import javax.swing.JCheckBox;

import beast.app.beauti.BeautiDoc;
import beast.core.BEASTInterface;
import beast.core.Input;
import beast.core.util.Log;



public class BooleanInputEditor extends InputEditor.Base {
    public BooleanInputEditor(BeautiDoc doc) {
		super(doc);
	}
    //public BooleanInputEditor() {}

	private static final long serialVersionUID = 1L;
    JCheckBox m_entry;


    @Override
    public Class<?> type() {
        return Boolean.class;
    }

    /**
     * create input editor containing a check box *
     */
    @Override
    public void init(Input<?> input, BEASTInterface beastObject, int itemNr, ExpandOption isExpandOption, boolean addButtons) {
        m_bAddButtons = addButtons;
        m_beastObject = beastObject;
        m_input = input;
		this.itemNr = itemNr;
        m_entry = new JCheckBox(formatName(m_input.getName()));
        if (input.get() != null) {
            m_entry.setSelected((Boolean) input.get());
        }
        m_entry.setToolTipText(input.getHTMLTipText());
        m_entry.addActionListener(e -> {
                try {
                	setValue(m_entry.isSelected());
                    validateInput();
                    //m_input.setValue(m_entry.isSelected(), m_beastObject);
                } catch (Exception ex) {
                    Log.err.println("BooleanInputEditor " + ex.getMessage());
                }
            });
        add(m_entry);
        add(Box.createHorizontalGlue());
    } // c'tor

} // class BooleanInputEditor<commit_msg>force refresh of model after a boolean parameter is changed in BEAUti. fixes #292<commit_after>package beast.app.draw;

import javax.swing.Box;
import javax.swing.JCheckBox;

import beast.app.beauti.BeautiDoc;
import beast.core.BEASTInterface;
import beast.core.Input;
import beast.core.util.Log;



public class BooleanInputEditor extends InputEditor.Base {
    public BooleanInputEditor(BeautiDoc doc) {
		super(doc);
	}
    //public BooleanInputEditor() {}

	private static final long serialVersionUID = 1L;
    JCheckBox m_entry;


    @Override
    public Class<?> type() {
        return Boolean.class;
    }

    /**
     * create input editor containing a check box *
     */
    @Override
    public void init(Input<?> input, BEASTInterface beastObject, int itemNr, ExpandOption isExpandOption, boolean addButtons) {
        m_bAddButtons = addButtons;
        m_beastObject = beastObject;
        m_input = input;
		this.itemNr = itemNr;
        m_entry = new JCheckBox(formatName(m_input.getName()));
        if (input.get() != null) {
            m_entry.setSelected((Boolean) input.get());
        }
        m_entry.setToolTipText(input.getHTMLTipText());
        m_entry.addActionListener(e -> {
                try {
                	setValue(m_entry.isSelected());
                	refreshPanel();
                    //validateInput();
                    //m_input.setValue(m_entry.isSelected(), m_beastObject);
                } catch (Exception ex) {
                    Log.err.println("BooleanInputEditor " + ex.getMessage());
                }
            });
        add(m_entry);
        add(Box.createHorizontalGlue());
    } // c'tor

} // class BooleanInputEditor
{'fraction_non_alphanumeric': 0.10887465690759378, 'fraction_numerical': 0.0015248551387618177, 'mean_word_length': 2.3572159672466735, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3821491', 'n_tokens_mistral': 966, 'n_tokens_neox': 946, 'n_words': 197}