Package org.geotools.styling

Examples of org.geotools.styling.Fill


        SimpleFeatureType schema = featureCollection.getSchema();
        geometryName.setInput(schema);
        String name = DEFAULT_GEOMETRY;

        Stroke stroke = null;
        Fill fill = null;
        Graphic graphic = null;
        TextSymbolizer text = null;
        LabelPlacement placement = null;

        List<Rule> rules = Collections.emptyList();
View Full Code Here


        assertEquals("MyPolygonSymbolizer", sym.getName());
        assertEquals("Example PolygonSymbolizer", sym.getDescription().getTitle().toString());
        assertEquals("This is just a simple example of a polygon symbolizer.",
                sym.getDescription().getAbstract().toString());
       
        Fill f = sym.getFill();
        Color c = f.getColor().evaluate(null, Color.class);
        assertEquals(170, c.getRed());
        assertEquals(170, c.getGreen());
        assertEquals(255, c.getBlue());
       
        c = sym.getStroke().getColor().evaluate(null, Color.class);
View Full Code Here

        assertEquals("Arial", f.getFamily().get(0).evaluate(null, String.class));
        assertEquals("Sans-Serif", f.getFamily().get(1).evaluate(null, String.class));
        assertEquals("italic", f.getStyle().evaluate(null, String.class));
        assertEquals("10", f.getSize().evaluate(null, String.class));
       
        Fill fill = sym.getFill();
        assertEquals(Color.BLACK, fill.getColor().evaluate(null, Color.class));
    }
View Full Code Here

            if ("fill-opacity".equals(param.getName())) {
                opacity = param.getExpression();
            }
        }

        Fill fill = styleFactory.createFill(color);

        if (opacity != null) {
            fill.setOpacity(opacity);
        }
        if(graphicFill != null) {
            fill.setGraphicFill(graphicFill);
        }

        return fill;
    }
View Full Code Here

    }

    public void test() throws Exception {
        SLDMockData.fill(document, document);

        Fill fill = (Fill) parse();
        assertNotNull(fill);
        assertEquals(org.geotools.styling.SLD.opacity(fill), 1, 0d);

        Color c = org.geotools.styling.SLD.color(fill.getColor());
        assertEquals(c.getRed(), integer("12"));
        assertEquals(c.getGreen(), integer("34"));
        assertEquals(c.getBlue(), integer("56"));
    }
View Full Code Here

     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        // get the children and apply the defaults in case they are missing
        Fill fill = (Fill) node.getChildValue("Fill");
        if(fill == null) {
            fill = styleFactory.createFill(filterFactory.literal("#FFFFFF"));  
        }
        Expression radius = (Expression) node.getChildValue("Radius");
        if(radius == null) {
View Full Code Here

     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        String wkName = (String) node.getChildValue("WellKnownName");
        Stroke stroke = (Stroke) node.getChildValue("Stroke");
        Fill fill = (Fill) node.getChildValue("Fill");

        Mark mark = styleFactory.createMark();

        if (wkName != null) {
            mark.setWellKnownName(filterFactory.literal(wkName));
View Full Code Here

        Stroke stroke = sb.createStroke();
        stroke.setColor(null);
        stroke.setGraphicStroke(sb.createGraphic(null, sb.createMark("square", null, sb.createStroke(1)), null));
       
        // a graphic fill
        Fill fill = sb.createFill();
        fill.setColor(null);
        fill.setGraphicFill(sb.createGraphic(null, sb.createMark("square", null, sb.createStroke(2)), null));
       
        // a polygon and line symbolizer using them
        PolygonSymbolizer ps = sb.createPolygonSymbolizer(stroke, fill);
       
        // rescale it
View Full Code Here

        String fontName = this.font[0].getName();
        boolean fontBold = (this.font[0].getStyle() == SWT.BOLD);
        boolean fontItalic = (this.font[0].getStyle() == SWT.ITALIC);
        double fontSize = this.font[0].getHeight();
        Font gtFont = build.createFont(fontName, fontItalic, fontBold, fontSize);
        Fill fill = build.createFill(this.colour);

        LabelPlacement placement;
        if (pointPlacement) {
            // PointPlacement
            double horiz;
View Full Code Here

        // create a partially opaque outline stroke
        Stroke stroke = styleFactory.createStroke(filterFactory.literal(Color.BLUE), filterFactory.literal(1),
                filterFactory.literal(0.5));

        // create a partial opaque fill
        Fill fill = styleFactory.createFill(filterFactory.literal(Color.CYAN), filterFactory.literal(0.5));

        /*
         * Setting the geometryPropertyName arg to null signals that we want to
         * draw the default geomettry of features
         */
 
View Full Code Here

TOP

Related Classes of org.geotools.styling.Fill

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.