当前位置: 首页>>代码示例>>Java>>正文


Java StyleFactory.createLineSymbolizer方法代码示例

本文整理汇总了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;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:LayerFactory.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:43,代码来源:SLDExternalImagesTest.java


注:本文中的org.geotools.styling.StyleFactory.createLineSymbolizer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。