/** * Set the current open DarwinCSV. You should really, really, really setCurrentCSV(null) before * you load a new DarwinCSV. * * @param csv The new DarwinCSV object. */ private void setCurrentCSV(DarwinCSV csv) { // Clear the old currentCSV object and matchAgainst object. currentCSV = null; matchAgainst(null); // Load the new currentCSV object. currentCSV = csv; table.removeAll(); table.setDefaultRenderer(Name.class, this); // Set the currentCSV // TODO: This causes an exception occasionally, because we shouldn't // be calling setModel outside of the Event Queue thread; however, we're // currently in a worker thread, so dipping back into the Event thread // would just cause more problems. Sorry! if (csv != null) { table.setModel(currentCSV.getRowIndex()); } else { table.setModel(blankDataModel); } columnInfoPanel.loadedFileChanged(csv); columnInfoPanel.columnChanged(-1); table.repaint(); }
/** * Set the DarwinCSV to match this against. * * @param against The DarwinCSV object to match against. */ private void matchAgainst(DarwinCSV against) { // System.err.println("matchAgainst: " + against); // Reset previous match information. currentMatch = null; table.repaint(); // If all we're doing is a reset, we can get out now. if (against == null) return; // long t1 = System.currentTimeMillis(); currentMatch = currentCSV.getRowIndex().matchAgainst(against.getRowIndex()); table.repaint(); matchInfoPanel.matchChanged(currentMatch); // long t2 = System.currentTimeMillis(); // System.err.println("matchAgainst finished: " + (t2 - t1) + " ms"); }