From: amwaterhouse Date: Fri, 18 Aug 2006 08:53:07 +0000 (+0000) Subject: Only discover DAS sources if panel shown X-Git-Tag: Release_2_1~33 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4123d7eb50c5959e29ddaf803af285d722d5a8a5;p=jalview.git Only discover DAS sources if panel shown --- diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java index 36e5164..e78d2d4 100755 --- a/src/jalview/gui/DasSourceBrowser.java +++ b/src/jalview/gui/DasSourceBrowser.java @@ -43,6 +43,8 @@ public class DasSourceBrowser extends GDasSourceBrowser String DEFAULT_REGISTRY = "http://das.sanger.ac.uk/registry/das1/sources/"; + boolean loadingDasSources = false; + public DasSourceBrowser() { @@ -83,15 +85,19 @@ public class DasSourceBrowser extends GDasSourceBrowser } }); - if(dasSources==null) + if(dasSources!=null) { - Thread worker = new Thread(this); - worker.start(); - } - else - { init(); - } + } + } + + public void paintComponent(java.awt.Graphics g) + { + if (dasSources == null && !loadingDasSources) + { + Thread worker = new Thread(this); + worker.start(); + } } void init() @@ -239,6 +245,8 @@ public class DasSourceBrowser extends GDasSourceBrowser public void run() { + loadingDasSources = true; + addLocal.setVisible(false); refresh.setVisible(false); progressBar.setVisible(true); @@ -250,6 +258,8 @@ public class DasSourceBrowser extends GDasSourceBrowser init(); + loadingDasSources = false; + } public Vector getSelectedSources()