/** * Loads results from a set of instances contained in the supplied file. * * @param f a value of type 'File' */ protected void setInstancesFromFile(File f) { boolean incremental = m_readIncrementally; try { // m_Loader = ConverterUtils.getLoaderForFile(f); m_Loader = m_FileChooser.getLoader(); if (m_Loader == null) throw new Exception( "No suitable FileSourcedConverter found for file!\n" + f); // not an incremental loader? if (!(m_Loader instanceof IncrementalConverter)) incremental = false; // load ((FileSourcedConverter) m_Loader).setFile(f); if (incremental) { m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown); setInstances(m_Loader.getStructure()); } else { // If we are batch loading then we will know for sure that // the data has no instances m_Summary.setShowZeroInstancesAsUnknown(false); setInstances(m_Loader.getDataSet()); } } catch (Exception ex) { JOptionPane.showMessageDialog(this, "Couldn't read from file:\n" + f.getName(), "Load Instances", JOptionPane.ERROR_MESSAGE); } }
/** * Loads instances from a URL. * * @param u the URL to load from. */ protected void setInstancesFromURL(URL u) { boolean incremental = m_readIncrementally; try { m_Loader = ConverterUtils.getURLLoaderForFile(u.toString()); if (m_Loader == null) throw new Exception("No suitable URLSourcedLoader found for URL!\n" + u); // not an incremental loader? if (!(m_Loader instanceof IncrementalConverter)) incremental = false; // load ((URLSourcedLoader) m_Loader).setURL(u.toString()); if (incremental) { m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown); setInstances(m_Loader.getStructure()); } else { m_Summary.setShowZeroInstancesAsUnknown(false); setInstances(m_Loader.getDataSet()); } } catch (Exception ex) { JOptionPane.showMessageDialog(this, "Couldn't read from URL:\n" + u, "Load Instances", JOptionPane.ERROR_MESSAGE); } }
/** * Loads results from a set of instances contained in the supplied * file. * * @param f a value of type 'File' */ protected void setInstancesFromFile(File f) { boolean incremental = m_readIncrementally; try { m_Loader = ConverterUtils.getLoaderForFile(f); if (m_Loader == null) throw new Exception("No suitable FileSourcedConverter found for file!\n" + f); // not an incremental loader? if (!(m_Loader instanceof IncrementalConverter)) incremental = false; // load ((FileSourcedConverter) m_Loader).setFile(f); if (incremental) { m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown); setInstances(m_Loader.getStructure()); } else { // If we are batch loading then we will know for sure that // the data has no instances m_Summary.setShowZeroInstancesAsUnknown(false); setInstances(m_Loader.getDataSet()); } } catch (Exception ex) { JOptionPane.showMessageDialog(this, "Couldn't read from file:\n" + f.getName(), "Load Instances", JOptionPane.ERROR_MESSAGE); } }
/** * Loads results from a set of instances contained in the supplied file. * * @param f a value of type 'File' */ protected void setInstancesFromFile(File f) { boolean incremental = m_readIncrementally; try { m_Loader = ConverterUtils.getLoaderForFile(f); if (m_Loader == null) throw new Exception(Messages.getInstance().getString( "SetInstancesPanel_SetInstancesFromFile_Exception_Text_First") + f); // not an incremental loader? if (!(m_Loader instanceof IncrementalConverter)) incremental = false; // load ((FileSourcedConverter) m_Loader).setFile(f); if (incremental) { m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown); setInstances(m_Loader.getStructure()); } else { m_Summary.setShowZeroInstancesAsUnknown(false); setInstances(m_Loader.getDataSet()); } } catch (Exception ex) { JOptionPane .showMessageDialog( this, Messages .getInstance() .getString( "SetInstancesPanel_SetInstancesFromFile_Exception_JOptionPaneShowMessageDialog_Text_First") + f.getName(), Messages .getInstance() .getString( "SetInstancesPanel_SetInstancesFromFile_Exception_JOptionPaneShowMessageDialog_Text_Second"), JOptionPane.ERROR_MESSAGE); } }
/** * Loads instances from a URL. * * @param u the URL to load from. */ protected void setInstancesFromURL(URL u) { boolean incremental = m_readIncrementally; try { m_Loader = ConverterUtils.getURLLoaderForFile(u.toString()); if (m_Loader == null) throw new Exception(Messages.getInstance().getString( "SetInstancesPanel_SetInstancesFromURL_Exception_Text_First") + u); // not an incremental loader? if (!(m_Loader instanceof IncrementalConverter)) incremental = false; // load ((URLSourcedLoader) m_Loader).setURL(u.toString()); if (incremental) { m_Summary.setShowZeroInstancesAsUnknown(m_showZeroInstancesAsUnknown); setInstances(m_Loader.getStructure()); } else { m_Summary.setShowZeroInstancesAsUnknown(false); setInstances(m_Loader.getDataSet()); } } catch (Exception ex) { JOptionPane .showMessageDialog( this, Messages .getInstance() .getString( "SetInstancesPanel_SetInstancesFromURL_Exception_JOptionPaneShowMessageDialog_Text_First") + u, Messages .getInstance() .getString( "SetInstancesPanel_SetInstancesFromURL_Exception_JOptionPaneShowMessageDialog_Text_Second"), JOptionPane.ERROR_MESSAGE); } }