} else if (res.equalsIgnoreCase(opacityString) || res.equalsIgnoreCase("fill-opacity")) { fill.setOpacity(parseCssParameter(child));
public Fill getDefaultFill() { Fill fill = new FillImpl(filterFactory); try { fill.setColor(filterFactory.literal("#808080")); fill.setOpacity(filterFactory.literal(new Double(1.0))); fill.setBackgroundColor(filterFactory.literal("#FFFFFF")); } catch (org.geotools.filter.IllegalFilterException ife) { throw new RuntimeException("Error creating fill", ife); } return fill; }
fill.setOpacity(opacity);
public void visit(Fill fill) { Fill copy = sf.getDefaultFill(); copy.setBackgroundColor(copy(fill.getBackgroundColor())); copy.setColor(copy(fill.getColor())); copy.setGraphicFill(copy(fill.getGraphicFill())); copy.setOpacity(copy(fill.getOpacity())); if (STRICT && !copy.equals(fill)) { throw new IllegalStateException("Was unable to duplicate provided Fill:" + fill); } pages.push(copy); }
/** * create a default fill 50% gray * * @return the fill created */ public Fill createFill() { Fill f = sf.getDefaultFill(); f.setColor(literalExpression("#808080")); f.setBackgroundColor(literalExpression("#808080")); f.setOpacity(literalExpression(1.0)); return f; }
public Fill createFill( Expression color, Expression backgroundColor, Expression opacity, Graphic graphicFill) { Fill fill = new FillImpl(filterFactory); if (color == null) { color = Fill.DEFAULT.getColor(); } fill.setColor(color); if (backgroundColor == null) { backgroundColor = Fill.DEFAULT.getBackgroundColor(); } fill.setBackgroundColor(backgroundColor); if (opacity == null) { opacity = Fill.DEFAULT.getOpacity(); } // would be nice to check if this was within bounds but we have to wait until use since it // may depend on an attribute fill.setOpacity(opacity); fill.setGraphicFill(graphicFill); return fill; }
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { YamlMap map = obj.map(); if (map.has("fill-color")) { fill().setColor(Util.color(map.get("fill-color"), factory)); } if (map.has("fill-opacity")) { fill().setOpacity(Util.expression(map.str("fill-opacity"), factory)); } context.push( "fill-graphic", new GraphicParser(factory) { @Override protected void graphic(Graphic g) { fill().setGraphicFill(g); } }); }
@Override public void visit(TextSymbolizer text) { super.visit(text); TextSymbolizer textCopy = (TextSymbolizer) pages.peek(); Fill textFill = textCopy.getFill(); if (textFill != null) { textFill.setOpacity(textExp); } else { textCopy.setFill(defaultTextFill); } } }
@Override public void visit(TextSymbolizer text) { super.visit(text); TextSymbolizer textCopy = (TextSymbolizer) pages.peek(); Fill textFill = textCopy.getFill(); if (textFill != null) { textFill.setOpacity(textExp); } else { textCopy.setFill(defaultTextFill); } } }
public Fill getDefaultFill() { Fill fill = new FillImpl(); try { fill.setColor(filterFactory.literal("#808080")); fill.setOpacity(filterFactory.literal( new Double(1.0))); } catch (org.geotools.filter.IllegalFilterException ife) { throw new RuntimeException("Error creating fill", ife); } return fill; }
public void apply() { if (fill != null) { fill.setColor(guiColor.getExpression()); fill.setOpacity(guiAlpha.getExpression()); } }
@Override public void visit(Fill fill) { super.visit(fill); Fill copy = (Fill) pages.peek(); if (copy.getGraphicFill() != null) { copy.setGraphicFill(null); } copy.setColor(colorFunction); copy.setOpacity(LITERAL_ONE); }
@Override public void visit(PolygonSymbolizer poly) { super.visit(poly); PolygonSymbolizer polyCopy = (PolygonSymbolizer) pages.peek(); Fill polyFill = polyCopy.getFill(); if (polyFill != null) { polyFill.setOpacity(polyFillExp); } Stroke polyStroke = polyCopy.getStroke(); if (polyStroke != null) { polyStroke.setOpacity(polyStrokeExp); } }
@Override public void visit(PolygonSymbolizer poly) { super.visit(poly); PolygonSymbolizer polyCopy = (PolygonSymbolizer) pages.peek(); Fill polyFill = polyCopy.getFill(); if (polyFill != null) { polyFill.setOpacity(polyFillExp); } Stroke polyStroke = polyCopy.getStroke(); if (polyStroke != null) { polyStroke.setOpacity(polyStrokeExp); } }
public Fill getDefaultFill() { Fill fill = new FillImpl(filterFactory); try { fill.setColor(filterFactory.literal("#808080")); fill.setOpacity(filterFactory.literal( new Double(1.0))); fill.setBackgroundColor(filterFactory.literal("#FFFFFF")); } catch (org.geotools.filter.IllegalFilterException ife) { throw new RuntimeException("Error creating fill", ife); } return fill; }
public void visit(Fill fill) { Fill copy = sf.getDefaultFill(); copy.setBackgroundColor( copy( fill.getBackgroundColor()) ); copy.setColor(copy( fill.getColor())); copy.setGraphicFill( copy(fill.getGraphicFill())); copy.setOpacity( copy(fill.getOpacity())); if( STRICT && !copy.equals( fill )){ throw new IllegalStateException("Was unable to duplicate provided Fill:"+fill ); } pages.push(copy); }
/** * create a default fill 50% gray * * @return the fill created */ public Fill createFill() { Fill f = sf.getDefaultFill(); f.setColor(literalExpression("#808080")); f.setBackgroundColor(literalExpression("#808080")); f.setOpacity(literalExpression(1.0)); return f; }
/** * create a default fill 50% gray * * @return the fill created */ public Fill createFill() { Fill f = sf.getDefaultFill(); f.setColor(literalExpression("#808080")); f.setBackgroundColor(literalExpression("#808080")); f.setOpacity(literalExpression(1.0)); return f; }
public Style createPolygonStyle() { Style style = null; PolygonSymbolizer ps = sb.createPolygonSymbolizer(randomColor(), randomWidth()); ps.getFill().setOpacity(sb.literalExpression(0.6f)); style = sb.createStyle(); style.addFeatureTypeStyle(sb.createFeatureTypeStyle(ps)); return style; }
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { YamlMap map = obj.map(); if (map.has("fill-color")) { fill().setColor(Util.color(map.get("fill-color"), factory)); } if (map.has("fill-opacity")) { fill().setOpacity(Util.expression(map.str("fill-opacity"), factory)); } context.push( "fill-graphic", new GraphicParser(factory) { @Override protected void graphic(Graphic g) { fill().setGraphicFill(g); } }); }