Examples of Symbolizer


Examples of org.geotools.styling.Symbolizer

            filters.add(filter);
        }

        // create the symbolizer
        Symbolizer symb = createSymbolizer(geometryAttrType, getColor(elseMode, colors, i),
                opacity, defaultStroke);

        // create the rule
        Rule rule = sb.createRule(symb);
View Full Code Here

Examples of org.geotools.styling.Symbolizer

            LOGGER.log(Level.SEVERE, "Error: no handler for this Classifier type");
        }

        // add an else rule to capture any missing features?
        if (elseMode != ELSEMODE_IGNORE) {
            Symbolizer symb = createSymbolizer(geometryAttrType, getElseColor(elseMode, colors),
                    opacity, defaultStroke);
            Rule elseRule = sb.createRule(symb);
            elseRule.setIsElseFilter(true);
            elseRule.setTitle("Else");
            elseRule.setName("else");
View Full Code Here

Examples of org.geotools.styling.Symbolizer

     * Helper for createXXXStyle methods. Creates a new Rule containing
     * a Symbolizer tailored to the geometry type of the features that
     * we are displaying.
     */
    private Rule createRule(Color outlineColor, Color fillColor) {
        Symbolizer symbolizer = null;
        Fill fill = null;
        Stroke stroke = sf.createStroke(ff.literal(outlineColor), ff.literal(LINE_WIDTH));

        switch (geometryType) {
            case POLYGON:
View Full Code Here

Examples of org.geotools.styling.Symbolizer

        Symbolizer[] symbolizers = rule.getSymbolizers();

        if (symbolizers != null) {
            for (int i = 0; i < symbolizers.length; i++) {
                Symbolizer symbolizer = symbolizers[i];
                symbolizer.accept(this);
            }
        }

        Graphic[] legendGraphics = rule.getLegendGraphic();
View Full Code Here

Examples of org.geotools.styling.Symbolizer

        assertTrue(rbe.isEstimateAccurate());
    }

    @Test
    public void testMultiSymbolizers() {
        Symbolizer ls = sb.createLineSymbolizer(sb.createStroke(10.8));
        Symbolizer ps = sb.createPolygonSymbolizer(sb.createStroke(12), sb.createFill());
        Rule r = sb.createRule(new Symbolizer[] { ls, ps });
        MetaBufferEstimator rbe = new MetaBufferEstimator();
        rbe.visit(r);
        assertEquals(12, rbe.getBuffer());
        assertTrue(rbe.isEstimateAccurate());
View Full Code Here

Examples of org.geotools.styling.Symbolizer

        assertTrue(rbe.isEstimateAccurate());
    }

    @Test
    public void testPropertyWidth() {
        Symbolizer ls = sb.createLineSymbolizer(sb.createStroke(sb.colorExpression(Color.BLACK), sb
                .attributeExpression("gimbo")));
        Symbolizer ps = sb.createPolygonSymbolizer(sb.createStroke(12), sb.createFill());
        Rule r = sb.createRule(new Symbolizer[] { ls, ps });
        MetaBufferEstimator rbe = new MetaBufferEstimator();
        rbe.visit(r);
        assertEquals(12, rbe.getBuffer());
        assertTrue(!rbe.isEstimateAccurate());
View Full Code Here

Examples of org.geotools.styling.Symbolizer

        assertTrue(!rbe.isEstimateAccurate());
    }
   
    @Test
    public void testEnvironmentWidth() {
        Symbolizer ls = sb.createLineSymbolizer(sb.createStroke(sb.colorExpression(Color.BLACK),
                ff.function("env", ff.literal("thickness"), ff.literal(10))));
        Rule r = sb.createRule(new Symbolizer[] { ls});
        MetaBufferEstimator rbe = new MetaBufferEstimator();
       
        // no env variable, fall back on the default value
View Full Code Here

Examples of org.geotools.styling.Symbolizer

    }
   
    @Test
    public void testConstantFunction() {
        Function cos = ff.function("cos", ff.literal(Math.toRadians(Math.PI)));
        Symbolizer ls = sb.createLineSymbolizer(sb.createStroke(sb.colorExpression(Color.BLACK), cos));
        Rule r = sb.createRule(new Symbolizer[] { ls });
        MetaBufferEstimator rbe = new MetaBufferEstimator();

        // cos(pi) == 1
        rbe.visit(r);
View Full Code Here

Examples of org.geotools.styling.Symbolizer

    }
   
    @Test
    public void testMath() {
        Add add = ff.add(ff.literal("5"), ff.literal("-2"));
        Symbolizer ls = sb.createLineSymbolizer(sb.createStroke(sb.colorExpression(Color.BLACK), add));
        Rule r = sb.createRule(new Symbolizer[] { ls });
        MetaBufferEstimator rbe = new MetaBufferEstimator();
       
        // 5-2 = 3
        rbe.visit(r);
View Full Code Here

Examples of org.geotools.styling.Symbolizer

    }

    public void visit(ImageOutline outline) {
        //copy the symbolizer
        final Symbolizer symb = outline.getSymbolizer();
        final Symbolizer copySymb = copy(symb);

        final ImageOutline copy = sf.createImageOutline(copySymb);
        copy.setSymbolizer(copySymb);
        if (STRICT && !copy.equals(outline)) {
            throw new IllegalStateException("Was unable to duplicate provided ImageOutline:" + outline);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.