// Path: jasperreports-wms-component/src/main/java/com/sourcepole/jasperreports/wmsmap/fill/WmsMapFillFactory.java
// public class WmsMapFillFactory implements ComponentFillFactory {
// 
//   @Override
//   public FillComponent toFillComponent(Component component,
//       JRFillObjectFactory factory) {
//     WmsMapComponent map = (WmsMapComponent) component;
//     return new WmsMapFillComponent(map, factory);
//   }
// 
//   @Override
//   public FillComponent cloneFillComponent(FillComponent component,
//       JRFillCloneFactory factory) {
//     WmsMapFillComponent fillMap = (WmsMapFillComponent) component;
//     return new WmsMapFillComponent(fillMap.getMap());
//   }
// 
// }


import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import net.sf.jasperreports.engine.JRPropertiesMap;
import net.sf.jasperreports.engine.component.ComponentManager;
import net.sf.jasperreports.engine.component.ComponentsBundle;
import net.sf.jasperreports.engine.component.DefaultComponentXmlParser;
import net.sf.jasperreports.engine.component.DefaultComponentsBundle;
import net.sf.jasperreports.engine.export.GenericElementHandler;
import net.sf.jasperreports.engine.export.GenericElementHandlerBundle;
import net.sf.jasperreports.engine.export.JExcelApiExporter;
import net.sf.jasperreports.engine.export.JRGraphics2DExporter;
import net.sf.jasperreports.engine.export.JRHtmlExporter;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.JRRtfExporter;
import net.sf.jasperreports.engine.export.JRXhtmlExporter;
import net.sf.jasperreports.engine.export.JRXlsExporter;
import net.sf.jasperreports.engine.export.oasis.JROdsExporter;
import net.sf.jasperreports.engine.export.oasis.JROdtExporter;
import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter;
import net.sf.jasperreports.engine.export.ooxml.JRPptxExporter;
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
import net.sf.jasperreports.extensions.ExtensionsRegistry;
import net.sf.jasperreports.extensions.ExtensionsRegistryFactory;
import com.sourcepole.jasperreports.wmsmap.fill.WmsMapFillFactory;
            else if (JRPptxExporter.PPTX_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementPptxHandler.getInstance();
            }
            else if (JRRtfExporter.RTF_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementRtfHandler.getInstance();
            }
            else if (JROdtExporter.ODT_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementOdtHandler.getInstance();
            }
            else if (JROdsExporter.ODS_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementOdsHandler.getInstance();
            }
          }
          return null;
        }
      };

  private static final DefaultComponentsBundle COMPONENTS_BUNDLE = new DefaultComponentsBundle();

  static {
    DefaultComponentXmlParser parser = new DefaultComponentXmlParser();
    parser.setNamespace(NAMESPACE);
    parser.setPublicSchemaLocation(XSD_LOCATION);
    parser.setInternalSchemaResource(XSD_RESOURCE);
    parser.setDigesterConfigurer(new WmsMapComponentsXmlDigesterConfigurer());
    COMPONENTS_BUNDLE.setXmlParser(parser);

    WmsMapComponentManager wmsMapManager = new WmsMapComponentManager();
    wmsMapManager.setDesignConverter(WmsMapDesignConverter.getInstance());
    wmsMapManager.setComponentCompiler(new WmsMapCompiler());
// Path: jasperreports-wms-component/src/main/java/com/sourcepole/jasperreports/wmsmap/fill/WmsMapFillFactory.java
// public class WmsMapFillFactory implements ComponentFillFactory {
// 
//   @Override
//   public FillComponent toFillComponent(Component component,
//       JRFillObjectFactory factory) {
//     WmsMapComponent map = (WmsMapComponent) component;
//     return new WmsMapFillComponent(map, factory);
//   }
// 
//   @Override
//   public FillComponent cloneFillComponent(FillComponent component,
//       JRFillCloneFactory factory) {
//     WmsMapFillComponent fillMap = (WmsMapFillComponent) component;
//     return new WmsMapFillComponent(fillMap.getMap());
//   }
// 
// }


// Path: jasperreports-wms-component/src/main/java/com/sourcepole/jasperreports/wmsmap/ComponentsExtensionsRegistryFactory.java
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import net.sf.jasperreports.engine.JRPropertiesMap;
import net.sf.jasperreports.engine.component.ComponentManager;
import net.sf.jasperreports.engine.component.ComponentsBundle;
import net.sf.jasperreports.engine.component.DefaultComponentXmlParser;
import net.sf.jasperreports.engine.component.DefaultComponentsBundle;
import net.sf.jasperreports.engine.export.GenericElementHandler;
import net.sf.jasperreports.engine.export.GenericElementHandlerBundle;
import net.sf.jasperreports.engine.export.JExcelApiExporter;
import net.sf.jasperreports.engine.export.JRGraphics2DExporter;
import net.sf.jasperreports.engine.export.JRHtmlExporter;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.JRRtfExporter;
import net.sf.jasperreports.engine.export.JRXhtmlExporter;
import net.sf.jasperreports.engine.export.JRXlsExporter;
import net.sf.jasperreports.engine.export.oasis.JROdsExporter;
import net.sf.jasperreports.engine.export.oasis.JROdtExporter;
import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter;
import net.sf.jasperreports.engine.export.ooxml.JRPptxExporter;
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
import net.sf.jasperreports.extensions.ExtensionsRegistry;
import net.sf.jasperreports.extensions.ExtensionsRegistryFactory;
import com.sourcepole.jasperreports.wmsmap.fill.WmsMapFillFactory;

            else if (JRPptxExporter.PPTX_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementPptxHandler.getInstance();
            }
            else if (JRRtfExporter.RTF_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementRtfHandler.getInstance();
            }
            else if (JROdtExporter.ODT_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementOdtHandler.getInstance();
            }
            else if (JROdsExporter.ODS_EXPORTER_KEY.equals(exporterKey)) {
              return WmsMapElementOdsHandler.getInstance();
            }
          }
          return null;
        }
      };

  private static final DefaultComponentsBundle COMPONENTS_BUNDLE = new DefaultComponentsBundle();

  static {
    DefaultComponentXmlParser parser = new DefaultComponentXmlParser();
    parser.setNamespace(NAMESPACE);
    parser.setPublicSchemaLocation(XSD_LOCATION);
    parser.setInternalSchemaResource(XSD_RESOURCE);
    parser.setDigesterConfigurer(new WmsMapComponentsXmlDigesterConfigurer());
    COMPONENTS_BUNDLE.setXmlParser(parser);

    WmsMapComponentManager wmsMapManager = new WmsMapComponentManager();
    wmsMapManager.setDesignConverter(WmsMapDesignConverter.getInstance());
    wmsMapManager.setComponentCompiler(new WmsMapCompiler());
    wmsMapManager.setComponentFillFactory(new WmsMapFillFactory());