private Mark mark;
public PolygonSymbolizerWrapper( Symbolizer tmpSymbolizer, RuleWrapper parent ) {
super((PolygonSymbolizer) tmpSymbolizer, parent);
PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer) tmpSymbolizer;
// offset
Point2D offset = getOffset(polygonSymbolizer);
if (offset != null) {
xOffset = String.valueOf(offset.getX());
yOffset = String.valueOf(offset.getY());
} else {
xOffset = DEFAULT_OFFSET;
yOffset = DEFAULT_OFFSET;
}
stroke = polygonSymbolizer.getStroke();
if (stroke != null) {
Expression color = stroke.getColor();
strokeColor = expressionToString(color);
Expression width = stroke.getWidth();
strokeWidth = expressionToString(width);
Expression opacity = stroke.getOpacity();
strokeOpacity = expressionToString(opacity);
if (strokeColor == null) {
strokeColor = DEFAULT_COLOR;
stroke.setColor(ff.literal(DEFAULT_COLOR));
}
if (strokeOpacity == null) {
strokeOpacity = DEFAULT_OPACITY;
stroke.setOpacity(ff.literal(DEFAULT_OPACITY));
}
if (strokeWidth == null) {
strokeWidth = DEFAULT_WIDTH;
stroke.setWidth(ff.literal(DEFAULT_WIDTH));
}
strokeGraphicStroke = stroke.getGraphicStroke();
if (strokeGraphicStroke != null) {
List<GraphicalSymbol> graphicalSymbolsList = strokeGraphicStroke.graphicalSymbols();
if (graphicalSymbolsList.size() > 0) {
GraphicalSymbol graphicalSymbol = graphicalSymbolsList.get(0);
if (graphicalSymbol instanceof ExternalGraphic) {
strokeExternalGraphicStroke = (ExternalGraphic) graphicalSymbol;
}
}
}
// dash
float[] dashArray = stroke.getDashArray();
if (dashArray != null) {
dash = Utilities.getDashString(dashArray);
} else {
dash = ""; //$NON-NLS-1$
}
// dashoffset
dashOffset = stroke.getDashOffset().evaluate(null, String.class);
// line cap
lineCap = stroke.getLineCap().evaluate(null, String.class);
// line join
lineJoin = stroke.getLineJoin().evaluate(null, String.class);
hasStroke = true;
} else {
hasStroke = false;
}
fill = polygonSymbolizer.getFill();
if (fill != null) {
Expression color = fill.getColor();
if (color != null) {
fillColor = expressionToString(color);
}