From 09bcf67a11fad002fc7c18aca46bf3672bb9f3ec Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 19 Sep 2005 13:41:25 +0000 Subject: [PATCH] Make sure fontmetrics exists for headless state --- src/jalview/gui/AnnotationPanel.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 8a220b8..15bc284 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -608,6 +608,9 @@ public class AnnotationPanel extends JPanel implements MouseListener, */ public void drawComponent(Graphics2D g, int startRes, int endRes) { + if(fm==null) + fm = g.getFontMetrics(); + g.setColor(Color.white); g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getHeight()); -- 1.7.10.2