Package org.geotools.styling

Examples of org.geotools.styling.Fill


            Expression graphicName = parseProperty(styleJson.getString(JSON_GRAPHIC_NAME), new Function<String, Object>() {
                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


                public Double apply(final String input) {
                    return Double.parseDouble(input);
                }
            });

            final Fill fill;
            if (styleJson.has(JSON_HALO_COLOR) || styleJson.has(JSON_HALO_OPACITY)) {
                fill = addFill(styleJson.optString(JSON_HALO_COLOR, "white"), styleJson.optString(JSON_HALO_OPACITY, "1.0"));
                return this.styleBuilder.createHalo(fill, radius);
            }
        }
View Full Code Here

    }

    @Test
    public void fill() throws Exception {
        FillBuilder b = new FillBuilder();
        Fill fill = b.color(Color.BLUE).opacity(0.75).build();
        assertNotNull(fill);
        assertNotNull(b.color);
        assertEquals(Color.BLUE, fill.getColor().evaluate(null, Color.class));
    }
View Full Code Here

    /**
     * Computes and returns the fill based on the feature and the symbolizer
     */
    public java.awt.Paint getFill() {
        Fill fill = ps.getFill();

        if (fill == null) {
            return null;
        }

        Paint fillPaint = (Color) fill.getColor().evaluate(feature, Color.class);

        // if a graphic fill is to be used, prepare the paint accordingly....
        org.geotools.styling.Graphic gr = fill.getGraphicFill();

        if (gr != null) {
            SLDStyleFactory fac = new SLDStyleFactory();
            fillPaint = fac.getTexturePaint(gr, feature, ps);
        }
View Full Code Here

    /**
     * Computes and returns the fill composite based on the feature and the symbolizer
     */
    public Composite getFillComposite() {
        Fill fill = ps.getFill();

        if (fill == null) {
            return null;
        }

        // get the opacity and prepare the composite
        float opacity = ((Float) fill.getOpacity().evaluate(feature,Float.class)).floatValue();

        if (opacity == 1) {
            return null;
        }

View Full Code Here

     */
    public Fill build() {
        if (unset) {
            return null;
        }
        Fill fill = sf.createFill(color, null, opacity, graphic.build());

        if (parent == null) {
            reset();
        }
        return fill;
View Full Code Here

            defaultStroke = sb.createStroke(color, 1, opacity);
        }

        if ((geometryAttrType.getType().getBinding() == MultiPolygon.class)
                || (geometryAttrType.getType().getBinding() == Polygon.class)) {
            Fill fill = sb.createFill(color, opacity);
            symb = sb.createPolygonSymbolizer(defaultStroke, fill);
        } else if (geometryAttrType.getType().getBinding() == LineString.class) {
            symb = sb.createLineSymbolizer(color);
        } else if ((geometryAttrType.getType().getBinding() == MultiPoint.class)
                || (geometryAttrType.getType().getBinding() == Point.class)) {
            Fill fill = sb.createFill(color, opacity);
            Mark square = sb.createMark(StyleBuilder.MARK_SQUARE, fill, defaultStroke);
            Graphic graphic = sb.createGraphic(null, square, null); //, 1, 4, 0);
            symb = sb.createPointSymbolizer(graphic);

            //TODO: handle Text and Raster
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)));
View Full Code Here

     * 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:
                fill = sf.createFill(ff.literal(fillColor), ff.literal(OPACITY));
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)));
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.