if (symbolizers.length > 0) {
Symbolizer symbolizer = symbolizers[0];
if (symbolizer instanceof PointSymbolizer) {
PointSymbolizer previousSymbolizer = (PointSymbolizer) symbolizer;
Graphic oldGraphic = SLDs.graphic(previousSymbolizer);
Mark oldMark = SLDs.mark(previousSymbolizer);
if (oldMark != null) {
// we apply the properties to all the new rules
List<Rule> rules = newFTS.rules();
for( Rule rule : rules ) {
String[] colors = SLDs.colors(rule);
Color fill = SLDs.toColor(colors[0]);
List<Symbolizer> newSymbolizers = rule.symbolizers();
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());