⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getlegendgraphicproducer.java

📁 电子地图服务器,搭建自己的地图服务
💻 JAVA
字号:
/* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
 * This code is licensed under the GPL 2.0 license, availible at the root
 * application directory.
 */
package org.vfny.geoserver.wms;

import org.vfny.geoserver.ServiceException;
import org.vfny.geoserver.wms.requests.GetLegendGraphicRequest;
import java.io.IOException;
import java.io.OutputStream;


/**
 * Provides the skeleton for producers of a legend image, as required by the
 * GetLegendGraphic WMS request.
 *
 * <p>
 * To incorporate a new producer specialized in one or many output formats,
 * there must be a {@linkPlain
 * org.vfny.geoserver.responses.wms.GetLegendGraphicProducerSpi} registered
 * that can provide instances of that concrete implementation.
 * </p>
 *
 * <p>
 * The methods defined in this interface respects the general parse
 * request/produce response/get mime type/write content workflow, so they
 * should raise an exception if are called in the wrong order (which is
 * produceLegendGraphic -> getContentType -> writeTo)
 * </p>
 *
 * @author Gabriel Roldan, Axios Engineering
 * @version $Id: GetLegendGraphicProducer.java 6326 2007-03-15 18:36:40Z jdeolive $
 */
public interface GetLegendGraphicProducer {
    /**
     * Asks this legend graphic producer to create a graphic for the
     * GetLegenGraphic request parameters held in <code>request</code>
     *
     * @param request the "parsed" request, where "parsed" means that it's
     *        properties are already validated so this method must not take
     *        care of verifying the requested layer exists and the like.
     *
     * @throws WmsException something goes wrong
     */
    void produceLegendGraphic(GetLegendGraphicRequest request)
        throws WmsException;

    /**
     * Writes the legend graphic created in produceLegendGraphic to the
     * destination stream, though it could be used to encode the legend to the
     * proper output format, provided that there are almost no risk that the
     * encoding fails.
     *
     * @param out an open stream where to send the produced legend graphic to.
     *
     * @throws IOException if something goes wrong in the actual process of
     *         writing content to <code>out</code>.
     * @throws ServiceException if something else goes wrong.
     */
    void writeTo(OutputStream out) throws IOException, ServiceException;

    /**
     * Returns the MIME type of the content to be writen at
     * <code>writeTo(OutputStream)</code>
     *
     * @return the output format
     *
     * @throws java.lang.IllegalStateException if this method is called before
     *         {@linkplain #produceLegendGraphic(GetLegendGraphicRequest)}.
     */
    String getContentType() throws java.lang.IllegalStateException;

    /**
     * asks the legend graphic producer to stop processing since it will be no
     * longer needed (for example, because the request was interrupted by the
     * user)
     */
    void abort();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -