endBatchDrawing();
The endBatchDrawing method of the Window class marks the end of a batch mode operation and requests that the window redraw itself by replaying the drawing script.
If the window is repainted while still in batch mode, batch mode is cancelled and another paint request issued. This is necessary if the whole window has not been redrawn.
During batch mode, drawing requests are collected into the drawing script (as normally occurs when the autoRedraw property is set to true), but are not drawn. No evaluation of whether previous script entries are redundant is performed (for example, does a filled rectangle totally cover a previously drawn line?).
Use of batch drawing mode can reduce flicker associated with consecutive drawing operations and improve performance by using the same window drawing environment for the entire script.