*/
public class PaintRefresher
{
- static Map<String, List<Component>> components = new HashMap<String, List<Component>>();
+ static Map<String, List<Component>> components = new HashMap<>();
/**
* Add the given component to those registered under the given sequence set
}
else
{
- List<Component> vcoms = new ArrayList<Component>();
+ List<Component> vcoms = new ArrayList<>();
vcoms.add(comp);
components.put(seqSetId, vcoms);
}
{
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();
}
}
{
// raise an implementation warning here - not sure if this situation
// will ever occur
- System.err.println(
+ jalview.bin.Console.errPrintln(
"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]);
}
{
return new AlignmentPanel[0];
}
- List<AlignmentPanel> tmp = new ArrayList<AlignmentPanel>();
+ List<AlignmentPanel> tmp = new ArrayList<>();
for (Component comp : comps)
{
if (comp instanceof AlignmentPanel)