From 712aae0966c10bcb460ec63b81f85ae95cd182e6 Mon Sep 17 00:00:00 2001 From: hansonr Date: Thu, 18 Apr 2019 12:54:46 -0500 Subject: [PATCH] removes unnecessary clearFastPaint --- src/jalview/appletgui/AlignmentPanel.java | 1 - src/jalview/gui/AlignmentPanel.java | 15 +++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index edb9522..58569cd 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -916,7 +916,6 @@ public class AlignmentPanel extends Panel av.isShowAutocalculatedAbove()); sorter.sort(getAlignment().getAlignmentAnnotation(), av.getSortAnnotationsBy()); - this.seqPanel.seqCanvas.clearFastPaint(); repaint(); if (updateStructures) diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 4e5e72b..20f8cd1 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -543,6 +543,14 @@ public class AlignmentPanel extends GAlignmentPanel implements */ 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. + int annotationHeight = getAnnotationPanel().adjustPanelHeight(); annotationHeight = getAnnotationPanel() .adjustForAlignFrame(adjustPanelHeight, annotationHeight); @@ -554,6 +562,7 @@ public class AlignmentPanel extends GAlignmentPanel implements Dimension e = idPanel.getSize(); alabels.setSize(new Dimension(e.width, annotationHeight)); + annotationSpaceFillerHolder.setPreferredSize(new Dimension( annotationSpaceFillerHolder.getWidth(), annotationHeight)); annotationScroller.validate(); @@ -810,12 +819,6 @@ public class AlignmentPanel extends GAlignmentPanel implements av.isShowAutocalculatedAbove()); sorter.sort(getAlignment().getAlignmentAnnotation(), av.getSortAnnotationsBy()); - // BH 2019.04.18 this should not be necessary, but - // there is something wrong with the fast painting - // in that there is a -1 shift that should not be there. - // It is being covered in Java by the Consensus and Conservation - // threads forcing a full repaint after pasting. - seqPanel.seqCanvas.clearFastPaint(); repaint(); if (updateStructures) -- 1.7.10.2