X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FDasSequenceFeatureFetcher.java;h=c661e2c3c6efce6b0ccd10919a601ddd532e4f9e;hb=19bf96b1bcedc7c00f97e1947d889c24fec48ae7;hp=e553b09d5ace577d4016a85790f5bdae06b31a5d;hpb=59d682209891099d46b960509907c79e3fb276fe;p=jalview.git
diff --git a/src/jalview/ws/DasSequenceFeatureFetcher.java b/src/jalview/ws/DasSequenceFeatureFetcher.java
index e553b09..c661e2c 100644
--- a/src/jalview/ws/DasSequenceFeatureFetcher.java
+++ b/src/jalview/ws/DasSequenceFeatureFetcher.java
@@ -1,29 +1,36 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* 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.
+ * 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 .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.ws;
import jalview.bin.Cache;
import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.FeatureSettings;
+import jalview.gui.JvOptionPane;
+import jalview.util.DBRefUtils;
+import jalview.util.MessageManager;
import jalview.util.UrlLink;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
import jalview.ws.dbsources.das.api.jalviewSourceI;
@@ -40,8 +47,6 @@ import java.util.Set;
import java.util.StringTokenizer;
import java.util.Vector;
-import javax.swing.JOptionPane;
-
import org.biodas.jdas.client.FeaturesClient;
import org.biodas.jdas.client.adapters.features.DasGFFAdapter;
import org.biodas.jdas.client.adapters.features.DasGFFAdapter.GFFAdapter;
@@ -130,7 +135,7 @@ public class DasSequenceFeatureFetcher
boolean useJDasMultiThread)
{
this.useJDASMultiThread = useJDasMultiThread;
- this.selectedSources = new ArrayList();
+ this.selectedSources = new ArrayList<>();
// filter both sequences and sources to eliminate duplicates
for (jalviewSourceI src : selectedSources2)
{
@@ -177,13 +182,12 @@ public class DasSequenceFeatureFetcher
int refCount = 0;
for (int i = 0; i < sequences.length; i++)
{
- DBRefEntry[] dbref = sequences[i].getDBRef();
+ DBRefEntry[] dbref = sequences[i].getDBRefs();
if (dbref != null)
{
for (int j = 0; j < dbref.length; j++)
{
- if (dbref[j].getSource().equals(
- jalview.datamodel.DBRefSource.UNIPROT))
+ if (dbref[j].getSource().equals(DBRefSource.UNIPROT))
{
refCount++;
break;
@@ -195,20 +199,18 @@ public class DasSequenceFeatureFetcher
if (checkDbrefs && refCount < sequences.length && uniprotCount > 0)
{
- int reply = JOptionPane.YES_OPTION;
+ int reply = JvOptionPane.YES_OPTION;
if (promptFetchDbrefs)
{
- reply = JOptionPane
- .showInternalConfirmDialog(
- Desktop.desktop,
- "Do you want Jalview to find\n"
- + "Uniprot Accession ids for given sequence names?",
- "Find Uniprot Accession Ids",
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ reply = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
+ MessageManager.getString(
+ "info.you_want_jalview_to_find_uniprot_accessions"),
+ MessageManager
+ .getString("label.find_uniprot_accession_ids"),
+ JvOptionPane.YES_NO_OPTION, JvOptionPane.QUESTION_MESSAGE);
}
- if (reply == JOptionPane.YES_OPTION)
+ if (reply == JvOptionPane.YES_OPTION)
{
Thread thread = new Thread(new FetchDBRefs());
thread.start();
@@ -233,6 +235,7 @@ public class DasSequenceFeatureFetcher
class FetchSeqFeatures implements Runnable
{
+ @Override
public void run()
{
startFetching();
@@ -242,10 +245,14 @@ public class DasSequenceFeatureFetcher
class FetchDBRefs implements Runnable
{
+ @Override
public void run()
{
running = true;
- new DBRefFetcher(sequences, af).fetchDBRefs(true);
+ boolean isNucleotide = af.getViewport().getAlignment().isNucleotide();
+ new DBRefFetcher(sequences, af, null, af.featureSettings,
+ isNucleotide).fetchDBRefs(true);
+
startFetching();
setGuiFetchComplete();
}
@@ -261,7 +268,8 @@ public class DasSequenceFeatureFetcher
startTime = System.currentTimeMillis();
if (af != null)
{
- af.setProgressBar("Fetching DAS Sequence Features", startTime);
+ af.setProgressBar(MessageManager.getString(
+ "status.fetching_das_sequence_features"), startTime);
}
if (sourceRegistry == null)
{
@@ -271,10 +279,9 @@ public class DasSequenceFeatureFetcher
{
try
{
- jalviewSourceI[] sources = sourceRegistry.getSources().toArray(
- new jalviewSourceI[0]);
- String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE",
- "uniprot");
+ jalviewSourceI[] sources = sourceRegistry.getSources()
+ .toArray(new jalviewSourceI[0]);
+ String active = Cache.getDefault("DAS_ACTIVE_SOURCE", "uniprot");
StringTokenizer st = new StringTokenizer(active, "\t");
selectedSources = new Vector();
String token;
@@ -309,17 +316,17 @@ public class DasSequenceFeatureFetcher
FeaturesClientMultipleSources fc = new FeaturesClientMultipleSources();
fc.setConnProps(sourceRegistry.getSessionHandler());
// Now sending requests one at a time to each server
- ArrayList srcobj = new ArrayList();
- ArrayList src = new ArrayList();
- List> ids = new ArrayList>();
- List> idobj = new ArrayList>();
- List