public void setRendererHints(Map hints) { if (hints != null && hints.containsKey(LABEL_CACHE_KEY)) { LabelCache cache = (LabelCache) hints.get(LABEL_CACHE_KEY); if (cache == null) throw new NullPointerException( "Label_Cache_Hint has a null value for the labelcache"); this.labelCache = cache; painter = new StyledShapePainter(cache); } if (hints != null && hints.containsKey(LINE_WIDTH_OPTIMIZATION_KEY)) { styleFactory.setLineOptimizationEnabled( Boolean.TRUE.equals(hints.get(LINE_WIDTH_OPTIMIZATION_KEY))); } rendererHints = hints; // sets whether vector rendering is enabled in the SLDStyleFactory styleFactory.setVectorRenderingEnabled(isVectorRenderingEnabled()); }
@Override protected void tearDown() throws Exception { sld.setVectorRenderingEnabled(false); MarkStyle2D.setMaxMarkSizeEnabled(false); }
public void testCreateDynamicExternalGraphicsVector() throws Exception { URL url = StreamingRenderer.class.getResource("test-data/"); PointSymbolizer symb = sf.createPointSymbolizer(); ExternalGraphic eg = sf.createExternalGraphic(url + "${icon}", "image/png"); symb.getGraphic().addExternalGraphic(eg); sld.setVectorRenderingEnabled(true); GraphicStyle2D gs = (GraphicStyle2D) sld.createStyle(feature, symb, range); // make sure the style has been recognized as dynamic SymbolizerKey key = new SymbolizerKey(symb, range); assertTrue(sld.dynamicSymbolizers.containsKey(key)); BufferedImage expected = ImageIO.read(StreamingRenderer.class.getResource("test-data/draw.png")); assertEquals(expected.getHeight(), gs.getImage().getHeight()); assertEquals(expected.getWidth(), gs.getImage().getWidth()); }
public void setRendererHints(Map hints) { if( hints!=null && hints.containsKey(LABEL_CACHE_KEY) ){ LabelCache cache=(LabelCache) hints.get(LABEL_CACHE_KEY); if( cache==null ) throw new NullPointerException("Label_Cache_Hint has a null value for the labelcache"); this.labelCache=cache; this.painter=new StyledShapePainter(cache); } if(hints != null && hints.containsKey(StreamingRenderer.LINE_WIDTH_OPTIMIZATION_KEY)) { styleFactory.setLineOptimizationEnabled(Boolean.TRUE.equals(hints.get(StreamingRenderer.LINE_WIDTH_OPTIMIZATION_KEY))); } if(hints != null && hints.containsKey(StreamingRenderer.VECTOR_RENDERING_KEY)) { styleFactory.setVectorRenderingEnabled(Boolean.TRUE.equals(hints.get(StreamingRenderer.VECTOR_RENDERING_KEY))); } rendererHints = hints; }
public void setRendererHints(Map hints) { if( hints!=null && hints.containsKey(LABEL_CACHE_KEY) ){ LabelCache cache=(LabelCache) hints.get(LABEL_CACHE_KEY); if( cache==null ) throw new NullPointerException("Label_Cache_Hint has a null value for the labelcache"); this.labelCache=cache; } if(hints != null && hints.containsKey(LINE_WIDTH_OPTIMIZATION_KEY)) { styleFactory.setLineOptimizationEnabled(Boolean.TRUE.equals(hints.get(LINE_WIDTH_OPTIMIZATION_KEY))); } rendererHints = hints; // sets whether vector rendering is enabled in the SLDStyleFactory styleFactory.setVectorRenderingEnabled(isVectorRenderingEnabled()); }