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


Java PointSymbolizer.setGeometry方法代码示例

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


在下文中一共展示了PointSymbolizer.setGeometry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: updateSymbol

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * Update symbol.
 */
private void updateSymbol() {
    if (!Controller.getInstance().isPopulating()) {
        StandardData standardData = getStandardData();

        Expression geometryField = ExtractGeometryField.getGeometryField(fieldConfigVisitor);

        PointSymbolizer pointSymbolizer = (PointSymbolizer) SelectedSymbol.getInstance()
                .getSymbolizer();

        if (pointSymbolizer != null) {
            pointSymbolizer.setName(standardData.name);
            pointSymbolizer.setDescription(standardData.description);
            pointSymbolizer.setUnitOfMeasure(standardData.unit);
            pointSymbolizer.setGeometry(geometryField);

            this.fireUpdateSymbol();
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:PointSymbolizerDetails.java

示例4: updateEndpointStyle

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
private PointSymbolizerWrapper updateEndpointStyle(String geomName, PointSymbolizerWrapper wrapper, String wkgName,
    String size, String color, boolean isStart) {
    if (wkgName == null || wkgName.length() == 0) {
        if (wrapper != null) {
            getParent().getRule().symbolizers().remove(wrapper.getSymbolizer());
            return null;
        }
    }
    if (wrapper == null) {
        PointSymbolizer p = sf.createPointSymbolizer();
        if (isStart) {
            p.setGeometry(ff.function("startPoint", ff.property(geomName))); //$NON-NLS-1$
            p.getGraphic().setRotation(ff.add(ff.function("startAngle", ff.property(geomName)), ff.literal(-180))); //rotate start 180 degrees //$NON-NLS-1$
        } else {
            p.setGeometry(ff.function("endPoint", ff.property(geomName))); //$NON-NLS-1$
            p.getGraphic().setRotation(ff.function("endAngle", ff.property(geomName))); //$NON-NLS-1$
        }
        wrapper = new PointSymbolizerWrapper(p, getParent());

        getParent().getRule().symbolizers().add(wrapper.getSymbolizer());
    }
    wrapper.setMarkName(wkgName);
    wrapper.setStrokeColor(color);
    wrapper.setFillColor(color);
    wrapper.setSize(size, false);
    return wrapper;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:28,代码来源:LineSymbolizerWrapper.java

示例5: createArrow

import org.geotools.styling.PointSymbolizer; //导入方法依赖的package包/类
/**
 * Creates the arrow.
 *
 * @param angleFunction the angle function
 * @param locationFunction the location function
 * @param markerSymbol the marker symbol
 * @param isSourceArrow the is source arrow
 * @return the point symbolizer
 */
private static PointSymbolizer createArrow(FunctionName angleFunction,
        FunctionName locationFunction, String markerSymbol, boolean isSourceArrow) {
    String name = isSourceArrow
            ? Localisation.getString(SLDTreeTools.class, "TreeItem.sourceArrow")
            : Localisation.getString(SLDTreeTools.class, "TreeItem.destArrow");

    PointSymbolizer pointSymbolizer = createDefaultPointSymbolizer();

    pointSymbolizer.setName(name);
    Graphic graphic = pointSymbolizer.getGraphic();
    graphic.setSize(ff.literal(DEFAULT_ARROW_SIZE));
    List<GraphicalSymbol> graphicalSymbolList = graphic.graphicalSymbols();
    MarkImpl mark = (MarkImpl) graphicalSymbolList.get(0);

    Expression wellKnownName = ff.literal(markerSymbol);
    mark.setWellKnownName(wellKnownName);

    mark.getFill().setColor(ff.literal(DEFAULT_COLOUR));

    // Arrow rotation
    List<Expression> rotationArgumentList = new ArrayList<Expression>();

    String geometryFieldName = "geom";
    DataSourceInterface dsInfo = DataSourceFactory.getDataSource();
    if (dsInfo != null) {
        geometryFieldName = dsInfo.getGeometryFieldName();
    }
    rotationArgumentList.add(ff.property(geometryFieldName));

    Expression rotation = FunctionManager.getInstance().createExpression(angleFunction,
            rotationArgumentList);
    if (isSourceArrow) {
        graphic.setRotation(ff.add(ff.literal(DEGREES_180), rotation));
    } else {
        graphic.setRotation(rotation);
    }

    AnchorPoint anchorPoint = styleFactory.anchorPoint(ff.literal(0.5), ff.literal(0.5));
    graphic.setAnchorPoint(anchorPoint);

    // Set location of the arrow head
    List<Expression> endPointArgumentList = new ArrayList<Expression>();
    endPointArgumentList.add(ff.property(geometryFieldName));

    Expression geometry = FunctionManager.getInstance().createExpression(locationFunction,
            endPointArgumentList);
    pointSymbolizer.setGeometry(geometry);

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


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