X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDasSourceBrowser.java;h=0487c5653d99d3a0a649df46ede357df8603e684;hb=c0adaae0693daad638b6b7db284eb17ea543f757;hp=e695d3d44d5524869019cd130130a62cdd14e1dc;hpb=dbbd8851fe0e30aa9606657b5f4eb41e0db21563;p=jalview.git
diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java
index e695d3d..0487c56 100755
--- a/src/jalview/gui/DasSourceBrowser.java
+++ b/src/jalview/gui/DasSourceBrowser.java
@@ -1,20 +1,19 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2007 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
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
*/
package jalview.gui;
@@ -30,8 +29,8 @@ import org.biojava.dasobert.dasregistry.*;
import jalview.jbgui.*;
import jalview.util.*;
-public class DasSourceBrowser
- extends GDasSourceBrowser implements Runnable, ListSelectionListener
+public class DasSourceBrowser extends GDasSourceBrowser implements
+ Runnable, ListSelectionListener
{
static DasSource[] dasSources = null;
@@ -39,24 +38,31 @@ public class DasSourceBrowser
Vector selectedSources;
- public static String DEFAULT_REGISTRY =
- "http://www.dasregistry.org/das1/sources/";
+ public static String DEFAULT_REGISTRY = "http://www.dasregistry.org/das1/sources/";
/**
* true if thread is running and we are talking to DAS registry service
*/
public boolean loadingDasSources = false;
- public DasSourceBrowser()
+ protected static String getDasRegistryURL()
{
String registry = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL",
- DEFAULT_REGISTRY);
+ DEFAULT_REGISTRY);
if (registry.indexOf("/registry/das1/sources/") > -1)
{
- jalview.bin.Cache.setProperty("DAS_REGISTRY_URL", DEFAULT_REGISTRY);
+ jalview.bin.Cache.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL,
+ DEFAULT_REGISTRY);
registry = DEFAULT_REGISTRY;
}
+ return registry;
+ }
+
+ public DasSourceBrowser(FeatureSettings featureSettings)
+ {
+ fs = featureSettings;
+ String registry = getDasRegistryURL();
registryURL.setText(registry);
@@ -69,7 +75,7 @@ public class DasSourceBrowser
filter2.addListSelectionListener(this);
filter3.addListSelectionListener(this);
- //Ask to be notified of selection changes.
+ // Ask to be notified of selection changes.
ListSelectionModel rowSM = table.getSelectionModel();
rowSM.addListSelectionListener(new ListSelectionListener()
{
@@ -89,7 +95,7 @@ public class DasSourceBrowser
public void mouseClicked(MouseEvent evt)
{
if (evt.getClickCount() == 2
- || SwingUtilities.isRightMouseButton(evt))
+ || SwingUtilities.isRightMouseButton(evt))
{
editRemoveLocalSource(evt);
}
@@ -101,6 +107,11 @@ public class DasSourceBrowser
init();
}
}
+ FeatureSettings fs = null;
+ public DasSourceBrowser()
+ {
+ this(null);
+ }
public void paintComponent(java.awt.Graphics g)
{
@@ -118,8 +129,8 @@ public class DasSourceBrowser
for (int i = 0; i < dSize; i++)
{
data[i][0] = dasSources[i].getNickname();
- data[i][1] = new Boolean(selectedSources.contains(dasSources[i].
- getNickname()));
+ data[i][1] = new Boolean(selectedSources.contains(dasSources[i]
+ .getNickname()));
}
refreshTableData(data);
@@ -152,13 +163,12 @@ public class DasSourceBrowser
{
StringBuffer text = new StringBuffer(
- "");
+ "");
if (nickName == null)
{
- fullDetails.setText(text +
- "Select a DAS service from the table"
- + " to read a full description here.");
+ fullDetails.setText(text + "Select a DAS service from the table"
+ + " to read a full description here.");
return;
}
@@ -172,26 +182,24 @@ public class DasSourceBrowser
DasSource ds = dasSources[i];
- text.append("Id: " + dasSources[i].getId() +
- "
");
- text.append("Nickname: " +
- dasSources[i].getNickname() + "
");
- text.append("URL: " + dasSources[i].getUrl() +
- "
");
+ text.append("Id: "
+ + dasSources[i].getId() + "
");
+ text.append("Nickname: "
+ + dasSources[i].getNickname() + "
");
+ 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() +
- "
");
+ text.append("Registered at: "
+ + dasSources[i].getRegisterDate() + "
");
- text.append("Last successful test: " +
- dasSources[i].getLeaseDate() +
- "
");
+ text.append("Last successful test: "
+ + dasSources[i].getLeaseDate() + "
");
text.append("Labels: ");
for (int s = 0; s < dasSources[i].getLabels().length; s++)
@@ -222,7 +230,7 @@ public class DasSourceBrowser
for (int j = 0; j < dcs.length; j++)
{
text.append("(" + dcs[j].getUniqueId() + ") "
- + dcs[j].getCategory() + ", " + dcs[j].getName());
+ + dcs[j].getCategory() + ", " + dcs[j].getName());
if (dcs[j].getNCBITaxId() != 0)
{
text.append(", " + dcs[j].getNCBITaxId());
@@ -235,15 +243,15 @@ public class DasSourceBrowser
text.append("
");
}
- text.append("Description: " +
- dasSources[i].getDescription() + "
");
+ text.append("Description: "
+ + dasSources[i].getDescription() + "
");
if (dasSources[i].getHelperurl() != null
- && dasSources[i].getHelperurl().length() > 0)
+ && dasSources[i].getHelperurl().length() > 0)
{
- text.append("Go to site");
+ text.append("Go to site");
}
text.append("