Search in sources :

Example 11 with Font

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

the class ListingPropertyVisitor method visit.

@Override
public Object visit(final TextSymbolizer textSymbolizer, Object data) {
    visitGeomName(textSymbolizer, data);
    final Fill fill = textSymbolizer.getFill();
    if (fill != null) {
        data = fill.accept(this, data);
    }
    final Font font = textSymbolizer.getFont();
    if (font != null) {
        data = font.accept(this, data);
    }
    final Halo halo = textSymbolizer.getHalo();
    if (halo != null) {
        data = halo.accept(this, data);
    }
    final Expression label = textSymbolizer.getLabel();
    if (label != null) {
        visit(label, (Collection<String>) data);
    }
    final LabelPlacement place = textSymbolizer.getLabelPlacement();
    if (place != null) {
        data = place.accept(this, data);
    }
    return data;
}
Also used : GraphicFill(org.opengis.style.GraphicFill) Fill(org.opengis.style.Fill) LabelPlacement(org.opengis.style.LabelPlacement) Expression(org.opengis.filter.Expression) Font(org.opengis.style.Font) Halo(org.opengis.style.Halo)

Example 12 with Font

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

the class SE110toGTTransformer method visit.

/**
 * Transform a SLD v1.1 text symbolizer in GT text symbolizer.
 */
public TextSymbolizer visit(final TextSymbolizerType tst) {
    if (tst == null)
        return null;
    final Expression label = visitExpression(tst.getLabel());
    final Font font = (tst.getFont() == null) ? styleFactory.font() : visit(tst.getFont());
    final LabelPlacement placement = (tst.getLabelPlacement() == null) ? styleFactory.pointPlacement() : visit(tst.getLabelPlacement());
    final Halo halo = (tst.getHalo() == null) ? styleFactory.halo(Color.WHITE, 0) : visit(tst.getHalo());
    final Fill fill = (tst.getFill() == null) ? styleFactory.fill() : visit(tst.getFill());
    final Unit uom = visitUOM(tst.getUom());
    final Expression geom = notEmpty(visitExpression(tst.getGeometry()));
    final String name = tst.getName();
    final Description desc = visitDescription(tst.getDescription());
    if (label == null)
        return null;
    return styleFactory.textSymbolizer(name, geom, desc, uom, label, font, placement, halo, fill);
}
Also used : Fill(org.opengis.style.Fill) GraphicFill(org.opengis.style.GraphicFill) Description(org.opengis.style.Description) LabelPlacement(org.opengis.style.LabelPlacement) Expression(org.opengis.filter.Expression) Unit(javax.measure.Unit) Font(org.opengis.style.Font) Halo(org.opengis.style.Halo)

Aggregations

Expression (org.opengis.filter.Expression)12 Font (org.opengis.style.Font)12 Fill (org.opengis.style.Fill)11 Halo (org.opengis.style.Halo)11 LabelPlacement (org.opengis.style.LabelPlacement)9 Unit (javax.measure.Unit)8 Description (org.opengis.style.Description)8 GraphicFill (org.opengis.style.GraphicFill)7 TextSymbolizer (org.opengis.style.TextSymbolizer)4 SimpleInternationalString (org.apache.sis.util.SimpleInternationalString)3 MutableStyle (org.geotoolkit.style.MutableStyle)3 PointPlacement (org.opengis.style.PointPlacement)2 Dimension (java.awt.Dimension)1 BufferedImage (java.awt.image.BufferedImage)1 Raster (java.awt.image.Raster)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 JAXBException (javax.xml.bind.JAXBException)1 FeatureTypeBuilder (org.apache.sis.feature.builder.FeatureTypeBuilder)1 GeneralEnvelope (org.apache.sis.geometry.GeneralEnvelope)1