{
drawComponent(g, false, width);
}
+
+ private final boolean debugRedraw = false;
/**
* Draw the full set of annotation Labels for the alignment at the given cursor
*
{
if (!before)
{
- System.out.println("before vis: "+i);
+ if (debugRedraw) {
+ System.out.println("before vis: "+i);
+ }
before=true;
}
// don't draw what isn't visible
if (!after)
{
- System.out.println("Scroll offset: "+sOffset+" after vis: "+i);
+ if (debugRedraw) {
+ System.out.println("Scroll offset: "+sOffset+" after vis: "+i);
+ }
after=true;
}
// don't draw what isn't visible
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
*
*/
public void fastPaint(int horizontal)
{
-
if ((horizontal == 0) || gg == null
|| av.getAlignment().getAlignmentAnnotation() == null
|| av.getAlignment().getAlignmentAnnotation().length < 1
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;
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));
+ }
}
public class AnnotationRenderer
{
+ /**
+ * flag indicating if timing and redraw parameter info should be output
+ */
+ private final boolean debugRedraw;
public AnnotationRenderer()
{
- // TODO Auto-generated constructor stub
+ this(false);
+ }
+ /**
+ * Create a new annotation Renderer
+ * @param debugRedraw flag indicating if timing and redraw parameter info should be output
+ */
+ public AnnotationRenderer(boolean debugRedraw)
+ {
+ this.debugRedraw=debugRedraw;
}
public void drawStemAnnot(Graphics g, Annotation[] row_annotations,
/**
* indicate if the renderer should only render the visible portion of the annotation given the current view settings
*/
- private boolean useClip=false;
+ private boolean useClip=true;
/**
* master flag indicating if renderer should ever try to clip. not enabled for jalview 2.8.1
*/
private boolean canClip=false;
+
// public void updateFromAnnotationPanel(FontMetrics annotFM, AlignViewportI
// av)
public void updateFromAwtRenderPanel(AwtRenderPanelI annotPanel,
AlignViewportI av, Graphics g, int activeRow, int startRes,
int endRes)
{
+ long stime=System.currentTimeMillis();
boolean usedFaded = false;
// NOTES:
// AnnotationPanel needs to implement: ImageObserver, access to
y += aa[i].height;
}
}
- if (canClip)
+ if (debugRedraw)
{
- if (clipst)
+ if (canClip)
{
- System.err.println("Start clip at : " + yfrom + " (index " + f_i
- + ")");
- }
- if (clipend)
- {
- System.err
- .println("End clip at : " + yto + " (index " + f_to + ")");
+ if (clipst)
+ {
+ System.err.println("Start clip at : " + yfrom + " (index " + f_i
+ + ")");
+ }
+ if (clipend)
+ {
+ System.err.println("End clip at : " + yto + " (index " + f_to
+ + ")");
+ }
}
+ ;
+ System.err.println("Annotation Rendering time:"
+ + (System.currentTimeMillis() - stime));
}
;
+
return !usedFaded;
}