From: amwaterhouse Date: Tue, 30 Aug 2005 14:33:02 +0000 (+0000) Subject: Repaint annotations after edit X-Git-Tag: Release_2_05b~80 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c4c63a44f658c697f670c3c0b091372a6a3a9cd6;p=jalview.git Repaint annotations after edit --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 4f984fd..8a262d9 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -531,24 +531,18 @@ public class AnnotationPanel extends JPanel implements MouseListener, imgWidth = (av.endRes - av.startRes + 1) * av.charWidth; - if (image != null && imgWidth == image.getWidth()) + if (image == null || imgWidth != image.getWidth()) { - //This will be called by a mouse over, tool tip etc - // no need to redraw whole image - g.drawImage(image, 0, 0, this); - fastPaint = false; - return; + image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(), + BufferedImage.TYPE_INT_RGB); + gg = (Graphics2D) image.getGraphics(); + gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + gg.setFont(av.getFont()); + fm = gg.getFontMetrics(); } - image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(), - BufferedImage.TYPE_INT_RGB); - gg = (Graphics2D) image.getGraphics(); - gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); - - gg.setFont(av.getFont()); - fm = gg.getFontMetrics(); - drawComponent(gg, av.startRes, av.endRes + 1); g.drawImage(image, 0, 0, this); }