symbol.setGeometry(parseGeometry(child)); } else if (childName.equalsIgnoreCase(fillSt)) { symbol.setFill(parseFill(child));
ts.setGeometryPropertyName(propertyName.getPropertyName()); } else { ts.setGeometry(geometry);
public TextSymbolizer build() { if (unset) { return null; } Font[] array = null; if (!fonts.isEmpty()) { array = new Font[fonts.size()]; for (int i = 0; i < array.length; i++) { array[i] = fonts.get(i).build(); } } TextSymbolizer ts = sf.createTextSymbolizer( fill.build(), array, halo.build(), label, placement.build(), null); ts.setGeometry(geometry); if (uom != null) { ts.setUnitOfMeasure(uom); } ts.getOptions().putAll(options); ts.setPriority(priority); if (ts instanceof TextSymbolizer2) { TextSymbolizer2 ts2 = (TextSymbolizer2) ts; if (!shield.isUnset()) { ts2.setGraphic(shield.build()); } } reset(); return ts; }
ts.setGeometryPropertyName(propertyName.getPropertyName()); } else { ts.setGeometry(geometry);
public void testTextSymbolizerWithGeometryFunction() { TextSymbolizer symb = sf.createTextSymbolizer(); // Set a function as geometry Function geomFunc = ff.function("centroid", ff.property("the_geom")); symb.setGeometry(geomFunc); TextSymbolizer copy = (TextSymbolizer) visitor.copy(symb); // compare it assertEquals( "Any Expression set as Geometry must be correctly replicated", geomFunc, copy.getGeometry()); }
public void visit(TextSymbolizer text) { TextSymbolizer copy = sf.createTextSymbolizer(); copy.setFill(copy(text.getFill())); copy.fonts().clear(); copy.fonts().addAll(copyFonts(text.fonts())); copy.setGeometry(copy(text.getGeometry())); copy.setUnitOfMeasure(text.getUnitOfMeasure()); copy.setHalo(copy(text.getHalo())); copy.setLabel(copy(text.getLabel())); copy.setLabelPlacement(copy(text.getLabelPlacement())); copy.setPriority(copy(text.getPriority())); copy.getOptions().putAll(text.getOptions()); if (text instanceof TextSymbolizer2) { TextSymbolizer2 text2 = (TextSymbolizer2) text; TextSymbolizer2 copy2 = (TextSymbolizer2) copy; copy2.setGraphic(copy(text2.getGraphic())); copy2.setSnippet(copy(text2.getSnippet())); copy2.setFeatureDescription(copy(text2.getFeatureDescription())); copy2.setOtherText(copy(text2.getOtherText())); } if (STRICT && !copy.equals(text)) { throw new IllegalStateException( "Was unable to duplicate provided TextSymbolizer:" + text); } pages.push(copy); }
symbol.setGeometry(parseGeometry(child)); } else if (childName.equalsIgnoreCase(fillSt)) { symbol.setFill(parseFill(child));
copy.setGeometry(copy(text.getGeometry()));
public void visit(TextSymbolizer text) { TextSymbolizer copy = sf.createTextSymbolizer(); copy.setFill( copy( text.getFill())); copy.setFont( copy( text.getFont())); copy.setGeometry(copy(text.getGeometry())); copy.setUnitOfMeasure(text.getUnitOfMeasure()); copy.setHalo( copy( text.getHalo() )); copy.setLabel( copy( text.getLabel())); copy.setLabelPlacement( copy( text.getLabelPlacement())); copy.setPriority( copy( text.getPriority())); copy.getOptions().putAll(text.getOptions()); if (text instanceof TextSymbolizer2){ TextSymbolizer2 text2 = (TextSymbolizer2) text; TextSymbolizer2 copy2 = (TextSymbolizer2) copy; copy2.setGraphic( copy(text2.getGraphic())); copy2.setSnippet(copy(text2.getSnippet())); copy2.setFeatureDescription(copy(text2.getFeatureDescription())); copy2.setOtherText(copy(text2.getOtherText())); } if( STRICT && !copy.equals( text )){ throw new IllegalStateException("Was unable to duplicate provided TextSymbolizer:"+text ); } pages.push(copy); }
textSymbolizer.setGeometry(geometryField);