comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 3499:17c66d38f095

FixA: Added AT file export to FixAnalysis W/Q. flys-client/trunk@5223 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 17 Aug 2012 11:18:15 +0000
parents b6575b8c8db0
children ebf47e4adea5
comparison
equal deleted inserted replaced
3498:92239b53823f 3499:17c66d38f095
6 import com.smartgwt.client.widgets.ImgButton; 6 import com.smartgwt.client.widgets.ImgButton;
7 import com.smartgwt.client.widgets.Label; 7 import com.smartgwt.client.widgets.Label;
8 import com.smartgwt.client.widgets.events.ClickEvent; 8 import com.smartgwt.client.widgets.events.ClickEvent;
9 import com.smartgwt.client.widgets.events.ClickHandler; 9 import com.smartgwt.client.widgets.events.ClickHandler;
10 10
11 import de.intevation.flys.client.client.Config;
11 import de.intevation.flys.client.client.FLYSConstants; 12 import de.intevation.flys.client.client.FLYSConstants;
12 import de.intevation.flys.client.client.event.ZoomEvent; 13 import de.intevation.flys.client.client.event.ZoomEvent;
13 import de.intevation.flys.client.client.event.ZoomHandler; 14 import de.intevation.flys.client.client.event.ZoomHandler;
14 import de.intevation.flys.client.client.ui.ImgLink; 15 import de.intevation.flys.client.client.ui.ImgLink;
15 import de.intevation.flys.client.client.ui.Toolbar; 16 import de.intevation.flys.client.client.ui.Toolbar;
39 protected ImgButton historyBack; 40 protected ImgButton historyBack;
40 protected ImgButton zoomOut; 41 protected ImgButton zoomOut;
41 protected ImgButton chartProperties; 42 protected ImgButton chartProperties;
42 protected Button addPoints; 43 protected Button addPoints;
43 protected Button addWSP; 44 protected Button addWSP;
45 protected ImgLink exportAT;
44 protected PanControl panControl; 46 protected PanControl panControl;
45 47
46 48
47 /** @param chartTab Output-Tab on which this toolbar is located. */ 49 /** @param chartTab Output-Tab on which this toolbar is located. */
48 public ChartToolbar(ChartOutputTab chartTab) { 50 public ChartToolbar(ChartOutputTab chartTab) {
100 openDatacageWindow((ChartOutputTab) getOutputTab()); 102 openDatacageWindow((ChartOutputTab) getOutputTab());
101 } 103 }
102 }); 104 });
103 105
104 String baseUrl = GWT.getHostPageBaseURL(); 106 String baseUrl = GWT.getHostPageBaseURL();
107 String moduleUrl = GWT.getModuleBaseURL();
108 Config config = Config.getInstance();
109
110 if (chartTab.getMode().getName().equals("fix_wq_curve")) {
111 exportAT = new ImgLink(
112 baseUrl + MSG.downloadCSV(),
113 moduleUrl + "export" +
114 "?uuid=" + chartTab.getCollection().identifier() +
115 "&mode=" + chartTab.getMode().getName() + "_at_export" +
116 "&type=at" +
117 "&server=" + config.getServerUrl() +
118 "&locale=" + config.getLocale() +
119 "&km=" + chartTab.getCollectionView().getCurrentKm(),
120 20,
121 20
122 );
123 exportAT.setTooltip(MSG.exportATTooltip());
124 }
105 125
106 downloadPNG = new ImgLink( 126 downloadPNG = new ImgLink(
107 baseUrl + MSG.downloadPNG(), 127 baseUrl + MSG.downloadPNG(),
108 chartTab.getExportUrl(-1, -1, "png"), 128 chartTab.getExportUrl(-1, -1, "png"),
109 20, 129 20,
234 addMember(datacage); 254 addMember(datacage);
235 addMember(downloadPNG); 255 addMember(downloadPNG);
236 addMember(downloadPDF); 256 addMember(downloadPDF);
237 addMember(downloadSVG); 257 addMember(downloadSVG);
238 addMember(downloadCSV); 258 addMember(downloadCSV);
259 if (getChartOutputTab().getMode().getName().equals("fix_wq_curve")) {
260 addMember(exportAT);
261 }
239 addMember(zoomToMaxExtent); 262 addMember(zoomToMaxExtent);
240 addMember(historyBack); 263 addMember(historyBack);
241 addMember(zoomOut); 264 addMember(zoomOut);
242 addMember(zoombox); 265 addMember(zoombox);
243 addMember(panControl); 266 addMember(panControl);
290 } 313 }
291 314
292 public void deselectControls() { 315 public void deselectControls() {
293 zoombox.deselect(); 316 zoombox.deselect();
294 } 317 }
318
319 public void updateLinks() {
320 ChartOutputTab chartTab = getChartOutputTab();
321 String moduleUrl = GWT.getModuleBaseURL();
322 Config config = Config.getInstance();
323
324 if (chartTab.getMode().getName().equals("fix_wq_curve")) {
325 exportAT.setSource(
326 moduleUrl + "export" +
327 "?uuid=" + chartTab.getCollection().identifier() +
328 "&mode=" + chartTab.getMode().getName() + "_at_export" +
329 "&type=at" +
330 "&server=" + config.getServerUrl() +
331 "&locale=" + config.getLocale() +
332 "&km=" + chartTab.getCollectionView().getCurrentKm());
333 }
334 }
295 } 335 }
296 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 336 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org