JAL-3383 removing colour caching (to a separate branch)
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index d305183..2f5d83b 100644 (file)
@@ -70,7 +70,14 @@ import java.util.List;
 import javax.swing.SwingUtilities;
 
 /**
- * DOCUMENT ME!
+ * The main panel of an AlignFrame, containing holders for the IdPanel,
+ * SeqPanel, AnnotationLabels (a JPanel), and AnnotationPanel.
+ * 
+ * Additional holders contain an IdPanelWidthAdjuster space above the idPanel,
+ * AnnotationScroller (JScrollPane for AnnotationPanel), and vertical and
+ * horizontal scrollbars.
+ * 
+ * 
  * 
  * @author $author$
  * @version $Revision: 1.161 $
@@ -585,7 +592,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    */
   public void updateLayout()
   {
-    fontChanged();
+    fontChanged(); // fires repaint
     setAnnotationVisible(av.isShowAnnotation());
     boolean wrap = av.getWrapAlignment();
     ViewportRanges ranges = av.getRanges();
@@ -852,6 +859,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   @Override
   public void paintComponent(Graphics g)
   {
+
     invalidate(); // needed so that the id width adjuster works correctly
 
     Dimension d = getIdPanel().getIdCanvas().getPreferredSize();
@@ -1846,4 +1854,37 @@ public class AlignmentPanel extends GAlignmentPanel implements
     overviewPanel.canvas.finalizeDraw(miniMe);
   }
 
+
+  private boolean holdRepaint = false;
+
+  public boolean getHoldRepaint()
+  {
+    return holdRepaint;
+  }
+
+  public void setHoldRepaint(boolean b)
+  {
+    if (holdRepaint == b)
+    {
+      return;
+    }
+    holdRepaint = b;
+    if (!b)
+    {
+      repaint();
+    }
+  }
+
+  @Override
+  public void repaint()
+  {
+    if (holdRepaint)
+    {
+      // System.out.println("AP repaint holding");
+      // Platform.stackTrace();
+      return;
+    }
+    super.repaint();
+  }
+
 }