本文整理汇总了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);
}
示例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);
}
示例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();
}
}
}
示例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;
}
示例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;
}