/** * create a textsymbolizer * * @param color the color of the text * @param fonts an array of fonts to use from the first to last * @param attributeName the attribute to use for the label * @return the new textsymbolizer * @throws org.geotools.filter.IllegalFilterException - if the attribute name does not exist */ public TextSymbolizer createTextSymbolizer(Color color, Font[] fonts, String attributeName) throws org.geotools.filter.IllegalFilterException { return createTextSymbolizer( createFill(color), fonts, null, attributeExpression(attributeName), null, null); }
/** * create a textsymbolizer * * @param color the color of the text * @param font the font to use * @param attributeName the attribute to use for the label * @return the new textsymbolizer * @throws org.geotools.filter.IllegalFilterException - if the attribute name does not exist */ public TextSymbolizer createTextSymbolizer(Color color, Font font, String attributeName) throws org.geotools.filter.IllegalFilterException { return createTextSymbolizer( createFill(color), new Font[] {font}, null, attributeExpression(attributeName), null, null); }
@Test public void testPropertyWidth() { Symbolizer ls = sb.createLineSymbolizer( sb.createStroke( sb.colorExpression(Color.BLACK), sb.attributeExpression("gimbo"))); Symbolizer ps = sb.createPolygonSymbolizer(sb.createStroke(12), sb.createFill()); Rule r = sb.createRule(new Symbolizer[] {ls, ps}); MetaBufferEstimator rbe = new MetaBufferEstimator(); rbe.visit(r); assertEquals(12, rbe.getBuffer()); assertTrue(!rbe.isEstimateAccurate()); }
/** * create a textsymbolizer * * @param color the color of the text * @param fonts an array of fonts to use from the first to last * @param attributeName the attribute to use for the label * * @return the new textsymbolizer * * @throws org.geotools.filter.IllegalFilterException - if the attribute name does not exist */ public TextSymbolizer createTextSymbolizer(Color color, Font[] fonts, String attributeName) throws org.geotools.filter.IllegalFilterException { return createTextSymbolizer( createFill(color), fonts, null, attributeExpression(attributeName), null, null); }
/** * create a textsymbolizer * * @param color the color of the text * @param fonts an array of fonts to use from the first to last * @param attributeName the attribute to use for the label * * @return the new textsymbolizer * * @throws org.geotools.filter.IllegalFilterException - if the attribute name does not exist */ public TextSymbolizer createTextSymbolizer(Color color, Font[] fonts, String attributeName) throws org.geotools.filter.IllegalFilterException { return createTextSymbolizer( createFill(color), fonts, null, attributeExpression(attributeName), null, null); }
/** * create a textsymbolizer * * @param color the color of the text * @param font the font to use * @param attributeName the attribute to use for the label * * @return the new textsymbolizer * * @throws org.geotools.filter.IllegalFilterException - if the attribute name does not exist */ public TextSymbolizer createTextSymbolizer(Color color, Font font, String attributeName) throws org.geotools.filter.IllegalFilterException { return createTextSymbolizer( createFill(color), new Font[] { font }, null, attributeExpression(attributeName), null, null); }
/** * create a textsymbolizer * * @param color the color of the text * @param font the font to use * @param attributeName the attribute to use for the label * * @return the new textsymbolizer * * @throws org.geotools.filter.IllegalFilterException - if the attribute name does not exist */ public TextSymbolizer createTextSymbolizer(Color color, Font font, String attributeName) throws org.geotools.filter.IllegalFilterException { return createTextSymbolizer( createFill(color), new Font[] { font }, null, attributeExpression(attributeName), null, null); }
Expression width = styleBuilder.attributeExpression("width"); Stroke stroke = styleBuilder.createStroke(color, width); LineSymbolizerImpl lineSymb =
StyleBuilder sb = new StyleBuilder(); FilterFactory2 ff = sb.getFilterFactory(); Mark testMark = sb.createMark(sb.literalExpression("Circle"), sb.createFill(sb.attributeExpression("color"),sb.attributeExpression("opacity")), null); Graphic graph = sb.createGraphic(null, // An external graphics if needed new Mark[] { testMark }, // a Mark if not an external graphics null, // aSymbol ff.literal(sb.attributeExpression("opacity")), // opacity ff.property("size"), // read from feature "size" attribute ff.literal(0)); // rotation, here read into the feature PointSymbolizer aPointSymbolizer = sb.createPointSymbolizer(graph); // creation of the style org.geotools.styling.Style style = sb.createStyle(aPointSymbolizer);