Search in sources :

Example 1 with XMLPanelDetails

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

the class SymbolTypeConfigReader method readConfig.

/**
 * Read configuration.
 *
 * @param panelId the panel id
 * @param fullResourceName the full resource name
 * @param fieldEnableMap the field enable map
 * @return true, if successful
 */
public static boolean readConfig(Class<?> panelId, String fullResourceName, Map<Class<?>, List<SymbolTypeConfig>> fieldEnableMap) {
    XMLSymbolTypeConfig symbolTypeConfig = (XMLSymbolTypeConfig) ParseXML.parseUIFile(fullResourceName, SCHEMA_RESOURCE, XMLSymbolTypeConfig.class);
    if (symbolTypeConfig == null) {
        return false;
    }
    for (XMLPanelDetails xmlPanelDetails : symbolTypeConfig.getPanel()) {
        String symbolizerClassName = xmlPanelDetails.getType();
        logger.debug("Symbolizer : " + symbolizerClassName);
        Class<?> symbolizerClass;
        try {
            symbolizerClass = Class.forName(symbolizerClassName);
            List<SymbolTypeConfig> configList = readSymbolizerConfig(panelId, xmlPanelDetails);
            fieldEnableMap.put(symbolizerClass, configList);
        } catch (ClassNotFoundException e) {
            ConsoleManager.getInstance().exception(SymbolTypeConfigReader.class, e);
            return false;
        }
    }
    return true;
}
Also used : XMLSymbolTypeConfig(com.sldeditor.common.xml.ui.XMLSymbolTypeConfig) XMLPanelDetails(com.sldeditor.common.xml.ui.XMLPanelDetails) XMLSymbolTypeConfig(com.sldeditor.common.xml.ui.XMLSymbolTypeConfig)

Aggregations

XMLPanelDetails (com.sldeditor.common.xml.ui.XMLPanelDetails)1 XMLSymbolTypeConfig (com.sldeditor.common.xml.ui.XMLSymbolTypeConfig)1