first patch for JAL-563 - attempt to relayout annotation panel after adjusting heights
authorjprocter <Jim Procter>
Fri, 4 Jun 2010 15:44:15 +0000 (15:44 +0000)
committerjprocter <Jim Procter>
Fri, 4 Jun 2010 15:44:15 +0000 (15:44 +0000)
src/jalview/appletgui/AnnotationPanel.java

index e3ba18b..1a5697f 100755 (executable)
@@ -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;