Search in sources :

Example 1 with XMLFieldConfigEnumValueItem

use of com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem in project sldeditor by robward-scisys.

the class ReadPanelConfig method parseSymbolTypeConfig.

/**
 * Parses the symbol type configuration.
 *
 * @param localisationClass the localisation class
 * @param panelId the panel id
 * @param valueObj the value obj
 * @return the symbol type config
 */
public static SymbolTypeConfig parseSymbolTypeConfig(Class<?> localisationClass, Class<?> panelId, XMLFieldConfigEnumValue valueObj) {
    SymbolTypeConfig config = new SymbolTypeConfig(panelId);
    String groupName = valueObj.getGroupName();
    boolean isSeparateGroup = valueObj.getSeparateGroup();
    if (groupName != null) {
        config.setGroupName(groupName);
    }
    config.setSeparateGroup(isSeparateGroup);
    for (XMLFieldConfigEnumValueItem itemObj : valueObj.getItem()) {
        config.addOption(itemObj.getId(), getLocalisedText(localisationClass, itemObj.getLabel()));
    }
    FieldList fieldList = valueObj.getFieldList();
    if (fieldList != null) {
        for (XMLFieldConfigEnumValueField field : fieldList.getField()) {
            config.addField(field.getId(), field.getEnabled());
        }
        for (XMLFieldConfigEnumValueGroup group : fieldList.getGroup()) {
            config.addGroup(group.getId(), group.getEnabled());
        }
    }
    return config;
}
Also used : XMLFieldConfigEnumValueField(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueField) XMLFieldConfigString(com.sldeditor.common.xml.ui.XMLFieldConfigString) SymbolTypeConfig(com.sldeditor.ui.detail.config.symboltype.SymbolTypeConfig) XMLFieldConfigEnumValueItem(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem) XMLFieldConfigEnumValueGroup(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueGroup) FieldList(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValue.FieldList)

Example 2 with XMLFieldConfigEnumValueItem

use of com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem in project sldeditor by robward-scisys.

the class ReadMapUnits method parseSymbolTypeConfig.

/**
 * Parses the symbol type configuration.
 *
 * @param localisationClass the localisation class
 * @param panelId the panel id
 * @param valueObj the value obj
 * @return the symbol type config
 */
public static SymbolTypeConfig parseSymbolTypeConfig(Class<?> localisationClass, Class<?> panelId, XMLFieldConfigEnumValue valueObj) {
    SymbolTypeConfig config = new SymbolTypeConfig(panelId);
    String groupName = valueObj.getGroupName();
    boolean isSeparateGroup = valueObj.getSeparateGroup();
    if (groupName != null) {
        config.setGroupName(groupName);
    }
    config.setSeparateGroup(isSeparateGroup);
    for (XMLFieldConfigEnumValueItem itemObj : valueObj.getItem()) {
        config.addOption(itemObj.getId(), getLocalisedText(localisationClass, itemObj.getLabel()));
    }
    FieldList fieldList = valueObj.getFieldList();
    if (fieldList != null) {
        for (XMLFieldConfigEnumValueField field : fieldList.getField()) {
            config.addField(field.getId(), field.getEnabled());
        }
    }
    return config;
}
Also used : XMLFieldConfigEnumValueField(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueField) SymbolTypeConfig(com.sldeditor.ui.detail.config.symboltype.SymbolTypeConfig) XMLFieldConfigEnumValueItem(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem) FieldList(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValue.FieldList)

Aggregations

FieldList (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValue.FieldList)2 XMLFieldConfigEnumValueField (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueField)2 XMLFieldConfigEnumValueItem (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem)2 SymbolTypeConfig (com.sldeditor.ui.detail.config.symboltype.SymbolTypeConfig)2 XMLFieldConfigEnumValueGroup (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueGroup)1 XMLFieldConfigString (com.sldeditor.common.xml.ui.XMLFieldConfigString)1