JAL-2381 copy and paste sequence also copies contact matrix annotation
[jalview.git] / src / jalview / gui / AlignFrame.java
index ae945fe..48927bb 100644 (file)
@@ -2304,10 +2304,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .intValue();
               }
             }
-            alignment.addAnnotation(sequences[i].getAnnotation()[a]); // annotation
-            // was
-            // duplicated
-            // earlier
+            // annotation was duplicated earlier
+            alignment.addAnnotation(sequences[i].getAnnotation()[a]);
+            // take care of contact matrix too
+            ContactMatrixI cm=sequences[i].getContactMatrixFor(sequences[i].getAnnotation()[a]);
+            if (cm!=null)
+            {
+              alignment.addContactListFor(sequences[i].getAnnotation()[a], cm);
+            }
+            
             alignment.setAnnotationIndex(sequences[i].getAnnotation()[a],
                     a);
           }