01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package net.refractions.udig.render.internal.gridcoverage.basic;
18:
19: import net.refractions.udig.project.render.ICompositeRenderContext;
20: import net.refractions.udig.project.render.IRenderContext;
21: import net.refractions.udig.project.render.IRenderMetrics;
22: import net.refractions.udig.project.render.IRenderMetricsFactory;
23:
24: import org.opengis.coverage.grid.GridCoverage;
25:
26: /**
27: * The RenderMetricFactory Implementation for the BasicGridCoverageRenderer Extension.
28: *
29: * @author Jesse Eichar
30: * @version $Revision: 1.9 $
31: */
32: public class BasicGridCoverageMetricsFactory implements
33: IRenderMetricsFactory {
34:
35: /**
36: * TODO summary sentence for canRender ...
37: *
38: * @see net.refractions.udig.project.render.RenderMetricsFactory#canRender(net.refractions.udig.project.render.RenderTools)
39: * @param context
40: * @return
41: */
42: public boolean canRender(IRenderContext context) {
43: if (context instanceof ICompositeRenderContext) {
44: return false;
45: }
46: return context.getGeoResource().canResolve(GridCoverage.class);
47: }
48:
49: /**
50: * TODO summary sentence for createMetrics ...
51: *
52: * @see net.refractions.udig.project.render.RenderMetricsFactory#createMetrics(net.refractions.udig.project.render.RenderTools)
53: * @param context
54: * @return
55: */
56: public IRenderMetrics createMetrics(IRenderContext context) {
57: return new BasicGridCoverageMetrics(context, this );
58: }
59:
60: public Class getRendererType() {
61: return BasicGridCoverageRenderer.class;
62: }
63:
64: }
|