From: kiramt Date: Wed, 1 Nov 2017 16:16:55 +0000 (+0000) Subject: JAL-2778 remove unnecessary code running in repaint X-Git-Tag: Release_2_10_4~67^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=90ff735f876d7064f1f24925874fd7f41f94c7ac;p=jalview.git JAL-2778 remove unnecessary code running in repaint --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 8c5e4ac..29e9dc8 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -190,13 +190,12 @@ public class Alignment implements AlignmentI @Override public SequenceI getSequenceAt(int i) { - synchronized (sequences) + // don't need to synchronise here as sequences is a synchronizedList + if (i > -1 && i < sequences.size()) { - if (i > -1 && i < sequences.size()) - { - return sequences.get(i); - } + return sequences.get(i); } + return null; } diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 48e0483..abe92bb 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -994,10 +994,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, int er = av.getRanges().getEndRes() + 1; int transX = 0; - long stime = System.currentTimeMillis(); gg.copyArea(0, 0, imgWidth, getHeight(), -horizontal * av.getCharWidth(), 0); - long mtime = System.currentTimeMillis(); if (horizontal > 0) // scrollbar pulled right, image to the left { @@ -1014,17 +1012,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, drawComponent(gg, sr, er); gg.translate(-transX, 0); - long dtime = System.currentTimeMillis(); + fastPaint = true; repaint(); - long rtime = System.currentTimeMillis(); - if (debugRedraw) - { - System.err.println("Scroll:\t" + horizontal + "\tCopyArea:\t" - + (mtime - stime) + "\tDraw component:\t" + (dtime - mtime) - + "\tRepaint call:\t" + (rtime - dtime)); - } - } private volatile boolean lastImageGood = false;