/** * Null safe graphic copy * * @param graphic * @return copy of graphic or null if not provided */ protected Graphic copy(Graphic graphic) { if (graphic == null) return null; graphic.accept(this); return (Graphic) pages.pop(); }
/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.PointSymbolizer) */ public void visit(PointSymbolizer ps) { if (ps.getGraphic() != null) { ps.getGraphic().accept(this); } }
public void visit(PointSymbolizer ps) { if (isAcceptable(ps)) { ps.getGraphic().accept(this); } }
@Override public void visit(Fill fill) { if (fill.getGraphicFill() != null) { fill.getGraphicFill().accept(this); } }
/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Stroke) */ public void visit(Stroke stroke) { try { Expression width = stroke.getWidth(); if (!isNull(width)) { evaluateWidth(width); } if (stroke.getGraphicStroke() != null) { stroke.getGraphicStroke().accept(this); } } catch (ClassCastException e) { estimateAccurate = false; LOGGER.info("Could not parse stroke width, " + "it's a literal but not a Number..."); } }
@Override public void visit(PointSymbolizer ps) { if (ps.getDescription() != null) { ps.getDescription().accept(this); } if (ps.getGraphic() != null) { ps.getGraphic().accept(this); } }
/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.PointSymbolizer) */ public void visit(PointSymbolizer ps) { if (symbolizerGeometriesVisitEnabled) { if (ps.getGeometry() != null) { ps.getGeometry().accept(this, null); } else { this.defaultGeometryUsed = true; // they want the default geometry (see GEOS-469) } } if (ps.getGraphic() != null) { ps.getGraphic().accept(this); } }
public void visit(PointSymbolizer ps) { // adds the uom attribute according to the OGC SE specification AttributesImpl atts = new AttributesImpl(); Unit<Length> uom = ps.getUnitOfMeasure(); if (uom != null) atts.addAttribute("", "uom", "uom", "", UomOgcMapping.get(uom).getSEString()); start("PointSymbolizer", atts); encodeGeometryExpression(ps.getGeometry()); ps.getGraphic().accept(this); if (ps.getOptions() != null) { encodeVendorOptions(ps.getOptions()); } end("PointSymbolizer"); }
Graphic graphic = ((TextSymbolizer2) text).getGraphic(); if (graphic != null) { graphic.accept(this);
public void visit(Fill fill) { start("Fill"); if (fill.getGraphicFill() != null) { start("GraphicFill"); fill.getGraphicFill().accept(this); end("GraphicFill"); } encodeCssParam("fill", fill.getColor(), "#808080"); encodeCssParam("fill-opacity", fill.getOpacity(), 1.0); end("Fill"); }
@Test public void testGraphicAnchor() { Graphic g = sb.createGraphic(); g.setAnchorPoint(sb.createAnchorPoint(ff.property("ax"), ff.property("ay"))); StyleAttributeExtractor extractor = new StyleAttributeExtractor(); g.accept(extractor); // check the plain names Set<String> atts = extractor.getAttributeNameSet(); assertEquals(2, atts.size()); assertTrue(atts.contains("ax")); assertTrue(atts.contains("ay")); }
/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill) */ public void visit(Fill fill) { if (fill.getBackgroundColor() != null) { fill.getBackgroundColor().accept(this, null); } if (fill.getColor() != null) { fill.getColor().accept(this, null); } if (fill.getGraphicFill() != null) { fill.getGraphicFill().accept(this); } if (fill.getOpacity() != null) { fill.getOpacity().accept(this, null); } }
public void visit(Stroke stroke) { start("Stroke"); if (stroke.getGraphicFill() != null) { start("GraphicFill"); stroke.getGraphicFill().accept(this); end("GraphicFill"); } if (stroke.getGraphicStroke() != null) { start("GraphicStroke"); stroke.getGraphicStroke().accept(this); end("GraphicStroke"); } encodeCssParam("stroke", stroke.getColor(), Color.BLACK); encodeCssParam("stroke-linecap", stroke.getLineCap(), "butt"); encodeCssParam("stroke-linejoin", stroke.getLineJoin(), "miter"); encodeCssParam("stroke-opacity", stroke.getOpacity(), 1.0); encodeCssParam("stroke-width", stroke.getWidth(), 1.0); encodeCssParam("stroke-dashoffset", stroke.getDashOffset(), 0.0); encodeStrokeDasharray(stroke.dashArray()); end("Stroke"); }
/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.PointSymbolizer) */ public void visit(PointSymbolizer ps) { if (ps.getGraphic() != null) { ps.getGraphic().accept(this); } }
public void visit(PointSymbolizer ps) { if (isAcceptable(ps)) { ps.getGraphic().accept(this); } }
((TextSymbolizer2) text).getGraphic().accept(this);
for (int i = 0; i < gr.length; i++) { start("LegendGraphic"); gr[i].accept(this); end("LegendGraphic");
((TextSymbolizer2) text).getGraphic().accept(this);