Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 2391:3c8ae5605a51
Picked rev 4059,4071,4072,4073 from trunk.
flys-client/tags/2.6.1@4079 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 17 Feb 2012 11:33:03 +0000 |
parents | 45cd2364adad |
children | 0235cdb62c98 |
comparison
equal
deleted
inserted
replaced
2390:39955a31f090 | 2391:3c8ae5605a51 |
---|---|
8 import com.smartgwt.client.widgets.Label; | 8 import com.smartgwt.client.widgets.Label; |
9 import com.smartgwt.client.widgets.events.ClickEvent; | 9 import com.smartgwt.client.widgets.events.ClickEvent; |
10 import com.smartgwt.client.widgets.events.ClickHandler; | 10 import com.smartgwt.client.widgets.events.ClickHandler; |
11 | 11 |
12 import de.intevation.flys.client.client.FLYSConstants; | 12 import de.intevation.flys.client.client.FLYSConstants; |
13 import de.intevation.flys.client.client.event.ZoomEvent; | |
14 import de.intevation.flys.client.client.event.ZoomHandler; | |
13 import de.intevation.flys.client.client.ui.ImgLink; | 15 import de.intevation.flys.client.client.ui.ImgLink; |
14 import de.intevation.flys.client.client.ui.Toolbar; | 16 import de.intevation.flys.client.client.ui.Toolbar; |
15 | 17 |
16 | 18 |
17 /** | 19 /** |
18 * Toolbar with buttons/icons to open datacage, switch to zoom mode, zoom out | 20 * Toolbar with buttons/icons to open datacage, switch to zoom mode, zoom out |
19 * etc. | 21 * etc. |
20 * | 22 * |
21 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 23 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
22 */ | 24 */ |
23 public class ChartToolbar extends Toolbar { | 25 public class ChartToolbar extends Toolbar implements ZoomHandler { |
24 | 26 |
25 protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); | 27 protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); |
26 | 28 |
27 public static final int PANEL_HEIGHT = 30; | 29 public static final int PANEL_HEIGHT = 30; |
28 | 30 |
29 protected ChartOutputTab chartTab; | 31 protected ChartOutputTab chartTab; |
30 | 32 |
31 protected Button datacage; | 33 protected Button datacage; |
32 | 34 |
33 protected Canvas downloadPNG; | 35 protected ImgLink downloadPNG; |
34 | 36 |
35 protected Canvas downloadPDF; | 37 protected ImgLink downloadPDF; |
36 | 38 |
37 protected Canvas downloadSVG; | 39 protected ImgLink downloadSVG; |
38 | 40 |
39 protected Canvas downloadCSV; | 41 protected Canvas downloadCSV; |
40 | 42 |
41 protected MousePositionPanel position; | 43 protected MousePositionPanel position; |
42 | 44 |
132 getChartOutputTab().zoomOut(); | 134 getChartOutputTab().zoomOut(); |
133 } | 135 } |
134 }); | 136 }); |
135 | 137 |
136 zoombox.addZoomHandler(chartTab); | 138 zoombox.addZoomHandler(chartTab); |
139 zoombox.addZoomHandler(this); | |
137 zoombox.addClickHandler(new ClickHandler() { | 140 zoombox.addClickHandler(new ClickHandler() { |
138 public void onClick(ClickEvent event) { | 141 public void onClick(ClickEvent event) { |
139 panControl.deselect(); | 142 panControl.deselect(); |
140 } | 143 } |
141 }); | 144 }); |
218 /** Open editor for custom points. */ | 221 /** Open editor for custom points. */ |
219 protected void openPointWindow() { | 222 protected void openPointWindow() { |
220 new ManualPointsEditor(chartTab.getView().getCollection(), | 223 new ManualPointsEditor(chartTab.getView().getCollection(), |
221 this.chartTab, this.chartTab.getMode().getName()).show(); | 224 this.chartTab, this.chartTab.getMode().getName()).show(); |
222 } | 225 } |
226 | |
227 | |
228 public void onZoom(ZoomEvent evt) { | |
229 downloadPNG.setSource(chartTab.getExportUrl(-1, -1, "png")); | |
230 downloadPDF.setSource(chartTab.getExportUrl(-1, -1, "pdf")); | |
231 downloadSVG.setSource(chartTab.getExportUrl(-1, -1, "svg")); | |
232 } | |
223 } | 233 } |
224 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 234 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |