From 0f7960c1a7b70cfffae875303e4445215278e9df Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 28 Nov 2006 09:44:11 +0000 Subject: [PATCH] No need to create tmpAnnotationPanel every paint --- src/jalview/gui/IdCanvas.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 0fe986a..b2a5ede 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -44,6 +44,8 @@ public class IdCanvas extends JPanel boolean fastPaint = false; java.util.Vector searchResults; FontMetrics fm; + AnnotationLabels labels = null; + AnnotationPanel ap; /** * Creates a new IdCanvas object. @@ -239,13 +241,16 @@ public class IdCanvas extends JPanel maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1; int annotationHeight = 0; - AnnotationLabels labels = null; + if(av.showAnnotation) { - AnnotationPanel ap = new AnnotationPanel(av); + if (ap == null) + ap = new AnnotationPanel(av); + annotationHeight = ap.adjustPanelHeight(); - labels = new AnnotationLabels(av); + if (labels == null) + labels = new AnnotationLabels(av); } int hgap = av.charHeight; -- 1.7.10.2