Package org.geomajas.plugin.printing.component.dto

Examples of org.geomajas.plugin.printing.component.dto.LegendItemComponentInfo


          if (defs.size() > 1) {
            text = label + "(" + styleDefinition.getName() + ")";
          } else {
            text = label;
          }
          LegendItemComponentInfo item = new LegendItemComponentInfo();
          LegendIconComponentInfo icon = new LegendIconComponentInfo();
          icon.setLabel(text);
          icon.setStyleInfo(styleDefinition);
          icon.setLayerType(layerInfo.getLayerType());
          LabelComponentInfo legendLabel = new LabelComponentInfo();
          legendLabel.setBackgroundColor("0xFFFFFF");
          legendLabel.setBorderColor("0x000000");
          legendLabel.setFontColor("0x000000");
          legendLabel.setFont(legend.getFont());
          legendLabel.setText(text);
          legendLabel.setTextOnly(true);
          item.addChild(icon);
          item.addChild(legendLabel);
          legend.addChild(item);
        }
      } else if (layer instanceof RasterLayer && layer.isShowing()) {
        RasterLayer rasterLayer = (RasterLayer) layer;
        ClientRasterLayerInfo layerInfo = rasterLayer.getLayerInfo();
        LegendItemComponentInfo item = new LegendItemComponentInfo();
        LegendIconComponentInfo icon = new LegendIconComponentInfo();
        icon.setLabel(layerInfo.getLabel());
        icon.setLayerType(layerInfo.getLayerType());
        LabelComponentInfo legendLabel = new LabelComponentInfo();
        legendLabel.setFont(legend.getFont());
        legendLabel.setBackgroundColor("0xFFFFFF");
        legendLabel.setBorderColor("0x000000");
        legendLabel.setFontColor("0x000000");
        legendLabel.setText(layerInfo.getLabel());
        legendLabel.setTextOnly(true);
        item.addChild(icon);
        item.addChild(legendLabel);
        legend.addChild(item);
      }
    }
    return legend;
  }
View Full Code Here


          if (defs.size() > 1) {
            text = label + "(" + styleDefinition.getName() + ")";
          } else {
            text = label;
          }
          LegendItemComponentInfo item = new LegendItemComponentInfo();
          LegendIconComponentInfo icon = new LegendIconComponentInfo();
          icon.setLabel(text);
          icon.setStyleInfo(styleDefinition);
          icon.setLayerType(layerInfo.getLayerType());
          LabelComponentInfo legendLabel = new LabelComponentInfo();
          legendLabel.setBackgroundColor("0xFFFFFF");
          legendLabel.setBorderColor("0x000000");
          legendLabel.setFontColor("0x000000");
          legendLabel.setFont(legend.getFont());
          legendLabel.setText(text);
          legendLabel.setTextOnly(true);
          item.addChild(icon);
          item.addChild(legendLabel);
          legend.addChild(item);
        }
      } else if (layer instanceof ClientRasterLayerInfo) {
        ClientRasterLayerInfo layerInfo = (ClientRasterLayerInfo) layer;
        LegendItemComponentInfo item = new LegendItemComponentInfo();
        LegendIconComponentInfo icon = new LegendIconComponentInfo();
        icon.setLabel(layerInfo.getLabel());
        icon.setLayerType(layerInfo.getLayerType());
        LabelComponentInfo legendLabel = new LabelComponentInfo();
        legendLabel.setFont(legend.getFont());
        legendLabel.setBackgroundColor("0xFFFFFF");
        legendLabel.setBorderColor("0x000000");
        legendLabel.setFontColor("0x000000");
        legendLabel.setText(layerInfo.getLabel());
        legendLabel.setTextOnly(true);
        item.addChild(icon);
        item.addChild(legendLabel);
        legend.addChild(item);
      }
    }
    LegendComponent comp = (LegendComponent) printDtoService.toInternal(legend);
    PageComponentImpl page = new PageComponentImpl();
View Full Code Here

          String title = (rule.getTitle() != null ? rule.getTitle() : rule.getName());
          // fall back to style name
          if (title == null) {
            title = layerInfo.getNamedStyleInfo().getName();
          }
          LegendItemComponentInfo item = new LegendItemComponentInfo();
          LegendGraphicComponentInfo graphic = new LegendGraphicComponentInfo();
          graphic.setLabel(title);
          graphic.setRuleInfo(rule);
          graphic.setLayerId(layerInfo.getServerLayerId());
          item.addChild(graphic);
          item.addChild(getLegendLabel(legend, title));
          legend.addChild(item);
        }
      } else if (layer instanceof RasterLayer && layer.isShowing()) {
        RasterLayer rasterLayer = (RasterLayer) layer;
        ClientRasterLayerInfo layerInfo = rasterLayer.getLayerInfo();
        LegendItemComponentInfo item = new LegendItemComponentInfo();
        LegendIconComponentInfo icon = new LegendIconComponentInfo();
        icon.setLabel(layerInfo.getLabel());
        icon.setLayerType(layerInfo.getLayerType());
        item.addChild(icon);
        item.addChild(getLegendLabel(legend, layerInfo.getLabel()));
        legend.addChild(item);
      }
    }
    return legend;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.printing.component.dto.LegendItemComponentInfo

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.