use of beast.app.draw.BooleanInputEditor in project beast2 by CompEvol.
the class MRCAPriorInputEditor method createTipsonlyEditor.
public InputEditor createTipsonlyEditor() throws NoSuchMethodException, SecurityException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
BooleanInputEditor e = new BooleanInputEditor(doc) {
private static final long serialVersionUID = 1L;
@Override
public void init(Input<?> input, BEASTInterface beastObject, int itemNr, ExpandOption isExpandOption, boolean addButtons) {
super.init(input, beastObject, itemNr, isExpandOption, addButtons);
// hack to get to JCheckBox
Component[] components = getComponents();
((JCheckBox) components[0]).addActionListener(e -> {
JCheckBox src = (JCheckBox) e.getSource();
if (src.isSelected()) {
enableTipSampling();
} else {
disableTipSampling(m_beastObject, doc);
}
});
}
};
MRCAPrior prior = (MRCAPrior) m_beastObject;
Input<?> input = prior.onlyUseTipsInput;
e.init(input, prior, -1, ExpandOption.FALSE, false);
return e;
}
Aggregations