From 11cce1c1e065d4430400ad414460ae643b51fbfe Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 4 Jun 2010 15:44:15 +0000 Subject: [PATCH] first patch for JAL-563 - attempt to relayout annotation panel after adjusting heights --- src/jalview/appletgui/AnnotationPanel.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index e3ba18b..1a5697f 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -326,13 +326,18 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, graphStretch = -1; graphStretchY = -1; mouseDragging = false; + if (needValidating) + { + ap.validate(); + needValidating=false; + } ap.scalePanel.mouseReleased(evt); } public void mouseClicked(MouseEvent evt) { } - + boolean needValidating=false; public void mouseDragged(MouseEvent evt) { if (graphStretch > -1) @@ -345,6 +350,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, } graphStretchY = evt.getY(); adjustPanelHeight(); + needValidating=true; ap.paintAlignment(true); } else @@ -447,13 +453,11 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, height += aa[i].height; } } - else + if (height==0) { height = 20; } - this.setSize(getSize().width, height); - repaint(); return height; -- 1.7.10.2