JAL-674 make transferAnnotation method static
[jalview.git] / src / MCview / PDBfile.java
index d8ca9a7..bb01faf 100755 (executable)
@@ -22,7 +22,7 @@ package MCview;
 
 import java.io.*;
 import java.util.*;
-
+import java.util.List;
 import java.awt.*;
 
 import jalview.analysis.AlignSeq;
@@ -279,7 +279,7 @@ public class PDBfile extends jalview.io.AlignFile
                 {}).invoke(jmf));
         cl.getMethod("addAnnotations", new Class[]
         { Alignment.class }).invoke(jmf, al);
-        replaceMatchingSeqsWith(prot, al, AlignSeq.PEP);
+        replaceMatchingSeqsWith(seqs, annotations, prot, al, AlignSeq.PEP, false);
       }
     } catch (ClassNotFoundException q)
     {
@@ -307,7 +307,7 @@ public class PDBfile extends jalview.io.AlignFile
                 new Class[]
                 { FileParse.class }).invoke(annotate3d, new Object[]
         { new FileParse(getDataName(), type) }));
-        replaceMatchingSeqsWith(rna, al, AlignSeq.DNA);
+        replaceMatchingSeqsWith(seqs, annotations, rna, al, AlignSeq.DNA, false);
       }
     } catch (ClassNotFoundException x)
     {
@@ -323,9 +323,10 @@ public class PDBfile extends jalview.io.AlignFile
    * @param ochains
    * @param al
    * @param dnaOrProtein
+   * @param removeOldAnnots when true, old annotation is cleared before new annotation transferred
    */
-  private void replaceMatchingSeqsWith(ArrayList<SequenceI> ochains,
-          AlignmentI al, String dnaOrProtein)
+  public static void replaceMatchingSeqsWith(List<SequenceI> seqs, List<AlignmentAnnotation> annotations, List<SequenceI> ochains,
+          AlignmentI al, String dnaOrProtein, boolean removeOldAnnots)
   {
     if (al != null && al.getHeight() > 0)
     {