apply jalview code style
[jalview.git] / src / jalview / appletgui / AppletJmol.java
index 55df194..42e6f56 100644 (file)
@@ -98,25 +98,41 @@ public class AppletJmol extends EmbmenuFrame implements
    * datasource protocol for access to PDBEntry
    */
   String protocol = null;
+
   /**
-   * Load a bunch of pdb entries associated with sequences in the alignment and display them - aligning them if necessary.
-   * @param pdbentries each pdb file (at least one needed)
-   * @param boundseqs each set of sequences for each pdb file (must match number of pdb files)
-   * @param boundchains the target pdb chain corresponding with each sequence associated with each pdb file (may be null at any level)
-   * @param align true/false
-   * @param ap associated alignment
-   * @param protocol how to get pdb data
+   * Load a bunch of pdb entries associated with sequences in the alignment and
+   * display them - aligning them if necessary.
+   * 
+   * @param pdbentries
+   *          each pdb file (at least one needed)
+   * @param boundseqs
+   *          each set of sequences for each pdb file (must match number of pdb
+   *          files)
+   * @param boundchains
+   *          the target pdb chain corresponding with each sequence associated
+   *          with each pdb file (may be null at any level)
+   * @param align
+   *          true/false
+   * @param ap
+   *          associated alignment
+   * @param protocol
+   *          how to get pdb data
    */
-  public AppletJmol(PDBEntry[] pdbentries, SequenceI[][] boundseqs, String[][] boundchains, boolean align, AlignmentPanel ap, String protocol)
+  public AppletJmol(PDBEntry[] pdbentries, SequenceI[][] boundseqs,
+          String[][] boundchains, boolean align, AlignmentPanel ap,
+          String protocol)
   {
     throw new Error("Not yet implemented.");
   }
+
   public AppletJmol(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
           AlignmentPanel ap, String protocol)
   {
     this.ap = ap;
     jmb = new AppletJmolBinding(this, new PDBEntry[]
-    { pdbentry }, new SequenceI[][]{seq}, new String[][]{ chains }, protocol);
+    { pdbentry }, new SequenceI[][]
+    { seq }, new String[][]
+    { chains }, protocol);
     jmb.setColourBySequence(true);
     if (pdbentry.getId() == null || pdbentry.getId().length() < 1)
     {
@@ -194,12 +210,12 @@ public class AppletJmol extends EmbmenuFrame implements
     scriptWindow = new Panel();
     scriptWindow.setVisible(false);
     // this.add(scriptWindow, BorderLayout.SOUTH);
-    
+
     try
     {
-      jmb.allocateViewer(renderPanel, true, ap.av.applet.getName()+"_jmol_",
-              ap.av.applet.getDocumentBase(), ap.av.applet.getCodeBase(),
-              "-applet", scriptWindow, null);
+      jmb.allocateViewer(renderPanel, true, ap.av.applet.getName()
+              + "_jmol_", ap.av.applet.getDocumentBase(),
+              ap.av.applet.getCodeBase(), "-applet", scriptWindow, null);
     } catch (Exception e)
     {
       System.err
@@ -220,7 +236,7 @@ public class AppletJmol extends EmbmenuFrame implements
         closeViewer();
       }
     });
-    if (pdbentry.getProperty()==null)
+    if (pdbentry.getProperty() == null)
     {
       pdbentry.setProperty(new Hashtable());
       pdbentry.getProperty().put("protocol", protocol);
@@ -359,19 +375,21 @@ public class AppletJmol extends EmbmenuFrame implements
       frame.add(cap);
 
       StringBuffer sb = new StringBuffer();
-      try {
-      for (int s = 0; s < jmb.pdbentry.length; s++)
+      try
       {
-        sb.append(StructureSelectionManager.getStructureSelectionManager()
-                .printMapping(jmb.pdbentry[s].getFile()));
-        sb.append("\n");
-      }
-      cap.setText(sb.toString());
-      }
-      catch (OutOfMemoryError ex)
+        for (int s = 0; s < jmb.pdbentry.length; s++)
+        {
+          sb.append(StructureSelectionManager
+                  .getStructureSelectionManager().printMapping(
+                          jmb.pdbentry[s].getFile()));
+          sb.append("\n");
+        }
+        cap.setText(sb.toString());
+      } catch (OutOfMemoryError ex)
       {
         frame.dispose();
-        System.err.println("Out of memory when trying to create dialog box with sequence-structure mapping.");
+        System.err
+                .println("Out of memory when trying to create dialog box with sequence-structure mapping.");
         return;
       }
       jalview.bin.JalviewLite.addFrame(frame, "PDB - Sequence Mapping",
@@ -525,26 +543,30 @@ public class AppletJmol extends EmbmenuFrame implements
     {
     }
   }
-  Panel splitPane=null;
+
+  Panel splitPane = null;
+
   public void showConsole(boolean showConsole)
   {
     if (showConsole)
     {
       remove(renderPanel);
       splitPane = new Panel();
-      
-      splitPane.setLayout(new java.awt.GridLayout(2,1));
+
+      splitPane.setLayout(new java.awt.GridLayout(2, 1));
       splitPane.add(renderPanel);
       splitPane.add(scriptWindow);
       scriptWindow.setVisible(true);
       this.add(splitPane, BorderLayout.CENTER);
       splitPane.setVisible(true);
       splitPane.validate();
-    } else {
+    }
+    else
+    {
       scriptWindow.setVisible(false);
       remove(splitPane);
       add(renderPanel, BorderLayout.CENTER);
-      splitPane=null;
+      splitPane = null;
     }
     validate();
   }