JAL-1115 refactor base collection for Alignment from Vector to locally synchronized...
[jalview.git] / src / jalview / appletgui / PaintRefresher.java
index 25e529b..fbdea9d 100755 (executable)
@@ -18,6 +18,7 @@
 package jalview.appletgui;
 
 import java.util.*;
+import java.util.List;
 
 import java.awt.*;
 
@@ -183,7 +184,11 @@ public class PaintRefresher
       {
         if (i < comp.getHeight())
         {
-          comp.getSequences().insertElementAt(a1[i], i);
+          // TODO: the following does not trigger any recalculation of height/etc, or maintain the dataset
+          List<SequenceI> alsq;
+          synchronized (alsq=comp.getSequences()) {
+            alsq.add(i, a1[i]);
+          }
         }
         else
         {