Java Code Examples for org.geotools.styling.StyleBuilder#getStyleFactory()
The following examples show how to use
org.geotools.styling.StyleBuilder#getStyleFactory() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SLDExternalImagesTest.java From sldeditor with GNU General Public License v3.0 | 3 votes |
/** * Creates the test line. * * @param url the url * @return the styled layer descriptor */ private StyledLayerDescriptor createTestLine(URL url) { StyleBuilder sb = new StyleBuilder(); StyleFactory styleFactory = sb.getStyleFactory(); StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor(); NamedLayer namedLayer = styleFactory.createNamedLayer(); sld.addStyledLayer(namedLayer); Style style = styleFactory.createStyle(); namedLayer.addStyle(style); List<FeatureTypeStyle> ftsList = style.featureTypeStyles(); FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(); ftsList.add(fts); Rule rule = styleFactory.createRule(); fts.rules().add(rule); LineSymbolizer line = styleFactory.createLineSymbolizer(); rule.symbolizers().add(line); Graphic graphicFill = createGraphic(url, styleFactory); Graphic graphicStroke = createGraphic(url, styleFactory); Stroke stroke = styleFactory.createStroke( null, null, null, null, null, null, null, graphicFill, graphicStroke); line.setStroke(stroke); return sld; }
Example 2
Source File: SLDExternalImagesTest.java From sldeditor with GNU General Public License v3.0 | 3 votes |
/** * Creates the test point. * * @param url the url * @return the styled layer descriptor */ private StyledLayerDescriptor createTestPoint(URL url) { StyleBuilder sb = new StyleBuilder(); StyleFactory styleFactory = sb.getStyleFactory(); StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor(); NamedLayer namedLayer = styleFactory.createNamedLayer(); sld.addStyledLayer(namedLayer); Style style = styleFactory.createStyle(); namedLayer.addStyle(style); List<FeatureTypeStyle> ftsList = style.featureTypeStyles(); FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(); ftsList.add(fts); Rule rule = styleFactory.createRule(); fts.rules().add(rule); PointSymbolizer point = styleFactory.createPointSymbolizer(); rule.symbolizers().add(point); Graphic graphic = createGraphic(url, styleFactory); point.setGraphic(graphic); return sld; }
Example 3
Source File: SLDExternalImagesTest.java From sldeditor with GNU General Public License v3.0 | 2 votes |
/** * Creates the test polygon. * * @param url the url * @return the styled layer descriptor */ private StyledLayerDescriptor createTestPolygon(URL url) { StyleBuilder sb = new StyleBuilder(); StyleFactory styleFactory = sb.getStyleFactory(); StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor(); NamedLayer namedLayer = styleFactory.createNamedLayer(); sld.addStyledLayer(namedLayer); Style style = styleFactory.createStyle(); namedLayer.addStyle(style); List<FeatureTypeStyle> ftsList = style.featureTypeStyles(); FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(); ftsList.add(fts); Rule rule = styleFactory.createRule(); fts.rules().add(rule); PolygonSymbolizer polygon = styleFactory.createPolygonSymbolizer(); rule.symbolizers().add(polygon); Graphic graphicFill1 = createGraphic(url, styleFactory); Graphic graphicFill2 = createGraphic(url, styleFactory); Graphic graphicStroke = createGraphic(url, styleFactory); Fill fill = styleFactory.createFill(null, null, null, graphicFill1); polygon.setFill(fill); Stroke stroke = styleFactory.createStroke( null, null, null, null, null, null, null, graphicFill2, graphicStroke); polygon.setStroke(stroke); return sld; }