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


Java PointPlacement类代码示例

本文整理汇总了Java中org.geotools.styling.PointPlacement的典型用法代码示例。如果您正苦于以下问题:Java PointPlacement类的具体用法?Java PointPlacement怎么用?Java PointPlacement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PointPlacement类属于org.geotools.styling包,在下文中一共展示了PointPlacement类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TextSymbolizerDetails

import org.geotools.styling.PointPlacement; //导入依赖的package包/类
/**
 * Constructor.
 */
public TextSymbolizerDetails() {
    super(TextSymbolizerDetails.class);

    // Cache the default point placement anchor point values
    StyleBuilder styleBuilder = new StyleBuilder();
    PointPlacement defaultPointPlacement = styleBuilder.createPointPlacement();
    defaultPointPlacementAnchorPointX = defaultPointPlacement.getAnchorPoint()
            .getAnchorPointX();
    defaultPointPlacementAnchorPointY = defaultPointPlacement.getAnchorPoint()
            .getAnchorPointY();

    createUI();
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:TextSymbolizerDetails.java

示例2: createDefaultTextSymbolizer

import org.geotools.styling.PointPlacement; //导入依赖的package包/类
/**
 * Creates the default text symbolizer.
 *
 * @return the text symbolizer
 */
public static TextSymbolizer createDefaultTextSymbolizer() {
    Expression fontFamily = ff.literal("Serif");
    Expression fontSize = ff.literal(10.0);
    Expression fontStyle = ff.literal("normal");
    Expression fontWeight = ff.literal("normal");
    Expression rotation = ff.literal(0.0);
    Expression label = ff.literal("Test");

    String geometryFieldName = null;
    Expression geometryField = ff.property(geometryFieldName);

    String name = Localisation.getString(SLDTreeTools.class, "TreeItem.newText");
    AnchorPoint anchor = null;
    Displacement displacement = null;

    PointPlacement pointPlacement = (PointPlacement) styleFactory.pointPlacement(anchor,
            displacement, rotation);

    Expression fillColour = ff.literal(DEFAULT_COLOUR);
    Expression fillColourOpacity = ff.literal(1.0);

    Fill fill = styleFactory.fill(null, fillColour, fillColourOpacity);

    Halo halo = null;

    List<Expression> fontFamilyList = new ArrayList<Expression>();
    fontFamilyList.add(fontFamily);
    Font font = (Font) styleFactory.font(fontFamilyList, fontStyle, fontWeight, fontSize);

    Description description = null;
    Unit<Length> unit = null;

    TextSymbolizer newTextSymbolizer = (TextSymbolizer) styleFactory.textSymbolizer(name,
            geometryField, description, unit, label, font, pointPlacement, halo, fill);

    return newTextSymbolizer;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:43,代码来源:DefaultSymbols.java

示例3: quickTextSymbolizer

import org.geotools.styling.PointPlacement; //导入依赖的package包/类
private void quickTextSymbolizer() {
    // quickTextSymbolizer start
    // "labelPoint" feature type style
    StyleBuilder sb = new StyleBuilder();
    FilterFactory2 ff = sb.getFilterFactory();
    
    // creation of the TextSymbolizer
    AnchorPoint anchorPoint = sb.createAnchorPoint(sb.attributeExpression("X"),
            sb.attributeExpression("Y"));
    PointPlacement pointPlacement = sb.createPointPlacement(anchorPoint, null,
            sb.literalExpression(0));
    TextSymbolizer textSymbolizer = sb.createTextSymbolizer(sb.createFill(Color.BLACK), new Font[] {
            sb.createFont("Lucida Sans", 10), sb.createFont("Arial", 10) }, sb.createHalo(),
            sb.attributeExpression("name"), pointPlacement, null);
    
    // creation of the Point symbolizer
    Mark circle = sb.createMark(StyleBuilder.MARK_CIRCLE, Color.RED);
    Graphic graph2 = sb.createGraphic(null, circle, null, 1, 4, 0);
    PointSymbolizer pointSymbolizer = sb.createPointSymbolizer(graph2);
    
    // creation of the style
    Style style = sb.createStyle();
    FeatureTypeStyle featureTypeStyle = sb.createFeatureTypeStyle("labelPoint", new Symbolizer[] {
            textSymbolizer, pointSymbolizer });
    style.featureTypeStyles().add(featureTypeStyle);
    
    // creation of the style
    // quickTextSymbolizer end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:30,代码来源:StyleExamples.java

示例4: markTestSLD

import org.geotools.styling.PointPlacement; //导入依赖的package包/类
private void markTestSLD() {
    // markTestSLD start
    StyleBuilder sb = new StyleBuilder();
    FilterFactory ff = sb.getFilterFactory();
    Style style = sb.createStyle();
    style.setName("MyStyle");
    
    // "testPoint" feature type style
    Mark testMark = sb.createMark(sb.attributeExpression("name"), sb.createFill(Color.RED, 0.5),
            null);
    Graphic graph = sb.createGraphic(null, new Mark[] { testMark }, null, sb.literalExpression(1),
            sb.attributeExpression("size"), sb.attributeExpression("rotation"));
    style.featureTypeStyles().add(
            sb.createFeatureTypeStyle("testPoint", sb.createPointSymbolizer(graph)));
    
    // "labelPoint" feature type style
    AnchorPoint anchorPoint = sb.createAnchorPoint(sb.attributeExpression("X"),
            sb.attributeExpression("Y"));
    PointPlacement pointPlacement = sb.createPointPlacement(anchorPoint, null,
            sb.literalExpression(0));
    TextSymbolizer textSymbolizer = sb.createTextSymbolizer(sb.createFill(Color.BLACK), new Font[] {
            sb.createFont("Lucida Sans", 10), sb.createFont("Arial", 10) }, sb.createHalo(),
            sb.attributeExpression("name"), pointPlacement, null);
    Mark circle = sb.createMark(StyleBuilder.MARK_CIRCLE, Color.RED);
    Graphic graph2 = sb.createGraphic(null, circle, null, 1, 4, 0);
    PointSymbolizer pointSymbolizer = sb.createPointSymbolizer(graph2);
    style.featureTypeStyles().add(
            sb.createFeatureTypeStyle("labelPoint", new Symbolizer[] { textSymbolizer,
                    pointSymbolizer }));
    // markTestSLD end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:32,代码来源:StyleExamples.java


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