X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fgui%2FDasSourceBrowser.java;h=6e4cd9ae1637c8b7dc689f3de3fb7a76d42cbc86;hb=8d5a12d996b49525f7c5b83f3cc280aeb7c3fda7;hp=4bd31bd47f65f34f7772af9d4694efc69539f710;hpb=d423f22792e47dbc800ae220a58677f988971d06;p=jalview.git
diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java
index 4bd31bd..6e4cd9a 100755
--- a/src/jalview/gui/DasSourceBrowser.java
+++ b/src/jalview/gui/DasSourceBrowser.java
@@ -1,6 +1,6 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
@@ -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);
@@ -107,6 +108,13 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
}
}
+ FeatureSettings fs = null;
+
+ public DasSourceBrowser()
+ {
+ this(null);
+ }
+
public void paintComponent(java.awt.Graphics g)
{
if (dasSources == null && !loadingDasSources)
@@ -183,11 +191,10 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
text.append("URL: "
+ dasSources[i].getUrl() + "
");
- text
- .append("Admin Email: "
- + dasSources[i].getAdminemail() + "" + "
");
+ text.append("Admin Email: "
+ + dasSources[i].getAdminemail() + "" + "
");
text.append("Registered at: "
+ dasSources[i].getRegisterDate() + "
");
@@ -271,16 +278,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.
@@ -570,8 +588,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
{
tmp[index] = dasSources[i];
data[index][0] = dasSources[i].getNickname();
- data[index][1] = new Boolean(selectedSources
- .contains(dasSources[i].getNickname()));
+ data[index][1] = new Boolean(
+ selectedSources.contains(dasSources[i].getNickname()));
index++;
}
}
@@ -671,14 +689,13 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
// HAVE COORDINATE SYSTEMS, INFO WHICH AT PRESENT
// IS ADDED FROM THE REGISTRY
names.add(ds.getNickname());
- selected
- .add(new Boolean(selectedSources.contains(ds.getNickname())));
+ selected.add(new Boolean(selectedSources.contains(ds.getNickname())));
continue;
}
if (!selectedInList(dummyFeatureList, ds.getCapabilities())
- || !selectedInList(filter3.getSelectedValues(), ds
- .getLabels()))
+ || !selectedInList(filter3.getSelectedValues(),
+ ds.getLabels()))
{
continue;
}
@@ -788,8 +805,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
}
}
- properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE, sb
- .toString());
+ properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE,
+ sb.toString());
if (localSources != null)
{
@@ -805,8 +822,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
+ ((DasSource) localSources.get(token)).getUrl() + "\t");
}
- properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE, sb
- .toString());
+ properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE,
+ sb.toString());
}
}
@@ -931,4 +948,15 @@ 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);
+ }
}