diff 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
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Thu Aug 16 16:38:21 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Fri Aug 17 11:18:15 2012 +0000
@@ -8,6 +8,7 @@
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
 
+import de.intevation.flys.client.client.Config;
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.event.ZoomEvent;
 import de.intevation.flys.client.client.event.ZoomHandler;
@@ -41,6 +42,7 @@
     protected ImgButton chartProperties;
     protected Button addPoints;
     protected Button addWSP;
+    protected ImgLink exportAT;
     protected PanControl panControl;
 
 
@@ -102,6 +104,24 @@
         });
 
         String baseUrl = GWT.getHostPageBaseURL();
+        String moduleUrl = GWT.getModuleBaseURL();
+        Config config = Config.getInstance();
+
+        if (chartTab.getMode().getName().equals("fix_wq_curve")) {
+            exportAT = new ImgLink(
+                baseUrl + MSG.downloadCSV(),
+                moduleUrl + "export" +
+                   "?uuid=" + chartTab.getCollection().identifier() +
+                   "&mode=" + chartTab.getMode().getName() + "_at_export" +
+                   "&type=at" +
+                   "&server=" + config.getServerUrl() +
+                   "&locale=" + config.getLocale() +
+                   "&km=" + chartTab.getCollectionView().getCurrentKm(),
+                20,
+                20
+            );
+            exportAT.setTooltip(MSG.exportATTooltip());
+        }
 
         downloadPNG = new ImgLink(
             baseUrl + MSG.downloadPNG(),
@@ -236,6 +256,9 @@
         addMember(downloadPDF);
         addMember(downloadSVG);
         addMember(downloadCSV);
+        if (getChartOutputTab().getMode().getName().equals("fix_wq_curve")) {
+            addMember(exportAT);
+        }
         addMember(zoomToMaxExtent);
         addMember(historyBack);
         addMember(zoomOut);
@@ -292,5 +315,22 @@
     public void deselectControls() {
         zoombox.deselect();
     }
+
+    public void updateLinks() {
+        ChartOutputTab chartTab = getChartOutputTab();
+        String moduleUrl = GWT.getModuleBaseURL();
+        Config config = Config.getInstance();
+
+        if (chartTab.getMode().getName().equals("fix_wq_curve")) {
+            exportAT.setSource(
+                   moduleUrl + "export" +
+                   "?uuid=" + chartTab.getCollection().identifier() +
+                   "&mode=" + chartTab.getMode().getName() + "_at_export" +
+                   "&type=at" +
+                   "&server=" + config.getServerUrl() +
+                   "&locale=" + config.getLocale() +
+                   "&km=" + chartTab.getCollectionView().getCurrentKm());
+        }
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org