private OverviewDimensions od;
+ private OverviewRenderer or = null;
+
private AlignViewportI av;
public OverviewCanvas(OverviewDimensions overviewDims,
if (updaterunning)
{
restart = true;
+ if (or != null)
+ {
+ or.setRedraw(true);
+ }
}
else
{
setPreferredSize(new Dimension(od.getWidth(), od.getHeight()));
- OverviewRenderer or = new OverviewRenderer(sr, fr, od);
+ or = new OverviewRenderer(sr, fr, od);
miniMe = or.draw(od.getRows(av.getAlignment()),
od.getColumns(av.getAlignment()));
// raw number of pixels to allocate to each row
private float pixelsPerSeq;
+ // flag to indicate whether to halt drawing
+ private boolean redraw = false;
+
public OverviewRenderer(jalview.api.SequenceRenderer seqRenderer,
FeatureRenderer fr, OverviewDimensions od)
- // FeatureColourFinder colfinder, OverviewDimensions od)
{
sr = seqRenderer;
- finder = new FeatureColourFinder(fr); // colfinder;
+ finder = new FeatureColourFinder(fr);
pixelsPerCol = od.getPixelsPerCol();
pixelsPerSeq = od.getPixelsPerSeq();
int rgbcolor = Color.white.getRGB();
int seqIndex = 0;
int pixelRow = 0;
+
for (int alignmentRow : rows)
{
+ if (redraw)
+ {
+ break;
+ }
+
// get details of this alignment row
boolean hidden = rows.isHidden(alignmentRow);
SequenceI seq = rows.getSequence(alignmentRow);
int pixelCol = 0;
for (int alignmentCol : cols)
{
+ if (redraw)
+ {
+ break;
+ }
+
// calculate where this column extends to in pixels
int endCol = Math.min(
Math.round((colIndex + 1) * pixelsPerCol) - 1,
int pixelCol = 0;
for (int alignmentCol : cols)
{
+ if (redraw)
+ {
+ break;
+ }
if (alignmentCol >= annotations.length)
{
break; // no more annotations to draw here
}
}
}
+
+ public void setRedraw(boolean b)
+ {
+ synchronized (this)
+ {
+ redraw = b;
+ }
+ }
}