+ /**
+ * properly initialise DAS fetcher and then initiate a new thread to fetch features from the named sources (rather than any turned on by default)
+ * @param sources
+ */
+ public void fetchDasFeatures(Vector sources)
+ {
+ Thread thr = new Thread(new Runnable() {
+ public void run() {
+ // this actually initialises the das source list
+ dassourceBrowser.paintComponent(null); // yuk
+ }
+ });
+ thr.start();
+ while (dassourceBrowser.loadingDasSources || dassourceBrowser.dasSources==null)
+ {
+ try { Thread.sleep(10); } catch (Exception e) {};
+ }
+ Vector resolved = new Vector();
+ if (sources!=null)
+ {
+ for (int i=0;i<dassourceBrowser.dasSources.length; i++)
+ {
+ if (sources.contains(dassourceBrowser.dasSources[i].getNickname()))
+ {
+ if (!resolved.contains(dassourceBrowser.dasSources[i]))
+ {
+ resolved.addElement(dassourceBrowser.dasSources[i]);
+ }
+ }
+ }
+ }
+ if (resolved.size()==0)
+ {
+ resolved = dassourceBrowser.getSelectedSources();
+ }
+ if (resolved.size()>0)
+ {
+ final Vector dassources = resolved;
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run()
+ {
+ fetchDAS.setEnabled(false);
+ cancelDAS.setEnabled(true);
+ doDasFeatureFetch(dassources, true, false);
+
+ }});
+ }
+ }