JAL-1834 removed quotes around truncated strings with ellipsis
[jalview.git] / src / jalview / gui / SequenceFetcher.java
index d83f034..6a0d010 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -20,7 +20,6 @@
  */
 package jalview.gui;
 
-import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
@@ -178,8 +177,7 @@ public class SequenceFetcher extends JPanel implements Runnable
       jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
       if (guiWindow != null)
       {
-        guiWindow.setProgressBar(MessageManager.getString("status.init_sequence_database_fetchers"),
-                Thread.currentThread().hashCode());
+        guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
       }
       lastDasSourceRegistry = (dasRegistry.getDasRegistryURL() + dasRegistry
               .getLocalSourceString()).hashCode();
@@ -360,18 +358,19 @@ public class SequenceFetcher extends JPanel implements Runnable
       {
         debounceTrap++;
         String currentSelection = database.getSelectedItem();
-
         if (!currentSelection.equalsIgnoreCase("pdb"))
         {
             otherSourceAction();
         }
-        if (currentSelection.equalsIgnoreCase("pdb") && ((debounceTrap % 2) == 0))
+        if (currentSelection.equalsIgnoreCase("pdb")
+                && (database.action == KeyEvent.VK_ENTER || ((debounceTrap % 2) == 0)))
         {
           pdbSourceAction();
         }
-
+        database.action = -1;
       }
     });
+
     dbeg.setText("");
     jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
     jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
@@ -775,7 +774,7 @@ public class SequenceFetcher extends JPanel implements Runnable
   AlignmentI parseResult(String result, String title)
   {
     String format = new IdentifyFile().Identify(result, "Paste");
-    Alignment sequences = null;
+    AlignmentI sequences = null;
     if (FormatAdapter.isValidFormat(format))
     {
       sequences = null;
@@ -817,6 +816,10 @@ public class SequenceFetcher extends JPanel implements Runnable
 
     if (al != null && al.getHeight() > 0)
     {
+      if (title == null)
+      {
+        title = getDefaultRetrievalTitle();
+      }
       if (alignFrame == null)
       {
         AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
@@ -829,10 +832,6 @@ public class SequenceFetcher extends JPanel implements Runnable
           // Alignments?
         }
 
-        if (title == null)
-        {
-          title = getDefaultRetrievalTitle();
-        }
         SequenceFeature[] sfs = null;
         List<SequenceI> alsqs;
         synchronized (alsqs = al.getSequences())
@@ -866,21 +865,7 @@ public class SequenceFetcher extends JPanel implements Runnable
       }
       else
       {
-        for (int i = 0; i < al.getHeight(); i++)
-        {
-          alignFrame.viewport.getAlignment().addSequence(
-                  al.getSequenceAt(i)); // this
-          // also
-          // creates
-          // dataset
-          // sequence
-          // entries
-        }
-        alignFrame.viewport.setEndSeq(alignFrame.viewport.getAlignment()
-                .getHeight());
-        alignFrame.viewport.getAlignment().getWidth();
-        alignFrame.viewport.firePropertyChange("alignment", null,
-                alignFrame.viewport.getAlignment().getSequences());
+        alignFrame.viewport.addAlignment(al, title);
       }
     }
     return al;
@@ -906,6 +891,8 @@ public class SequenceFetcher extends JPanel implements Runnable
     return progressIndicator;
   }
 
+
+
   public void setProgressIndicator(IProgressIndicator progressIndicator)
   {
     this.progressIndicator = progressIndicator;