Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java @ 4474:bd78d2b0e309
Map print settings can now be configured via settings window.
Configurable for now are page layout (A0 or A4), caption text and
comment text.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sun, 11 Nov 2012 14:44:12 +0100 |
parents | 6db783627137 |
children | 6fb4e29a2a9b |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java Sat Nov 10 23:47:38 2012 +0100 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java Sun Nov 11 14:44:12 2012 +0100 @@ -653,11 +653,12 @@ protected ImgButton createMapPrintSettingsControl() { + final MapToolbar mtb = this; ImgButton btn = createButton(MSG.printMapSettings(), new ClickHandler() { @Override public void onClick(ClickEvent event) { MapPrintSettingsWindow mpsw = - new MapPrintSettingsWindow(outputTab.getCollection()); + new MapPrintSettingsWindow(outputTab.getCollection(), mtb); outputTab.getCollectionView().addChild(mpsw); } }); @@ -693,7 +694,7 @@ @Override public void onMapZoom(MapZoomListener.MapZoomEvent e) { - printMapLink.setSource(createPrintUrl()); + updatePrintUrl(); } protected void appendPrintSettingsToUrl(Collection collection, StringBuilder url) { @@ -701,20 +702,19 @@ if (settings != null) { List<Property> properties = settings.getSettings("default"); for (Property prop : properties) { - GWT.log("prop=" + prop.getName()); PropertySetting props = (PropertySetting)prop; - if (props.getName().equals("page-format")) { - - } - else if (props.getName().equals("page-title")) { - url.append("&page-title="); - url.append(props.getValue()); - GWT.log(props.getName() + "=" + props.getValue()); - } + url.append("&"); + url.append(props.getName()); + url.append("="); + url.append(props.getValue()); } } } + public void updatePrintUrl() { + printMapLink.setSource(createPrintUrl()); + } + public String createPrintUrl() { MapOutputTab ot = (MapOutputTab)getOutputTab(); Collection collection = ot.getCollection();