/** * Create action for given map widget. * * @param mapWidget map widget */ public PrintingAction(MapWidget mapWidget) { super(WidgetLayout.iconPrint, null); this.mapWidget = mapWidget; setTooltip(MESSAGES.printBtnTitle()); }
protected LegendComponentInfo buildLegend() { LegendComponentInfo legend = new LegendComponentInfo(); legend.setTitle(MESSAGES.legendTitle()); return legend; }
/** {@inheritDoc} */ public void onClick(ClickEvent event) { PrintPreferencesCanvas canvas = new PrintPreferencesCanvas(mapWidget); canvas.setMargin(WidgetLayout.marginSmall); Window window = new KeepInScreenWindow(); window.setTitle(MESSAGES.printPrefsTitle()); window.addItem(canvas); window.centerInPage(); window.setAutoSize(true); window.show(); }
mainPreferences.setTitle(MESSAGES.printPrefsChoose()); titleItem.setTitle(MESSAGES.printPrefsTitleText()); sizeItem.setTitle(MESSAGES.printPrefsSize()); sizeItem.setValueMap(PageSize.getAllNames()); sizeItem.setValue(PageSize.A4.getName()); orientationGroup.setTitle(MESSAGES.printPrefsOrientation()); LinkedHashMap<String, String> orientations = new LinkedHashMap<String, String>(); orientations.put(LANDSCAPE, MESSAGES.printPrefsLandscape()); orientations.put(PORTRAIT, MESSAGES.printPrefsPortrait()); orientationGroup.setValueMap(orientations); orientationGroup.setVertical(false); rasterDpiSlider.setTitle(MESSAGES.printPrefsRasterDPI()); rasterDpiSlider.setWidth(PrintingLayout.printPreferencesResolutionWidth); rasterDpiSlider.setHeight(PrintingLayout.printPreferencesResolutionHeight); arrowCheckbox.setTitle(MESSAGES.printPrefsWithArrow()); scaleBarCheckbox.setTitle(MESSAGES.printPrefsWithScaleBar()); fileNameItem.setTitle(MESSAGES.printPrefsFileName()); fileNameItem.setValue(mapWidget.getMapModel().getMapInfo().getId() + EXTENSION); barIcon.setHeight(PrintingLayout.iconWaitHeight); barIcon.setWidth(PrintingLayout.iconWaitWidth); StaticTextItem statusText = new StaticTextItem(MESSAGES.printPrefsStatus());
DefaultTemplateBuilder builder = new DefaultTemplateBuilder(mapBuilder); builder.setApplicationId(this.applicationId); builder.setMapPresenter(mapPresenter); builder.setMarginX((int) PrintingLayout.templateMarginX); builder.setMarginY((int) PrintingLayout.templateMarginY); PageSize size = PageSize.A4; builder.setPageHeight(size.getWidth()); builder.setPageWidth(size.getHeight()); } else { builder.setPageHeight(size.getHeight()); builder.setPageWidth(size.getWidth()); title = MESSAGES.defaultPrintTitle(); builder.setTitleText(title); builder.setWithArrow(true); builder.setWithScaleBar(true); builder.setRasterDpi(200); PrintTemplateInfo template = builder.buildTemplate(); request.setTemplate(template); final GwtCommand command = new GwtCommand(PrintGetTemplateRequest.COMMAND);
@Override protected LegendComponentInfo buildLegend() { LegendComponentInfo legend = super.buildLegend(); FontStyleInfo style = new FontStyleInfo(); style.setFamily(PrintingLayout.templateDefaultFontFamily); legend.setMapId(mapModel.getMapInfo().getId()); legend.setTag("legend"); legend.setTitle(MESSAGES.legendTitle()); for (Layer layer : mapModel.getLayers()) { if (layer instanceof VectorLayer && layer.isShowing()) { graphic.setLayerId(layerInfo.getServerLayerId()); item.addChild(graphic); item.addChild(getLegendLabel(legend, title)); legend.addChild(item); icon.setLayerType(layerInfo.getLayerType()); item.addChild(icon); item.addChild(getLegendLabel(legend, layerInfo.getLabel())); legend.addChild(item);
public PrintPanel(MapPresenter mapPresenter, String applicationId) { assert (mapPresenter != null) : "mapPresenter must be specified when constructing PrintPanel"; assert (applicationId != null) : "applicationId must be specified when constructing PrintPanel"; initWidget(UI_BINDER.createAndBindUi(this)); this.mapPresenter = mapPresenter; this.applicationId = applicationId; printButton.setEnabled(true); titleTextBox.setTitle(MESSAGES.printPrefsTitleTooltip()); titleTextBox.getElement().setAttribute("placeholder", MESSAGES.printPrefsTitlePlaceholder()); final ClickHandler orientationOptionClickedHandler = new ClickHandler() { public void onClick(ClickEvent event) { if (event != null) { optionLandscapeOrientation.setValue(event.getSource().equals(optionLandscapeOrientation)); optionPortraitOrientation.setValue(event.getSource().equals(optionPortraitOrientation)); } } }; optionLandscapeOrientation.addClickHandler(orientationOptionClickedHandler); optionPortraitOrientation.addClickHandler(orientationOptionClickedHandler); // Defayult = Landscape optionLandscapeOrientation.setValue(true); optionPortraitOrientation.setValue(false); }
mainPreferences.setTitle(MESSAGES.printPrefsChoose()); titleItem.setTitle(MESSAGES.printPrefsTitleText()); sizeItem.setTitle(MESSAGES.printPrefsSize()); sizeItem.setValueMap(PageSize.getAllNames()); sizeItem.setValue(PageSize.A4.getName()); orientationGroup.setTitle(MESSAGES.printPrefsOrientation()); LinkedHashMap<String, String> orientations = new LinkedHashMap<String, String>(); orientations.put(LANDSCAPE, MESSAGES.printPrefsLandscape()); orientations.put(PORTRAIT, MESSAGES.printPrefsPortrait()); orientationGroup.setValueMap(orientations); orientationGroup.setVertical(false); rasterDpiSlider.setTitle(MESSAGES.printPrefsRasterDPI()); rasterDpiSlider.setWidth(PrintingLayout.printPreferencesResolutionWidth); rasterDpiSlider.setHeight(PrintingLayout.printPreferencesResolutionHeight); arrowCheckbox.setTitle(MESSAGES.printPrefsWithArrow()); scaleBarCheckbox.setTitle(MESSAGES.printPrefsWithScaleBar()); fileNameItem.setTitle(MESSAGES.printPrefsFileName()); fileNameItem.setValue(mapWidget.getMapModel().getMapInfo().getId() + EXTENSION); barIcon.setHeight(PrintingLayout.iconWaitHeight); barIcon.setWidth(PrintingLayout.iconWaitWidth); StaticTextItem statusText = new StaticTextItem(MESSAGES.printPrefsStatus());
@Override public void onClick(ClickEvent event) { PrintPreferencesCanvas canvas = new PrintPreferencesCanvas(mapWidget); canvas.setMargin(WidgetLayout.marginSmall); Window window = new KeepInScreenWindow(); window.setTitle(MESSAGES.printPrefsTitle()); window.addItem(canvas); window.centerInPage(); window.setAutoSize(true); window.show(); }
/** * Create action for given map widget. * * @param mapWidget map widget */ public PrintingAction(MapWidget mapWidget) { super(WidgetLayout.iconPrint, null); this.mapWidget = mapWidget; setTooltip(MESSAGES.printBtnTitle()); }