diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 1344:51d4b51a51ed

Added icons to export chart as PNG, PDF and SVG to the ChartToolbar. flys-client/trunk@2998 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 17 Oct 2011 17:33:27 +0000
parents 4782c0ce9cec
children 064fb5d181ea
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Mon Oct 17 17:28:24 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Mon Oct 17 17:33:27 2011 +0000
@@ -3,6 +3,7 @@
 import com.google.gwt.core.client.GWT;
 
 import com.smartgwt.client.widgets.Button;
+import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.ImgButton;
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.layout.HLayout;
@@ -15,8 +16,10 @@
 import de.intevation.flys.client.shared.model.User;
 
 import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.FLYSImages;
 import de.intevation.flys.client.client.ui.CollectionView;
 import de.intevation.flys.client.client.ui.DatacageWindow;
+import de.intevation.flys.client.client.ui.ImgLink;
 
 
 /**
@@ -26,6 +29,8 @@
 
     protected static FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
+    protected static FLYSImages IMG = GWT.create(FLYSImages.class);
+
 
     public static final int PANEL_HEIGHT = 30;
 
@@ -37,6 +42,12 @@
 
     protected Button datacage;
 
+    protected Canvas downloadPNG;
+
+    protected Canvas downloadPDF;
+
+    protected Canvas downloadSVG;
+
     protected MousePositionPanel position;
 
     protected ZoomboxControl zoombox;
@@ -73,6 +84,26 @@
         });
 
         String baseUrl = GWT.getHostPageBaseURL();
+
+        String url = "http://www.heise.de";
+        downloadPNG = new ImgLink(
+            IMG.downloadPNG().getURL(),
+            chartTab.getExportUrl(1280, 1024, "png"),
+            20,
+            20);
+
+        downloadPDF = new ImgLink(
+            IMG.downloadPDF().getURL(),
+            chartTab.getExportUrl(1280, 1024, "pdf"),
+            20,
+            20);
+
+        downloadSVG = new ImgLink(
+            IMG.downloadSVG().getURL(),
+            chartTab.getExportUrl(1280, 1024, "svg"),
+            20,
+            20);
+
         zoomToMaxExtent.setSrc(baseUrl + MSG.zoom_all());
         zoomToMaxExtent.setWidth(20);
         zoomToMaxExtent.setHeight(20);
@@ -163,6 +194,9 @@
         position.setWidth("200px");
 
         addMember(datacage);
+        addMember(downloadPNG);
+        addMember(downloadPDF);
+        addMember(downloadSVG);
         addMember(zoomToMaxExtent);
         addMember(historyBack);
         addMember(zoomOut);

http://dive4elements.wald.intevation.org