| 759 | } |
| 760 | |
| 761 | private void loadData(List<File> files, List<String> names, Box2D initialZoom) { |
| 762 | final StringBuilder sb = new StringBuilder(); |
| 763 | final ProgressBarDelegate progress = new ProgressBarDelegate(mProgressBar); |
| 764 | for (int i = 0; i < files.size(); ++i) { |
| 765 | final File f = files.get(i); |
| 766 | final String name = names.get(i); |
| 767 | try { |
| 768 | loadFile(f, name, progress); |
| 769 | } catch (final IOException | NoTalkbackSlimException e1) { |
| 770 | sb.append(f.getPath()).append('\n'); |
| 771 | } |
| 772 | } |
| 773 | progress.done(); |
| 774 | if (sb.length() > 0) { |
| 775 | JOptionPane.showMessageDialog(mMainPanel.getTopLevelAncestor(), |
| 776 | "Some files could not be loaded:\n" + sb.toString() + "\n", |
| 777 | "Invalid ROC File", JOptionPane.ERROR_MESSAGE); |
| 778 | } |
| 779 | if (initialZoom == null) { |
| 780 | SwingUtilities.invokeLater(() -> mZoomPP.getDefaultZoomAction().actionPerformed(new ActionEvent(this, 0, "LoadComplete"))); |
| 781 | } else { |
| 782 | SwingUtilities.invokeLater(() -> mZoomPP.setZoom(initialZoom)); |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | private void loadFile(final File f, final String name, ProgressDelegate progress) throws IOException { |
| 787 | mFileChooserParent = f.getParentFile(); |