/** * Applies the selected converter * * @param cnv the converter to apply to the input file * @param f the input file */ private void tryConverter(final Loader cnv, final File f) { if (m_IOThread == null) { m_IOThread = new Thread() { @Override public void run() { try { cnv.setSource(f); Instances inst = cnv.getDataSet(); setInstances(inst); } catch (Exception ex) { m_Log.statusMessage(cnv.getClass().getName()+" failed to load " +f.getName()); JOptionPane.showMessageDialog(PreprocessPanel.this, cnv.getClass().getName()+" failed to load '" + f.getName() + "'.\n" + "Reason:\n" + ex.getMessage(), "Convert File", JOptionPane.ERROR_MESSAGE); m_IOThread = null; converterQuery(f); } m_IOThread = null; } }; m_IOThread.setPriority(Thread.MIN_PRIORITY); // UI has most priority m_IOThread.start(); } }
/** * Applies the selected converter * * @param cnv the converter to apply to the input file * @param f the input file */ private void tryConverter(final Loader cnv, final File f) { if (m_IOThread == null) { m_IOThread = new Thread() { public void run() { try { cnv.setSource(f); Instances inst = cnv.getDataSet(); setInstances(inst); } catch (Exception ex) { m_Log.statusMessage(cnv.getClass().getName()+" failed to load " +f.getName()); JOptionPane.showMessageDialog(PreprocessPanel.this, cnv.getClass().getName()+" failed to load '" + f.getName() + "'.\n" + "Reason:\n" + ex.getMessage(), "Convert File", JOptionPane.ERROR_MESSAGE); m_IOThread = null; converterQuery(f); } m_IOThread = null; } }; m_IOThread.setPriority(Thread.MIN_PRIORITY); // UI has most priority m_IOThread.start(); } }
/** * Applies the selected converter * * @param cnv the converter to apply to the input file * @param f the input file */ private void tryConverter(final Loader cnv, final File f) { if (m_IOThread == null) { m_IOThread = new Thread() { public void run() { try { cnv.setSource(f); Instances inst = cnv.getDataSet(); setInstances(inst); } catch (Exception ex) { m_Log.statusMessage(cnv.getClass().getName()+Messages.getInstance().getString("PreprocessPanel_TryConverter_Log_StatusMessage_Text") +f.getName()); JOptionPane.showMessageDialog(PreprocessPanel.this, cnv.getClass().getName()+Messages.getInstance().getString("PreprocessPanel_TryConverter_JOptionPaneShowMessageDialog_Text_First") + f.getName() + Messages.getInstance().getString("PreprocessPanel_TryConverter_JOptionPaneShowMessageDialog_Text_Second") + Messages.getInstance().getString("PreprocessPanel_TryConverter_JOptionPaneShowMessageDialog_Text_Third") + ex.getMessage(), Messages.getInstance().getString("PreprocessPanel_TryConverter_JOptionPaneShowMessageDialog_Text_Fourth"), JOptionPane.ERROR_MESSAGE); m_IOThread = null; converterQuery(f); } m_IOThread = null; } }; m_IOThread.setPriority(Thread.MIN_PRIORITY); // UI has most priority m_IOThread.start(); } }