Search in sources :

Example 21 with PointSymbolizer

use of org.opengis.style.PointSymbolizer in project geotoolkit by Geomatys.

the class Styles method markPoint.

public static MutableStyle markPoint() {
    // general informations
    final String name = "mySymbol";
    final Description desc = DEFAULT_DESCRIPTION;
    // use the default geometry of the feature
    final String geometry = null;
    final Unit unit = Units.POINT;
    // the visual element
    final Expression size = FF.literal(12);
    final Expression opacity = LITERAL_ONE_FLOAT;
    final Expression rotation = LITERAL_ONE_FLOAT;
    final AnchorPoint anchor = DEFAULT_ANCHOR_POINT;
    final Displacement disp = DEFAULT_DISPLACEMENT;
    final List<GraphicalSymbol> symbols = new ArrayList<GraphicalSymbol>();
    final Stroke stroke = SF.stroke(Color.BLACK, 2);
    final Fill fill = SF.fill(Color.RED);
    final Mark mark = SF.mark(MARK_CIRCLE, fill, stroke);
    symbols.add(mark);
    final Graphic graphic = SF.graphic(symbols, opacity, size, rotation, anchor, disp);
    final PointSymbolizer symbolizer = SF.pointSymbolizer(name, geometry, desc, unit, graphic);
    final MutableStyle style = SF.style(symbolizer);
    return style;
}
Also used : PointSymbolizer(org.opengis.style.PointSymbolizer) Stroke(org.opengis.style.Stroke) GraphicStroke(org.opengis.style.GraphicStroke) Fill(org.opengis.style.Fill) GraphicFill(org.opengis.style.GraphicFill) Description(org.opengis.style.Description) Graphic(org.opengis.style.Graphic) GraphicalSymbol(org.opengis.style.GraphicalSymbol) ArrayList(java.util.ArrayList) ExternalMark(org.opengis.style.ExternalMark) Mark(org.opengis.style.Mark) Unit(javax.measure.Unit) Displacement(org.opengis.style.Displacement) AnchorPoint(org.opengis.style.AnchorPoint) MutableStyle(org.geotoolkit.style.MutableStyle) Expression(org.opengis.filter.Expression)

Aggregations

PointSymbolizer (org.opengis.style.PointSymbolizer)21 Graphic (org.opengis.style.Graphic)12 GraphicalSymbol (org.opengis.style.GraphicalSymbol)12 ArrayList (java.util.ArrayList)11 Mark (org.opengis.style.Mark)10 MutableStyle (org.geotoolkit.style.MutableStyle)9 Fill (org.opengis.style.Fill)7 LineSymbolizer (org.opengis.style.LineSymbolizer)7 PolygonSymbolizer (org.opengis.style.PolygonSymbolizer)7 Stroke (org.opengis.style.Stroke)7 Test (org.junit.Test)6 Expression (org.opengis.filter.Expression)6 Unit (javax.measure.Unit)5 AnchorPoint (org.opengis.style.AnchorPoint)5 Description (org.opengis.style.Description)5 Displacement (org.opengis.style.Displacement)5 TextSymbolizer (org.opengis.style.TextSymbolizer)5 RasterSymbolizer (org.opengis.style.RasterSymbolizer)4 Color (java.awt.Color)3 BufferedImage (java.awt.image.BufferedImage)3