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.ILayer;
20: import net.refractions.udig.project.internal.render.Renderer;
21: import net.refractions.udig.project.render.AbstractRenderMetrics;
22: import net.refractions.udig.project.render.IRenderContext;
23: import net.refractions.udig.project.render.IRenderMetricsFactory;
24:
25: import org.geotools.styling.Style;
26:
27: /**
28: * The metrics object for the BasicFeatureRenderer
29: *
30: * @author Jesse Eichar
31: */
32: public class BasicFeatureMetrics extends AbstractRenderMetrics {
33:
34: public BasicFeatureMetrics(IRenderContext context2,
35: BasicFeatureMetricsFactory factory) {
36: super (context2, factory);
37: }
38:
39: /**
40: * @see net.refractions.udig.project.render.IRenderMetrics#createRenderer()
41: */
42: public Renderer createRenderer() {
43: Renderer renderer = new BasicFeatureRenderer();
44: renderer.setContext(context);
45: renderer.setName(context.getLayer().getName());
46: return renderer;
47: }
48:
49: /**
50: * @see net.refractions.udig.project.render.IRenderMetrics#getRenderContext()
51: */
52: public IRenderContext getRenderContext() {
53: return context;
54: }
55:
56: /**
57: * @see net.refractions.udig.project.render.IRenderMetrics#getRenderMetricsFactory()
58: */
59: public IRenderMetricsFactory getRenderMetricsFactory() {
60: return factory;
61: }
62:
63: public boolean canAddLayer(ILayer layer) {
64: return true;
65: }
66:
67: public boolean canStyle(String SyleID, Object value) {
68: return value != null && value instanceof Style;
69: }
70:
71: public boolean isOptimized() {
72: return false;
73: }
74: }
|