Package org.geotools.styling

Examples of org.geotools.styling.Stroke


                public Object apply(final String input) {
                    return input;
                }
            });
            Fill fill = createFill(styleJson);
            Stroke stroke = createStroke(styleJson, false);

            final Mark mark = this.styleBuilder.createMark(graphicName, fill, stroke);
            graphic.graphicalSymbols().add(mark);
        }

        if (graphic.graphicalSymbols().isEmpty()) {
            Fill fill = createFill(styleJson);
            Stroke stroke = createStroke(styleJson, false);

            final Mark mark = this.styleBuilder.createMark(DEFAULT_POINT_MARK, fill, stroke);
            graphic.graphicalSymbols().add(mark);
        }
View Full Code Here


     * @param styleJson The old style.
     */
    @VisibleForTesting
    @Nullable
    protected LineSymbolizer createLineSymbolizer(final PJsonObject styleJson) {
        final Stroke stroke = createStroke(styleJson, true);
        if (stroke == null) {
            return null;
        } else {
            return this.styleBuilder.createLineSymbolizer(stroke);
        }
View Full Code Here

            }
        }

        Expression lineCap = parseExpression(null, styleJson, JSON_STROKE_LINECAP, Functions.<String>identity());

        final Stroke stroke = this.styleBuilder.createStroke(strokeColor, widthExpression);
        stroke.setLineCap(lineCap);
        stroke.setOpacity(strokeOpacity);
        stroke.setDashArray(dashArray);
        return stroke;
    }
View Full Code Here

        final PointSymbolizer pointSymbolizer = this.helper.createPointSymbolizer(pJson);
        assertNotNull(pointSymbolizer);

        final Graphic graphic = pointSymbolizer.getGraphic();
        Mark mark = (Mark) graphic.graphicalSymbols().get(0);
        Stroke stroke = mark.getStroke();
        assertArrayEquals(Arrays.toString(stroke.getDashArray()), new float[]{5f, 4f}, stroke.getDashArray(), FLOAT_DELTA);
    }
View Full Code Here

        JSONObject json = new JSONObject();
        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final LineSymbolizer lineSymbolizer = this.helper.createLineSymbolizer(pJson);
        assertNotNull(lineSymbolizer);

        final Stroke stroke = lineSymbolizer.getStroke();
        assertNotNull(stroke);

        assertNull(stroke.getDashArray());
    }
View Full Code Here

        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final LineSymbolizer lineSymbolizer = this.helper.createLineSymbolizer(pJson);
        assertNotNull(lineSymbolizer);

        final Stroke stroke = lineSymbolizer.getStroke();
        assertArrayEquals(Arrays.toString(stroke.getDashArray()), new float[]{5f, 4f}, stroke.getDashArray(), FLOAT_DELTA);
    }
View Full Code Here

        JSONObject json = new JSONObject();
        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final PolygonSymbolizer polygonSymbolizer = this.helper.createPolygonSymbolizer(pJson);
        assertNotNull(polygonSymbolizer);

        final Stroke stroke = polygonSymbolizer.getStroke();
        assertNotNull(stroke);
        assertNull(stroke.getDashArray());

        assertNotNull(polygonSymbolizer.getFill());
    }
View Full Code Here

        PJsonObject pJson = new PJsonObject(json, "symbolizers");
        final PolygonSymbolizer polygonSymbolizer = this.helper.createPolygonSymbolizer(pJson);
        assertNotNull(polygonSymbolizer);

        final Stroke stroke = polygonSymbolizer.getStroke();
        assertArrayEquals(Arrays.toString(stroke.getDashArray()), new float[]{5f, 4f}, stroke.getDashArray(), FLOAT_DELTA);

        assertNotNull(polygonSymbolizer.getFill());
    }
View Full Code Here

    private void assertDashStyle(String dashStyle, float[] expectedDashArray) throws JSONException {
        JSONObject strokeJson = new JSONObject();
        strokeJson.put(JsonStyleParserHelper.JSON_STROKE_DASHSTYLE, dashStyle);

        PJsonObject pStyle = new PJsonObject(strokeJson, "style");
        final Stroke stroke = helper.createStroke(pStyle, false);
        assertNotNull(stroke);
        assertArrayEquals(Arrays.toString(stroke.getDashArray()), expectedDashArray, stroke.getDashArray(), FLOAT_DELTA);
    }
View Full Code Here

    public LineSymbolizer build() {
        if (unset) {
            return null; // builder was constructed but never used
        }
        Stroke stroke = strokeBuilder.build();
        if (stroke == null) {
            stroke = Stroke.DEFAULT;
        }
        LineSymbolizer ls = sf.createLineSymbolizer(stroke, null);
        if (geometry != null) {
View Full Code Here

TOP

Related Classes of org.geotools.styling.Stroke

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.