comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 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 f25a3eb9785d
children 6461b8dbe093
comparison
equal deleted inserted replaced
2909:6d4a80b668a4 2910:ab0014c58ecb
121 zoomToMaxExtent.setSrc(baseUrl + MSG.zoom_all()); 121 zoomToMaxExtent.setSrc(baseUrl + MSG.zoom_all());
122 adjustImageButton(zoomToMaxExtent); 122 adjustImageButton(zoomToMaxExtent);
123 zoomToMaxExtent.addClickHandler(new ClickHandler() { 123 zoomToMaxExtent.addClickHandler(new ClickHandler() {
124 public void onClick(ClickEvent event) { 124 public void onClick(ClickEvent event) {
125 getChartOutputTab().resetRanges(); 125 getChartOutputTab().resetRanges();
126 // Relink the export buttons.
127 onZoom(null);
126 } 128 }
127 }); 129 });
128 zoomToMaxExtent.setTooltip(MSG.zoomToMaxExtentTooltip()); 130 zoomToMaxExtent.setTooltip(MSG.zoomToMaxExtentTooltip());
129 131
130 zoomOut.setSrc(baseUrl + MSG.zoom_out()); 132 zoomOut.setSrc(baseUrl + MSG.zoom_out());
131 adjustImageButton(zoomOut); 133 adjustImageButton(zoomOut);
132 zoomOut.addClickHandler(new ClickHandler() { 134 zoomOut.addClickHandler(new ClickHandler() {
133 public void onClick(ClickEvent event) { 135 public void onClick(ClickEvent event) {
134 getChartOutputTab().zoomOut(10); 136 getChartOutputTab().zoomOut(10);
137 // Relink the export buttons.
138 onZoom(null);
135 } 139 }
136 }); 140 });
137 zoomOut.setTooltip(MSG.zoomOutTooltip()); 141 zoomOut.setTooltip(MSG.zoomOutTooltip());
138 142
139 historyBack.setSrc(baseUrl + MSG.zoom_back()); 143 historyBack.setSrc(baseUrl + MSG.zoom_back());
140 adjustImageButton(historyBack); 144 adjustImageButton(historyBack);
141 historyBack.addClickHandler(new ClickHandler() { 145 historyBack.addClickHandler(new ClickHandler() {
142 public void onClick(ClickEvent event) { 146 public void onClick(ClickEvent event) {
143 getChartOutputTab().zoomOut(); 147 getChartOutputTab().zoomOut();
148 // Relink the export buttons.
149 onZoom(null);
144 } 150 }
145 }); 151 });
146 historyBack.setTooltip(MSG.historyBackTooltip()); 152 historyBack.setTooltip(MSG.historyBackTooltip());
147 153
148 zoombox.addZoomHandler(chartTab); 154 zoombox.addZoomHandler(chartTab);
252 this.chartTab, this.chartTab.getMode().getName()).show(); 258 this.chartTab, this.chartTab.getMode().getName()).show();
253 } 259 }
254 } 260 }
255 261
256 262
263 /**
264 * Sets new sources to the export button/images, such that the
265 * correct zoom values are included in the request when clicked.
266 * @param evt ignored.
267 */
257 public void onZoom(ZoomEvent evt) { 268 public void onZoom(ZoomEvent evt) {
258 downloadPNG.setSource(chartTab.getExportUrl(-1, -1, "png")); 269 downloadPNG.setSource(chartTab.getExportUrl(-1, -1, "png"));
259 downloadPDF.setSource(chartTab.getExportUrl(-1, -1, "pdf")); 270 downloadPDF.setSource(chartTab.getExportUrl(-1, -1, "pdf"));
260 downloadSVG.setSource(chartTab.getExportUrl(-1, -1, "svg")); 271 downloadSVG.setSource(chartTab.getExportUrl(-1, -1, "svg"));
261 } 272 }

http://dive4elements.wald.intevation.org