/* m_classifiers = new GenericObjectEditor();
m_classifiers.setClassType(Classifier.class);
m_classifiers.setValue(new weka.classifiers.rules.ZeroR());
((GenericObjectEditor.GOEPanel)m_classifiers.getCustomEditor())
.addOkListener(this); */
m_tView = new TreeVisualizer(UserClassifier.this, graph(),
new PlaceNode2());
m_tView.setHighlight(m_focus.m_identity);
m_reps.setComponentAt(0, m_tView);
m_iView.setShapes(null);
} catch(Exception er) {
System.out.println("Error : " + er);
System.out.println("Part of user input so had to catch here");
JOptionPane.showMessageDialog(
null,
"Unable to use " + m_focus.getClassifier().getClass().getName()
+ " at this node.\n"
+ "This exception was produced:\n"
+ er.toString(),
"UserClassifier",
JOptionPane.ERROR_MESSAGE);
}
}
});
m_built = false;
m_mainWin = new JFrame();
m_mainWin.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
int well = JOptionPane.showConfirmDialog(m_mainWin,
"Are You Sure...\n"
+ "Click Yes To Accept"
+ " The Tree"
+ "\n Click No To Return",
"Accept Tree",
JOptionPane.YES_NO_OPTION);
if (well == 0) {
m_mainWin.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
blocker(false);
}
else {
m_mainWin.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
}
}
});
m_reps = new JTabbedPane();
m_mainWin.getContentPane().add(m_reps);
//make a backup of the instances so that any changes don't go past here.
Instances te = new Instances(i, i.numInstances());
for (int noa = 0; noa < i.numInstances(); noa++) {
te.add(i.instance(noa));
}
te.deleteWithMissingClass(); //remove all instances with a missing class
//from training
m_top = new TreeClass(null, 0, 0, m_nextId, 1, te, null);
m_focus = m_top;
//System.out.println(graph());
m_tView = new TreeVisualizer(this, graph(), new PlaceNode1());
m_reps.add("Tree Visualizer", m_tView);
//tree_frame = new JFrame();
//tree_frame.getContentPane().add(m_tView);
//tree_frame.setSize(800,600);