/** * Builds and returns a {@link BufferedImageLegendGraphic} appropriate to be encoded as PNG * * @see GetLegendGraphicOutputFormat#produceLegendGraphic(GetLegendGraphicRequest) */ public BufferedImageLegendGraphic produceLegendGraphic(GetLegendGraphicRequest request) throws ServiceException { BufferedImageLegendGraphicBuilder builder = new BufferedImageLegendGraphicBuilder(); BufferedImage legendGraphic = builder.buildLegendGraphic(request); BufferedImageLegendGraphic legend = new BufferedImageLegendGraphic(legendGraphic); return legend; }
/** * @return a {@link BufferedImageLegendGraphic} * @see GetLegendGraphicOutputFormat#produceLegendGraphic(GetLegendGraphicRequest) * @see BufferedImageLegendGraphicBuilder */ public BufferedImageLegendGraphic produceLegendGraphic(GetLegendGraphicRequest request) throws ServiceException { BufferedImageLegendGraphicBuilder builder = new BufferedImageLegendGraphicBuilder(); BufferedImage legendGraphic = builder.buildLegendGraphic(request); BufferedImageLegendGraphic legend = new BufferedImageLegendGraphic(legendGraphic); return legend; }
/** * Builds a JPEG {@link BufferedImageLegendGraphic} * * @return a {@link BufferedImageLegendGraphic} holding a legend image appropriate to be encoded * as JPEG * @see GetLegendGraphicOutputFormat#produceLegendGraphic(GetLegendGraphicRequest) */ public BufferedImageLegendGraphic produceLegendGraphic(GetLegendGraphicRequest request) throws ServiceException { request.setTransparent(false); BufferedImageLegendGraphicBuilder builder = new BufferedImageLegendGraphicBuilder(); BufferedImage legendGraphic = builder.buildLegendGraphic(request); BufferedImageLegendGraphic legend = new BufferedImageLegendGraphic(legendGraphic); return legend; }