final javax.swing.JFrame jf =
new javax.swing.JFrame("Weka Classifier Tree Visualizer: "+treeName);
jf.setSize(500,400);
jf.getContentPane().setLayout(new BorderLayout());
if (graphString.contains("digraph")) {
TreeVisualizer tv = new TreeVisualizer(null,
graphString,
new PlaceNode2());
jf.getContentPane().add(tv, BorderLayout.CENTER);
jf.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
jf.dispose();
}
});
jf.setVisible(true);
tv.fitToScreen();
} else if (graphString.startsWith("Newick:")) {
HierarchyVisualizer tv = new HierarchyVisualizer(graphString.substring(7));
jf.getContentPane().add(tv, BorderLayout.CENTER);
jf.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
jf.dispose();
}
});
jf.setVisible(true);
tv.fitToScreen();
}
}