String rpClass = props.getProperty(policyPrefix + ".class"); if (rpClass == null) { Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for RenderPolicy, but " + policyPrefix + ".class property is undefined."); } else {
if (renderPolicy == null) { String rpClass = props.getProperty(policyPrefix + ".class"); if (rpClass == null) { Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for RenderPolicy, but " + policyPrefix + ".class property is undefined."); } else {
    public void setProperties(String prefix, Properties props) {        super.setProperties(prefix, props);        String realPrefix = PropUtils.getScopedPropertyPrefix(prefix);        // Check to see if the layer wants to set its own projection        // change policy.        String pcpString = props.getProperty(realPrefix + ProjectionChangePolicyProperty);        String policyPrefix;        if (pcpString != null) {            policyPrefix = realPrefix + pcpString;            String pcpClass = props.getProperty(policyPrefix + ".class");            if (pcpClass == null) {                Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for PropertyChangePolicy, but " + policyPrefix + ".class property is undefined.");            } else {                Object obj = ComponentFactory.create(pcpClass, policyPrefix, props);                if (obj != null) {                    if (Debug.debugging("layer")) {                        Debug.output("Layer " + getName() + " setting ProjectionChangePolicy [" +                                      obj.getClass().getName() + "]");                    }                    try {                        setProjectionChangePolicy((ProjectionChangePolicy)obj);                    } catch (ClassCastException cce) {                        Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for ProjectionChangePolicy, but " + policyPrefix + ".class property (" + pcpClass + ") does not define a valid ProjectionChangePolicy. A " + obj.getClass().getName() + " was created instead.");                    }                } else {                    Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for PropertyChangePolicy, but " + policyPrefix + ".class property does not define a valid PropertyChangePolicy.");                }            }        } else if (Debug.debugging("layer")) {            Debug.output("Layer " + getName() +                          " using default ProjectionChangePolicy [" +                          getProjectionChangePolicy().getClass().getName() + "]");        }        // Check to see if the layer want to set its own rendering policy.        String rpString = props.getProperty(realPrefix + RenderPolicyProperty);        if (rpString != null) {            policyPrefix = realPrefix + rpString;            String rpClass = props.getProperty(policyPrefix + ".class");            if (rpClass == null) {                Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for RenderPolicy, but " + policyPrefix + ".class property is undefined.");            } else {                Object rpObj = ComponentFactory.create(rpClass, policyPrefix, props);                if (rpObj != null) {                    if (Debug.debugging("layer")) {                        Debug.output("Layer " + getName() + " setting RenderPolicy [" +                                      rpObj.getClass().getName() + "]");                    }                    try {                        setRenderPolicy((RenderPolicy)rpObj);                    } catch (ClassCastException cce) {                        Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for RenderPolicy, but " + policyPrefix + ".class property (" + rpClass + ") does not define a valid RenderPolicy. A " + rpObj.getClass().getName() + " was created instead.");                    }                } else {                    Debug.error("Layer " + getName() + " has " + policyPrefix + " property defined in properties for RenderPolicy, but " + policyPrefix + ".class property (" + rpClass + ") isn't being created.");                }            }        } else if (Debug.debugging("layer")) {            Debug.output("Layer " + getName() + " using default RenderPolicy [" +                          getRenderPolicy().getClass().getName() + "]");        }        String mmString = props.getProperty(realPrefix + MouseModesProperty);        if (mmString != null) {            Vector mmv = PropUtils.parseSpacedMarkers(mmString);            if (mmv.size() > 0) {                String[] mm = new String[mmv.size()];                Iterator it = mmv.iterator();                int i = 0;                while (it.hasNext()) {                    mm[i] = (String)it.next();                }                setMouseModeIDsForEvents(mm);            }        }        consumeEvents = PropUtils.booleanFromProperties(props, realPrefix + ConsumeEventsProperty, consumeEvents);    }