01: package net.refractions.udig.mapgraphic.internal;
02:
03: import java.io.IOException;
04:
05: import net.refractions.udig.mapgraphic.MapGraphic;
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: public class MapGraphicRenderMetricsFactory implements
11: IRenderMetricsFactory {
12:
13: public boolean canRender(IRenderContext context) throws IOException {
14: return context.getLayer().hasResource(MapGraphic.class);
15: }
16:
17: public IRenderMetrics createMetrics(IRenderContext context) {
18: return new MapGraphicRenderMetrics(context, this );
19: }
20:
21: /**
22: * @see net.refractions.udig.project.render.IRenderMetricsFactory#getRendererType()
23: */
24: public Class<MapGraphicRenderer> getRendererType() {
25: return MapGraphicRenderer.class;
26: }
27:
28: }
|