Merge remote-tracking branch 'origin/develop' into bug/JAL-2665-2.10.3
[jalview.git] / src / jalview / appletgui / AppletJmol.java
index c0b4ff0..49219b9 100644 (file)
@@ -65,7 +65,7 @@ import java.util.List;
 import java.util.Vector;
 
 public class AppletJmol extends EmbmenuFrame implements
-// StructureListener,
+        // StructureListener,
         KeyListener, ActionListener, ItemListener
 
 {
@@ -88,7 +88,8 @@ public class AppletJmol extends EmbmenuFrame implements
   CheckboxMenuItem jmolColour = new CheckboxMenuItem(
           MessageManager.getString("action.using_jmol"), false);
 
-  MenuItem chain = new MenuItem(MessageManager.getString("action.by_chain"));
+  MenuItem chain = new MenuItem(
+          MessageManager.getString("action.by_chain"));
 
   MenuItem charge = new MenuItem(
           MessageManager.getString("label.charge_cysteine"));
@@ -182,15 +183,15 @@ public class AppletJmol extends EmbmenuFrame implements
   {
     this.ap = ap;
     jmb = new AppletJmolBinding(this, ap.getStructureSelectionManager(),
-            new PDBEntry[] { pdbentry }, new SequenceI[][] { seq },
-            protocol);
+            new PDBEntry[]
+            { pdbentry }, new SequenceI[][] { seq }, protocol);
     jmb.setColourBySequence(true);
     if (pdbentry.getId() == null || pdbentry.getId().length() < 1)
     {
       if (protocol == DataSourceType.PASTE)
       {
-        pdbentry.setId("PASTED PDB"
-                + (chains == null ? "_" : chains.toString()));
+        pdbentry.setId(
+                "PASTED PDB" + (chains == null ? "_" : chains.toString()));
       }
       else
       {
@@ -210,9 +211,9 @@ public class AppletJmol extends EmbmenuFrame implements
     StructureFile reader = null;
     if (alreadyMapped != null)
     {
-      reader = StructureSelectionManager.getStructureSelectionManager(
-              ap.av.applet).setMapping(seq, chains, pdbentry.getFile(),
-              protocol);
+      reader = StructureSelectionManager
+              .getStructureSelectionManager(ap.av.applet)
+              .setMapping(seq, chains, pdbentry.getFile(), protocol);
       // PROMPT USER HERE TO ADD TO NEW OR EXISTING VIEW?
       // FOR NOW, LETS JUST OPEN A NEW WINDOW
     }
@@ -268,15 +269,15 @@ public class AppletJmol extends EmbmenuFrame implements
 
     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
-              .println("Couldn't create a jmol viewer. Args to allocate viewer were:\nDocumentBase="
-                      + ap.av.applet.getDocumentBase()
-                      + "\nCodebase="
+      System.err.println(
+              "Couldn't create a jmol viewer. Args to allocate viewer were:\nDocumentBase="
+                      + ap.av.applet.getDocumentBase() + "\nCodebase="
                       + ap.av.applet.getCodeBase());
       e.printStackTrace();
       dispose();
@@ -294,7 +295,7 @@ public class AppletJmol extends EmbmenuFrame implements
     });
     pdbentry.setProperty("protocol", protocol);
     if (pdbentry.getFile() != null)
-    
+
     {
       // import structure data from pdbentry.getFile based on given protocol
       if (protocol == DataSourceType.PASTE)
@@ -319,8 +320,8 @@ public class AppletJmol extends EmbmenuFrame implements
           {
             if (jalview.bin.JalviewLite.debug)
             {
-              System.err
-                      .println("AppletJmol:Trying to reuse existing PDBfile IO parser.");
+              System.err.println(
+                      "AppletJmol:Trying to reuse existing PDBfile IO parser.");
             }
             // re-use the one we opened earlier
             freader = reader.getReader();
@@ -329,8 +330,8 @@ public class AppletJmol extends EmbmenuFrame implements
           {
             if (jalview.bin.JalviewLite.debug)
             {
-              System.err
-                      .println("AppletJmol:Creating new PDBfile IO parser.");
+              System.err.println(
+                      "AppletJmol:Creating new PDBfile IO parser.");
             }
             FileParse fp = new FileParse(pdbentry.getFile(), protocol);
             fp.mark();
@@ -346,9 +347,8 @@ public class AppletJmol extends EmbmenuFrame implements
           }
           if (freader == null)
           {
-            throw new Exception(
-                    MessageManager
-                            .getString("exception.invalid_datasource_couldnt_obtain_reader"));
+            throw new Exception(MessageManager.getString(
+                    "exception.invalid_datasource_couldnt_obtain_reader"));
           }
           jmb.viewer.openReader(pdbentry.getFile(), pdbentry.getId(),
                   freader);
@@ -433,8 +433,8 @@ public class AppletJmol extends EmbmenuFrame implements
       } 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,
@@ -500,10 +500,10 @@ public class AppletJmol extends EmbmenuFrame implements
     {
       try
       {
-        ap.av.applet.getAppletContext().showDocument(
-                new java.net.URL(
+        ap.av.applet.getAppletContext()
+                .showDocument(new java.net.URL(
                         "http://jmol.sourceforge.net/docs/JmolUserGuide/"),
-                "jmolHelp");
+                        "jmolHelp");
       } catch (java.net.MalformedURLException ex)
       {
       }