JAL-2598 Sequence.getSequence return a copy of the char array
[jalview.git] / src / jalview / ext / jmol / JmolParser.java
index c73657f..beaaf79 100644 (file)
@@ -24,6 +24,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
+import jalview.io.DataSourceType;
 import jalview.io.FileParse;
 import jalview.io.StructureFile;
 import jalview.schemes.ResidueProperties;
@@ -38,8 +39,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 
-import javajs.awt.Dimension;
-
 import org.jmol.api.JmolStatusListener;
 import org.jmol.api.JmolViewer;
 import org.jmol.c.CBK;
@@ -61,9 +60,10 @@ public class JmolParser extends StructureFile implements JmolStatusListener
 {
   Viewer viewer = null;
 
-  public JmolParser(String inFile, String type) throws IOException
+  public JmolParser(String inFile, DataSourceType sourceType)
+          throws IOException
   {
-    super(inFile, type);
+    super(inFile, sourceType);
   }
 
   public JmolParser(FileParse fp) throws IOException
@@ -124,12 +124,11 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       try
       {
         /*
-         * params -o (output to sysout) -i (no info logging, less verbose)
-         * -n (nodisplay) -x (exit when finished)
+         * params -o (output to sysout) -n (nodisplay) -x (exit when finished)
          * see http://wiki.jmol.org/index.php/Jmol_Application
          */
         viewer = (Viewer) JmolViewer.allocateViewer(null, null, null, null,
-                null, "-x -o -n -i", this);
+                null, "-x -o -n", this);
         // ensure the 'new' (DSSP) not 'old' (Ramachandran) SS method is used
         viewer.setBooleanProperty("defaultStructureDSSP", true);
       } catch (ClassCastException x)
@@ -155,10 +154,12 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       if (pdbId == null)
       {
         setId(safeName(getDataName()));
+        setPDBIdAvailable(false);
       }
       else
       {
         setId(pdbId);
+        setPDBIdAvailable(true);
       }
       List<Atom> significantAtoms = convertSignificantAtoms(ms);
       for (Atom tmpatom : significantAtoms)
@@ -350,10 +351,10 @@ public class JmolParser extends StructureFile implements JmolStatusListener
           SequenceI sq, char[] secstr, char[] secstrcode, String chainId,
           int firstResNum)
   {
-    char[] seq = sq.getSequence();
+    int length = sq.getLength();
     boolean ssFound = false;
-    Annotation asecstr[] = new Annotation[seq.length + firstResNum - 1];
-    for (int p = 0; p < seq.length; p++)
+    Annotation asecstr[] = new Annotation[length + firstResNum - 1];
+    for (int p = 0; p < length; p++)
     {
       if (secstr[p] >= 'A' && secstr[p] <= 'z')
       {
@@ -471,7 +472,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener
    * Not implemented - returns null
    */
   @Override
-  public String print()
+  public String print(SequenceI[] seqs, boolean jvSuffix)
   {
     return null;
   }
@@ -625,7 +626,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener
    * Not implemented - returns null
    */
   @Override
-  public Dimension resizeInnerPanel(String data)
+  public int[] resizeInnerPanel(String data)
   {
     return null;
   }