Package org.geotools.styling

Examples of org.geotools.styling.Displacement


        Graphic g = sym.getGraphic();
        Expression opacity = g.getOpacity();
        Expression rotation = g.getRotation();
        Expression size = g.getSize();
        AnchorPoint anchor = g.getAnchorPoint();
        Displacement displacement = g.getDisplacement();
       
       
    }
View Full Code Here


    private TextSymbolizer createGridTextSymbolizer(final StyleBuilder builder,
                                                    final Color color) {
        Expression xDisplacement = builder.attributeExpression(Constants.Style.Grid.ATT_X_DISPLACEMENT);
        Expression yDisplacement = builder.attributeExpression(Constants.Style.Grid.ATT_Y_DISPLACEMENT);
        Displacement displacement = builder.createDisplacement(xDisplacement, yDisplacement);
        Expression rotation = builder.attributeExpression(Constants.Style.Grid.ATT_ROTATION);

        PointPlacement text1Placement = builder.createPointPlacement(builder.createAnchorPoint(0, 0), displacement, rotation);
        final TextSymbolizer text1 = builder.createTextSymbolizer();
        text1.setFill(builder.createFill(color));
View Full Code Here

    @Nullable
    private PointPlacement createPointPlacement(final PJsonObject styleJson) {
        AnchorPoint anchorPoint = createAnchorPoint(styleJson);

        Displacement displacement = null;
        if (styleJson.has(JSON_LABEL_X_OFFSET) || styleJson.has(JSON_LABEL_Y_OFFSET)) {

            Expression xOffset = parseExpression(0.0, styleJson, JSON_LABEL_X_OFFSET, new Function<String, Double>() {
                @Nullable
                @Override
View Full Code Here

    public Displacement build() {
        if (unset) {
            return null;
        }
        Displacement displacement = sf.displacement(x, y);
        return displacement;
    }
View Full Code Here

            int textSize = getPositiveValue(text.getFont().getSize());
            int delta = -1;
            if (text.getLabelPlacement() instanceof PointPlacement) {
                PointPlacement pp = (PointPlacement) text.getLabelPlacement();
                Displacement pd = pp.getDisplacement();
                if (pd != null) {
                    int dx = getPositiveValue(pd.getDisplacementX());
                    int dy = getPositiveValue(pd.getDisplacementY());
                    delta = Math.max(dx, dy);
                }
                AnchorPoint ap = pp.getAnchorPoint();
                if (ap != null) {
                    double ax = Math.abs(getDouble(ap.getAnchorPointX()) - 0.5);
View Full Code Here

   
    Expression opacity = null; // use default
    Expression size = ff.literal(10);
    Expression rotation = null; // use default
    AnchorPoint anchor = null; // use default
    Displacement displacement = null; // use default
   
    // define a point symbolizer of a small circle
    Graphic city = sf.graphic(symbols, opacity, size, rotation, anchor, displacement);
    PointSymbolizer pointSymbolizer = sf.pointSymbolizer("point", ff.property("the_geom"), null,
            null, city);
View Full Code Here

    private void rescale(Graphic graphic, Unit<Length> unit) {
        if (graphic != null) {
            graphic.setSize(rescale(graphic.getSize(), unit));
            graphic.setGap(rescale(graphic.getGap(), unit));

            Displacement disp = graphic.getDisplacement();
            if (disp != null) {
                disp.setDisplacementX(rescale(disp.getDisplacementX(), unit));
                disp.setDisplacementY(rescale(disp.getDisplacementY(), unit));
                graphic.setDisplacement(disp);
            }

            if (graphic.graphicalSymbols() != null) {
                for (GraphicalSymbol gs : graphic.graphicalSymbols()) {
View Full Code Here

        // rescales label placement
        LabelPlacement placement = copy.getLabelPlacement();
        if (placement instanceof PointPlacement) {
            // rescales point label placement
            PointPlacement pointPlacement = (PointPlacement) placement;
            Displacement disp = pointPlacement.getDisplacement();
            if (disp != null) {
                disp.setDisplacementX(rescale(disp.getDisplacementX(), uom));
                disp.setDisplacementY(rescale(disp.getDisplacementY(), uom));
                pointPlacement.setDisplacement(disp);
            }
        } else if (placement instanceof LinePlacement) {
            // rescales line label placement
            LinePlacement linePlacement = (LinePlacement) placement;
View Full Code Here

    /** Make graphics (such as used with PointSymbolizer) bigger */
    public void visit(Graphic gr) {
        Graphic copy = null;

        Displacement displacementCopy = null;

        if (gr.getDisplacement() != null) {
            gr.getDisplacement().accept(this);
            displacementCopy = (Displacement) pages.pop();
        }
View Full Code Here

            // rescales label placement
            LabelPlacement placement = copy.getLabelPlacement();
            if (placement instanceof PointPlacement) {
                // rescales point label placement
                PointPlacement pointPlacement = (PointPlacement) placement;
                Displacement disp = pointPlacement.getDisplacement();
                if (disp != null) {
                    disp.setDisplacementX(rescale(disp.getDisplacementX()));
                    disp.setDisplacementY(rescale(disp.getDisplacementY()));
                    pointPlacement.setDisplacement(disp);
                }
            } else if (placement instanceof LinePlacement) {
                // rescales line label placement
                LinePlacement linePlacement = (LinePlacement) placement;
View Full Code Here

TOP

Related Classes of org.geotools.styling.Displacement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.