/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.PolygonSymbolizer) */ public void visit(PolygonSymbolizer poly) { if (symbolizerGeometriesVisitEnabled) { if (poly.getGeometry() != null) { poly.getGeometry().accept(this, null); } else { this.defaultGeometryUsed = true; // they want the default geometry (see GEOS-469) } } if (poly.getStroke() != null) { poly.getStroke().accept(this); } if (poly.getFill() != null) { poly.getFill().accept(this); } }
public void visit(PolygonSymbolizer poly) { PolygonSymbolizer copy = sf.createPolygonSymbolizer(); copy.setFill(copy(poly.getFill())); copy.setGeometry(copy(poly.getGeometry())); copy.setUnitOfMeasure(poly.getUnitOfMeasure()); copy.setStroke(copy(poly.getStroke())); copy.getOptions().putAll(poly.getOptions()); if (STRICT && !copy.equals(poly)) { throw new IllegalStateException( "Was unable to duplicate provided PolygonSymbolizer:" + poly); } pages.push(copy); }
public PolygonSymbolizerBuilder reset(PolygonSymbolizer symbolizer) { if (symbolizer == null) { return unset(); } stroke.reset(symbolizer.getStroke()); fill.reset(symbolizer.getFill()); uom = symbolizer.getUnitOfMeasure(); geometry = symbolizer.getGeometry(); unset = false; return this; }
public void visit(PolygonSymbolizer poly) { // adds the uom attribute according to the OGC SE specification AttributesImpl atts = new AttributesImpl(); Unit<Length> uom = poly.getUnitOfMeasure(); if (uom != null) atts.addAttribute("", "uom", "uom", "", UomOgcMapping.get(uom).getSEString()); start("PolygonSymbolizer", atts); encodeGeometryExpression(poly.getGeometry()); if (poly.getFill() != null) { poly.getFill().accept(this); } if (poly.getStroke() != null) { poly.getStroke().accept(this); } if (poly.getOptions() != null) { encodeVendorOptions(poly.getOptions()); } end("PolygonSymbolizer"); }
public void testPolygonSymbolizerWithGeometryFunction() { PolygonSymbolizer symb = sf.createPolygonSymbolizer(); // Set a function as geometry Function geomFunc = ff.function("centroid", ff.property("thr_geom")); symb.setGeometry(geomFunc); PolygonSymbolizer copy = (PolygonSymbolizer) visitor.copy(symb); // compare it assertEquals( "Any Expression set as Geometry must be correctly replicated", geomFunc, copy.getGeometry()); }
/** * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.PolygonSymbolizer) */ public void visit(PolygonSymbolizer poly) { if (poly.getGeometry() != null) { poly.getGeometry().accept(this, null); } else { this.defaultGeometryUsed = true; // they want the default geometry (see GEOS-469) } if (poly.getStroke() != null) { poly.getStroke().accept(this); } if (poly.getFill() != null) { poly.getFill().accept(this); } }
public void visit(PolygonSymbolizer poly) { PolygonSymbolizer copy = sf.createPolygonSymbolizer(); copy.setFill( copy( poly.getFill())); copy.setGeometry(copy(poly.getGeometry())); copy.setUnitOfMeasure(poly.getUnitOfMeasure()); copy.setStroke(copy(poly.getStroke())); copy.getOptions().putAll(poly.getOptions()); if( STRICT && !copy.equals( poly )){ throw new IllegalStateException("Was unable to duplicate provided PolygonSymbolizer:"+poly ); } pages.push(copy); }
@Override public void populate(SelectedSymbol selectedSymbol) { if (selectedSymbol != null) { PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer) selectedSymbol.getSymbolizer(); if (polygonSymbolizer != null) { populateStandardData(polygonSymbolizer); fieldConfigVisitor.populateField( FieldIdEnum.PERPENDICULAR_OFFSET, polygonSymbolizer.getPerpendicularOffset()); fieldConfigVisitor.populateField( FieldIdEnum.GEOMETRY, polygonSymbolizer.getGeometry()); } } }
/** * (non-Javadoc) * * @see * org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PolygonSymbolizer) */ public void visit(PolygonSymbolizer poly) { PolygonSymbolizer copy = sf.createPolygonSymbolizer(); copy.setFill(copy(poly.getFill())); copy.setGeometry(copy(poly.getGeometry())); copy.setUnitOfMeasure(poly.getUnitOfMeasure()); copy.setStroke(copy(poly.getStroke())); copy.getOptions().putAll(poly.getOptions()); if (STRICT && !copy.equals(poly)) { throw new IllegalStateException( "Was unable to duplicate provided PolygonSymbolizer:" + poly); } pages.push(copy); }
/** * Force a solid color, otherwise we might decide the user did not click on the polygon because * the area in which he clicked is fully transparent */ @Override public void visit(PolygonSymbolizer poly) { super.visit(poly); PolygonSymbolizer copy = (PolygonSymbolizer) pages.peek(); Fill fill = copy.getFill(); if (fill == null || isStaticTransparentFill(fill)) { copy.setFill(sb.createFill()); } Stroke stroke = copy.getStroke(); addStrokeSymbolizerIfNecessary(stroke); addGeometryExpression(poly.getGeometry(), geometriesOnPolygonSymbolizer); }
/** * (non-Javadoc) * * @see * org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PolygonSymbolizer) */ @Override public void visit(PolygonSymbolizer poly) { PolygonSymbolizer copy = sf.createPolygonSymbolizer(); copy.setFill(copy(poly.getFill())); copy.setGeometry(copy(MultiPolygon.class, poly.getGeometry())); copy.setUnitOfMeasure(poly.getUnitOfMeasure()); copy.setStroke(copy(poly.getStroke())); copy.getOptions().putAll(poly.getOptions()); if (STRICT && !copy.equals(poly)) { throw new IllegalStateException( "Was unable to duplicate provided PolygonSymbolizer:" + poly); } pages.push(copy); }
public void visit(PolygonSymbolizer poly) { // adds the uom attribute according to the OGC SE specification AttributesImpl atts = new AttributesImpl(); Unit<Length> uom = poly.getUnitOfMeasure(); if(uom != null) atts.addAttribute("", "uom", "uom", "", UomOgcMapping.get(uom).getSEString()); start("PolygonSymbolizer", atts); encodeGeometryExpression(poly.getGeometry()); if (poly.getFill() != null) { poly.getFill().accept(this); } if (poly.getStroke() != null) { poly.getStroke().accept(this); } if (poly.getOptions() != null) { encodeVendorOptions(poly.getOptions()); } end("PolygonSymbolizer"); }
@Override public void visit(PolygonSymbolizer poly) { if (poly.getDescription() != null) { poly.getDescription().accept(this); } if (poly.getDisplacement() != null) { poly.getDisplacement().accept(this); } if (poly.getFill() != null) { poly.getFill().accept(this); } if (poly.getGeometry() != null) { //poly.getGeometry().accept(visitor, extraData); } if (poly.getPerpendicularOffset() != null) { //poly.getPerpendicularOffset().accept(visitor, extraData) } if (poly.getStroke() != null) { poly.getStroke().accept(this); } }