Can specify PDB chain to map sequence to - only used by applet so far
[jalview.git] / src / jalview / appletgui / AppletJmol.java
index 4951516..29cc070 100644 (file)
@@ -67,6 +67,7 @@ public class AppletJmol extends Frame
   TextField inputLine;
   TextArea history;
   SequenceI[] sequence;
+  String [] chains;
   StructureSelectionManager ssm;
   RenderPanel renderPanel;
   AlignmentPanel ap;
@@ -78,11 +79,13 @@ public class AppletJmol extends Frame
 
   public AppletJmol(PDBEntry pdbentry,
                     SequenceI[] seq,
+                    String[] chains,
                     AlignmentPanel ap,
                     String protocol)
   {
     this.ap = ap;
     this.sequence = seq;
+    this.chains = chains;
     this.pdbentry = pdbentry;
 
    String alreadyMapped = StructureSelectionManager
@@ -92,7 +95,7 @@ public class AppletJmol extends Frame
     if (alreadyMapped != null)
     {
        StructureSelectionManager.getStructureSelectionManager()
-            .setMapping(seq, pdbentry.getFile(), protocol);
+            .setMapping(seq, chains, pdbentry.getFile(), protocol);
        //PROMPT USER HERE TO ADD TO NEW OR EXISTING VIEW?
        //FOR NOW, LETS JUST OPEN A NEW WINDOW
     }
@@ -616,14 +619,14 @@ public class AppletJmol extends Frame
       MCview.PDBfile pdb;
       if (loadedInline)
       {
-        pdb = ssm.setMapping(sequence,
+        pdb = ssm.setMapping(sequence,chains,
                                 pdbentry.getFile(),
                                 AppletFormatAdapter.PASTE);
         pdbentry.setFile("INLINE"+pdb.id);
       }
       else
       {
-         pdb = ssm.setMapping(sequence,
+         pdb = ssm.setMapping(sequence,chains,
                               pdbentry.getFile(),
                               AppletFormatAdapter.URL);
       }