Merge branch 'JAL-1445' into develop
[jalview.git] / src / jalview / ext / varna / VarnaCommands.java
index 9d57969..b5f0dc9 100644 (file)
@@ -1,5 +1,20 @@
-/**\r
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Copyright (C) 2014 The Jalview Authors
+ * \r
+ * This file is part of Jalview.\r
+ * \r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
+ *  \r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE.  See the GNU General Public License for more details.\r
  * \r
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */\r
 package jalview.ext.varna;\r
 \r
@@ -15,8 +30,8 @@ import java.awt.Color;
 import java.util.ArrayList;\r
 \r
 /**\r
- * Routines for generating Jmol commands for Jalview/Jmol binding\r
- * another cruisecontrol test.\r
+ * Routines for generating Jmol commands for Jalview/Jmol binding another
+ * cruisecontrol test.
  * \r
  * @author JimP\r
  *\r
@@ -25,11 +40,16 @@ public class VarnaCommands
 {\r
 \r
   /**\r
-   * Jmol utility which constructs the commands to colour chains by the given alignment\r
+   * Jmol utility which constructs the commands to colour chains by the given
+   * alignment
    * \r
    */\r
-  public static String[] getColourBySequenceCommand(StructureSelectionManager ssm, String[] files, SequenceI[][] sequence, SequenceRenderer sr, FeatureRenderer fr, AlignmentI alignment)\r
+  public static String[] getColourBySequenceCommand(
+          StructureSelectionManager ssm, String[] files,
+          SequenceI[][] sequence, SequenceRenderer sr, FeatureRenderer fr,
+          AlignmentI alignment)
   {\r
+       \r
     ArrayList<String> str = new ArrayList<String>();\r
     StringBuffer command = new StringBuffer();\r
   \r
@@ -78,7 +98,10 @@ public class VarnaCommands
                       + col.getGreen()\r
                       + ","\r
                       + col.getBlue() + "]";\r
-              if (command.length()>newSelcom.length() && command.substring(command.length()-newSelcom.length()).equals(newSelcom))\r
+              if (command.length() > newSelcom.length()
+                      && command.substring(
+                              command.length() - newSelcom.length())
+                              .equals(newSelcom))
               {\r
                 command = VarnaCommands.condenseCommand(command, pos);\r
                 continue;\r
@@ -114,9 +137,14 @@ public class VarnaCommands
   \r
     // work back to last 'select'\r
     int p=command.length(),q=p;\r
-    do {\r
+    do
+    {
       p-=6;\r
-      if (p<1) { p=0; };\r
+      if (p < 1)
+      {
+        p = 0;
+      }
+      ;
     } while ((q=command.indexOf("select",p))==-1 && p>0);\r
     \r
     StringBuffer sb = new StringBuffer(command.substring(0,q+7));\r