Package org.vfny.geoserver.wms

Examples of org.vfny.geoserver.wms.GetLegendGraphicProducerSpi


     *             instantiated
     */
    private GetLegendGraphicProducer getDelegate(String outputFormat)
        throws WmsException {
        Collection producers = GeoServerExtensions.extensions(GetLegendGraphicProducerSpi.class);
        GetLegendGraphicProducerSpi factory;

        for (Iterator iter = producers.iterator(); iter.hasNext();) {
            factory = (GetLegendGraphicProducerSpi) iter.next();

            if (factory.canProduce(outputFormat)) {
                return factory.createLegendProducer(outputFormat);
            }
        }

        throw new WmsException("There is no support for creating legends in " + outputFormat
            + " format", "InvalidFormat");
View Full Code Here


     * point and returning the set of available image formats.
     */
    private static Set loadLegendFormats() {
        Collection producers = GeoServerExtensions.extensions(GetLegendGraphicProducerSpi.class);
        Set formats = new HashSet();
        GetLegendGraphicProducerSpi producer;

        for (Iterator iter = producers.iterator(); iter.hasNext();) {
            producer = (GetLegendGraphicProducerSpi) iter.next();
            formats.addAll(producer.getSupportedFormats());
        }

        return formats;
    }
View Full Code Here

     *
     * @throws ServiceException DOCUMENT ME!
     */
    public void execute(Request req) throws ServiceException {
        GetLegendGraphicRequest request = (GetLegendGraphicRequest) req;
        GetLegendGraphicProducerSpi glf = getProducerFactory(request.getFormat());
        this.producer = glf.createLegendProducer(request.getFormat());
        this.producer.produceLegendGraphic(request);
    }
View Full Code Here

     * @return DOCUMENT ME!
     */
    private static GetLegendGraphicProducerSpi getProducerFactory(
        String mimeType) {
        Iterator it = FactoryFinder.factories(GetLegendGraphicProducerSpi.class);
        GetLegendGraphicProducerSpi glf = null;

        while (it.hasNext()) {
            GetLegendGraphicProducerSpi tmpGlf = (GetLegendGraphicProducerSpi) it
                .next();

            if (tmpGlf.canProduce(mimeType)) {
                glf = tmpGlf;

                break;
            }
        }
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wms.GetLegendGraphicProducerSpi

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.