*
* @param imagesPath Path to check in and store symbols to. Can be null, in such case default path should be used.
*/
@Override
public void downloadSymbols(String imagesPath) {
final DownloadGui g = new DownloadGui(new Downloader());
Iterable<DownloadJob> it = new GathererSymbols(imagesPath);
for (DownloadJob job : it) {
g.getDownloader().add(job);
}
it = new GathererSets(imagesPath);
for(DownloadJob job:it) {
g.getDownloader().add(job);
}
it = new DirectLinksForDownload(imagesPath);
for(DownloadJob job:it) {
g.getDownloader().add(job);
}
JDialog d = new JDialog((Frame) null, "Download pictures", false);
d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
d.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
g.getDownloader().dispose();
}
});
d.setLayout(new BorderLayout());
d.add(g);
d.pack();