updated version to 2.6.1
[jalview.git] / src / jalview / appletgui / AnnotationPanel.java
index e3ba18b..6d55b13 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6.1)
  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
@@ -104,7 +104,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
   public void actionPerformed(ActionEvent evt)
   {
     AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
-    if (aa==null)
+    if (aa == null)
     {
       return;
     }
@@ -326,6 +326,11 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
     graphStretch = -1;
     graphStretchY = -1;
     mouseDragging = false;
+    if (needValidating)
+    {
+      ap.validate();
+      needValidating = false;
+    }
     ap.scalePanel.mouseReleased(evt);
   }
 
@@ -333,6 +338,8 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
   {
   }
 
+  boolean needValidating = false;
+
   public void mouseDragged(MouseEvent evt)
   {
     if (graphStretch > -1)
@@ -345,6 +352,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
       }
       graphStretchY = evt.getY();
       adjustPanelHeight();
+      needValidating = true;
       ap.paintAlignment(true);
     }
     else
@@ -447,13 +455,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;
@@ -693,9 +699,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
 
               if (v == column)
               {
-                g
-                        .fillRect(x * av.charWidth, y, av.charWidth,
-                                av.charHeight);
+                g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
               }
             }
           }
@@ -873,9 +877,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener,
           if (sCol == 0 || row.annotations[sCol - 1] == null
                   || row.annotations[sCol - 1].secondaryStructure != 'H')
           {
-            g
-                    .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8,
-                            90, 180);
+            g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
             x1 += av.charWidth / 2;
           }