Renderers bring to gether information and put it on the screen. The interesting thing about the uDig renderering system is it is adaptive. The correct geospatial inforamtion is brought together based on the available metadata information (such as style or performance metrics).
uDig currently uses StreamingRenderer as a general purpose feature renderer.
There is an optimized ShapefileRenderer which is used to render shapefiles only. The shapefile renderer can only render data from shapefiles but it can do so at speeds from 20-500% faster than StreamingRenderer. Both feature renderers are fully SLD compliant.
It also uses has separate renderers for communicating with WMSs, and rendering Coverages.
Renderers are associated with layers, and are specific to a GeoResources.
A renderer is chosen if:
- It can render the layer using an available GeoResource.
- It can style the layer. The renderer capable of the most accurate styling is chosen if both 1 and 2 are satisfied.
- It is optimized for the particular GeoResource type.
A Renderer class implements one of:
- Renderer interface: is responsible for renderering a single layer.
- MultiLayerRenderer interface: is responsible for renderering multiple layers
Through the Map datastructure you have access to rather a lot of information, to make matters easier we have gathered together the "useful" information for you ... into a RenderContext. The Pattern police call this a Facade, we call it easier.
Each renderer is provided with a context:
- Renderers get a IRenderContext
- MultiLayerRenderers get a ICompositeRenderContextfor
(A ICompositeRenderContext contains a set of IRenderContexts, not necessarily ordered).
The context objects provide access to the Map data model, provide useful methods, have methods to access the layer and GeoResource that the renderer must use and render and contains the image that the renderer must render to.

Object |
Task |
RenderManager |
Responsible for creating renderers and triggering refreshes. |
RendererCreator |
The default implementation uses a renderer creator to create renderers. The default implementation chooses a renderer based on the criteria mentioned earler. |
RenderMetricsFactory |
Can create the RenderMetrics for a given renderer. It is the class that is created from Extensions. It has a short cut method that can detect whether a resource will ever be able to render the resource. |
RenderMetrics |
Provides information on whether the renderer can correctly style a layer, if it the renderer has been optimized for rendering the resource and whether more resources can be added to the context object (in the case where the renderer is a MultiLayerRenderer). It also creates the renderer. The RenderMetrics is provided with a RenderContext to make these calculations. The Metrics MUST base its information on the assumption that the renderer will use the GeoResource provided by the RenderContext. |
RendererExecutor |
Each renderer has an executor that runs the renderer in a separate thread. There are currently 3 implementations. One for each type of renderer. (Composite/MultiLayer/Renderer). The CompositeRendererExecutor provides the incremental update functionality. |
Renderer |
Renders a resource, specifically, the resource referenced by the RenderContext. The renderer is responsible for listening to their resource and triggering updates when the resource changes. |
|
Takes a CompositeRenderContext and renders all the resources in the contexts into the image obtained from the composite RenderContext. |
|
Creates a seperate renderer for each context in the CompositeRenderContext. Each Renderer is assigned to its own RenderExecutor. (The Standard implementation uses the same RendererCreator as the RenderManager). |
RenderContext |
A RenderContext is a facade into the system in addition to having references to the Layer that the Renderer must render as and the GeoResource that the will be used by the renderer. Finally the RenderContext contains the image that the Renderer must render to and has a number of generally useful methods. |
|
A CompositeRenderContext contains a set of RenderContexts. The image that is rendered to is the image contained by the CompositeRenderContext, the contained RenderContexts will not be rendered to. |
As mentioned at the start of the page, uDig makes use of metadata and metrics to figure out which Renderer is best suited to the task at hand.
Lets see how this works with a quick example:

A layer makes use of a WMS GeoResource, a NamedStyle from the Blackboard, this results in a WMSRenderer being chosen to draw onto the screen.
Note just because a WMS is being used to draw does not prevent other tools from using the layer in a different manner.

An editor makes use of the same layer, this time a WFS is used to access the real Feature data
Note that several renderers may draw from the same layer at once.

This time a custom SLD style is being used to draw the "selected" features
|