本文整理汇总了Java中org.geotools.styling.FeatureTypeStyle.setTransformation方法的典型用法代码示例。如果您正苦于以下问题:Java FeatureTypeStyle.setTransformation方法的具体用法?Java FeatureTypeStyle.setTransformation怎么用?Java FeatureTypeStyle.setTransformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geotools.styling.FeatureTypeStyle
的用法示例。
在下文中一共展示了FeatureTypeStyle.setTransformation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSymbol
import org.geotools.styling.FeatureTypeStyle; //导入方法依赖的package包/类
/**
* Update symbol.
*/
private void updateSymbol() {
if (!Controller.getInstance().isPopulating()) {
StandardData standardData = getStandardData();
Expression transformation = fieldConfigVisitor
.getExpression(FieldIdEnum.TRANSFORMATION);
FeatureTypeStyle existingFTS = SelectedSymbol.getInstance().getFeatureTypeStyle();
if (existingFTS != null) {
List<org.opengis.style.Rule> newRuleList = new ArrayList<org.opengis.style.Rule>();
for (org.opengis.style.Rule rule : existingFTS.rules()) {
newRuleList.add(rule);
}
FeatureTypeStyle fts = (FeatureTypeStyle) getStyleFactory().featureTypeStyle(
standardData.name, (org.opengis.style.Description) standardData.description,
existingFTS.getFeatureInstanceIDs(), existingFTS.featureTypeNames(),
existingFTS.semanticTypeIdentifiers(), newRuleList);
if (transformation != null) {
fts.setTransformation(transformation);
}
if (vendorOptionFTSFactory != null) {
vendorOptionFTSFactory.updateSymbol(fts);
}
SelectedSymbol.getInstance().replaceFeatureTypeStyle(fts);
this.fireUpdateSymbol();
}
}
}
示例2: visit
import org.geotools.styling.FeatureTypeStyle; //导入方法依赖的package包/类
/**
* Visit.
*
* @param fts the fts
*/
/*
* (non-Javadoc)
*
* @see org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.
* FeatureTypeStyle)
*/
@SuppressWarnings("deprecation")
@Override
public void visit(FeatureTypeStyle fts) {
FeatureTypeStyle copy = new FeatureTypeStyleImpl((FeatureTypeStyleImpl) fts);
if (!options.isTransformationApplied()) {
copy.setTransformation(null);
}
Rule[] rules = fts.getRules();
int length = rules.length;
Rule[] rulesCopy = null;
if (this.ruleToRender == null) {
rulesCopy = new Rule[length];
for (int i = 0; i < length; i++) {
if (rules[i] != null) {
rules[i].accept(this);
rulesCopy[i] = (Rule) pages.pop();
}
}
} else {
rulesCopy = new Rule[1];
for (int i = 0; i < length; i++) {
if (rules[i] != null) {
if (renderRule(rules[i])) {
rules[i].accept(this);
rulesCopy[0] = (Rule) pages.pop();
}
}
}
}
copy.setRules(rulesCopy);
if (STRICT && !copy.equals(fts)) {
throw new IllegalStateException(
"Was unable to duplicate provided FeatureTypeStyle:" + fts);
}
pages.push(copy);
}