return getSymbolizers(type, baseColor, true);
}
public static Symbolizer[] getSymbolizers(Class<? extends Geometry> type, Color baseColor, boolean useTransparency) {
StyleBuilder builder=new StyleBuilder();
Symbolizer[] syms=new Symbolizer[1];
if( LineString.class.isAssignableFrom(type) ||
MultiLineString.class.isAssignableFrom(type) )
syms[0]=builder.createLineSymbolizer(baseColor,2);
if( Point.class.isAssignableFrom(type) ||
MultiPoint.class.isAssignableFrom(type)){
PointSymbolizer point = builder.createPointSymbolizer(builder.createGraphic());
// set graphic size to 10 by default
point.getGraphic().setSize((Expression) CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()).literal(10));
// danger assumes a Mark!
point.getGraphic().getMarks()[0].setFill(builder.createFill(baseColor));
syms[0]=point;
}
if( Polygon.class.isAssignableFrom(type) ||
MultiPolygon.class.isAssignableFrom(type)){
syms[0]=builder.createPolygonSymbolizer(builder.createStroke(baseColor,2), builder.createFill(baseColor, useTransparency?.6:1.0));
}
return syms;
}