private final SequenceRenderer seqRdr;
- boolean fastPaint = false;
+ private boolean fastPaint = false;
private boolean fastpainting = false;
@Override
public void paintComponent(Graphics g)
{
-
if (av.getAlignPanel().getHoldRepaint())
{
return;
availWidth -= (availWidth % charWidth);
availHeight -= (availHeight % charHeight);
- // BH 2019 can't possibly fastPaint if either width or height is 0
-
if (availWidth == 0 || availHeight == 0)
{
return;
int endRes = ranges.getEndRes();
int endSeq = ranges.getEndSeq();
- // [JAL-3226] problem that JavaScript (or Java) may consolidate multiple
- // repaint() requests in unpredictable ways. In this case, the issue was
- // that in response to a CTRL-C/CTRL-V paste request, in Java a fast
- // repaint request preceded two full requests, thus resulting
- // in a full request for paint. In constrast, in JavaScript, the three
- // requests were bundled together into one, so the fastPaint flag was
- // still present for the second and third request.
- //
- // This resulted in incomplete painting.
- //
- // The solution was to set seqCanvas.fastPaint and idCanvas.fastPaint false
- // in PaintRefresher when the target to be painted is one of those two
- // components.
- //
- // BH 2019.04.22
- //
- // An initial idea; can be removed once we determine this issue is closed:
- // if (av.isFastPaintDisabled())
- // {
- // fastPaint = false;
- // }
-
Rectangle vis, clip;
if (img != null
&& (fastPaint
/**
* Using the current font, determine fields labelWidthEast and labelWidthWest,
- * and return the number of residues that can fill the remaining width.
+ * and return the number of residues that can fill the remaining width
*
- * @param width
+ * @param w
* the width in pixels (possibly including scales)
*
* @return the visible width in residues, after allowing for East or West
* scales (if shown)
*
*/
- public int getWrappedCanvasWidth(int width)
+ public int getWrappedCanvasWidth(int w)
{
int charWidth = av.getCharWidth();
labelWidthWest = av.getScaleLeftWrapped() ? labelWidth : 0;
- return (width - labelWidthEast - labelWidthWest) / charWidth;
+ return (w - labelWidthEast - labelWidthWest) / charWidth;
}
/**
// typically scroll, but possibly just the end changed
fastPaint(0, (int) evt.getNewValue() - (int) evt.getOldValue());
return;
- case ViewportRanges.ENDRES:
- case ViewportRanges.ENDSEQ:
- // meaning second event along with "START" -- ENDONLY,NOTSTART
- // TODO: ignore??
- return;
case ViewportRanges.STARTRES:
// meaning STARTOREND
scrollX = (int) evt.getNewValue() - (int) evt.getOldValue();
}
break;
+ default:
+ return;
}
ViewportRanges vpRanges = av.getRanges();
return labelWidthWest;
}
+ /**
+ * Clears the flag that allows a 'fast paint' on the next repaint, so
+ * requiring a full repaint
+ */
+ public void setNoFastPaint()
+ {
+ fastPaint = false;
+ }
+
}