本文整理汇总了Java中org.geotools.styling.FeatureTypeStyle类的典型用法代码示例。如果您正苦于以下问题:Java FeatureTypeStyle类的具体用法?Java FeatureTypeStyle怎么用?Java FeatureTypeStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FeatureTypeStyle类属于org.geotools.styling包,在下文中一共展示了FeatureTypeStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldRenderSymbol
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Should render symbol.
*
* @param style the style
* @param ruleToRender the rule to render
* @return true, if successful
*/
private boolean shouldRenderSymbol(Style style, FeatureTypeStyle ftsToRender,
Rule ruleToRender) {
if (ruleToRender == null) {
return true;
}
for (FeatureTypeStyle fts : style.featureTypeStyles()) {
if (fts == ftsToRender) {
for (Rule rule : fts.rules()) {
if (rule == ruleToRender) {
return true;
}
}
}
}
return false;
}
示例2: populate
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Populate.
*
* @param selectedSymbol the selected symbol
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.iface.PopulateDetailsInterface#populate(com.sldeditor.ui.detail.
* SelectedSymbol)
*/
@Override
public void populate(SelectedSymbol selectedSymbol) {
if (selectedSymbol != null) {
FeatureTypeStyle featureTypeStyle = selectedSymbol.getFeatureTypeStyle();
populateStandardData(featureTypeStyle);
if (featureTypeStyle != null) {
fieldConfigVisitor.populateField(FieldIdEnum.TRANSFORMATION,
featureTypeStyle.getTransformation());
}
if (vendorOptionFTSFactory != null) {
vendorOptionFTSFactory.populate(featureTypeStyle);
}
}
}
示例3: setText
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Sets the text.
*
* @param value the new text
*/
public void setText(String value) {
Map<String, String> options = new HashMap<String, String>();
ListSelectionModel model = destinationTable.getSelectionModel();
model.clearSelection();
SortBy[] sortArray = null;
if (!value.isEmpty()) {
options.put(FeatureTypeStyle.SORT_BY, value);
sortArray = SLDStyleFactory.getSortBy(options);
}
destinationModel.populate(sortArray);
updateLists();
btnMoveDown.setEnabled(false);
btnMoveUp.setEnabled(false);
btnDestToSrcButton.setEnabled(false);
btnSrcToDestButton.setEnabled(false);
}
示例4: populate
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
@Override
public void populate(FeatureTypeStyle featureTypeStyle) {
Map<String, String> options = featureTypeStyle.getOptions();
String compositeBaseString = options.get(FeatureTypeStyle.COMPOSITE_BASE);
boolean value = DEFAULT_COMPOSITE_BASE;
try {
value = Boolean.valueOf(compositeBaseString);
} catch (Exception e) {
// Do nothing and revert to default
}
fieldConfigVisitor.populateBooleanField(FieldIdEnum.VO_FTS_COMPOSITE_BASE_BOOL, value);
GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_COMPOSITE_BASE);
groupPanel.enable(compositeBaseString != null);
}
示例5: updateSymbol
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
@Override
public void updateSymbol(FeatureTypeStyle featureTypeStyle) {
Map<String, String> options = featureTypeStyle.getOptions();
GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_COMPOSITE);
if (groupPanel.isPanelEnabled()) {
ValueComboBoxData name = fieldConfigVisitor
.getComboBox(FieldIdEnum.VO_FTS_COMPOSITE_OPTION);
double opacity = fieldConfigVisitor.getDouble(FieldIdEnum.VO_FTS_COMPOSITE_OPACITY);
StringBuilder composite = new StringBuilder();
composite.append(name.getKey());
if (!(Math.abs(opacity - DEFAULT_COMPOSITE_OPACITY) < 0.0001)) {
// Don't add to string if the opacity is set to the default
composite.append(",");
composite.append(opacity);
}
options.put(FeatureTypeStyle.COMPOSITE, composite.toString());
} else {
options.remove(FeatureTypeStyle.COMPOSITE);
}
}
示例6: populate
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
@Override
public void populate(FeatureTypeStyle featureTypeStyle) {
Map<String, String> options = featureTypeStyle.getOptions();
String compositeBaseString = options.get(FeatureTypeStyle.KEY_EVALUATION_MODE);
String value = DEFAULT_COMPOSITE_RULE_EVALUATION;
if ((compositeBaseString != null) && (compositeBaseString
.equals(FeatureTypeStyle.VALUE_EVALUATION_MODE_ALL)
|| compositeBaseString.equals(FeatureTypeStyle.VALUE_EVALUATION_MODE_FIRST))) {
value = compositeBaseString;
}
fieldConfigVisitor.populateComboBoxField(FieldIdEnum.VO_FTS_RULE_EVALUATION_OPTION, value);
GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_RULE_EVALUATION);
groupPanel.enable(compositeBaseString != null);
}
示例7: getMinimumVersion
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
@Override
public void getMinimumVersion(Object parentObj, Object sldObj,
List<VendorOptionPresent> vendorOptionsPresentList) {
if (sldObj instanceof FeatureTypeStyle) {
FeatureTypeStyle fts = (FeatureTypeStyle) sldObj;
Map<String, String> options = fts.getOptions();
if (options.containsKey(FeatureTypeStyle.SORT_BY)
|| options.containsKey(FeatureTypeStyle.SORT_BY_GROUP)) {
VendorOptionPresent voPresent = new VendorOptionPresent(sldObj,
getVendorOptionInfo());
vendorOptionsPresentList.add(voPresent);
}
}
}
示例8: removeFeatureTypeStyle
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Removes the feature type style.
*
* @param ftsToDelete the feature type style to delete
*/
public void removeFeatureTypeStyle(FeatureTypeStyle ftsToDelete) {
List<FeatureTypeStyle> ftsList = this.symbolData.getStyle().featureTypeStyles();
int indexFound = -1;
int index = 0;
for (FeatureTypeStyle fts : ftsList) {
if (fts == ftsToDelete) {
indexFound = index;
break;
} else {
index++;
}
}
if (indexFound > -1) {
ftsList.remove(indexFound);
}
}
示例9: isRasterSymbol
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Checks if the selected Style contains a raster symbol.
*
* @return true, if is raster symbol
*/
public boolean isRasterSymbol() {
Style style = getStyle();
if (style != null) {
for (FeatureTypeStyle fts : style.featureTypeStyles()) {
for (Rule rule : fts.rules()) {
for (Symbolizer symbolizer : rule.symbolizers()) {
if (symbolizer instanceof RasterSymbolizer) {
return true;
}
}
}
}
}
return false;
}
示例10: getRenderStyle
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Gets the render style.
*
* @param selectedSymbol the selected symbol
* @return the render style
*/
public Style getRenderStyle(SelectedSymbol selectedSymbol) {
List<StyledLayer> styledLayerList = selectedSymbol.getSld().layers();
for (StyledLayer styledLayer : styledLayerList) {
List<Style> styleList = null;
if (styledLayer instanceof NamedLayerImpl) {
NamedLayerImpl namedLayer = (NamedLayerImpl) styledLayer;
styleList = namedLayer.styles();
} else if (styledLayer instanceof UserLayerImpl) {
UserLayerImpl userLayer = (UserLayerImpl) styledLayer;
styleList = userLayer.userStyles();
}
if (styleList != null) {
for (Style style : styleList) {
FeatureTypeStyle ftsToRender = selectedSymbol.getFeatureTypeStyle();
Rule ruleToRender = selectedSymbol.getRule();
// Check to see if style contains the rule to render
if (shouldRenderSymbol(style, ftsToRender, ruleToRender)) {
return renderSymbol(style, ftsToRender, ruleToRender, renderOptions);
}
}
}
}
return null;
}
示例11: renderSymbol
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Render symbol.
*
* @param style the style
* @param ftsToRender the fts to render
* @param ruleToRender the rule to render
* @param options the options
* @return the style
*/
private Style renderSymbol(Style style, FeatureTypeStyle ftsToRender, Rule ruleToRender,
RuleRenderOptions options) {
int symbolIndex = SelectedSymbol.getInstance().getSymbolIndex();
RuleRenderVisitor visitor = new RuleRenderVisitor(ftsToRender, ruleToRender, symbolIndex,
options);
style.accept(visitor);
Style copy = (Style) visitor.getCopy();
return copy;
}
示例12: getTreeString
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
@Override
public String getTreeString(DefaultMutableTreeNode node, Object nodeObject) {
FeatureTypeStyle fts = (FeatureTypeStyle) nodeObject;
String name = "";
if (fts != null) {
if (fts.getName() != null) {
name = fts.getName();
}
}
return String.format("%s : %s", TITLE, name);
}
示例13: populateStandardData
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
/**
* Populate standard data.
*
* @param featureTypeStyle the feature type style
*/
protected void populateStandardData(FeatureTypeStyle featureTypeStyle) {
StandardData standardData = new StandardData();
if (featureTypeStyle != null) {
standardData.name = featureTypeStyle.getName();
standardData.description = featureTypeStyle.getDescription();
}
populateStandardData(standardData);
}
示例14: 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();
}
}
}
示例15: updateSymbol
import org.geotools.styling.FeatureTypeStyle; //导入依赖的package包/类
@Override
public void updateSymbol(FeatureTypeStyle featureTypeStyle) {
Map<String, String> options = featureTypeStyle.getOptions();
GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_COMPOSITE_BASE);
if (groupPanel.isPanelEnabled()) {
boolean value = fieldConfigVisitor.getBoolean(FieldIdEnum.VO_FTS_COMPOSITE_BASE_BOOL);
options.put(FeatureTypeStyle.COMPOSITE_BASE, String.valueOf(value));
} else {
options.remove(FeatureTypeStyle.COMPOSITE_BASE);
}
}