01: package net.refractions.udig.mapgraphic.internal;
02:
03: import net.refractions.udig.mapgraphic.MapGraphic;
04: import net.refractions.udig.project.ILayer;
05: import net.refractions.udig.project.internal.render.Renderer;
06: import net.refractions.udig.project.render.IRenderContext;
07: import net.refractions.udig.project.render.IRenderMetrics;
08: import net.refractions.udig.project.render.IRenderMetricsFactory;
09:
10: /**
11: * Used to describe the rendering abilities of MapGraphicRenderer
12: */
13: public class MapGraphicRenderMetrics implements IRenderMetrics {
14:
15: IRenderContext context;
16: private IRenderMetricsFactory factory;
17:
18: /**
19: * Construct <code>MapGraphicRenderMetrics</code>.
20: *
21: * @param context
22: * @param factory
23: */
24: public MapGraphicRenderMetrics(IRenderContext context,
25: IRenderMetricsFactory factory) {
26: this .factory = factory;
27: this .context = context;
28: }
29:
30: public Renderer createRenderer() {
31: MapGraphicRenderer renderer = new MapGraphicRenderer();
32: renderer.setContext(context);
33: return renderer;
34: }
35:
36: public IRenderContext getRenderContext() {
37: return context;
38: }
39:
40: /**
41: * @see net.refractions.udig.project.render.IRenderMetrics#getRenderMetricsFactory()
42: */
43: public IRenderMetricsFactory getRenderMetricsFactory() {
44: return factory;
45: }
46:
47: public boolean canAddLayer(ILayer layer) {
48: if (layer.hasResource(MapGraphic.class))
49: return true;
50: return false;
51: }
52:
53: public boolean canStyle(String SyleID, Object value) {
54: return true;
55: }
56:
57: public boolean isOptimized() {
58: return false;
59: }
60: }
|