From 90ff735f876d7064f1f24925874fd7f41f94c7ac Mon Sep 17 00:00:00 2001 From: kiramt Date: Wed, 1 Nov 2017 16:16:55 +0000 Subject: [PATCH] JAL-2778 remove unnecessary code running in repaint --- src/jalview/datamodel/Alignment.java | 9 ++++----- src/jalview/gui/AnnotationPanel.java | 12 +----------- 2 files changed, 5 insertions(+), 16 deletions(-) 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; -- 1.7.10.2