StreamingRenderer implements GTRenderer { Interpolation getRenderingInterpolation(Layer currLayer) { if (currLayer != null && currLayer.getUserData().containsKey(BYLAYER_INTERPOLATION)) { return (Interpolation) currLayer.getUserData().get(BYLAYER_INTERPOLATION); } if(java2dHints == null) { return Interpolation.getInstance(Interpolation.INTERP_NEAREST); } Object interpolationHint = java2dHints.get(RenderingHints.KEY_INTERPOLATION); if (interpolationHint == null || interpolationHint == RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) { return Interpolation.getInstance(Interpolation.INTERP_NEAREST); } else if (interpolationHint == RenderingHints.VALUE_INTERPOLATION_BILINEAR) { return Interpolation.getInstance(Interpolation.INTERP_BILINEAR); } else { return Interpolation.getInstance(Interpolation.INTERP_BICUBIC); } } StreamingRenderer(); void setThreadPool(ExecutorService threadPool); void setConcatTransforms(boolean flag); boolean getConcatTransforms(); void addRenderListener(RenderListener listener); void removeRenderListener(RenderListener listener); void stopRendering(); void paint(Graphics2D graphics, Rectangle paintArea,
            AffineTransform worldToScreen); void paint(Graphics2D graphics, Rectangle paintArea, Envelope mapArea); void paint(Graphics2D graphics, Rectangle paintArea,
            ReferencedEnvelope mapArea); void paint(Graphics2D graphics, Rectangle paintArea,
            Envelope mapArea, AffineTransform worldToScreen); void paint(Graphics2D graphics, Rectangle paintArea,
            ReferencedEnvelope mapArea, AffineTransform worldToScreen); int getMaxBackBufferMemory(int width, int height); boolean isInteractive(); void setInteractive(boolean interactive); double getGeneralizationDistance(); void setGeneralizationDistance(double d); void setJava2DHints(RenderingHints hints); RenderingHints getJava2DHints(); void setRendererHints(Map hints); Map getRendererHints(); void setContext(MapContext context); MapContext getContext(); void setMapContent(MapContent mapContent); MapContent getMapContent(); boolean isCanTransform(); static MathTransform getMathTransform(
            CoordinateReferenceSystem sourceCRS,
            CoordinateReferenceSystem destCRS); static final String SCALE_ACCURATE; static final String SCALE_OGC; static final String RENDERING_BUFFER; static final String TEXT_RENDERING_STRING; static final String TEXT_RENDERING_OUTLINE; static final String TEXT_RENDERING_ADAPTIVE; static final String TEXT_RENDERING_KEY; static final String LINE_WIDTH_OPTIMIZATION_KEY; static final String OPTIMIZE_FTS_RENDERING_KEY; static final String ADVANCED_PROJECTION_HANDLING_KEY; static final String CONTINUOUS_MAP_WRAPPING; static final String VECTOR_RENDERING_KEY; static final String LABEL_CACHE_KEY; static final String FORCE_EPSG_AXIS_ORDER_KEY; static final String DPI_KEY; static final String DECLARED_SCALE_DENOM_KEY; static final String SCALE_COMPUTATION_METHOD_KEY; static final String BYLAYER_INTERPOLATION; }
@Test public void testInterpolationByLayer() throws Exception { StreamingRenderer sr = new StreamingRenderer(); Layer layer = new FeatureLayer(createLineCollection(), createLineStyle()); assertEquals(sr.getRenderingInterpolation(layer), Interpolation.getInstance(Interpolation.INTERP_NEAREST)); layer.getUserData().put(StreamingRenderer.BYLAYER_INTERPOLATION, Interpolation.getInstance(Interpolation.INTERP_BICUBIC)); assertEquals(sr.getRenderingInterpolation(layer), Interpolation.getInstance(Interpolation.INTERP_BICUBIC)); layer.getUserData().put(StreamingRenderer.BYLAYER_INTERPOLATION, Interpolation.getInstance(Interpolation.INTERP_BILINEAR)); assertEquals(sr.getRenderingInterpolation(layer), Interpolation.getInstance(Interpolation.INTERP_BILINEAR)); layer.getUserData().put(StreamingRenderer.BYLAYER_INTERPOLATION, Interpolation.getInstance(Interpolation.INTERP_NEAREST)); assertEquals(sr.getRenderingInterpolation(layer), Interpolation.getInstance(Interpolation.INTERP_NEAREST)); }