Package org.geotools.styling

Examples of org.geotools.styling.PolygonSymbolizer


        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertSimpleStyle(collector);

        // check the symbolizer
        PolygonSymbolizer ps = (PolygonSymbolizer) collector.symbolizers.get(0);
        assertEquals(Color.BLUE, ps.getFill().getColor().evaluate(null, Color.class));
        assertEquals(0.5, ps.getFill().getOpacity().evaluate(null, Double.class), 0.0);
        assertEquals(Color.WHITE, ps.getStroke().getColor().evaluate(null, Color.class));
        assertEquals(2, (int) ps.getStroke().getWidth().evaluate(null, Integer.class));
    }
View Full Code Here


        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertSimpleStyle(collector);

        // check the symbolizer
        PolygonSymbolizer ps = (PolygonSymbolizer) collector.symbolizers.get(0);
        assertNull(ps.getStroke());
        ExternalGraphic eg = (ExternalGraphic) ps.getFill().getGraphicFill().graphicalSymbols()
                .get(0);
        assertEquals("colorblocks.png", eg.getOnlineResource().getLinkage().toString());
        assertEquals("image/png", eg.getFormat());
    }
View Full Code Here

        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertSimpleStyle(collector);

        // check the symbolizer
        PolygonSymbolizer ps = (PolygonSymbolizer) collector.symbolizers.get(0);
        assertNull(ps.getStroke());
        Mark mark = (Mark) ps.getFill().getGraphicFill().graphicalSymbols().get(0);
        assertEquals("shape://times", mark.getWellKnownName().evaluate(null, String.class));
        assertEquals("#990099", mark.getStroke().getColor().evaluate(null, String.class));
        assertNull(mark.getFill());
    }
View Full Code Here

        // round up the basic elements and check its simple
        StyleCollector collector = new StyleCollector();
        style.accept(collector);

        PolygonSymbolizer ps = (PolygonSymbolizer) collector.symbolizers.get(0);
        assertEquals("#40FF40", ps.getFill().getColor().evaluate(null, String.class));
        assertEquals(Color.WHITE, ps.getStroke().getColor().evaluate(null, Color.class));
        assertEquals(2, (int) ps.getStroke().getWidth().evaluate(null, Integer.class));

        TextSymbolizer2 ts = (TextSymbolizer2) collector.symbolizers.get(1);
        assertEquals(ff.property("name"), ts.getLabel());
        assertEquals(Color.BLACK, ts.getFill().getColor().evaluate(null, Color.class));
View Full Code Here

                collector.rules.get(1).getFilter());
        assertEquals(ff.greater(ff.property("pop"), ff.literal("500000")), collector.rules.get(2)
                .getFilter());

        // check symbolizers
        PolygonSymbolizer ps = (PolygonSymbolizer) collector.symbolizers.get(0);
        assertEquals("#66FF66", ps.getFill().getColor().evaluate(null, String.class));
        ps = (PolygonSymbolizer) collector.symbolizers.get(1);
        assertEquals("#33CC33", ps.getFill().getColor().evaluate(null, String.class));
        ps = (PolygonSymbolizer) collector.symbolizers.get(2);
        assertEquals("#009900", ps.getFill().getColor().evaluate(null, String.class));
    }
View Full Code Here

  }

  private PolygonSymbolizer polysym(StyleFactory sFac)
      throws IllegalFilterException {
    Stroke myStroke;
    PolygonSymbolizer polysym = sFac.createPolygonSymbolizer();
    Fill myFill = sFac.getDefaultFill();
    myFill.setColor(filterFactory.literal("#ff0000"));
    polysym.setFill(myFill);
    myStroke = sFac.getDefaultStroke();
    myStroke.setColor(filterFactory.literal("#0000ff"));
    myStroke
        .setWidth(filterFactory.literal(new Integer(2)));
    polysym.setStroke(myStroke);
    return polysym;
  }
View Full Code Here

  }

  private PolygonSymbolizer polysym1(StyleFactory sFac)
      throws IllegalFilterException {
    Stroke myStroke;
    PolygonSymbolizer polysym = sFac.createPolygonSymbolizer();
    Fill myFill = sFac.getDefaultFill();
    myFill.setColor(filterFactory.literal("#00ff00"));
    polysym.setFill(myFill);
    myStroke = sFac.getDefaultStroke();
    myStroke.setColor(filterFactory.literal("#00ff00"));
    myStroke
        .setWidth(filterFactory.literal(new Integer(2)));
    polysym.setStroke(myStroke);
    return polysym;
  }
View Full Code Here

    rule2.setSymbolizers(new Symbolizer[] { linesym });
    FeatureTypeStyle ftsL = sFac.createFeatureTypeStyle();
    ftsL.setRules(new Rule[] { rule2 });
    ftsL.setFeatureTypeName("querytest");

    PolygonSymbolizer polysym = sFac.createPolygonSymbolizer();
    polysym.setGeometryPropertyName("polygon");
    Fill myFill = sFac.getDefaultFill();
    myFill.setColor(filterFactory.literal("#ff0000"));
    polysym.setFill(myFill);
    polysym.setStroke(sFac.getDefaultStroke());
    Rule rule = sFac.createRule();
    rule.setSymbolizers(new Symbolizer[] { polysym });
    FeatureTypeStyle ftsPoly = sFac
        .createFeatureTypeStyle(new Rule[] { rule });
    // ftsPoly.setRules(new Rule[]{rule});
View Full Code Here

        /*
         * Setting the geometryPropertyName arg to null signals that we want to
         * draw the default geomettry of features
         */
        PolygonSymbolizer sym = styleFactory.createPolygonSymbolizer(stroke, fill, null);

        Rule rule = styleFactory.createRule();
        rule.symbolizers().add(sym);
        FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(new Rule[]{rule});
        Style style = styleFactory.createStyle();
View Full Code Here

    /**
     * Test of createPolygonStyle method, of class org.geotools.renderer.style.SLDStyleFactory.
     */
    public void testCreateIncompletePolygonStyle() {
        PolygonSymbolizer symb;
       
        //full symbolizer
        symb = sf.createPolygonSymbolizer();
        sld.createPolygonStyle(null, symb,range);
    }
View Full Code Here

TOP

Related Classes of org.geotools.styling.PolygonSymbolizer

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.