X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPaintRefresher.java;h=953fdc549b46b4af0631498b9b92cd2f0df6ad4f;hb=9d2408483e451285fd555c3cd6e0273977acbaa7;hp=ced554482e83da5104a0f2fea34c10e12c5cd176;hpb=14193747f3831242bc7dfac12394eb20eb0ba480;p=jalview.git diff --git a/src/jalview/gui/PaintRefresher.java b/src/jalview/gui/PaintRefresher.java index ced5544..953fdc5 100755 --- a/src/jalview/gui/PaintRefresher.java +++ b/src/jalview/gui/PaintRefresher.java @@ -39,7 +39,7 @@ import java.util.Map; */ public class PaintRefresher { - static Map> components = new HashMap>(); + static Map> components = new HashMap<>(); /** * Add the given component to those registered under the given sequence set @@ -60,7 +60,7 @@ public class PaintRefresher } else { - List vcoms = new ArrayList(); + List vcoms = new ArrayList<>(); vcoms.add(comp); components.put(seqSetId, vcoms); } @@ -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 alsq; - synchronized (alsq = comp.getSequences()) + List alsq = comp.getSequences(); + synchronized (alsq) { alsq.add(i, a1[i]); } @@ -240,7 +251,7 @@ public class PaintRefresher { return new AlignmentPanel[0]; } - List tmp = new ArrayList(); + List tmp = new ArrayList<>(); for (Component comp : comps) { if (comp instanceof AlignmentPanel)