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


Java PointSymbolizer.setGraphic方法代码示例

本文整理汇总了Java中org.geotools.styling.PointSymbolizer.setGraphic方法的典型用法代码示例。如果您正苦于以下问题:Java PointSymbolizer.setGraphic方法的具体用法?Java PointSymbolizer.setGraphic怎么用?Java PointSymbolizer.setGraphic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.geotools.styling.PointSymbolizer的用法示例。


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

示例1: visit

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * (non-Javadoc)
 * 
 * @see org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PointSymbolizer)
 */
public void visit(PointSymbolizer ps) {
    PointSymbolizer copy = sf.getDefaultPointSymbolizer();

    copy.setGeometry(copy(Point.class, ps.getGeometry()));

    copy.setUnitOfMeasure(ps.getUnitOfMeasure());
    copy.setGraphic(copy(ps.getGraphic()));
    copy.getOptions().putAll(ps.getOptions());

    if (STRICT) {
        if (!copy.equals(ps)) {
            throw new IllegalStateException("Was unable to duplicate provided Graphic:" + ps);
        }
    }
    pages.push(copy);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:ExtractAttributes.java

示例2: visit

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * (non-Javadoc)
 * 
 * @see org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PointSymbolizer)
 */
public void visit(PointSymbolizer ps) {
    PointSymbolizer copy = sf.getDefaultPointSymbolizer();

    copy.setGeometry(copy(ps.getGeometry()));

    copy.setUnitOfMeasure(ps.getUnitOfMeasure());
    copy.setGraphic(copy(ps.getGraphic()));
    copy.getOptions().putAll(ps.getOptions());

    if (STRICT) {
        if (!copy.equals(ps)) {
            throw new IllegalStateException("Was unable to duplicate provided Graphic:" + ps);
        }
    }
    pages.push(copy);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:RuleRenderVisitor.java

示例3: createFill

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
@Override
public void createFill(Symbolizer symbolizer) {
    if (symbolizer instanceof PointSymbolizer) {
        PointSymbolizer point = (PointSymbolizer) symbolizer;

        if (point != null) {
            Graphic graphic = point.getGraphic();
            if (graphic == null) {
                graphic = styleFactory.createDefaultGraphic();
                point.setGraphic(graphic);
            }

            if (graphic != null) {
                if (graphic.graphicalSymbols().isEmpty()) {
                    Mark mark = styleFactory.getDefaultMark();

                    graphic.graphicalSymbols().add(mark);
                }
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:SLDTreeLeafPoint.java

示例4: createDefaultPointRule

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * Creates a default {@link Rule} for a point.
 * 
 * @return the default rule.
 */
public static Rule createDefaultPointRule() {
    Graphic graphic = sf.createDefaultGraphic();
    Mark circleMark = sf.getCircleMark();
    circleMark.setFill(sf.createFill(ff.literal("#" + Integer.toHexString(Color.RED.getRGB() & 0xffffff))));
    circleMark.setStroke(sf.createStroke(ff.literal("#" + Integer.toHexString(Color.BLACK.getRGB() & 0xffffff)),
            ff.literal(DEFAULT_WIDTH)));
    graphic.graphicalSymbols().clear();
    graphic.graphicalSymbols().add(circleMark);
    graphic.setSize(ff.literal(DEFAULT_SIZE));

    PointSymbolizer pointSymbolizer = sf.createPointSymbolizer();
    Rule rule = sf.createRule();
    rule.setName("New rule");
    rule.symbolizers().add(pointSymbolizer);

    pointSymbolizer.setGraphic(graphic);
    return rule;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:24,代码来源:Utilities.java

示例5: featureTypeStyleExample

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
private void featureTypeStyleExample() {
    // featureTypeStyleExample start
    StyleBuilder styleBuilder = new StyleBuilder();
    Style style = styleBuilder.createStyle();
    
    PointSymbolizer pointSymbolizer = styleBuilder.createPointSymbolizer();
    
    Graphic graphic = styleBuilder.createGraphic();
    ExternalGraphic external = styleBuilder.createExternalGraphic("file:///C:/images/house.gif",
            "image/gif");
    graphic.graphicalSymbols().add(external);
    graphic.graphicalSymbols().add(styleBuilder.createMark("circle"));
    
    pointSymbolizer.setGraphic(graphic);
    
    Rule rule = styleBuilder.createRule(pointSymbolizer);
    FeatureTypeStyle featureTypeStyle = styleBuilder.createFeatureTypeStyle("Feature", rule);
    style.featureTypeStyles().add(featureTypeStyle);
    
    // featureTypeStyleExample end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:22,代码来源:StyleExamples.java

示例6: removeFill

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
@Override
public void removeFill(Symbolizer symbolizer) {
    if (symbolizer instanceof PointSymbolizer) {
        PointSymbolizer point = (PointSymbolizer) symbolizer;

        if (point != null) {
            point.setGraphic(null);
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:11,代码来源:SLDTreeLeafPoint.java

示例7: testHasFill

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafPoint#hasFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testHasFill() {
    SLDTreeLeafPoint leaf = new SLDTreeLeafPoint();

    assertFalse(leaf.hasFill(null));
    assertFalse(leaf.hasFill(DefaultSymbols.createDefaultPolygonSymbolizer()));

    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    assertTrue(leaf.hasFill(pointSymbolizer));

    pointSymbolizer.setGraphic(null);
    assertFalse(leaf.hasFill(pointSymbolizer));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:18,代码来源:SLDTreeLeafPointTest.java

示例8: testCreateFill

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafPoint#createFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testCreateFill() {
    SLDTreeLeafPoint leaf = new SLDTreeLeafPoint();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    pointSymbolizer.setGraphic(null);

    leaf.createFill(pointSymbolizer);

    assertTrue(pointSymbolizer.getGraphic() != null);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:15,代码来源:SLDTreeLeafPointTest.java

示例9: createTestPoint

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:40,代码来源:SLDExternalImagesTest.java


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