Ask the renderer to update the internal image using the smaller of getRenderBounds() or ViewportBounds.
Render State
Normally the RenderManager will update the screen every second. However if the renderer has data that must be displayed then
it can call setState(RENDERING) and the Screen will be updated immediately. This should be called with care however since many
such calls can cause performance problems.
Internal Image
The RenderContext maintains an "internal image" that you can access using getContext().getGraphics();
you can use Image.createGraphics() to retrive a Graphics2d to draw with.
Example Implementation:
public void render( IProgressMonitor monitor ) throws RenderException {
if( monitor == null ) monitor = NullProgressMonitor();
Graphics2D g = getContext().getImage().createGraphics();
render(g, monitor);
}
Updating a Portion of the Screen
When the envelope (ie getRenderBounds()) is smaller than the ViewportBounds, the rendered area
DOES NOT TAKE UP THE WHOLE MapDisplay. It only takes up the area that the envelope
would map to. The purpose of this functionality is to allows only a small area of the
MapDisplay to be refreshed rather than the whole area.
Please choose the smallest of:
- getRenderBounds() - an Envelope in your CRS
- viewPortBounds()
See Also: IRenderer.getContext() See Also: IRenderContext.getImage See Also: IRenderContext.getImage(intint) See Also: See Also: This method will block See Also:
See Also: See Also: A value of null renders the bounds the entire viewport obtained from the See Also: ViewportModel.getBounds(). See Also:
throws: RenderException - |