JAL-1118 WIP - flag to mark if image buffer has just been cleared ready for a redraw
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 14 Jun 2012 10:34:01 +0000 (11:34 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 14 Jun 2012 10:34:01 +0000 (11:34 +0100)
src/jalview/gui/AnnotationPanel.java

index e00483d..85a31f7 100755 (executable)
@@ -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);
   }