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


Java FeatureTypeStyle类代码示例

本文整理汇总了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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:27,代码来源:RenderSymbol.java

示例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);
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:29,代码来源:FeatureTypeStyleDetails.java

示例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);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:27,代码来源:SortByPanel.java

示例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);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:19,代码来源:VOGeoServerFTSCompositeBase.java

示例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);
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:VOGeoServerFTSComposite.java

示例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);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:VOGeoServerFTSRuleEvaluation.java

示例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);
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:VOGeoServerFTSSortBy.java

示例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);
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:24,代码来源:SelectedSymbol.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:SelectedSymbol.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:37,代码来源:RenderSymbol.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:RenderSymbol.java

示例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);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:13,代码来源:FeatureTypeStyleTreeItem.java

示例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);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:16,代码来源:StandardPanel.java

示例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();
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:37,代码来源:FeatureTypeStyleDetails.java

示例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);
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:14,代码来源:VOGeoServerFTSCompositeBase.java


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