super(symbolizer, parent);
this.geomType = geomType;
textSymbolizer = (TextSymbolizer) symbolizer;
Expression labelExpression = textSymbolizer.getLabel();
if (labelExpression != null) {
labelName = expressionToString(labelExpression);
}
font = textSymbolizer.getFont();
if (font != null) {
List<Expression> family = font.getFamily();
fontFamily = family.get(0).evaluate(null, String.class);
Expression styleExpression = font.getStyle();
fontStyle = styleExpression.evaluate(null, String.class);
Expression styleWeight = font.getWeight();
fontWeight = styleWeight.evaluate(null, String.class);
Expression styleSize = font.getSize();
fontSize = styleSize.evaluate(null, String.class);
}
fill = textSymbolizer.getFill();
if (fill != null) {
Expression colorExpression = fill.getColor();
color = colorExpression.evaluate(null, String.class);
Expression opacityExpression = fill.getOpacity();
if (opacityExpression != null) {
opacity = expressionToString(opacityExpression);
}
}
halo = textSymbolizer.getHalo();
if (halo != null) {
haloFill = halo.getFill();
Expression haloColorExpression = haloFill.getColor();
haloColor = haloColorExpression.evaluate(null, String.class);
Expression haloRadiusExpression = halo.getRadius();
haloRadius = haloRadiusExpression.evaluate(null, String.class);
}
LabelPlacement labelPlacement = textSymbolizer.getLabelPlacement();
if (geomType != null) {
switch( geomType ) {
case POINT:
case POLYGON:
if (labelPlacement instanceof PointPlacement) {
pointPlacement = (PointPlacement) labelPlacement;
if (pointPlacement != null) {
anchorPoint = pointPlacement.getAnchorPoint();
if (anchorPoint != null) {
Expression anchorPointXExpression = anchorPoint.getAnchorPointX();
anchorX = anchorPointXExpression.evaluate(null, String.class);
Expression anchorPointYExpression = anchorPoint.getAnchorPointY();
anchorY = anchorPointYExpression.evaluate(null, String.class);
}
displacement = pointPlacement.getDisplacement();
if (displacement != null) {
Expression displacementXExpression = displacement.getDisplacementX();
displacementX = displacementXExpression.evaluate(null, String.class);
Expression displacementYExpression = displacement.getDisplacementY();
displacementY = displacementYExpression.evaluate(null, String.class);
} else {
displacementX = "0.0"; //$NON-NLS-1$
displacementY = "0.0"; //$NON-NLS-1$
}
Expression rotationExpression = pointPlacement.getRotation();
rotation = expressionToString(rotationExpression);
}
}
break;
case LINE:
if (labelPlacement instanceof LinePlacement) {
linePlacement = (LinePlacement) labelPlacement;
if (linePlacement != null) {
Expression initialGapExpression = linePlacement.getInitialGap();
if (initialGapExpression != null)
initialGap = initialGapExpression.evaluate(null, String.class);
Expression perpendicularOffsetExpression = linePlacement.getPerpendicularOffset();
if (perpendicularOffset != null)
perpendicularOffset = perpendicularOffsetExpression.evaluate(null, String.class);
}
}
break;
default:
break;