JAL-845 code/refactoring/tests related to linking DNA and protein
[jalview.git] / src / jalview / bin / JalviewLite.java
index ef1e16e..f596a9c 100644 (file)
@@ -60,6 +60,7 @@ import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.net.URL;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
@@ -447,12 +448,11 @@ public class JalviewLite extends Applet implements
         end = rs.findIndex(end);
         if (csel != null)
         {
-          Vector cs = csel.getSelected();
+          List<Integer> cs = csel.getSelected();
           csel.clear();
-          for (int csi = 0, csiS = cs.size(); csi < csiS; csi++)
+          for (Integer selectedCol : cs)
           {
-            csel.addElement(rs.findIndex(((Integer) cs.elementAt(csi))
-                    .intValue()));
+            csel.addElement(rs.findIndex(selectedCol));
           }
         }
       }
@@ -1269,7 +1269,7 @@ public class JalviewLite extends Applet implements
 
   public static boolean debug = false;
 
-  static String builddate = null, version = null;
+  static String builddate = null, version = null, installation = null;
 
   private static void initBuildDetails()
   {
@@ -1277,6 +1277,7 @@ public class JalviewLite extends Applet implements
     {
       builddate = "unknown";
       version = "test";
+      installation = "Webstart";
       java.net.URL url = JalviewLite.class
               .getResource("/.build_properties");
       if (url != null)
@@ -1296,6 +1297,10 @@ public class JalviewLite extends Applet implements
             {
               builddate = line.substring(line.indexOf("=") + 1);
             }
+            if (line.indexOf("INSTALLATION") > -1)
+            {
+              installation = line.substring(line.indexOf("=") + 1);
+            }
           }
         } catch (Exception ex)
         {
@@ -1311,6 +1316,12 @@ public class JalviewLite extends Applet implements
     return builddate;
   }
 
+  public static String getInstallation()
+  {
+    initBuildDetails();
+    return installation;
+  }
+
   public static String getVersion()
   {
     initBuildDetails();
@@ -1360,6 +1371,7 @@ public class JalviewLite extends Applet implements
 
       System.err.println("JalviewLite Version " + getVersion());
       System.err.println("Build Date : " + getBuildDate());
+      System.err.println("Installation : " + getInstallation());
 
     }
     String externalsviewer = getParameter("externalstructureviewer");
@@ -2076,10 +2088,12 @@ public class JalviewLite extends Applet implements
             {
               String sequence = applet.getParameter("PDBSEQ");
               if (sequence != null)
+              {
                 seqs = new SequenceI[]
                 { matcher == null ? (Sequence) newAlignFrame
                         .getAlignViewport().getAlignment()
                         .findName(sequence) : matcher.findIdMatch(sequence) };
+              }
 
             }
             else
@@ -2139,6 +2153,8 @@ public class JalviewLite extends Applet implements
                 if (seqs[i] != null)
                 {
                   ((Sequence) seqs[i]).addPDBId(pdb);
+                  StructureSelectionManager.getStructureSelectionManager(
+                          applet).registerPDBEntry(pdb);
                 }
                 else
                 {
@@ -2323,7 +2339,9 @@ public class JalviewLite extends Applet implements
     // note separator local variable intentionally masks object field
     int seplen = separator.length();
     if (list == null || list.equals("") || list.equals(separator))
+    {
       return null;
+    }
     java.util.Vector jv = new Vector();
     int cp = 0, pos;
     while ((pos = list.indexOf(separator, cp)) > cp)