}
}
}
public void showExplorer(String fileToLoad) {
Explorer expl = null;
if (m_ExplorerFrame == null) {
m_ExplorerBut.setEnabled(false);
m_ExplorerFrame = new JFrame("Weka Explorer");
m_ExplorerFrame.setIconImage(m_Icon);
m_ExplorerFrame.getContentPane().setLayout(new BorderLayout());
expl = new Explorer();
m_ExplorerFrame.getContentPane().add(expl, BorderLayout.CENTER);
m_ExplorerFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent w) {
m_ExplorerFrame.dispose();
m_ExplorerFrame = null;
m_ExplorerBut.setEnabled(true);
checkExit();
}
});
m_ExplorerFrame.pack();
m_ExplorerFrame.setSize(800, 600);
m_ExplorerFrame.setVisible(true);
} else {
Object o = m_ExplorerFrame.getContentPane().getComponent(0);
if (o instanceof Explorer) {
expl = (Explorer)o;
}
}
if (fileToLoad != null) {
try {
weka.core.converters.AbstractFileLoader loader =
weka.core.converters.ConverterUtils.getLoaderForFile(fileToLoad);
loader.setFile(new File(fileToLoad));
expl.getPreprocessPanel().setInstancesFromFile(loader);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}