stroke.setColor(color); } else if (res.equalsIgnoreCase("width") || res.equalsIgnoreCase("stroke-width")) { Expression width = parseCssParameter(child, false);
/** * Sets the Colour for the given Line symbolizer * * @param symbolizer * @param colour */ public static void setLineColour(LineSymbolizer symbolizer, Color colour) { if (symbolizer == null || colour == null) { return; } Stroke stroke = symbolizer.getStroke(); if (stroke == null) { stroke = sf.createStroke(ff.literal(colour), Stroke.DEFAULT.getWidth()); symbolizer.setStroke(stroke); } else { stroke.setColor(ff.literal(colour)); } }
private LineSymbolizer linesym(StyleFactory sFac) throws IllegalFilterException { LineSymbolizer linesym = sFac.createLineSymbolizer(); Stroke myStroke = sFac.getDefaultStroke(); myStroke.setColor(filterFactory.literal("#0000ff")); myStroke.setWidth(filterFactory.literal(Integer.valueOf(5))); LOGGER.fine("got new Stroke " + myStroke); linesym.setStroke(myStroke); return linesym; }
/** * Sets the colour to use for outline (stroke) and fill in a polygon symbolizer * * @param symbolizer the polygon symbolizer * @param colour the colour for polygon outlines and fill */ public static void setPolyColour(PolygonSymbolizer symbolizer, Color colour) { if (symbolizer == null || colour == null) { return; } Expression colourExp = ff.literal(colour); Stroke stroke = symbolizer.getStroke(); if (stroke == null) { stroke = sf.createStroke(colourExp, Stroke.DEFAULT.getWidth()); symbolizer.setStroke(stroke); } else { stroke.setColor(ff.literal(colour)); } Fill fill = symbolizer.getFill(); if (fill != null) { fill.setColor(colourExp); } }
public void visit(Stroke stroke) { Stroke copy = sf.getDefaultStroke(); copy.setColor(copy(stroke.getColor())); copy.setDashArray(copyExpressions(stroke.dashArray())); copy.setDashOffset(copy(stroke.getDashOffset())); copy.setGraphicFill(copy(stroke.getGraphicFill())); copy.setGraphicStroke(copy(stroke.getGraphicStroke())); copy.setLineCap(copy(stroke.getLineCap())); copy.setLineJoin(copy(stroke.getLineJoin())); copy.setOpacity(copy(stroke.getOpacity())); copy.setWidth(copy(stroke.getWidth())); if (STRICT && !copy.equals(stroke)) { throw new IllegalStateException("Was unable to duplicate provided Stroke:" + stroke); } pages.push(copy); }
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(Integer.valueOf(2))); polysym.setStroke(myStroke); return polysym; }
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(Integer.valueOf(2))); polysym.setStroke(myStroke); return polysym; }
/** * Increase stroke width. * * <p>Based on feedback we may need to change the dash array as well. * * <p> */ public void visit(org.geotools.styling.Stroke stroke) { Stroke copy = sf.getDefaultStroke(); copy.setColor(copy(stroke.getColor())); copy.setDashArray(rescaleDashArray(stroke.dashArray())); copy.setDashOffset(rescale(stroke.getDashOffset())); copy.setGraphicFill(copy(stroke.getGraphicFill())); copy.setGraphicStroke(copy(stroke.getGraphicStroke())); copy.setLineCap(copy(stroke.getLineCap())); copy.setLineJoin(copy(stroke.getLineJoin())); copy.setOpacity(copy(stroke.getOpacity())); copy.setWidth(rescale(stroke.getWidth())); pages.push(copy); }
stroke.setColor(color);
stroke.setColor(null); stroke.setGraphicStroke( sb.createGraphic(null, sb.createMark("square", null, sb.createStroke(1)), null));
stroke().setColor(Util.color(map.get("stroke-color"), factory));
myStroke.setColor(filterFactory.literal("#0000ff")); myStroke.setWidth(filterFactory.literal(Integer.valueOf(3))); LOGGER.info("got new Stroke " + myStroke);
stroke.setColor(null); Graphic graphic = sb.createGraphic(null, sb.createMark("square", null, sb.createStroke(1)), null);
private static Style createLineStyle() { LineSymbolizer symbolizer = styleFactory.createLineSymbolizer(); SLD.setLineColour(symbolizer, Color.BLUE); symbolizer.getStroke().setWidth(filterFactory.literal(1)); symbolizer.getStroke().setColor(filterFactory.literal(Color.BLUE)); Rule rule = styleFactory.createRule(); rule.symbolizers().add(symbolizer); FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(); fts.rules().add(rule); Style style = styleFactory.createStyle(); style.featureTypeStyles().add(fts); return style; }
private static Style createLineStyle() { LineSymbolizer symbolizer = styleFactory.createLineSymbolizer(); SLD.setLineColour(symbolizer, Color.BLUE); symbolizer.getStroke().setWidth(filterFactory.literal(1)); symbolizer.getStroke().setColor(filterFactory.literal(Color.BLUE)); Rule rule = styleFactory.createRule(); rule.symbolizers().add(symbolizer); FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(); fts.rules().add(rule); Style style = styleFactory.createStyle(); style.featureTypeStyles().add(fts); return style; }
/** * Sets the Colour for the given Line symbolizer * * @param symbolizer * @param colour */ public static void setLineColour(LineSymbolizer symbolizer, Color colour) { if (symbolizer == null || colour == null) { return; } Stroke stroke = symbolizer.getStroke(); if (stroke == null) { stroke = sf.createStroke(ff.literal(colour), Stroke.DEFAULT.getWidth()); symbolizer.setStroke(stroke); } else { stroke.setColor(ff.literal(colour)); } }
@Override public void visit(Stroke stroke) { super.visit(stroke); Stroke copy = (Stroke) pages.peek(); if (copy.getGraphicFill() != null) { copy.setGraphicFill(null); } if (copy.getGraphicStroke() != null) { copy.setWidth(getSymbolsSize(copy.getGraphicStroke())); copy.setGraphicStroke(null); } copy.setColor(colorFunction); copy.setOpacity(LITERAL_ONE); if (copy.dashArray() != null) { copy.dashArray().clear(); } copy.setDashOffset(null); }
public void apply(){ if(stroke != null){ stroke.setLineCap(GuiStrokeLineCap.getLineCap()); stroke.setLineJoin(GuiStrokeLineJoin.getLineJoin()); stroke.setDashArray(GuiStrokeDashes.getDashes()); stroke.setDashOffset(GuiStrokeDashes.getOffset()); stroke.setOpacity(GuiStrokeAlpha.getExpression()); stroke.setWidth(GuiStrokeWidth.getExpression()); stroke.setColor(GuiStrokeColor.getExpression()); } }
public void visit(Stroke stroke) { Stroke copy = sf.getDefaultStroke(); copy.setColor( copy(stroke.getColor())); copy.setDashArray( copy(stroke.getDashArray())); copy.setDashOffset( copy( stroke.getDashOffset())); copy.setGraphicFill( copy(stroke.getGraphicFill())); copy.setGraphicStroke( copy( stroke.getGraphicStroke())); copy.setLineCap(copy(stroke.getLineCap())); copy.setLineJoin( copy(stroke.getLineJoin())); copy.setOpacity( copy(stroke.getOpacity())); copy.setWidth( copy(stroke.getWidth())); if( STRICT && !copy.equals( stroke)){ throw new IllegalStateException("Was unable to duplicate provided Stroke:"+stroke ); } pages.push(copy); }
/** * Increase stroke width. * <p> * Based on feedback we may need to change the dash array as well. * <p> */ public void visit(org.geotools.styling.Stroke stroke) { Stroke copy = sf.getDefaultStroke(); copy.setColor( copy(stroke.getColor())); copy.setDashArray( rescale(stroke.getDashArray())); copy.setDashOffset( rescale(stroke.getDashOffset())); copy.setGraphicFill( copy(stroke.getGraphicFill())); copy.setGraphicStroke( copy( stroke.getGraphicStroke())); copy.setLineCap(copy(stroke.getLineCap())); copy.setLineJoin( copy(stroke.getLineJoin())); copy.setOpacity( copy(stroke.getOpacity())); copy.setWidth( rescale(stroke.getWidth())); pages.push(copy); }