GenericObjectEditor.registerEditors();
GenericObjectEditor ce = new GenericObjectEditor(true);
ce.setClassType(weka.classifiers.Classifier.class);
ce.setValue(m_BayesNet);
PropertyDialog pd;
if (PropertyDialog.getParentDialog(GUI.this) != null)
pd = new PropertyDialog(PropertyDialog.getParentDialog(GUI.this), ce, 100, 100);
else
pd = new PropertyDialog(PropertyDialog.getParentFrame(GUI.this), ce, 100, 100);
pd.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
PropertyEditor pe = ((PropertyDialog) e.getSource()).getEditor();
Object c = (Object) pe.getValue();
String options = "";
if (c instanceof OptionHandler) {
options = Utils.joinOptions(((OptionHandler) c).getOptions());
try {
m_BayesNet.setOptions(((OptionHandler) c).getOptions());
} catch (Exception e2) {
e2.printStackTrace();
}
}
System.out.println(c.getClass().getName() + " " + options);
System.exit(0);
}
});
pd.setVisible(true);
} catch (Exception ex) {
ex.printStackTrace();
System.err.println(ex.getMessage());
}
m_BayesNet.clearUndoStack();