Package org.geomajas.plugin.printing.client.template

Examples of org.geomajas.plugin.printing.client.template.DefaultTemplateBuilder


  }

  protected void print() {
    startProgress();
    PrintGetTemplateRequest request = new PrintGetTemplateRequest();
    DefaultTemplateBuilder builder = new DefaultTemplateBuilder();
    builder.setApplicationId(mapWidget.getApplicationId());
    builder.setMapModel(mapWidget.getMapModel());
    builder.setMarginX(20);
    builder.setMarginY(20);
    PageSize size = PageSize.getByName((String) sizeItem.getValue());
    if ("landscape".equals(orientationGroup.getValue())) {
      builder.setPageHeight(size.getWidth());
      builder.setPageWidth(size.getHeight());
    } else {
      builder.setPageHeight(size.getHeight());
      builder.setPageWidth(size.getWidth());
    }
    builder.setTitleText((String) titleItem.getValue());
    builder.setWithArrow((Boolean) arrowCheckbox.getValue());
    builder.setWithScaleBar((Boolean) scaleBarCheckbox.getValue());
    builder.setRasterDpi((Integer) rasterDpiSlider.getValue());
    PrintTemplateInfo template = builder.buildTemplate();
    request.setTemplate(template);
    final GwtCommand command = new GwtCommand(PrintGetTemplateRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
View Full Code Here


  protected void print() {
    startProgress();
    PrintGetTemplateRequest request = new PrintGetTemplateRequest();
    imageUrlService.makeRasterizable(mapWidget);
    DefaultTemplateBuilder builder = new DefaultTemplateBuilder();
    builder.setApplicationId(mapWidget.getApplicationId());
    builder.setMapModel(mapWidget.getMapModel());
    builder.setMarginX((int) PrintingLayout.templateMarginX);
    builder.setMarginY((int) PrintingLayout.templateMarginY);
    PageSize size = PageSize.getByName((String) sizeItem.getValue());
    if (LANDSCAPE.equals(orientationGroup.getValue())) {
      builder.setPageHeight(size.getWidth());
      builder.setPageWidth(size.getHeight());
    } else {
      builder.setPageHeight(size.getHeight());
      builder.setPageWidth(size.getWidth());
    }
    builder.setTitleText((String) titleItem.getValue());
    builder.setWithArrow((Boolean) arrowCheckbox.getValue());
    builder.setWithScaleBar((Boolean) scaleBarCheckbox.getValue());
    builder.setRasterDpi((Integer) rasterDpiSlider.getValue());
    PrintTemplateInfo template = builder.buildTemplate();
    request.setTemplate(template);
    final GwtCommand command = new GwtCommand(PrintGetTemplateRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<PrintGetTemplateResponse>() {
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.printing.client.template.DefaultTemplateBuilder

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.