net.refractions.udig.project.render
Interface IMultiLayerRenderer

All Superinterfaces:
IRenderer

public interface IMultiLayerRenderer
extends IRenderer

The CompositeRenderer is a container for all the Renderers of a viewport.

Produces a Image out of a series of renderers, provides viewport pane notification when content changes.

  • Renderer must ensure that the layers are combined in the correct zorder. The largest zorder must be drawn first.
  • Combines all outputs from contained renderers into a buffered image
  • Image creation is provided by RenderContext
  • Double Buffering is handled by someone else (viewport pane)
  • CompositeRenderer must register with its contained renderers so it can merge the rendered layers again.
  • The events the render stack must listen for are setState(DONE) events. The following code illustrates how this can be done:
    
     executor.eAdapters().add(new RenderListenerAdapter(){
         //renderDone is called when setState(DONE) is called
         protected void renderDone() {
             synchronized (CompositeRendererImpl.this) {
                 setState(DONE);
             }
         }
     });
     
  • Call setState(RENDERING) when a redraw is required.
  • The Default implementation simply draws the layers overtop one another to merge the Layers. CompositeRenderer

    Author:
    jeichar

    Field Summary
     
    Fields inherited from interface net.refractions.udig.project.render.IRenderer
    CANCELLED, DISPOSED, DONE, NEVER, RENDER_EXT, RENDER_REQUEST, RENDERING, STARTING
     
    Method Summary
     IRenderContext getContext()
              Implementation always returns a CompositeRendererContext.
     void refreshImage()
              Called when the map has changed.
     
    Methods inherited from interface net.refractions.udig.project.render.IRenderer
    dispose, getRenderBounds, getState, isCacheable, render, render, setRenderBounds
     

    Method Detail

    getContext

    IRenderContext getContext()
    Implementation always returns a CompositeRendererContext.

    Note: The declaration of getContext is declared in IRender so the return type cannot be declared in this interface

    Specified by:
    getContext in interface IRenderer
    Returns:
    a CompositeRendererContext.
    See Also:
    IRenderContext

    refreshImage

    void refreshImage()
                      throws RenderException
    Called when the map has changed.

    This method is guaranteed not to block.

    Usually the image will merge the images for each layer. However in some cases, such as for a WMS, the image will have to be recreated. This should be a quick operation.

    Note: This command differs from render. render() forces a full rerendering of the data whereas refreshImage does not require that the renderer access the data again.

    Throws:
    RenderException