X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fws%2FDBRefFetcher.java;h=f5789ea5ee265f7ebe7d0c5e364527f101593a33;hb=6a9cf7ddfdb65e38e8caa2d760877725b7f7bae0;hp=84eba02fcfdb62b42e6c55df144ea06db00eeb98;hpb=a9f80616357f04492852a963a610f98657c63533;p=jalview.git
diff --git a/src/jalview/ws/DBRefFetcher.java b/src/jalview/ws/DBRefFetcher.java
index 84eba02..f5789ea 100644
--- a/src/jalview/ws/DBRefFetcher.java
+++ b/src/jalview/ws/DBRefFetcher.java
@@ -1,19 +1,21 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
* Copyright (C) 2014 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;
@@ -79,9 +81,10 @@ public class DBRefFetcher implements Runnable
private SequenceI[] alseqs;
/**
- * when true - retrieved sequences will be trimmed to cover longest derived alignment sequence
+ * when true - retrieved sequences will be trimmed to cover longest derived
+ * alignment sequence
*/
- private boolean trimDsSeqs=true;
+ private boolean trimDsSeqs = true;
public DBRefFetcher()
{
@@ -129,7 +132,8 @@ public class DBRefFetcher implements Runnable
this.dataset = ds;
// TODO Jalview 2.5 lots of this code should be in the gui package!
sfetcher = jalview.gui.SequenceFetcher.getSequenceFetcherSingleton(af);
- // set default behaviour for transferring excess sequence data to the dataset
+ // set default behaviour for transferring excess sequence data to the
+ // dataset
trimDsSeqs = Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true);
if (sources == null)
{
@@ -279,11 +283,11 @@ public class DBRefFetcher implements Runnable
{
if (dbSources == null)
{
- throw new Error("Implementation error. Must initialise dbSources");
+ throw new Error(MessageManager.getString("error.implementation_error_must_init_dbsources"));
}
running = true;
long startTime = System.currentTimeMillis();
- af.setProgressBar("Fetching db refs", startTime);
+ af.setProgressBar(MessageManager.getString("status.fetching_db_refs"), startTime);
try
{
if (Cache.getDefault("DBREFFETCH_USEPICR", false))
@@ -379,7 +383,7 @@ public class DBRefFetcher implements Runnable
if (retrieved != null)
{
transferReferences(sdataset, dbsource.getDbSource(),
- retrieved,trimDsSeqs);
+ retrieved, trimDsSeqs);
}
}
else
@@ -458,15 +462,20 @@ public class DBRefFetcher implements Runnable
} // all databases have been queries.
if (sbuffer.length() > 0)
{
- output.setText(MessageManager.getString("label.your_sequences_have_been_verified")
+ output.setText(MessageManager
+ .getString("label.your_sequences_have_been_verified")
+ sbuffer.toString());
- Desktop.addInternalFrame(output, MessageManager.getString("label.sequence_names_updated"), 600, 300);
+ Desktop.addInternalFrame(output,
+ MessageManager.getString("label.sequence_names_updated"),
+ 600, 300);
// The above is the dataset, we must now find out the index
// of the viewed sequence
}
- af.setProgressBar(MessageManager.getString("label.dbref_search_completed"), startTime);
+ af.setProgressBar(
+ MessageManager.getString("label.dbref_search_completed"),
+ startTime);
// promptBeforeBlast();
running = false;
@@ -476,14 +485,15 @@ public class DBRefFetcher implements Runnable
/**
* Verify local sequences in seqRefs against the retrieved sequence database
* records.
- * @param trimDatasetSeqs
+ *
+ * @param trimDatasetSeqs
*
*/
void transferReferences(Vector sdataset, String dbSource,
AlignmentI retrievedAl, boolean trimDatasetSeqs) // File
// file)
{
- System.out.println("trimming ? "+trimDatasetSeqs);
+ System.out.println("trimming ? " + trimDatasetSeqs);
if (retrievedAl == null || retrievedAl.getHeight() == 0)
{
return;
@@ -658,7 +668,8 @@ public class DBRefFetcher implements Runnable
// unknownSequences.remove(sequence);
int absEnd = absStart + nonGapped.length();
absStart += 1;
- if (!trimDatasetSeqs) {
+ if (!trimDatasetSeqs)
+ {
// insert full length sequence from record
sequence.setSequence(entry.getSequenceAsString());
sequence.setStart(entry.getStart());
@@ -666,7 +677,8 @@ public class DBRefFetcher implements Runnable
if (updateRefFrame)
{
// finally, update local sequence reference frame if we're allowed
- if (trimDatasetSeqs) {
+ if (trimDatasetSeqs)
+ {
// just fix start/end
sequence.setStart(absStart);
sequence.setEnd(absEnd);