JAL-1291 conditional output of rendering debugging info
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index ed7f359..eb21dbc 100755 (executable)
@@ -800,7 +800,10 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     imageFresh = false;
     g.drawImage(image, 0, 0, this);
   }
-
+  /**
+   * set true to enable redraw timing debug output on stderr
+   */
+  private final boolean debugRedraw = false;
   /**
    * non-Thread safe repaint
    * 
@@ -809,7 +812,6 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
    */
   public void fastPaint(int horizontal)
   {
-
     if ((horizontal == 0) || gg == null
             || av.getAlignment().getAlignmentAnnotation() == null
             || av.getAlignment().getAlignmentAnnotation().length < 1
@@ -818,8 +820,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       repaint();
       return;
     }
+    long stime=System.currentTimeMillis();
     gg.copyArea(0, 0, imgWidth, getHeight(), -horizontal * av.charWidth, 0);
-
+    long mtime=System.currentTimeMillis();
     int sr = av.startRes;
     int er = av.endRes + 1;
     int transX = 0;
@@ -839,9 +842,13 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     drawComponent(gg, sr, er);
 
     gg.translate(-transX, 0);
-
+    long dtime=System.currentTimeMillis();
     fastPaint = true;
     repaint();
+    long rtime=System.currentTimeMillis();
+    if (debugRedraw) {
+      System.err.println("Scroll:\t"+horizontal+"\tCopyArea:\t"+(mtime-stime)+"\tDraw component:\t"+(dtime-mtime)+"\tRepaint call:\t"+(rtime-dtime));
+    }
 
   }