X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=1ba04b464718211afaa6936cbaab156cb6644839;hb=36c3c5a0883c68bb8b007bb392668977331f9f1a;hp=3dee5a8c3723d440954a062ed3917e2023cd56ce;hpb=bef980d8536bd7da240abcbf357e3ed3b064b523;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 3dee5a8..1ba04b4 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -971,7 +971,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, * @param horizontal * repaint with horizontal shift in alignment */ - public void fastPaint(int horizontal, boolean isresize) + public void fastPaint(int horizontal) { if ((horizontal == 0) || gg == null || av.getAlignment().getAlignmentAnnotation() == null @@ -985,45 +985,20 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, int sr = av.getRanges().getStartRes(); int er = av.getRanges().getEndRes() + 1; int transX = 0; - long stime; - long mtime; - if (isresize) - { - imgWidth = (av.getRanges().getEndRes() - av.getRanges().getStartRes() - + 1) * av.getCharWidth(); - - if (imgWidth > 0) - { - BufferedImage newimage = new BufferedImage(imgWidth, - ap.getAnnotationPanel().getHeight(), - BufferedImage.TYPE_INT_ARGB); + long stime = System.currentTimeMillis(); + gg.copyArea(0, 0, imgWidth, getHeight(), + -horizontal * av.getCharWidth(), 0); + long mtime = System.currentTimeMillis(); - gg = (Graphics2D) newimage.getGraphics(); - gg.setFont(av.getFont()); - gg.drawImage(image, null, 0, 0); - image = newimage; - - transX = (er - horizontal - sr) * av.getCharWidth(); - sr = er - horizontal - sr; - } + if (horizontal > 0) // scrollbar pulled right, image to the left + { + transX = (er - sr - horizontal) * av.getCharWidth(); + sr = er - horizontal; } - else + else if (horizontal < 0) { - stime = System.currentTimeMillis(); - gg.copyArea(0, 0, imgWidth, getHeight(), - -horizontal * av.getCharWidth(), 0); - mtime = System.currentTimeMillis(); - - if (horizontal > 0) // scrollbar pulled right, image to the left - { - transX = (er - sr - horizontal) * av.getCharWidth(); - sr = er - horizontal; - } - else if (horizontal < 0) - { - er = sr - horizontal; - } + er = sr - horizontal; } gg.translate(transX, 0); @@ -1197,12 +1172,11 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, // Respond to viewport range changes (e.g. alignment panel was scrolled) if (evt.getPropertyName().equals("startres")) { - fastPaint((int) evt.getNewValue() - (int) evt.getOldValue(), false); + fastPaint((int) evt.getNewValue() - (int) evt.getOldValue()); } else if (evt.getPropertyName().equals("endres")) { - // resize - fastPaint((int) evt.getNewValue() - (int) evt.getOldValue(), true); + // resize - do nothing } } }