use of org.geotools.styling.PointPlacement in project sldeditor by robward-scisys.
the class DefaultSymbols method createDefaultTextSymbolizer.
/**
* Creates the default text symbolizer.
*
* @return the text symbolizer
*/
public static TextSymbolizer createDefaultTextSymbolizer() {
Expression fontFamily = ff.literal("Serif");
Expression fontSize = ff.literal(10.0);
Expression fontStyle = ff.literal("normal");
Expression fontWeight = ff.literal("normal");
Expression rotation = ff.literal(0.0);
Expression label = ff.literal("Test");
String geometryFieldName = null;
Expression geometryField = ff.property(geometryFieldName);
String name = Localisation.getString(SLDTreeTools.class, "TreeItem.newText");
AnchorPoint anchor = null;
Displacement displacement = null;
PointPlacement pointPlacement = styleFactory.pointPlacement(anchor, displacement, rotation);
Expression fillColour = ff.literal(DEFAULT_COLOUR);
Expression fillColourOpacity = ff.literal(1.0);
Fill fill = styleFactory.fill(null, fillColour, fillColourOpacity);
Halo halo = null;
List<Expression> fontFamilyList = new ArrayList<>();
fontFamilyList.add(fontFamily);
Font font = styleFactory.font(fontFamilyList, fontStyle, fontWeight, fontSize);
Description description = null;
Unit<?> unit = null;
return styleFactory.textSymbolizer(name, geometryField, description, unit, label, font, pointPlacement, halo, fill);
}
Aggregations