import jalview.analysis.AnnotationSorter;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
+import jalview.api.SequenceRenderer;
import jalview.bin.Cache;
import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
*/
public AlignmentPanel(AlignFrame af, final AlignViewport av)
{
-// setBackground(Color.white); // BH 2019
+ setBackground(Color.white); // BH 2019
+ setOpaque(true);
alignFrame = af;
this.av = av;
setSeqPanel(new SeqPanel(av, this));
*/
protected void validateAnnotationDimensions(boolean adjustPanelHeight)
{
+ // BH 2018.04.18 comment: addNotify() is not appropriate here. We
+ // are not changing ancestors, and keyboard action listeners do
+ // not need to be reset. addNotify() is a very expensive operation,
+ // requiring a full re-layout of all parents and children.
+ // Note in JComponent:
+ // This method is called by the toolkit internally and should
+ // not be called directly by programs.
+ // I note that addNotify() is called in several areas of Jalview.
+
int annotationHeight = getAnnotationPanel().adjustPanelHeight();
annotationHeight = getAnnotationPanel()
.adjustForAlignFrame(adjustPanelHeight, annotationHeight);
Dimension e = idPanel.getSize();
alabels.setSize(new Dimension(e.width, annotationHeight));
+
annotationSpaceFillerHolder.setPreferredSize(new Dimension(
annotationSpaceFillerHolder.getWidth(), annotationHeight));
annotationScroller.validate();
}
ranges.setViewportStartAndHeight(y, height);
}
- seqPanel.seqCanvas.clearFastPaint();
repaint();
}
public int getVisibleIdWidth(boolean onscreen)
{
// see if rendering offscreen - check preferences and calc width accordingly
- if (!onscreen && Cache.getDefault("FIGURE_AUTOIDWIDTH", false))
+ if (!onscreen && Cache.getDefault(Preferences.FIGURE_AUTOIDWIDTH, false))
{
return calculateIdWidth(-1).width + 4;
}
Integer idwidth = null;
if (onscreen || (idwidth = Cache
- .getIntegerProperty("FIGURE_FIXEDIDWIDTH")) == null)
+ .getIntegerProperty(Preferences.FIGURE_FIXEDIDWIDTH)) == null)
{
int w = getIdPanel().getWidth();
return (w > 0 ? w : calculateIdWidth().width + 4);
{
int seqPanelWidth = getSeqPanel().seqCanvas.getWidth();
- if (System.getProperty("java.awt.headless") != null
- && System.getProperty("java.awt.headless").equals("true"))
+ if (Jalview.isHeadlessMode())
{
seqPanelWidth = alignFrame.getWidth() - getVisibleIdWidth()
- vscroll.getPreferredSize().width
return calculationDialog;
}
+ @Override
+ public SequenceRenderer getSequenceRenderer()
+ {
+ return seqPanel.seqCanvas.getSequenceRenderer();
+ }
+
}