From: jprocter Date: Thu, 14 Jun 2012 10:34:01 +0000 (+0100) Subject: JAL-1118 WIP - flag to mark if image buffer has just been cleared ready for a redraw X-Git-Tag: Jalview_2_9~473 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=02e1d788cdc3fa6df26343b984e7ed6bfb6f3262;p=jalview.git JAL-1118 WIP - flag to mark if image buffer has just been cleared ready for a redraw --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index e00483d..85a31f7 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -66,7 +66,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, public BufferedImage image; - public BufferedImage fadedImage; + public volatile BufferedImage fadedImage; Graphics2D gg; @@ -715,7 +715,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, } } - + private volatile boolean imageFresh=false; /** * DOCUMENT ME! * @@ -758,9 +758,11 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, fm = gg.getFontMetrics(); gg.setColor(Color.white); gg.fillRect(0, 0, imgWidth, image.getHeight()); + imageFresh=true; } drawComponent(gg, av.startRes, av.endRes + 1); + imageFresh=false; g.drawImage(image, 0, 0, this); }