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.feature.basic;
18:
19: import net.refractions.udig.project.render.IRenderContext;
20: import net.refractions.udig.project.render.IRenderMetrics;
21: import net.refractions.udig.project.render.IRenderMetricsFactory;
22: import net.refractions.udig.project.render.IRenderer;
23:
24: import org.geotools.data.FeatureSource;
25:
26: /**
27: * The RenderMetricsFactory object for the BasicFeatureRenderer Extension
28: *
29: * @author Jesse Eichar
30: * @version $Revision: 1.9 $
31: */
32: public class BasicFeatureMetricsFactory implements
33: IRenderMetricsFactory {
34:
35: /**
36: * @see net.refractions.udig.project.render.IRenderMetricsFactory#createMetrics(net.refractions.udig.project.render.IRenderContext)
37: */
38: public IRenderMetrics createMetrics(IRenderContext context) {
39: // TODO Auto-generated method stub
40: return new BasicFeatureMetrics(context, this );
41: }
42:
43: /**
44: * @see net.refractions.udig.project.render.IRenderMetricsFactory#canRender(net.refractions.udig.project.render.IRenderContext)
45: */
46: public boolean canRender(IRenderContext context) {
47: return context.getGeoResource().canResolve(FeatureSource.class);
48: }
49:
50: /**
51: * @see IRenderMetricsFactory#getRendererType()
52: */
53: public Class<? extends IRenderer> getRendererType() {
54: return BasicFeatureRenderer.class;
55: }
56:
57: }
|