Mercurial > dive4elements > river
changeset 2391:3c8ae5605a51
Picked rev 4059,4071,4072,4073 from trunk.
flys-client/tags/2.6.1@4079 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 17 Feb 2012 11:33:03 +0000 |
parents | 39955a31f090 |
children | 8112ec686a9a |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java |
diffstat | 5 files changed, 81 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Thu Feb 16 12:02:46 2012 +0000 +++ b/flys-client/ChangeLog Fri Feb 17 11:33:03 2012 +0000 @@ -1,3 +1,36 @@ +2012-02-17 Ingo Weinzierl <ingo@intevation.de> + + flys/issue459 (Diagramm-Export hat nicht die gleiche Axenskalierung wie + Diagramm-Ansicht) + + * src/main/java/de/intevation/flys/client/client/ui/ImgLink.java: Added a + method setSource() that allows to reset the url of the export. + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java: + Implements ZoomHandler to update the export url of PNG, PDF and SVG + download links. This is necessary to take the current zoom information + into account. + +2012-02-17 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java: + Removed the server URL provided by Config. The URL is no longer + required since it is configured in web.xml. + +2012-02-17 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java: + Print debug messages for zoom values. + +2012-02-16 Raimund Renkert <raimund.renkert@intevation.de> + + Refactored the wq input data fields. + + * src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java, + src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java: + Refactored the wq input data fields. The data fields wq_mode, wq_free + and wq_selection are now of type 'boolean'. + 2012-02-16 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java Thu Feb 16 12:02:46 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ImgLink.java Fri Feb 17 11:33:03 2012 +0000 @@ -1,17 +1,42 @@ package de.intevation.flys.client.client.ui; +import com.google.gwt.core.client.GWT; + import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.HTMLPane; public class ImgLink extends HTMLPane { + private int width; + private int height; + + private String href; + private String imgUrl; + + public ImgLink(String imgUrl, String href, int width, int height) { super(); + this.width = width; + this.height = height; + this.href = href; + this.imgUrl = imgUrl; + + update(); + } + + + protected void update() { setContents("<a href='" + href + "'><img src='" + imgUrl + "'></a>"); setWidth(width); setHeight(height); setOverflow(Overflow.VISIBLE); } + + + public void setSource(String href) { + this.href = href; + update(); + } }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Thu Feb 16 12:02:46 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Fri Feb 17 11:33:03 2012 +0000 @@ -578,7 +578,6 @@ imgUrl += "chart"; imgUrl += "?uuid=" + collection.identifier(); imgUrl += "&type=" + mode.getName(); - imgUrl += "&server=" + config.getServerUrl(); imgUrl += "&locale=" + config.getLocale(); imgUrl += "×tamp=" + new Date().getTime(); imgUrl += "&width=" + Integer.toString(width); @@ -593,6 +592,7 @@ imgUrl += "&minx=" + zoom[0]; imgUrl += "&maxx=" + zoom[1]; } + if (zoom[2].intValue() != 0 || zoom[3].intValue() != 1) { // a zoom range of 0-1 means displaying the whole range. In such // case we don't need to zoom.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Thu Feb 16 12:02:46 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Fri Feb 17 11:33:03 2012 +0000 @@ -10,6 +10,8 @@ import com.smartgwt.client.widgets.events.ClickHandler; import de.intevation.flys.client.client.FLYSConstants; +import de.intevation.flys.client.client.event.ZoomEvent; +import de.intevation.flys.client.client.event.ZoomHandler; import de.intevation.flys.client.client.ui.ImgLink; import de.intevation.flys.client.client.ui.Toolbar; @@ -20,7 +22,7 @@ * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ -public class ChartToolbar extends Toolbar { +public class ChartToolbar extends Toolbar implements ZoomHandler { protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); @@ -30,11 +32,11 @@ protected Button datacage; - protected Canvas downloadPNG; + protected ImgLink downloadPNG; - protected Canvas downloadPDF; + protected ImgLink downloadPDF; - protected Canvas downloadSVG; + protected ImgLink downloadSVG; protected Canvas downloadCSV; @@ -134,6 +136,7 @@ }); zoombox.addZoomHandler(chartTab); + zoombox.addZoomHandler(this); zoombox.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { panControl.deselect(); @@ -220,5 +223,12 @@ new ManualPointsEditor(chartTab.getView().getCollection(), this.chartTab, this.chartTab.getMode().getName()).show(); } + + + public void onZoom(ZoomEvent evt) { + downloadPNG.setSource(chartTab.getExportUrl(-1, -1, "png")); + downloadPDF.setSource(chartTab.getExportUrl(-1, -1, "pdf")); + downloadSVG.setSource(chartTab.getExportUrl(-1, -1, "svg")); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java Thu Feb 16 12:02:46 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java Fri Feb 17 11:33:03 2012 +0000 @@ -79,6 +79,14 @@ attr.put("maxy", req.getParameter("maxy")); attr.put("format", req.getParameter("format")); + if (logger.isDebugEnabled()) { + logger.debug("====== ZOOM VALUES ======="); + logger.debug(" min x: " + req.getParameter("minx")); + logger.debug(" max x: " + req.getParameter("maxx")); + logger.debug(" min y: " + req.getParameter("miny")); + logger.debug(" max y: " + req.getParameter("maxy")); + } + return attr; }