X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDasSourceBrowser.java;h=58580eb03dc89b79461e25a9f87f22e1b9543686;hb=cca1d315fd19ddcc7c67a5aba91dafa98be097cf;hp=f57967c6900c78c5f58300383ef517a98c21b510;hpb=42ed2d813b3b8e7c9c80d79e1c8e1ded61ec6dd9;p=jalview.git
diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java
index f57967c..58580eb 100755
--- a/src/jalview/gui/DasSourceBrowser.java
+++ b/src/jalview/gui/DasSourceBrowser.java
@@ -1,6 +1,6 @@
/*
* Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -27,8 +27,9 @@ import javax.swing.*;
import java.util.*;
-import org.biojava.services.das.registry.DasCoordinateSystem;
-import org.biojava.services.das.registry.DasSource;
+import org.biojava.dasobert.dasregistry.DasCoordinateSystem;
+import org.biojava.dasobert.dasregistry.DasSource;
+import org.biojava.dasobert.dasregistry.Das1Source;
import java.awt.BorderLayout;
public class DasSourceBrowser extends GDasSourceBrowser
@@ -40,19 +41,32 @@ public class DasSourceBrowser extends GDasSourceBrowser
Vector selectedSources;
+ public static String DEFAULT_REGISTRY = "http://www.dasregistry.org/das1/sources/";
+
+ boolean loadingDasSources = false;
+
+
public DasSourceBrowser()
{
- registryURL.setText(jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
- "http://servlet.sanger.ac.uk/dasregistry/services/das_registry") );
+ String registry = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
+ DEFAULT_REGISTRY);
+
+ if(registry.indexOf("/registry/das1/sources/")>-1)
+ {
+ jalview.bin.Cache.setProperty("DAS_REGISTRY_URL", DEFAULT_REGISTRY);
+ registry = DEFAULT_REGISTRY;
+ }
+
+ registryURL.setText( registry );
setSelectedFromProperties();
displayFullDetails(null);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- capabilities.addListSelectionListener(this);
- coords1.addListSelectionListener(this);
- coords2.addListSelectionListener(this);
+ filter1.addListSelectionListener(this);
+ filter2.addListSelectionListener(this);
+ filter3.addListSelectionListener(this);
//Ask to be notified of selection changes.
ListSelectionModel rowSM = table.getSelectionModel();
@@ -60,10 +74,6 @@ public class DasSourceBrowser extends GDasSourceBrowser
{
public void valueChanged(ListSelectionEvent e)
{
- //Ignore extra messages.
- if (e.getValueIsAdjusting())
- return;
-
ListSelectionModel lsm = (ListSelectionModel) e.getSource();
if (!lsm.isSelectionEmpty())
{
@@ -83,15 +93,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()
@@ -212,7 +226,9 @@ public class DasSourceBrowser extends GDasSourceBrowser
text.append("Description: " +
dasSources[i].getDescription() + "
");
- if (dasSources[i].getHelperurl().length() > 0)
+
+ if (dasSources[i].getHelperurl()!=null
+ && dasSources[i].getHelperurl().length() > 0)
{
text.append("