annotationPanelHolder.add(annotationPanel, BorderLayout.CENTER);
sequenceHolderPanel.add(annotationPanelHolder, BorderLayout.SOUTH);
-
alabels = new AnnotationLabels(this);
setAnnotationVisible(av.showAnnotation);
}
}
});
-
}
public SequenceRenderer getSequenceRenderer()
{
return seqPanel.seqCanvas.sr;
}
-
- public FeatureRenderer getFeatureRenderer()
+ @Override
+ public jalview.api.FeatureRenderer getFeatureRenderer()
{
return seqPanel.seqCanvas.fr;
}
-
+ @Override
+ public jalview.api.FeatureRenderer cloneFeatureRenderer()
+ {
+ FeatureRenderer nfr = new FeatureRenderer(av);
+ nfr.transferSettings(seqPanel.seqCanvas.fr);
+ return nfr;
+ }
public void alignmentChanged()
{
av.alignmentChanged(this);
int mheight = height;
Dimension d = sequenceHolderPanel.getSize(), e = idPanel.getSize();
int seqandannot = d.height - scalePanelHolder.getSize().height;
- // sets initial preferred height
- if ((height + 40) > seqandannot / 2)
+
+ if (adjustPanelHeight)
{
- height = seqandannot / 2;
+ // NOTE: this logic is different in the application. Need a better algorithm to define behaviour
+ // sets initial preferred height
+ // try and set height according to alignment
+ float sscaling = (float) ((av.getCharHeight() * av.getAlignment().getHeight())/(1.0*mheight));
+ if (sscaling > 0.5)
+ {
+ // if the alignment is too big then
+ // default is 0.5 split
+ height = seqandannot / 2;
+ }
+ else
+ {
+ // otherwise just set the panel so that one row of sequence is visible
+ height = -av.getCharHeight() * 1
+ + (int) (seqandannot * (1 - sscaling));
+ }
}
- if (!adjustPanelHeight)
+ else
{
// maintain same window layout whilst updating sliders
height = annotationPanelHolder.getSize().height;