01: /*
02: * uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004,
03: * Refractions Research Inc. This library is free software; you can redistribute it and/or modify it
04: * under the terms of the GNU Lesser General Public License as published by the Free Software
05: * Foundation; version 2.1 of the License. This library is distributed in the hope that it will be
06: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
07: * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
08: */
09: package net.refractions.udig.project.internal.render;
10:
11: import net.refractions.udig.project.render.IMultiLayerRenderer;
12: import net.refractions.udig.project.render.RenderException;
13:
14: /**
15: * The CompositeRenderer is a container for all the Renderers of a viewport.
16: * <p>
17: * Produces a Image out of a series of renderers, provides viewport pane notification when content
18: * changes.
19: * </p>
20: * <p>
21: * <li>Renderer must ensure that the layers are combined in the correct zorder. The largest zorder
22: * must be drawn first.</li>
23: * <li>Combines all outputs from contained renderers into a buffered image</li>
24: * <li>Image creation is provided by RenderContext</li>
25: * <li>Double Buffering is handled by someone else (viewport pane)</li>
26: * <li>CompositeRenderer must register with its contained renderers so it can merge the rendered
27: * layers again.</li>
28: * <li>The events the render stack must listen for are setState(DONE) events. The following code
29: * illustrates how this can be done:
30: *
31: * <pre><code>
32: * executor.eAdapters().add(new RenderListenerAdapter(){
33: * //renderDone is called when setState(DONE) is called
34: * protected void renderDone() {
35: * synchronized (CompositeRendererImpl.this) {
36: * setState(DONE);
37: * }
38: * }
39: * });
40: * </code></pre>
41: *
42: * <li>Call setState(RENDERING) when a redraw is required.</li>
43: * </p>
44: * The Default implementation simply draws the layers overtop one another to merge the Layers.
45: * CompositeRenderer
46: * </p>
47: *
48: * @author jeichar
49: * @model abstract="true"
50: */
51: public interface MultiLayerRenderer extends Renderer,
52: IMultiLayerRenderer {
53:
54: /**
55: * <!-- begin-user-doc --> <!-- end-user-doc -->
56: *
57: * @generated
58: */
59: String copyright = "uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004, Refractions Research Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details."; //$NON-NLS-1$
60:
61: /**
62: * Called when the map has changed.
63: * <p>
64: * this method is guaranteed not to block
65: * </p>
66: * <p>
67: * Usually the image will merge the images for each layer. However in some cases, such as for a
68: * WMS, the image will have to be recreated. This should be a quick operation.
69: * </p>
70: * <p>
71: * Note: This command differs from render. render() forces a full rerendering of the data
72: * whereas refreshImage does not require that the renderer access the data again.
73: *
74: * @throws RenderException
75: * @model
76: */
77: void refreshImage() throws RenderException;
78: }
|