Search in sources :

Example 46 with Expression

use of org.opengis.filter.Expression in project geotoolkit by Geomatys.

the class ListingPropertyVisitor method visit.

@Override
public Object visit(final Font font, Object data) {
    final List<Expression> families = font.getFamily();
    if (families != null) {
        for (Expression family : families) {
            visit(family, (Collection<String>) data);
        }
    }
    final Expression size = font.getSize();
    if (size != null) {
        visit(size, (Collection<String>) data);
    }
    final Expression style = font.getStyle();
    if (style != null) {
        visit(style, (Collection<String>) data);
    }
    final Expression weight = font.getWeight();
    if (weight != null) {
        visit(weight, (Collection<String>) data);
    }
    return data;
}
Also used : Expression(org.opengis.filter.Expression)

Example 47 with Expression

use of org.opengis.filter.Expression in project geotoolkit by Geomatys.

the class ListingPropertyVisitor method visit.

@Override
public Object visit(final Fill fill, Object data) {
    final Expression color = fill.getColor();
    if (color != null) {
        visit(color, (Collection<String>) data);
    }
    final GraphicFill gf = fill.getGraphicFill();
    if (gf != null) {
        data = gf.accept(this, data);
    }
    final Expression opa = fill.getOpacity();
    if (opa != null) {
        visit(opa, (Collection<String>) data);
    }
    return data;
}
Also used : Expression(org.opengis.filter.Expression) GraphicFill(org.opengis.style.GraphicFill)

Example 48 with Expression

use of org.opengis.filter.Expression in project geotoolkit by Geomatys.

the class ListingPropertyVisitor method visit.

@Override
public Object visit(final Mark mark, Object data) {
    final ExternalMark em = mark.getExternalMark();
    if (em != null) {
        data = em.accept(this, data);
    }
    final Fill fill = mark.getFill();
    if (fill != null) {
        data = fill.accept(this, data);
    }
    final Stroke stroke = mark.getStroke();
    if (stroke != null) {
        data = stroke.accept(this, data);
    }
    final Expression wkn = mark.getWellKnownName();
    if (wkn != null) {
        visit(wkn, (Collection<String>) data);
    }
    return data;
}
Also used : GraphicFill(org.opengis.style.GraphicFill) Fill(org.opengis.style.Fill) Stroke(org.opengis.style.Stroke) GraphicStroke(org.opengis.style.GraphicStroke) ExternalMark(org.opengis.style.ExternalMark) Expression(org.opengis.filter.Expression)

Example 49 with Expression

use of org.opengis.filter.Expression in project geotoolkit by Geomatys.

the class PrepareStyleVisitor method visit.

@Override
public Object visit(TextSymbolizer ts, Object o) {
    Fill fill = ts.getFill();
    Font font = ts.getFont();
    Halo halo = ts.getHalo();
    Expression label = ts.getLabel();
    LabelPlacement place = ts.getLabelPlacement();
    if (fill != null) {
        fill = (Fill) fill.accept(this, o);
    }
    if (font != null) {
        font = (Font) font.accept(this, o);
    }
    if (halo != null) {
        halo = (Halo) halo.accept(this, o);
    }
    if (label != null) {
        label = (Expression) visit(label);
    }
    if (place != null) {
        place = (LabelPlacement) place.accept(this, o);
    }
    // recreate symbolizer
    return SF.textSymbolizer(ts.getName(), visitGeometryExpression(ts, o), ts.getDescription(), ts.getUnitOfMeasure(), label, font, place, halo, fill);
}
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 50 with Expression

use of org.opengis.filter.Expression in project geotoolkit by Geomatys.

the class PrepareStyleVisitor method visit.

@Override
public Object visit(Stroke stroke, Object o) {
    Expression color = stroke.getColor();
    Expression offset = stroke.getDashOffset();
    GraphicFill grafill = stroke.getGraphicFill();
    GraphicStroke grastroke = stroke.getGraphicStroke();
    Expression cap = stroke.getLineCap();
    Expression join = stroke.getLineJoin();
    Expression opacity = stroke.getOpacity();
    Expression width = stroke.getWidth();
    if (color != null) {
        color = (Expression) visit(color);
    }
    if (offset != null) {
        offset = (Expression) visit(offset);
    }
    if (grafill != null) {
        grafill = (GraphicFill) grafill.accept(this, o);
    }
    if (grastroke != null) {
        grastroke = (GraphicStroke) grastroke.accept(this, o);
    }
    if (cap != null) {
        cap = (Expression) visit(cap);
    }
    if (join != null) {
        join = (Expression) visit(join);
    }
    if (opacity != null) {
        opacity = (Expression) visit(opacity);
    }
    if (width != null) {
        width = (Expression) visit(width);
    }
    if (grafill != null) {
        return SF.stroke(grafill, color, opacity, width, join, cap, stroke.getDashArray(), offset);
    } else if (grastroke != null) {
        return SF.stroke(grastroke, color, opacity, width, join, cap, stroke.getDashArray(), offset);
    } else {
        return SF.stroke(color, opacity, width, join, cap, stroke.getDashArray(), offset);
    }
}
Also used : Expression(org.opengis.filter.Expression) GraphicFill(org.opengis.style.GraphicFill) GraphicStroke(org.opengis.style.GraphicStroke)

Aggregations

Expression (org.opengis.filter.Expression)325 Test (org.junit.Test)112 LineString (org.locationtech.jts.geom.LineString)73 Literal (org.opengis.filter.Literal)65 ArrayList (java.util.ArrayList)47 MultiLineString (org.locationtech.jts.geom.MultiLineString)46 Unit (javax.measure.Unit)45 Description (org.opengis.style.Description)40 Fill (org.opengis.style.Fill)38 GraphicFill (org.opengis.style.GraphicFill)38 Stroke (org.opengis.style.Stroke)35 Geometry (org.locationtech.jts.geom.Geometry)31 Displacement (org.opengis.style.Displacement)29 GraphicStroke (org.opengis.style.GraphicStroke)29 ValueReference (org.opengis.filter.ValueReference)27 JAXBElement (javax.xml.bind.JAXBElement)22 LineSymbolizer (org.opengis.style.LineSymbolizer)22 PointSymbolizer (org.opengis.style.PointSymbolizer)22 PolygonSymbolizer (org.opengis.style.PolygonSymbolizer)22 MutableStyle (org.geotoolkit.style.MutableStyle)21