{
System.out.println("NEEDS FIXING");
}
-
+ validateAnnotationDimensions(true);
+ addNotify();
+ repaint();
+ }
+ /**
+ * calculate the annotation dimensions and refresh slider values accordingly.
+ * need to do repaints/notifys afterwards.
+ */
+ protected void validateAnnotationDimensions(boolean adjustPanelHeight) {
int height = annotationPanel.adjustPanelHeight();
-
+
if (hscroll.isVisible())
{
height += hscroll.getPreferredSize().height;
{
height = alignFrame.getHeight() / 2;
}
-
+ if (!adjustPanelHeight)
+ {
+ // maintain same window layout whilst updating sliders
+ height=annotationScroller.getSize().height;
+ }
hscroll.addNotify();
-
+
annotationScroller.setPreferredSize(new Dimension(annotationScroller
.getWidth(), height));
annotationSpaceFillerHolder.setPreferredSize(new Dimension(
annotationSpaceFillerHolder.getWidth(), height));
annotationScroller.validate();// repaint();
- addNotify();
- repaint();
+ annotationScroller.addNotify();
}
/**
*/
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;
// 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;
}