/** * Returns true if the ScreenMap optimization can be applied given the current renderer and * configuration and the style to be applied * * @param lfts * @return */ boolean screenMapEnabled(LiteFeatureTypeStyle lfts) { if (generalizationDistance == 0.0) { return false; } OpacityFinder finder = new OpacityFinder( new Class[] { PointSymbolizer.class, LineSymbolizer.class, PolygonSymbolizer.class }); for (Rule r : lfts.ruleList) { r.accept(finder); } for (Rule r : lfts.elseRules) { r.accept(finder); } return !finder.hasOpacity; }
public void visit(RasterSymbolizer raster) { if (isAcceptable(raster)) { if (raster.getOpacity() != null) { checkOpacity(raster.getOpacity()); } if (raster.getColorMap() != null) { raster.getColorMap().accept(this); } } }
public void visit(Fill fill) { checkOpacity(fill.getOpacity()); }
public void visit(PointSymbolizer ps) { if (isAcceptable(ps)) { ps.getGraphic().accept(this); } }
public void visit(Stroke stroke) { checkOpacity(stroke.getOpacity()); }
public void visit(LineSymbolizer line) { if (isAcceptable(line)) { if (line.getStroke() != null) line.getStroke().accept(this); } }
public void testRasterOpacity() throws Exception { StyleFactory factory = CommonFactoryFinder.getStyleFactory(null); URL styleURL = TestData.getResource(this, "raster.sld"); SLDParser stylereader = new SLDParser(factory, styleURL); Style style = stylereader.readXML()[0]; OpacityFinder opacityFinder = new OpacityFinder(new Class[] {RasterSymbolizer.class}); style.accept(opacityFinder); org.junit.Assert.assertTrue(opacityFinder.hasOpacity); }
public void visit(RasterSymbolizer raster) { if (isAcceptable(raster)) { if (raster.getOpacity() != null) { checkOpacity(raster.getOpacity()); } if (raster.getColorMap() != null) { raster.getColorMap().accept(this); } } }
public void visit(ColorMapEntry cme) { if (cme.getOpacity() != null) { checkOpacity(cme.getOpacity()); } }
public void visit(PolygonSymbolizer poly) { if (isAcceptable(poly)) { if (poly.getStroke() != null) poly.getStroke().accept(this); if (poly.getFill() != null) poly.getFill().accept(this); } }
public void testColorMapOpacity() throws Exception { StyleFactory factory = CommonFactoryFinder.getStyleFactory(null); URL styleURL = TestData.getResource(this, "raster-cmalpha.sld"); SLDParser stylereader = new SLDParser(factory, styleURL); Style style = stylereader.readXML()[0]; OpacityFinder opacityFinder = new OpacityFinder(new Class[] {RasterSymbolizer.class}); style.accept(opacityFinder); org.junit.Assert.assertTrue(opacityFinder.hasOpacity); } }
public void visit(Stroke stroke) { checkOpacity(stroke.getOpacity()); }
public void visit(PointSymbolizer ps) { if (isAcceptable(ps)) { ps.getGraphic().accept(this); } }
/** * Returns true if the ScreenMap optimization can be applied given the current renderer and * configuration and the style to be applied * * @param lfts * @return */ boolean screenMapEnabled(LiteFeatureTypeStyle lfts) { if (generalizationDistance == 0.0) { return false; } OpacityFinder finder = new OpacityFinder(new Class[] { PointSymbolizer.class, LineSymbolizer.class, PolygonSymbolizer.class }); for (Rule r : lfts.ruleList) { r.accept(finder); } for (Rule r : lfts.elseRules) { r.accept(finder); } return !finder.hasOpacity; }
public void visit(Fill fill) { checkOpacity(fill.getOpacity()); }
public void visit(LineSymbolizer line) { if (isAcceptable(line)) { if (line.getStroke() != null) line.getStroke().accept(this); } }
OpacityFinder opacityFinder = new OpacityFinder(getAcceptableSymbolizers(type .getGeometryDescriptor()));
public void visit(ColorMapEntry cme) { if(cme.getOpacity() != null) { checkOpacity(cme.getOpacity()); } }
public void visit(PolygonSymbolizer poly) { if (isAcceptable(poly)) { if (poly.getStroke() != null) poly.getStroke().accept(this); if (poly.getFill() != null) poly.getFill().accept(this); } }