apply jalview code style
[jalview.git] / src / jalview / gui / AppJmol.java
index 868f306..041d6a2 100644 (file)
@@ -49,7 +49,7 @@ public class AppJmol extends GStructureViewer implements Runnable,
   AppJmolBinding jmb;
 
   JPanel scriptWindow;
-  
+
   JSplitPane splitPane;
 
   RenderPanel renderPanel;
@@ -255,12 +255,13 @@ public class AppJmol extends GStructureViewer implements Runnable,
    * @param pdbentry
    * @param seq
    * @param chains
-   * @param alignFrame 
+   * @param alignFrame
    * @param align
    *          if true, new structure(s) will be align using associated alignment
    */
   private void addStructure(final PDBEntry pdbentry, final SequenceI[] seq,
-          final String[] chains, final boolean b, final IProgressIndicator alignFrame)
+          final String[] chains, final boolean b,
+          final IProgressIndicator alignFrame)
   {
     if (pdbentry.getFile() == null)
     {
@@ -298,7 +299,7 @@ public class AppJmol extends GStructureViewer implements Runnable,
     addingStructures = true;
     _started = false;
     alignAddedStructures = b;
-    progressBar = alignFrame; // visual indication happens on caller frame. 
+    progressBar = alignFrame; // visual indication happens on caller frame.
     (worker = new Thread(this)).start();
     return;
   }
@@ -340,8 +341,10 @@ public class AppJmol extends GStructureViewer implements Runnable,
       bl.setVgap(0);
       scriptWindow = new JPanel(bl);
       scriptWindow.setVisible(false);
-    };
-    jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow, null);
+    }
+    ;
+    jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow,
+            null);
     jmb.newJmolPopup(true, "Jmol", true);
     jmb.evalStateCommand(command);
     jmb.setFinishedInit(true);
@@ -414,7 +417,7 @@ public class AppJmol extends GStructureViewer implements Runnable,
   void closeViewer()
   {
     jmb.closeViewer();
-    
+
     // TODO: check for memory leaks where instance isn't finalised because jmb
     // holds a reference to the window
     jmb = null;
@@ -445,11 +448,10 @@ public class AppJmol extends GStructureViewer implements Runnable,
           // retrieve the pdb and store it locally
           AlignmentI pdbseq = null;
           pdbid = jmb.pdbentry[pi].getId();
-          long hdl=pdbid.hashCode()-System.currentTimeMillis();
+          long hdl = pdbid.hashCode() - System.currentTimeMillis();
           if (progressBar != null)
           {
-            progressBar.setProgressBar("Fetching PDB " + pdbid,
-                    hdl);
+            progressBar.setProgressBar("Fetching PDB " + pdbid, hdl);
           }
           try
           {
@@ -557,23 +559,24 @@ public class AppJmol extends GStructureViewer implements Runnable,
         {
           Cache.log.error("Couldn't add files to Jmol viewer!", ex);
         }
-          long lastnotify=jmb.getLoadNotifiesHandled();
-          // need to wait around until script has finished
-          while (lastnotify>=jmb.getLoadNotifiesHandled()); 
+        long lastnotify = jmb.getLoadNotifiesHandled();
+        // need to wait around until script has finished
+        while (lastnotify >= jmb.getLoadNotifiesHandled())
+          ;
+        {
+          try
           {
-            try
-            {
-              Thread.sleep(35);
-            } catch (Exception e)
-            {
-            }
-          }
-          // refresh the sequence colours for the new structure(s)
-          jmb.updateColours(ap);
-          // do superposition if asked to
-          if (alignAddedStructures)
+            Thread.sleep(35);
+          } catch (Exception e)
           {
-            javax.swing.SwingUtilities.invokeLater(new Runnable()
+          }
+        }
+        // refresh the sequence colours for the new structure(s)
+        jmb.updateColours(ap);
+        // do superposition if asked to
+        if (alignAddedStructures)
+        {
+          javax.swing.SwingUtilities.invokeLater(new Runnable()
           {
             public void run()
             {
@@ -787,7 +790,8 @@ public class AppJmol extends GStructureViewer implements Runnable,
     {
     }
   }
-public void showConsole(boolean showConsole)
+
+  public void showConsole(boolean showConsole)
   {
 
     if (showConsole)
@@ -808,9 +812,9 @@ public void showConsole(boolean showConsole)
     else
     {
       if (splitPane != null)
-        {
-          splitPane.setVisible(false);
-        }
+      {
+        splitPane.setVisible(false);
+      }
 
       splitPane = null;
 
@@ -819,6 +823,7 @@ public void showConsole(boolean showConsole)
 
     validate();
   }
+
   class RenderPanel extends JPanel
   {
     final Dimension currentSize = new Dimension();