Merge branch 'kjvdh/features/PhylogenyViewer_tabbedsupport' into merge/2_11_2/kjvdh...
[jalview.git] / src / jalview / gui / PaintRefresher.java
index 06a2f65..f56c61c 100755 (executable)
@@ -112,19 +112,30 @@ public class PaintRefresher
       {
         continue;
       }
-
-      if (validateSequences && comp instanceof AlignmentPanel
-              && source instanceof AlignmentPanel)
+      if (comp instanceof AlignmentPanel)
+      {
+        if (validateSequences && source instanceof AlignmentPanel)
+        {
+          validateSequences(((AlignmentPanel) source).av.getAlignment(),
+                  ((AlignmentPanel) comp).av.getAlignment());
+        }
+        if (alignmentChanged)
+        {
+          ((AlignmentPanel) comp).alignmentChanged();
+        }
+      }
+      else if (comp instanceof IdCanvas)
       {
-        validateSequences(((AlignmentPanel) source).av.getAlignment(),
-                ((AlignmentPanel) comp).av.getAlignment());
+        // BH 2019.04.22 fixes JS problem of repaint() consolidation
+        // that occurs in JavaScript but not Java [JAL-3226]
+        ((IdCanvas) comp).fastPaint = false;
       }
-
-      if (comp instanceof AlignmentPanel && alignmentChanged)
+      else if (comp instanceof SeqCanvas)
       {
-        ((AlignmentPanel) comp).alignmentChanged();
+        // BH 2019.04.22 fixes JS problem of repaint() consolidation
+        // that occurs in JavaScript but not Java [JAL-3226]
+        ((SeqCanvas) comp).fastPaint = false;
       }
-
       comp.repaint();
     }
   }
@@ -186,8 +197,8 @@ public class PaintRefresher
             System.err.println(
                     "IMPLEMENTATION PROBLEM: DATASET out of sync due to an insert whilst calling PaintRefresher.validateSequences(AlignmentI, ALignmentI)");
           }
-          List<SequenceI> alsq;
-          synchronized (alsq = comp.getSequences())
+          List<SequenceI> alsq = comp.getSequences();
+          synchronized (alsq)
           {
             alsq.add(i, a1[i]);
           }