Package org.geomajas.plugin.rasterizing.command.dto

Examples of org.geomajas.plugin.rasterizing.command.dto.LegendRasterizingInfo


    MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
    MapView mapView = map.getMapModel().getMapView();
    mapRasterizingInfo.setBounds(GeometryConverter.toDto(map.getMapModel().getMapView().getBounds()));
    mapRasterizingInfo.setScale(mapView.getCurrentScale());
    mapRasterizingInfo.setTransparent(true);
    LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo();
    legendRasterizingInfo.setTitle("Legend");
    FontStyleInfo font = new FontStyleInfo();
    font.applyDefaults();
    legendRasterizingInfo.setFont(font);
    mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo);
    mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);
    for (Layer<?> layer : map.getMapModel().getLayers()) {
      if (layer instanceof VectorLayer) {
        VectorLayer vectorLayer = (VectorLayer) layer;
View Full Code Here


  @SuppressWarnings("unchecked")
  public RenderedImage paintLegend(MapContext mapContext) {
    LegendBuilder builder = new LegendBuilder();
    MapRasterizingInfo mapRasterizingInfo = (MapRasterizingInfo) mapContext.getUserData().get(
        LayerFactory.USERDATA_RASTERIZING_INFO);
    LegendRasterizingInfo legendRasterizingInfo = mapRasterizingInfo.getLegendRasterizingInfo();
    Font font = textService.getFont(legendRasterizingInfo.getFont());
    builder.setTitle(legendRasterizingInfo.getTitle(), font);
    if (legendRasterizingInfo.getWidth() > 0) {
      builder.setSize(legendRasterizingInfo.getWidth(), legendRasterizingInfo.getHeight());
    }
    for (Layer layer : mapContext.layers()) {
      if (layer instanceof RasterDirectLayer) {
        RasterDirectLayer rasterLayer = (RasterDirectLayer) layer;
        builder.addRasterLayer(rasterLayer.getTitle(), font);
View Full Code Here

    VectorLayerRasterizingInfo lr3 = new VectorLayerRasterizingInfo();
    lr3.setStyle(layerBeansMultiLineStyleInfo);
    cl3.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, lr3);
    mapInfo.getLayers().add(cl3);

    LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo();
    legendRasterizingInfo.setFont(new FontStyleInfo());
    legendRasterizingInfo.getFont().applyDefaults();
    legendRasterizingInfo.getFont().setSize(12);
    legendRasterizingInfo.getFont().setFamily("courier");
    legendRasterizingInfo.setTitle("legend");
    mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo);
    new LegendAssert(mapInfo).assertEqualImage("legend.png", writeImages, DELTA);
  }
View Full Code Here

    VectorLayerRasterizingInfo lr3 = new VectorLayerRasterizingInfo();
    lr3.setStyle(layerBeansMultiLineStyleInfo);
    cl3.getWidgetInfo().put(VectorLayerRasterizingInfo.WIDGET_KEY, lr3);
    mapInfo.getLayers().add(cl3);

    LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo();
    legendRasterizingInfo.setFont(new FontStyleInfo());
    legendRasterizingInfo.getFont().applyDefaults();
    legendRasterizingInfo.getFont().setSize(12);
    legendRasterizingInfo.getFont().setFamily("courier");
    legendRasterizingInfo.setTitle("legend");
    mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo);
    new LegendAssert(mapInfo).assertEqualImage("legend_dynamic.png", writeImages, DELTA);
  }
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.rasterizing.command.dto.LegendRasterizingInfo

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.