From: jprocter Date: Fri, 30 Apr 2010 13:19:37 +0000 (+0000) Subject: patch for bug #59999 X-Git-Tag: Release_2_5~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c1d578127a42ebd8535c3135241e9b0da789d584;p=jalview.git patch for bug #59999 --- diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java index 4bd31bd..0487c56 100755 --- a/src/jalview/gui/DasSourceBrowser.java +++ b/src/jalview/gui/DasSourceBrowser.java @@ -59,8 +59,9 @@ public class DasSourceBrowser extends GDasSourceBrowser implements return registry; } - public DasSourceBrowser() + public DasSourceBrowser(FeatureSettings featureSettings) { + fs = featureSettings; String registry = getDasRegistryURL(); registryURL.setText(registry); @@ -106,6 +107,11 @@ public class DasSourceBrowser extends GDasSourceBrowser implements init(); } } + FeatureSettings fs = null; + public DasSourceBrowser() + { + this(null); + } public void paintComponent(java.awt.Graphics g) { @@ -271,16 +277,27 @@ public class DasSourceBrowser extends GDasSourceBrowser implements refresh.setVisible(false); progressBar.setVisible(true); progressBar.setIndeterminate(true); + setParentGuiEnabled(false); // Refresh the source list. dasSources = null; getDASSource(); init(); + setParentGuiEnabled(true); loadingDasSources = false; } + private void setParentGuiEnabled(boolean b) + { + if (fs!=null) + { + fs.fetchDAS.setEnabled(b); + fs.saveDAS.setEnabled(b); + } + } + public Vector getSelectedSources() { // wait around if we're still loading. @@ -931,4 +948,14 @@ public class DasSourceBrowser extends GDasSourceBrowser implements } return resolved; } + + /** + * disable or enable the buttons on the source browser + * @param b + */ + public void setGuiEnabled(boolean b) + { + refresh.setEnabled(b); + addLocal.setEnabled(b); + } } diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 1dc577e..8c15662 100755 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -134,7 +134,7 @@ public class FeatureSettings extends JPanel scrollPane.setViewportView(table); - dassourceBrowser = new DasSourceBrowser(); + dassourceBrowser = new DasSourceBrowser(this); dasSettingsPane.add(dassourceBrowser, BorderLayout.CENTER); if (af.getViewport().featuresDisplayed == null @@ -171,6 +171,7 @@ public class FeatureSettings extends JPanel javax.swing.event.InternalFrameEvent evt) { fr.removePropertyChangeListener(change); + dassourceBrowser.fs = null; }; }); frame.setLayer(JLayeredPane.PALETTE_LAYER); @@ -1158,6 +1159,7 @@ public class FeatureSettings extends JPanel { fetchDAS.setEnabled(false); cancelDAS.setEnabled(true); + dassourceBrowser.setGuiEnabled(false); Vector selectedSources = dassourceBrowser.getSelectedSources(); doDasFeatureFetch(selectedSources, true, true); } @@ -1285,6 +1287,8 @@ public class FeatureSettings extends JPanel { fetchDAS.setEnabled(true); cancelDAS.setEnabled(false); + dassourceBrowser.setGuiEnabled(true); + } public void cancelDAS_actionPerformed(ActionEvent e) @@ -1293,8 +1297,7 @@ public class FeatureSettings extends JPanel { dasFeatureFetcher.cancel(); } - fetchDAS.setEnabled(true); - cancelDAS.setEnabled(false); + complete(); } public void noDasSourceActive()