for( Symbolizer newSymbolizer : newSymbolizers ) {
if (newSymbolizer instanceof PointSymbolizer) {
PointSymbolizer newPointSymbolizer = (PointSymbolizer) newSymbolizer;
Mark mark = sb.createMark(oldMark.getWellKnownName().evaluate(null, String.class));
Fill newFill = sb.createFill(fill);
newFill.setOpacity(ff.literal(opac));
mark.setFill(newFill);
Stroke newStroke = oldMark.getStroke();
if (newStroke != null) {
if (borderColor!=null) {
newStroke.setColor(ff.literal(borderColor));
mark.setStroke(newStroke);
}else{
mark.setStroke(null);
}
}
Graphic newGraphic = SLDs.graphic(newPointSymbolizer);
newGraphic.setSize(oldGraphic.getSize());
newGraphic.setRotation( oldGraphic.getRotation());
newGraphic.graphicalSymbols().clear();
newGraphic.graphicalSymbols().add(mark);
break;
}
}
}
}
} else if (symbolizer instanceof PolygonSymbolizer) {
List<Rule> rules = newFTS.rules();
for( Rule rule : rules ) {
List<Symbolizer> newSymbolizers = rule.symbolizers();
for( Symbolizer newSymbolizer : newSymbolizers ) {
if (newSymbolizer instanceof PolygonSymbolizer) {
PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer ) newSymbolizer;
Fill previousFill = SLDs.fill(polygonSymbolizer);
previousFill.setOpacity(ff.literal(opac));
Stroke stroke = SLDs.stroke(polygonSymbolizer);
if (stroke != null) {
if(borderColor!=null){
stroke.setColor(ff.literal(borderColor));