From: amwaterhouse Date: Tue, 28 Nov 2006 09:44:11 +0000 (+0000) Subject: No need to create tmpAnnotationPanel every paint X-Git-Tag: Release_2_2~19 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0f7960c1a7b70cfffae875303e4445215278e9df;p=jalview.git No need to create tmpAnnotationPanel every paint --- 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;