use of org.opengis.style.Displacement 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 = (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<Expression>();
fontFamilyList.add(fontFamily);
Font font = (Font) styleFactory.font(fontFamilyList, fontStyle, fontWeight, fontSize);
Description description = null;
Unit<Length> unit = null;
TextSymbolizer newTextSymbolizer = (TextSymbolizer) styleFactory.textSymbolizer(name, geometryField, description, unit, label, font, pointPlacement, halo, fill);
return newTextSymbolizer;
}
use of org.opengis.style.Displacement in project sldeditor by robward-scisys.
the class DefaultSymbols method createDefaultPointSymbolizer.
/**
* Creates the default point symbolizer.
*
* @return the point symbolizer
*/
public static PointSymbolizer createDefaultPointSymbolizer() {
String geometryFieldName = null;
Expression geometryField = ff.property(geometryFieldName);
List<GraphicalSymbol> symbolList = new ArrayList<GraphicalSymbol>();
Stroke stroke = null;
AnchorPoint anchorPoint = null;
Displacement displacement = null;
Fill fill = styleFactory.createFill(ff.literal(DEFAULT_MARKER_COLOUR));
GraphicalSymbol symbol = styleFactory.mark(ff.literal(DEFAULT_MARKER_SYMBOL), fill, stroke);
symbolList.add(symbol);
Graphic graphic = styleFactory.graphic(symbolList, ff.literal(DEFAULT_COLOUR_OPACITY), ff.literal(DEFAULT_MARKER_SYMBOL_SIZE), ff.literal(0.0), anchorPoint, displacement);
PointSymbolizer newPointSymbolizer = (PointSymbolizer) styleFactory.pointSymbolizer(Localisation.getString(SLDTreeTools.class, "TreeItem.newMarker"), geometryField, null, null, graphic);
return newPointSymbolizer;
}
Aggregations