本文整理汇总了Java中org.geotools.styling.StyleFactory.createLineSymbolizer方法的典型用法代码示例。如果您正苦于以下问题:Java StyleFactory.createLineSymbolizer方法的具体用法?Java StyleFactory.createLineSymbolizer怎么用?Java StyleFactory.createLineSymbolizer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geotools.styling.StyleFactory
的用法示例。
在下文中一共展示了StyleFactory.createLineSymbolizer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultLineFeatureTypeStyle
import org.geotools.styling.StyleFactory; //导入方法依赖的package包/类
private FeatureTypeStyle createDefaultLineFeatureTypeStyle(String strokeWidth, String strokeColor, String opacity){
StyleFactory sf = CommonFactoryFinder.getStyleFactory(new Hints(Hints.KEY_RENDERING, Hints.VALUE_RENDER_SPEED));
FilterFactory filterFactory = new FilterFactoryImpl();
Stroke lineStroke = sf.getDefaultStroke();
lineStroke.setWidth(filterFactory.literal(new Integer(strokeWidth)));
lineStroke.setColor(filterFactory.literal(strokeColor));
lineStroke.setOpacity(filterFactory.literal(opacity));
LineSymbolizer lineSymbolizer = sf.createLineSymbolizer();
lineSymbolizer.setStroke(lineStroke);
Rule lineRule = sf.createRule();
lineRule.symbolizers().add(lineSymbolizer);
FeatureTypeStyle lineFeatureTypeStyle = sf.createFeatureTypeStyle(new Rule[]{lineRule});
return lineFeatureTypeStyle;
}
示例2: createTestLine
import org.geotools.styling.StyleFactory; //导入方法依赖的package包/类
/**
* 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;
}