JAL-853 use service action attribute to index services in webservices menu and hardwi...
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index a7cca2c..8a93f79 100755 (executable)
@@ -132,6 +132,24 @@ public class AnnotationPanel extends JPanel implements MouseListener,
    */
   public int adjustPanelHeight()
   {
+    int height=calcPanelHeight();
+    this.setPreferredSize(new Dimension(1, height));
+    if (ap != null)
+    {
+      // revalidate only when the alignment panel is fully constructed
+      ap.validate();
+    }
+
+    return height;
+  }
+
+  /**
+   * calculate the height for visible annotation, revalidating bounds where necessary
+   * ABSTRACT GUI METHOD
+   * @return total height of annotation
+   */
+  public int calcPanelHeight()
+  {
     // setHeight of panels
     AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
     int height = 0;
@@ -180,14 +198,6 @@ public class AnnotationPanel extends JPanel implements MouseListener,
       // set minimum
       height = 20;
     }
-
-    this.setPreferredSize(new Dimension(1, height));
-    if (ap != null)
-    {
-      // revalidate only when the alignment panel is fully constructed
-      ap.validate();
-    }
-
     return height;
   }
 
@@ -1376,7 +1386,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         }
       }
       // draw profile if available
-      if (aa.annotations[column].value != 0 && renderProfile)
+      if (renderProfile && aa.annotations[column].value != 0)
       {
         int profl[] = getProfileFor(aa, column);
         int ht = y1, htn = y2 - y1;// aa.graphHeight;