Package org.geomajas.plugin.printing.component.impl

Examples of org.geomajas.plugin.printing.component.impl.MapComponentImpl


  public PrintTemplate createTemplate(String pageSize, boolean landscape) {
    PageComponentImpl page = createInstance(PageComponentImpl.class);
    page.setSize(pageSize, landscape);
    page.setTag(PrintTemplate.PAGE);
    MapComponentImpl map = createMap();
    ImageComponentImpl northarrow = createArrow();
    ScaleBarComponentImpl bar = createBar();
    LabelComponentImpl title = createTitle();

    LegendComponentImpl legend = new LegendComponentImpl();
    legend.setTag(PrintTemplate.LEGEND);
    map.addComponent(bar);
    map.addComponent(legend);
    map.addComponent(northarrow);
    page.addComponent(map);
    page.addComponent(title);
    PrintTemplate template = new PrintTemplate(true);
    template.setName("Default" + "-" + pageSize + "-" + (landscape ? "landscape" : "portrait"));
    template.setPage(page);
View Full Code Here


    cache.setMemoryCapacity(getJaiTileCacheInMb() * MB);
    log.info("JAI cache size set to " + cache.getMemoryCapacity() / MB + " MB");
  }

  private MapComponentImpl createMap() {
    MapComponentImpl map = createInstance(MapComponentImpl.class);
    map.getConstraint().setMarginX(20);
    map.getConstraint().setMarginY(20);
    map.setLocation(new Coordinate());
    map.setPpUnit(1.0f);
    map.setTag(PrintTemplate.MAP);
    return map;
  }
View Full Code Here

  public void execute(PrintGetTemplateRequest request, PrintGetTemplateResponse response) throws Exception {
    // you dirty hack you...
    PrintTemplateInfo template = request.getTemplate();
    PageComponent page = (PageComponent) converterService.toInternal(template.getPage());
    MapComponentImpl mapComponent = (MapComponentImpl) page.getChild(PrintTemplate.MAP);
    if (mapComponent != null) {
      LegendComponentImpl legendComponent = (LegendComponentImpl) mapComponent.getChild(PrintTemplate.LEGEND);
      if (legendComponent != null) {
        LabelComponentImpl lab = (LabelComponentImpl) legendComponent.getChild(PrintTemplate.TITLE);
        if (lab != null) {
          lab.setText(legendComponent.getTitle());
        }
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.printing.component.impl.MapComponentImpl

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.