Java Code Examples for org.geotools.styling.FeatureTypeStyle#getOptions()

The following examples show how to use org.geotools.styling.FeatureTypeStyle#getOptions() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VOGeoServerFTSCompositeBase.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example 2
Source File: VOGeoServerFTSComposite.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@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);
    }
}
 
Example 3
Source File: VOGeoServerFTSRuleEvaluation.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example 4
Source File: VOGeoServerFTSSortBy.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@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);
        }
    }
}
 
Example 5
Source File: VOGeoServerFTSCompositeBase.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@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);
    }
}
 
Example 6
Source File: VOGeoServerFTSCompositeBase.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@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.COMPOSITE_BASE)) {
            VendorOptionPresent voPresent =
                    new VendorOptionPresent(sldObj, getVendorOptionInfo());

            vendorOptionsPresentList.add(voPresent);
        }
    }
}
 
Example 7
Source File: VOGeoServerFTSComposite.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void populate(FeatureTypeStyle featureTypeStyle) {
    Map<String, String> options = featureTypeStyle.getOptions();

    String compositeString = options.get(FeatureTypeStyle.COMPOSITE);

    String name = null;
    double opacity = DEFAULT_COMPOSITE_OPACITY;

    if (compositeString != null) {
        String[] components = compositeString.split(",");

        FieldConfigEnum optionData =
                (FieldConfigEnum)
                        fieldConfigVisitor.getFieldConfig(FieldIdEnum.VO_FTS_COMPOSITE_OPTION);
        if (optionData.isValidOption(components[0])) {
            name = components[0];
        }

        if (components.length == 2) {
            try {
                opacity = Double.valueOf(components[1]);
            } catch (Exception e) {
                // Do nothing and revert to default
            }
        }
    }

    fieldConfigVisitor.populateComboBoxField(FieldIdEnum.VO_FTS_COMPOSITE_OPTION, name);
    fieldConfigVisitor.populateDoubleField(FieldIdEnum.VO_FTS_COMPOSITE_OPACITY, opacity);

    GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_COMPOSITE);
    groupPanel.enable(compositeString != null);
}
 
Example 8
Source File: VOGeoServerFTSComposite.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@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.COMPOSITE)) {
            VendorOptionPresent voPresent =
                    new VendorOptionPresent(sldObj, getVendorOptionInfo());

            vendorOptionsPresentList.add(voPresent);
        }
    }
}
 
Example 9
Source File: VOGeoServerFTSRuleEvaluation.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void updateSymbol(FeatureTypeStyle featureTypeStyle) {
    Map<String, String> options = featureTypeStyle.getOptions();

    GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_RULE_EVALUATION);
    if (groupPanel.isPanelEnabled()) {
        ValueComboBoxData value =
                fieldConfigVisitor.getComboBox(FieldIdEnum.VO_FTS_RULE_EVALUATION_OPTION);

        options.put(FeatureTypeStyle.KEY_EVALUATION_MODE, value.getKey());
    } else {
        options.remove(FeatureTypeStyle.KEY_EVALUATION_MODE);
    }
}
 
Example 10
Source File: VOGeoServerFTSRuleEvaluation.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@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.KEY_EVALUATION_MODE)) {
            VendorOptionPresent voPresent =
                    new VendorOptionPresent(sldObj, getVendorOptionInfo());

            vendorOptionsPresentList.add(voPresent);
        }
    }
}
 
Example 11
Source File: VOGeoServerFTSSortBy.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void populate(FeatureTypeStyle featureTypeStyle) {
    Map<String, String> options = featureTypeStyle.getOptions();

    String sortByString = options.get(FeatureTypeStyle.SORT_BY);
    String sortByGroupString = null;
    MultiOptionGroup group = (MultiOptionGroup) getGroup(GroupIdEnum.VO_FTS_SORTBY_MULTIOPTION);

    if (sortByString != null) {
        group.setOption(GroupIdEnum.VO_FTS_SORTBY_MULTIOPTION_SORTBY_OPTION);

        fieldConfigVisitor.populateTextField(
                FieldIdEnum.VO_FTS_SORTBY_MULTIOPTION_SORTBY_LIST, sortByString);

    } else {
        sortByGroupString = options.get(FeatureTypeStyle.SORT_BY_GROUP);
        if (sortByGroupString != null) {
            group.setOption(GroupIdEnum.VO_FTS_SORTBY_MULTIOPTION_SORTBY_GROUP_OPTION);

            fieldConfigVisitor.populateTextField(
                    FieldIdEnum.VO_FTS_SORTBY_MULTIOPTION_SORTBY_GROUP_PROPERTIES,
                    sortByGroupString);
        }
    }

    group.enable((sortByString != null) || (sortByGroupString != null));
}
 
Example 12
Source File: VOGeoServerFTSSortBy.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void updateSymbol(FeatureTypeStyle featureTypeStyle) {
    Map<String, String> options = featureTypeStyle.getOptions();

    MultiOptionGroup groupPanel =
            (MultiOptionGroup) getGroup(GroupIdEnum.VO_FTS_SORTBY_MULTIOPTION);

    if (groupPanel.isPanelEnabled()) {
        if (groupPanel.getSelectedOptionGroup().getId()
                == GroupIdEnum.VO_FTS_SORTBY_MULTIOPTION_SORTBY_OPTION) {
            String value =
                    fieldConfigVisitor.getText(
                            FieldIdEnum.VO_FTS_SORTBY_MULTIOPTION_SORTBY_LIST);
            options.put(FeatureTypeStyle.SORT_BY, value);
        } else {
            String property =
                    fieldConfigVisitor.getText(
                            FieldIdEnum.VO_FTS_SORTBY_MULTIOPTION_SORTBY_GROUP_PROPERTIES);

            if (property != null) {
                options.put(FeatureTypeStyle.SORT_BY_GROUP, property);
            } else {
                options.remove(FeatureTypeStyle.SORT_BY_GROUP);
            }
        }
    } else {
        options.remove(FeatureTypeStyle.SORT_BY);
        options.remove(FeatureTypeStyle.SORT_BY_GROUP);
    }
}