JAL-1517 source formatting
[jalview.git] / src / jalview / ext / jmol / JalviewJmolBinding.java
index 46c94c4..c075bf5 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.ext.jmol;
@@ -66,7 +68,7 @@ public abstract class JalviewJmolBinding implements StructureListener,
    * time.
    */
   private boolean loadingFromArchive = false;
-  
+
   /**
    * second flag to indicate if the jmol viewer should ignore sequence colouring
    * events from the structure manager because the GUI is still setting up
@@ -328,13 +330,15 @@ public abstract class JalviewJmolBinding implements StructureListener,
 
     String[] files = getPdbFile();
     // check to see if we are still waiting for Jmol files
-    long starttime=System.currentTimeMillis();
-    boolean waiting=true;
-    do {
-      waiting=false;
-      for (String file:files)
+    long starttime = System.currentTimeMillis();
+    boolean waiting = true;
+    do
+    {
+      waiting = false;
+      for (String file : files)
       {
-        try {
+        try
+        {
           // HACK - in Jalview 2.8 this call may not be threadsafe so we catch
           // every possible exception
           StructureMapping[] sm = ssm.getMapping(file);
@@ -351,10 +355,12 @@ public abstract class JalviewJmolBinding implements StructureListener,
         }
       }
       // we wait around for a reasonable time before we give up
-    } while (waiting && System.currentTimeMillis()<(10000+1000*files.length+starttime));
+    } while (waiting
+            && System.currentTimeMillis() < (10000 + 1000 * files.length + starttime));
     if (waiting)
     {
-      System.err.println("RUNTIME PROBLEM: Jmol seems to be taking a long time to process all the structures.");
+      System.err
+              .println("RUNTIME PROBLEM: Jmol seems to be taking a long time to process all the structures.");
       return;
     }
     StringBuffer selectioncom = new StringBuffer();
@@ -418,7 +424,8 @@ public abstract class JalviewJmolBinding implements StructureListener,
         // Jmol callback has completed.
         if (mapping == null || mapping.length < 1)
         {
-          throw new Error("Implementation error - Jmol seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016");
+          throw new Error(
+                  "Implementation error - Jmol seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016");
         }
         int lastPos = -1;
         for (int s = 0; s < sequence[pdbfnum].length; s++)
@@ -484,7 +491,7 @@ public abstract class JalviewJmolBinding implements StructureListener,
           }
         }
       }
-      
+
       // TODO: consider bailing if nmatched less than 4 because superposition
       // not
       // well defined.
@@ -556,14 +563,17 @@ public abstract class JalviewJmolBinding implements StructureListener,
             {
               selectioncom.append("|");
             }
-          } else {
+          }
+          else
+          {
             selcom[pdbfnum] = null;
           }
         }
       }
       for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
       {
-        if (pdbfnum == refStructure || selcom[pdbfnum]==null || selcom[refStructure]==null)
+        if (pdbfnum == refStructure || selcom[pdbfnum] == null
+                || selcom[refStructure] == null)
         {
           continue;
         }
@@ -572,7 +582,7 @@ public abstract class JalviewJmolBinding implements StructureListener,
         command.append(chainNames[pdbfnum]);
         command.append(") against reference (");
         command.append(chainNames[refStructure]);
-        command.append(")\";\ncompare "+nSeconds);
+        command.append(")\";\ncompare " + nSeconds);
         command.append("{");
         command.append(1 + pdbfnum);
         command.append(".1} {");
@@ -1503,10 +1513,11 @@ public abstract class JalviewJmolBinding implements StructureListener,
   {
     this.loadingFromArchive = loadingFromArchive;
   }
-  
+
   /**
    * 
-   * @return true if Jmol is still restoring state or loading is still going on (see setFinsihedLoadingFromArchive)
+   * @return true if Jmol is still restoring state or loading is still going on
+   *         (see setFinsihedLoadingFromArchive)
    */
   public boolean isLoadingFromArchive()
   {
@@ -1514,8 +1525,9 @@ public abstract class JalviewJmolBinding implements StructureListener,
   }
 
   /**
-   * modify flag which controls if sequence colouring events are honoured by the binding. 
-   * Should be true for normal operation
+   * modify flag which controls if sequence colouring events are honoured by the
+   * binding. Should be true for normal operation
+   * 
    * @param finishedLoading
    */
   public void setFinishedLoadingFromArchive(boolean finishedLoading)