protected MapComponentInfo buildMap() { MapComponentInfo map = new MapComponentInfo(); if (PrintingLayout.templateIncludeScaleBar) { map.addChild(buildScaleBar()); } if (PrintingLayout.templateIncludeLegend) { map.addChild(buildLegend()); } if (PrintingLayout.templateIncludeNorthArrow) { map.addChild(buildArrow()); } return map; }
protected PageComponentInfo buildPage() { PageComponentInfo page = new PageComponentInfo(); page.addChild(buildMap()); page.addChild(buildTitle()); page.setTag("page"); return page; }
protected PrintTemplateInfo buildTemplate() { PrintTemplateInfo template = new PrintTemplateInfo(); template.setPage(buildPage()); return template; }
protected MapComponentInfo buildMap() { return buildMap(null); }
@Override public PrintTemplateInfo buildTemplate() { PrintTemplateInfo template = super.buildTemplate(); template.setId(1L); template.setName("default"); return template; }
@Override protected ScaleBarComponentInfo buildScaleBar() { if (isWithScaleBar()) { ScaleBarComponentInfo bar = super.buildScaleBar(); bar.setTicNumber(3); bar.setTag("scalebar"); return bar; } else { return null; } }
@Override protected LabelComponentInfo buildTitle() { if (titleText != null) { LabelComponentInfo title = super.buildTitle(); title.setText(titleText); title.getLayoutConstraint().setMarginY(2 * marginY); return title; } else { return null; } }
@Override protected ImageComponentInfo buildArrow() { if (isWithArrow()) { ImageComponentInfo northarrow = super.buildArrow(); northarrow.setImagePath("/images/northarrow.gif"); northarrow.getLayoutConstraint().setAlignmentX(LayoutConstraintInfo.RIGHT); northarrow.getLayoutConstraint().setAlignmentY(LayoutConstraintInfo.TOP); northarrow.getLayoutConstraint().setMarginX((float) PrintingLayout.templateMarginX); northarrow.getLayoutConstraint().setMarginY((float) PrintingLayout.templateMarginY); northarrow.getLayoutConstraint().setWidth((float) PrintingLayout.templateNorthArrowWidth); northarrow.setTag("arrow"); return northarrow; } else { return null; } }
@Override protected LegendComponentInfo buildLegend() { LegendComponentInfo legend = super.buildLegend(); FontStyleInfo style = new FontStyleInfo(); style.setFamily(PrintingLayout.templateDefaultFontFamily);
@Override protected MapComponentInfo buildMap() { ViewPort viewPort = mapPresenter.getViewPort(); double printWidth = getPageWidth() - 2 * marginX; double printHeight = getPageHeight() - 2 * marginY; Bbox fittingBox = createFittingBox(viewPort.getBounds(), printWidth / printHeight); MapComponentInfo map = super.buildMap(fittingBox); map.getLayoutConstraint().setMarginX(marginX); map.getLayoutConstraint().setMarginY(marginY); map.setLocation(new org.geomajas.geometry.Coordinate(fittingBox.getX(), fittingBox.getY())); map.setPpUnit((float) (printWidth / fittingBox.getWidth())); map.setTag("map"); // GWT:map.setMapId(mapModel.getMapInfo().getId()); // Old puregwt: map.setMapId(mapPresenter.getConfiguration().getId()); map.setMapId(mapPresenter.getConfiguration().getServerConfiguration().getId()); map.setApplicationId(applicationId); map.setRasterResolution(rasterDpi); // use rasterized layers for pure GWT double rasterScale = map.getPpUnit() * map.getRasterResolution() / 72.0; // map.getPpUnit() = aantal pixels per map unit bij 72 dpi mapBuilder.build(mapPresenter, fittingBox, rasterScale); List<PrintComponentInfo> layers = new ArrayList<PrintComponentInfo>(); RasterizedLayersComponentInfo rasterizedLayersComponentInfo = new RasterizedLayersComponentInfo(); rasterizedLayersComponentInfo.setMapInfo(mapPresenter.getConfiguration().getServerConfiguration()); layers.add(rasterizedLayersComponentInfo); map.getChildren().addAll(0, layers); return map; }
@Override public PrintTemplateInfo buildTemplate() { PrintTemplateInfo template = super.buildTemplate(); template.setId(1L); template.setName("default"); return template; }
@Override protected ScaleBarComponentInfo buildScaleBar() { if (isWithScaleBar()) { ScaleBarComponentInfo bar = super.buildScaleBar(); bar.setTicNumber(3); bar.setTag("scalebar"); return bar; } else { return null; } }
@Override protected LabelComponentInfo buildTitle() { if (titleText != null) { LabelComponentInfo title = super.buildTitle(); title.setText(titleText); title.getLayoutConstraint().setMarginY(2 * marginY); return title; } else { return null; } }
@Override protected ImageComponentInfo buildArrow() { if (isWithArrow()) { ImageComponentInfo northarrow = super.buildArrow(); northarrow.setImagePath("/images/northarrow.gif"); northarrow.getLayoutConstraint().setAlignmentX(LayoutConstraintInfo.RIGHT); northarrow.getLayoutConstraint().setAlignmentY(LayoutConstraintInfo.TOP); northarrow.getLayoutConstraint().setMarginX((float) PrintingLayout.templateMarginX); northarrow.getLayoutConstraint().setMarginY((float) PrintingLayout.templateMarginY); northarrow.getLayoutConstraint().setWidth((float) PrintingLayout.templateNorthArrowWidth); northarrow.setTag("arrow"); return northarrow; } else { return null; } }
@Override protected LegendComponentInfo buildLegend() { LegendComponentInfo legend = super.buildLegend(); FontStyleInfo style = new FontStyleInfo(); style.setFamily(PrintingLayout.templateDefaultFontFamily);
protected MapComponentInfo buildMap(Bbox bounds) { MapComponentInfo map = new MapComponentInfo(); if (PrintingLayout.templateIncludeScaleBar) { map.addChild(buildScaleBar()); } if (PrintingLayout.templateIncludeLegend) { LegendComponentInfo legend; if (null == bounds) { legend = buildLegend(); } else { legend = buildLegend(bounds); } map.addChild(legend); } if (PrintingLayout.templateIncludeNorthArrow) { map.addChild(buildArrow()); } return map; }
protected PageComponentInfo buildPage() { PageComponentInfo page = new PageComponentInfo(); page.addChild(buildMap()); page.addChild(buildTitle()); page.setTag("page"); return page; }
protected PrintTemplateInfo buildTemplate() { PrintTemplateInfo template = new PrintTemplateInfo(); template.setPage(buildPage()); return template; }
@Override protected MapComponentInfo buildMap() { MapComponentInfo map = super.buildMap(); map.getLayoutConstraint().setMarginX(marginX); map.getLayoutConstraint().setMarginY(marginY);
@Override public PrintTemplateInfo buildTemplate() { PrintTemplateInfo template = super.buildTemplate(); template.setId(1L); template.setName("default"); return template; }