/** * Initialize {@link GetLegendGraphicRequest} with list of layers to draw. * * @param layers * @deprecated Use {@link #getLegends()} */ public void setLayers(List<FeatureType> layers) { List<LegendRequest> list = new ArrayList<LegendRequest>(layers.size()); for (FeatureType type : layers) { LegendRequest legendRequest = new LegendRequest(type); list.add(legendRequest); } this.legends = list; }
/** * Used to clear {@link #legends} and configure with a feature type. * * @param layer */ public void setLayer(FeatureType layer) { this.legends.clear(); if (layer == null) { this.legends.add(new LegendRequest()); } else { this.legends.add(new LegendRequest(layer)); } }
/** * Separate symbolizers. * * @param imageMap the image map * @param request the request * @param styleMap the style map */ private void separateSymbolizers( Map<String, BufferedImage> imageMap, GetLegendGraphicRequest request, Map<String, Style> styleMap) { for (Entry<String, Style> entry : styleMap.entrySet()) { request.getLegends().clear(); LegendRequest legendEntryRequest = request.new LegendRequest(); legendEntryRequest.setStyle(entry.getValue()); legendEntryRequest.setStyleName(entry.getKey()); request.getLegends().add(legendEntryRequest); BufferedImage legendGraphic = null; try { legendGraphic = legendBuilder.buildLegendGraphic(request); } catch (Exception e) { // Ignore } imageMap.put(entry.getKey(), legendGraphic); } }
LegendRequest styleLegend = request.new LegendRequest(); layers.add(styleLegend);
int height = image.getHeight(); LegendRequest legend = req.new LegendRequest(ftInfo.getFeatureType()); legend.setStyle( getCatalog().getStyleByName(MockData.ROAD_SEGMENTS.getLocalPart()).getStyle());
LegendRequest legend = request .new LegendRequest(featureType, layerInfo.getResource().getQualifiedName()); legend.setLayerInfo(layerInfo);
int height = image.getHeight(); LegendRequest legend = req.new LegendRequest(ftInfo.getFeatureType()); legend.setStyle(cat.getStyleByName(MockData.ROAD_SEGMENTS.getLocalPart()).getStyle()); req.getLegends().add(legend);
FeatureTypeStyle featureTypeStyle = style.featureTypeStyles().get(0); if ((featureTypeStyle != null) && !featureTypeStyle.rules().isEmpty()) { LegendRequest legendEntryRequest = request.new LegendRequest(); request.getLegends().add(legendEntryRequest); legendEntryRequest.setTitle(entry.getKey());
LegendRequest legend = req.new LegendRequest(); legend.setStyle(externalGraphicStyle);