Search in sources :

Example 1 with ContrastMethod

use of org.opengis.style.ContrastMethod in project sldeditor by robward-scisys.

the class RasterSymbolizerDetails method populateContrastMethod.

/**
 * Populate contrast method.
 *
 * @param contrastEnhancement the contrast enhancement
 * @param contrastMethodGroup the contrast method group
 */
private void populateContrastMethod(ContrastEnhancement contrastEnhancement, GroupIdEnum contrastMethodGroup) {
    GroupConfigInterface group = getGroup(contrastMethodGroup);
    if (group != null) {
        GroupIdEnum selectedNormalizeMethod = GroupIdEnum.UNKNOWN;
        MultiOptionGroup contrastNormalizeMethodGroup = (MultiOptionGroup) group;
        if (contrastEnhancement != null) {
            ContrastMethod contrastMethod = contrastEnhancement.getMethod();
            if (contrastMethod != null) {
                String contrastMethodString = contrastMethod.name();
                for (OptionGroup option : contrastNormalizeMethodGroup.getGroupList()) {
                    if (option.getLabel().compareToIgnoreCase(contrastMethodString) == 0) {
                        selectedNormalizeMethod = option.getId();
                    }
                }
            }
        }
        contrastNormalizeMethodGroup.setOption(selectedNormalizeMethod);
    }
}
Also used : OptionGroup(com.sldeditor.ui.detail.config.base.OptionGroup) MultiOptionGroup(com.sldeditor.ui.detail.config.base.MultiOptionGroup) GroupConfigInterface(com.sldeditor.ui.detail.config.base.GroupConfigInterface) ContrastMethod(org.opengis.style.ContrastMethod) MultiOptionGroup(com.sldeditor.ui.detail.config.base.MultiOptionGroup) GroupIdEnum(com.sldeditor.common.xml.ui.GroupIdEnum)

Aggregations

GroupIdEnum (com.sldeditor.common.xml.ui.GroupIdEnum)1 GroupConfigInterface (com.sldeditor.ui.detail.config.base.GroupConfigInterface)1 MultiOptionGroup (com.sldeditor.ui.detail.config.base.MultiOptionGroup)1 OptionGroup (com.sldeditor.ui.detail.config.base.OptionGroup)1 ContrastMethod (org.opengis.style.ContrastMethod)1