# HG changeset patch # User Christian Lins # Date 1364997621 -7200 # Node ID 25c2505df28fc6b7de1c1c5b0141fa8774136162 # Parent 8d0af912351c2c33cefb31707f35156dd5622591# Parent b5912ad9926c8dcab9fe88578fa2bc83c9776af2 Merged diff -r b5912ad9926c -r 25c2505df28f flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Wed Apr 03 15:34:18 2013 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Wed Apr 03 16:00:21 2013 +0200 @@ -1,19 +1,16 @@ package de.intevation.flys.client.client.ui; -import java.util.List; - -import org.gwtopenmaps.openlayers.client.Map; -import org.gwtopenmaps.openlayers.client.control.Attribution; -import org.gwtopenmaps.openlayers.client.layer.WMS; -import org.gwtopenmaps.openlayers.client.layer.WMSOptions; -import org.gwtopenmaps.openlayers.client.layer.WMSParams; - import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; + import com.smartgwt.client.types.VerticalAlignment; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.events.ParentMovedEvent; +import com.smartgwt.client.widgets.events.ParentMovedHandler; +import com.smartgwt.client.widgets.events.ResizedEvent; +import com.smartgwt.client.widgets.events.ResizedHandler; import com.smartgwt.client.widgets.events.VisibilityChangedEvent; import com.smartgwt.client.widgets.events.VisibilityChangedHandler; import com.smartgwt.client.widgets.layout.VLayout; @@ -34,6 +31,14 @@ import de.intevation.flys.client.shared.model.DefaultDataItem; import de.intevation.flys.client.shared.model.MapInfo; +import java.util.List; + +import org.gwtopenmaps.openlayers.client.Map; +import org.gwtopenmaps.openlayers.client.control.Attribution; +import org.gwtopenmaps.openlayers.client.layer.WMS; +import org.gwtopenmaps.openlayers.client.layer.WMSOptions; +import org.gwtopenmaps.openlayers.client.layer.WMSParams; + public class DigitizePanel extends SelectProvider @@ -58,7 +63,7 @@ @Override public Canvas create(DataList list) { - List data = list.getAll(); + List data = list.getAll(); // FIXME: data is not used? getAll() side-effects? helperContainer.addVisibilityChangedHandler(this); DataList clone = (DataList) list.clone(); @@ -150,6 +155,18 @@ floodMap = mapPanel.getFloodMap(); Map map = floodMap.getMap(); + helperContainer.addResizedHandler(new ResizedHandler() { + @Override + public void onResized(ResizedEvent event) { + mapPanel.doLayout(helperContainer.getWidth(), helperContainer.getHeight()); + } + }); + helperContainer.addParentMovedHandler(new ParentMovedHandler() { + @Override + public void onParentMoved(ParentMovedEvent event) { + mapPanel.doLayout(helperContainer.getWidth(), helperContainer.getHeight()); + } + }); helperContainer.addMember(mapPanel); parameterList.registerCollectionViewTabHandler(this); diff -r b5912ad9926c -r 25c2505df28f flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Wed Apr 03 15:34:18 2013 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Wed Apr 03 16:00:21 2013 +0200 @@ -52,11 +52,11 @@ import de.intevation.flys.client.shared.model.DefaultDataItem; import de.intevation.flys.client.shared.model.ExportMode; import de.intevation.flys.client.shared.model.FixAnalysisArtifact; +import de.intevation.flys.client.shared.model.MINFOArtifact; import de.intevation.flys.client.shared.model.OutputMode; import de.intevation.flys.client.shared.model.ReportMode; import de.intevation.flys.client.shared.model.River; import de.intevation.flys.client.shared.model.WINFOArtifact; -import de.intevation.flys.client.shared.model.MINFOArtifact; import java.util.ArrayList; import java.util.List; diff -r b5912ad9926c -r 25c2505df28f flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Wed Apr 03 15:34:18 2013 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Wed Apr 03 16:00:21 2013 +0200 @@ -1,11 +1,7 @@ package de.intevation.flys.client.client.ui.map; import com.google.gwt.core.client.GWT; -import com.smartgwt.client.widgets.events.ParentMovedEvent; -import com.smartgwt.client.widgets.events.ParentMovedHandler; -import com.smartgwt.client.widgets.events.ResizedEvent; -import com.smartgwt.client.widgets.events.ResizedHandler; -import com.smartgwt.client.widgets.layout.VLayout; +import com.google.gwt.user.client.ui.AbsolutePanel; import de.intevation.flys.client.shared.model.BBox; import de.intevation.flys.client.shared.model.MapInfo; @@ -17,7 +13,7 @@ * Panel that contains a MapWidget and a MapToolbar. * This panel is used by the flood map calculation input helper. */ -public class MapPanel extends VLayout { +public class MapPanel extends AbsolutePanel { protected MapToolbar toolbar; @@ -43,33 +39,19 @@ private void initLayout() { - setWidth100(); - setHeight100(); + setWidth("100%"); + setHeight("100%"); floodMapWidget = floodMap.getMapWidget(); toolbar = new MapToolbar(floodMap, digitizeEnabled); - addMember(toolbar); - addMember(floodMapWidget); - - addResizedHandler(new ResizedHandler() { - @Override - public void onResized(ResizedEvent event) { - doLayout(); - } - }); - - addParentMovedHandler(new ParentMovedHandler() { - @Override - public void onParentMoved(ParentMovedEvent event) { - floodMapWidget.getMap().updateSize(); - } - }); + add(toolbar); + add(floodMapWidget); } - protected void doLayout() { - int width = getWidth(); - int height = getHeight(); + public void doLayout(int w, int h) { + int width = w; + int height = h; GWT.log("MapPanel.size: " + width + "x" + height); width -= 2; // minus black borders diff -r b5912ad9926c -r 25c2505df28f flys-client/src/main/webapp/WEB-INF/config.yaml --- a/flys-client/src/main/webapp/WEB-INF/config.yaml Wed Apr 03 15:34:18 2013 +0200 +++ b/flys-client/src/main/webapp/WEB-INF/config.yaml Wed Apr 03 16:00:21 2013 +0200 @@ -25,7 +25,7 @@ - 2000000 - 4000000 -outputFilename: "flys-${date}.pdf" +outputFilename: 'flys-${date}.pdf' #=========================================================================== # the list of allowed hosts @@ -54,12 +54,65 @@ port: 80 layouts: + #=========================================================================== + A4 portrait: + #=========================================================================== + metaData: + title: '${title}' + author: 'Flys' + subject: 'Kartendruck A4 Portrait' + keywords: 'map,print' + creator: 'd4e-river' + + #------------------------------------------------------------------------- + mainPage: + pageSize: A4 + landscape: false + header: + height: 50 + items: + - !image + align: left + maxWidth: 60 + maxHeight: 60 + url: '${configDir}/../images/FLYS_Logo.png' + items: + - !text + font: Helvetica + fontSize: 30 + align: right + text: '${mapTitle}' + spacingAfter: 30 + - !map + spacingAfter: 30 + width: 440 + height: 483 + - !scalebar + type: bar + maxSize: 100 + barBgColor: white + fontSize: 8 + align: right + - !text + text: '${comment}' + spacingAfter: 30 + - !text + font: Helvetica + fontSize: 9 + align: right + text: '1:${scale} ${now MM.dd.yyyy}' + - !legends + align: left + maxIconWidth: 32 + maxIconHeight: 32 + footer: *commonFooter + #=========================================================================== A4 landscape: #=========================================================================== metaData: - title: "${title}" + title: '${title}' author: 'Flys' subject: 'Kartendruck A4 Quer' keywords: 'map,print' @@ -72,27 +125,96 @@ header: height: 50 items: - - !columns - config: - cells: - - paddingBottom: 5 - items: - - !image - align: left - maxWidth: 50 - maxHeight: 50 - url: "${configDir}/../images/FLYS_Logo.png" - - !text - font: Helvetica - fontSize: 30 - align: right - text: "${mapTitle}" - + - !image + align: left + maxWidth: 60 + maxHeight: 60 + url: '${configDir}/../images/FLYS_Logo.png' items: - - !map - absoluteX: 45 - absoluteY: 510 - spacingAfter: 200 - width: 540 - height: 480 - align: left + - !text + font: Helvetica + fontSize: 30 + align: right + text: '${mapTitle}' + spacingAfter: 30 + - !map + absoluteX: 45 + absoluteY: 510 + #spacingAfter: 30 + width: 540 + height: 480 + align: left + - !scalebar + type: bar + maxSize: 100 + barBgColor: white + fontSize: 8 + align: right + - !text + text: '${comment}' + spacingAfter: 30 + - !text + font: Helvetica + fontSize: 9 + align: right + text: '1:${scale} ${now MM.dd.yyyy}' + - !legends + align: right + maxIconWidth: 32 + maxIconHeight: 32 +# - !columns +# widths: [500, 200] +# items: +# - !map +# width: 500 +# height: 500 +# - !legends + footer: *commonFooter + + + #=========================================================================== + A0 portrait: + #=========================================================================== + metaData: + title: '${title}' + author: 'MapFish print module' + subject: 'Simple layout' + keywords: 'map,print' + creator: 'MapFish' + + #------------------------------------------------------------------------- + mainPage: + pageSize: A0 + rotation: true + header: + height: 50 + items: + - !text + font: Helvetica + fontSize: 30 + align: right + text: '${mapTitle}' + items: + - !map + spacingAfter: 30 + width: 1760 + height: 1932 + - !scalebar + type: bar + maxSize: 100 + barBgColor: white + fontSize: 8 + align: right + - !text + text: '${comment}' + spacingAfter: 30 + - !text + font: Helvetica + fontSize: 9 + align: right + text: '1:${scale} ${now MM.dd.yyyy}' + - !legends + align: left + maxIconWidth: 32 + maxIconHeight: 32 + footer: *commonFooter