@Override public void run() { try { m_Log.statusMessage("Saving to file..."); saver.setInstances(inst); saver.writeBatch(); m_Log.statusMessage("OK"); } catch (Exception ex) { ex.printStackTrace(); m_Log.logMessage(ex.getMessage()); } m_IOThread = null; } };
/** * Saves the data to the specified file. * * @param file the file to save the data to * @param saver the saver to use, determines it automatically if null */ public void save(File file, AbstractFileSaver saver) { if (saver == null) saver = ConverterUtils.getSaverForFile(file); try { saver.setFile(file); saver.writeBatch(); m_CurrentFile = file; } catch (Exception e) { System.err.println("Failed to save data to '" + file + "':"); e.printStackTrace(); JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + e, "Error saving", JOptionPane.ERROR_MESSAGE); } updateMenu(); }
@Override public void run() { try { m_Log.statusMessage("Saving to file..."); saver.setInstances(inst); saver.writeBatch(); m_Log.statusMessage("OK"); } catch (Exception ex) { ex.printStackTrace(); m_Log.logMessage(ex.getMessage()); } m_IOThread = null; } };
saver.writeBatch(); } catch (Exception ex) { ex.printStackTrace();
saver.writeBatch(); } catch (Exception ex) { ex.printStackTrace();
saver.writeBatch();
saver = fc.getSaver(); saver.setInstances(data); saver.writeBatch(); } else { System.out.println("Saving aborted!");
saver = fc.getSaver(); saver.setInstances(data); saver.writeBatch(); } else { System.out.println("Saving aborted!");
/** * Exports the data to a file. */ protected void export() { int retVal; File file; AbstractFileSaver saver; if (m_FileChooser == null) m_FileChooser = GUIHelper.newConverterFileChooser(); retVal = m_FileChooser.showSaveDialog(this); if (retVal != ConverterFileChooser.APPROVE_OPTION) return; file = m_FileChooser.getSelectedFile(); saver = m_FileChooser.getSaver(); try { saver.setInstances(m_DataPanel.getInstances()); saver.writeBatch(); } catch (Exception e) { JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + Utils.throwableToString(e), "Error saving", JOptionPane.ERROR_MESSAGE); } // TODO }
/** * Exports the data to a file. */ protected void export() { int retVal; File file; AbstractFileSaver saver; if (m_FileChooser == null) m_FileChooser = GUIHelper.newConverterFileChooser(); retVal = m_FileChooser.showSaveDialog(this); if (retVal != ConverterFileChooser.APPROVE_OPTION) return; file = m_FileChooser.getSelectedFile(); saver = m_FileChooser.getSaver(); try { saver.setInstances(m_DataPanel.getInstances()); saver.writeBatch(); } catch (Exception e) { JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + Utils.throwableToString(e), "Error saving", JOptionPane.ERROR_MESSAGE); } // TODO }
/** * Saves the data to the specified file. * * @param file the file to save the data to * @param saver the saver to use, determines it automatically if null */ public void save(File file, AbstractFileSaver saver) { if (saver == null) saver = ConverterUtils.getSaverForFile(file); try { log(null, "Saving: " + file); saver.setInstances(m_Data); if ((saver.retrieveFile() == null) || !saver.retrieveFile().equals(file)) saver.setFile(file); saver.writeBatch(); m_CurrentFile = file; log(null, "Saved successfully: " + file); } catch (Exception e) { handleException(null, "Failed to save data to '" + file + "':", e); JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + e, "Error saving", JOptionPane.ERROR_MESSAGE); } updateMenu(); }
/** * Saves the data to the specified file. * * @param file the file to save the data to * @param saver the saver to use, determines it automatically if null */ public void save(File file, AbstractFileSaver saver) { if (saver == null) saver = ConverterUtils.getSaverForFile(file); try { log(null, "Saving: " + file); saver.setInstances(m_Data); if ((saver.retrieveFile() == null) || !saver.retrieveFile().equals(file)) saver.setFile(file); saver.writeBatch(); m_CurrentFile = file; log(null, "Saved successfully: " + file); } catch (Exception e) { handleException(null, "Failed to save data to '" + file + "':", e); JOptionPane.showMessageDialog( this, "Failed to save dataset to '" + file + "':\n" + e, "Error saving", JOptionPane.ERROR_MESSAGE); } updateMenu(); }
saver.setInstances(panel.getInstances()); try { saver.writeBatch(); panel.setChanged(false); } catch (IOException e) {
saver.setInstances(panel.getInstances()); try { saver.writeBatch(); panel.setChanged(false); } catch (IOException e) {
saver.setInstances(panel.getInstances()); try { saver.writeBatch(); panel.setChanged(false); } catch (IOException e) {
saver.setInstances(panel.getInstances()); try { saver.writeBatch(); panel.setChanged(false); } catch (IOException e) {
saver.writeBatch(); System.out.println("Predictions saved to: " + predictions);
saver.writeBatch(); System.out.println("Predictions saved to: " + predictions);
saver.writeBatch(); System.out.println("Predictions saved to: " + predictions);