Package org.geotools.styling

Examples of org.geotools.styling.Fill


    }
    return symbolizer;
  }

  private TextSymbolizer createTextSymbolizer(LabelStyleInfo labelStyle, LayerType layerType) {
    Fill fontFill = styleBuilder.createFill(styleBuilder.literalExpression(labelStyle.getFontStyle().getColor()),
        styleBuilder.literalExpression(labelStyle.getFontStyle().getOpacity()));
    TextSymbolizer symbolizer = styleBuilder.createTextSymbolizer();
    symbolizer.setFill(fontFill);
    FontStyleInfo fontInfo = labelStyle.getFontStyle();
    symbolizer.setFont(styleBuilder.createFont(styleBuilder.literalExpression(fontInfo.getFamily()),
        styleBuilder.literalExpression(fontInfo.getStyle()),
        styleBuilder.literalExpression(fontInfo.getWeight()),
        styleBuilder.literalExpression(fontInfo.getSize())));
    symbolizer.setLabel(styleBuilder.attributeExpression(labelStyle.getLabelAttributeName()));
    Fill haloFill = styleBuilder.createFill(
        styleBuilder.literalExpression(labelStyle.getBackgroundStyle().getFillColor()),
        styleBuilder.literalExpression(labelStyle.getBackgroundStyle().getFillOpacity()));
    symbolizer.setHalo(styleBuilder.createHalo(haloFill, 1));
    // label placement : point at bottom-center of label (same as vectorized)
    switch (layerType) {
View Full Code Here


        if( stroke!=null )
            stroke.accept(this);
    }

    public void visit( PolygonSymbolizer arg0 ) {
        Fill fill = arg0.getFill();
        if (fill != null)
            fill.accept(this);
        Stroke stroke = arg0.getStroke();
        if( stroke!=null )
            stroke.accept(this);
    }
View Full Code Here

        if( stroke!=null )
            stroke.accept(this);
    }

    public void visit( TextSymbolizer arg0 ) {
        Fill fill = arg0.getFill();
        if (fill != null)
            fill.accept(this);
    }
View Full Code Here

    public void visit( Graphic arg0 ) {
        arg0.setOpacity( fac.literal(1.0));
    }

    public void visit( Mark arg0 ) {
        Fill fill = arg0.getFill();
        if (fill != null)
            fill.accept(this);

        Stroke stroke = arg0.getStroke();
        if( stroke!=null )
            stroke.accept(this);
    }
View Full Code Here

    public void visit( LinePlacement arg0 ) {
        // nothing
    }

    public void visit( Halo arg0 ) {
        Fill fill = arg0.getFill();
        if (fill != null)
            fill.accept(this);
    }
View Full Code Here

    public static Color polyFill(PolygonSymbolizer symbolizer) {
        if (symbolizer == null) {
            return null;
        }

        Fill fill = symbolizer.getFill();

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

        Expression color = fill.getColor();
        return color(color);
    }
View Full Code Here

        }

        for( GraphicalSymbol gs : graphic.graphicalSymbols() ) {
            if ((gs != null) && (gs instanceof Mark)) {
                Mark mark = (Mark) gs;
                Fill fill = mark.getFill();
                if (fill != null) {
                    Color colour = color(fill.getColor());
                    if (colour == null) {
                        return null;
                    }
                    Expression opacity = fill.getOpacity();
                    if (opacity == null)
                        opacity = ff.literal(1.0);
                    float alpha = (float) Filters.asDouble(opacity);
                    colour = new Color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, alpha);
                    if (colour != null) {
View Full Code Here

    public void setFill(Fill fill2, Mode mode, Color defaultColor ) {
        listen( false );
        try {
           
            boolean enabled=true;
            Fill fill=fill2;
            if(fill==null ){
                StyleBuilder builder=new StyleBuilder();
                fill=builder.createFill(defaultColor, 0.5);
                enabled=false;
            }
View Full Code Here

        SimpleFeatureType schema = getLayer().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 = fts.rules();
View Full Code Here

                } else if (symbolizer instanceof PolygonSymbolizer) {
                    PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer) symbolizer;
                    Stroke stroke = polygonSymbolizer.getStroke();
                    if (stroke != null)
                        graphics[0] = stroke.getGraphicStroke();
                    Fill fill = polygonSymbolizer.getFill();
                    if (fill != null)
                        graphics[1] = fill.getGraphicFill();
                }
                for( int i = 0; i < graphics.length; i++ ) {
                    if (graphics[i] != null) {
                        for( GraphicalSymbol gs : graphics[i].graphicalSymbols() ) {
                            if ((gs != null) && (gs instanceof ExternalGraphic)) {
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.