From c4c63a44f658c697f670c3c0b091372a6a3a9cd6 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 30 Aug 2005 14:33:02 +0000 Subject: [PATCH] Repaint annotations after edit --- src/jalview/gui/AnnotationPanel.java | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) 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); } -- 1.7.10.2