public void componentResized(ComponentEvent evt)
{
setScrollValues(av.getStartRes(), av.getStartSeq());
+ if (getSize().height>0 && annotationPanelHolder.getSize().height>0) {
+ validateAnnotationDimensions(false);
+ }
repaint();
}
apvscroll.addNotify();
hscroll.addNotify();
validate();
- addNotify();
repaint();
}
/**
* need to do repaints/notifys afterwards.
*/
protected void validateAnnotationDimensions(boolean adjustPanelHeight) {
+ boolean modified=false;
int height = annotationPanel.calcPanelHeight();
+ int minsize=0;
if (hscroll.isVisible())
{
- height += hscroll.getPreferredSize().height;
+ height += (minsize=hscroll.getPreferredSize().height);
+ }
+ if (apvscroll.isVisible()) {
+ minsize+=apvscroll.getPreferredSize().height;
}
int mheight = height;
+ Dimension d=sequenceHolderPanel.getSize(),e=idPanel.getSize();
+ int seqandannot=d.height-scalePanelHolder.getSize().height;
// sets initial preferred height
- if ((height+40) > getSize().height / 2)
+ if ((height+40) > seqandannot / 2)
{
- height = getSize().height / 2;
+ height = seqandannot / 2;
}
if (!adjustPanelHeight)
{
// maintain same window layout whilst updating sliders
- height=seqPanelHolder.getSize().height;
+ height=annotationPanelHolder.getSize().height;
+ }
+
+ if (seqandannot-height<5)
+ {
+ height = seqandannot;
}
- Dimension d=seqPanelHolder.getSize(),e=idPanel.getSize();
annotationPanel.setSize(new Dimension(d.width,height));
- alabels.setSize(e.width,height);
+ alabels.setSize(new Dimension(e.width,height));
annotationSpaceFillerHolder.setSize(new Dimension(e.width, height));
annotationPanelHolder.setSize(new Dimension(d.width, height));
- seqPanelHolder.setSize(d.width,d.height-height);
+ seqPanelHolder.setSize(d.width,seqandannot-height);
int s=apvscroll.getValue();
if (s>mheight-height)
{
s = 0;
}
- apvscroll.setValues(apvscroll.getValue(), height, 0, mheight);
+ apvscroll.setValues(s, height, 0, mheight);
annotationPanel.setScrollOffset(apvscroll.getValue());
alabels.setScrollOffset(apvscroll.getValue());
}