removes unnecessary clearFastPaint
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Thu, 18 Apr 2019 17:54:46 +0000 (12:54 -0500)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Thu, 18 Apr 2019 17:54:46 +0000 (12:54 -0500)
src/jalview/appletgui/AlignmentPanel.java
src/jalview/gui/AlignmentPanel.java

index edb9522..58569cd 100644 (file)
@@ -916,7 +916,6 @@ public class AlignmentPanel extends Panel
             av.isShowAutocalculatedAbove());
     sorter.sort(getAlignment().getAlignmentAnnotation(),
             av.getSortAnnotationsBy());
-    this.seqPanel.seqCanvas.clearFastPaint();
     repaint();
 
     if (updateStructures)
index 4e5e72b..20f8cd1 100644 (file)
@@ -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)