Package org.geomajas.plugin.printing.component

Examples of org.geomajas.plugin.printing.component.PageComponent


  }

  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());
        }
        // need to do this before setSizeAndFit
        adjustLegendFontSizeForSmallPageSizes(request, legendComponent);
      }
    }

    if (request.getPageSize() != null) {
      page.setSize(request.getPageSize(), true);
    }
    SinglePageDocument pdfDoc = new SinglePageDocument(page, null);
    // layout the document
    pdfDoc.layout(Format.PDF);
    // Add document to container
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.printing.component.PageComponent

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.