changeset 2910:ab0014c58ecb

Fix zoom/export issue665, issue459, issue667. flys-client/trunk@4714 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 20 Jun 2012 07:25:31 +0000
parents 6d4a80b668a4
children 37dce0f2f63b
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Jun 18 11:29:33 2012 +0000
+++ b/flys-client/ChangeLog	Wed Jun 20 07:25:31 2012 +0000
@@ -1,3 +1,10 @@
+2012-06-20	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	Fix issue665, issue459, issue667 (zoom different in export).
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java:
+	  Fake a zoom-event when a zoom-value changing action was taken.
+
 2012-06-18  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/StyleHelper.java: Added
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Mon Jun 18 11:29:33 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Wed Jun 20 07:25:31 2012 +0000
@@ -123,6 +123,8 @@
         zoomToMaxExtent.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
                 getChartOutputTab().resetRanges();
+                // Relink the export buttons.
+                onZoom(null);
             }
         });
         zoomToMaxExtent.setTooltip(MSG.zoomToMaxExtentTooltip());
@@ -132,6 +134,8 @@
         zoomOut.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
                 getChartOutputTab().zoomOut(10);
+                // Relink the export buttons.
+                onZoom(null);
             }
         });
         zoomOut.setTooltip(MSG.zoomOutTooltip());
@@ -141,6 +145,8 @@
         historyBack.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
                 getChartOutputTab().zoomOut();
+                // Relink the export buttons.
+                onZoom(null);
             }
         });
         historyBack.setTooltip(MSG.historyBackTooltip());
@@ -254,6 +260,11 @@
     }
 
 
+    /**
+     * Sets new sources to the export button/images, such that the
+     * correct zoom values are included in the request when clicked.
+     * @param evt ignored.
+     */
     public void onZoom(ZoomEvent evt) {
         downloadPNG.setSource(chartTab.getExportUrl(-1, -1, "png"));
         downloadPDF.setSource(chartTab.getExportUrl(-1, -1, "pdf"));

http://dive4elements.wald.intevation.org