annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 1587:45cd2364adad

Issue 466. CSV export for activated chart themes. flys-client/trunk@3875 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 02 Feb 2012 11:14:40 +0000
parents 2432973ccced
children 3c8ae5605a51
rev   line source
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui.chart;
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import com.google.gwt.core.client.GWT;
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 import com.smartgwt.client.widgets.Button;
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
6 import com.smartgwt.client.widgets.Canvas;
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
7 import com.smartgwt.client.widgets.ImgButton;
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
8 import com.smartgwt.client.widgets.Label;
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import com.smartgwt.client.widgets.events.ClickEvent;
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import com.smartgwt.client.widgets.events.ClickHandler;
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import de.intevation.flys.client.client.FLYSConstants;
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
13 import de.intevation.flys.client.client.ui.ImgLink;
1364
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1350
diff changeset
14 import de.intevation.flys.client.client.ui.Toolbar;
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 /**
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
18 * Toolbar with buttons/icons to open datacage, switch to zoom mode, zoom out
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
19 * etc.
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
20 *
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 */
1364
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1350
diff changeset
23 public class ChartToolbar extends Toolbar {
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 protected static FLYSConstants MSG = GWT.create(FLYSConstants.class);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 public static final int PANEL_HEIGHT = 30;
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
29 protected ChartOutputTab chartTab;
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
31 protected Button datacage;
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
32
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
33 protected Canvas downloadPNG;
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
34
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
35 protected Canvas downloadPDF;
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
36
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
37 protected Canvas downloadSVG;
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
38
1587
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
39 protected Canvas downloadCSV;
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
40
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
41 protected MousePositionPanel position;
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
42
540
a866cdf1ca40 Implemented a zoombox control and added it to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 539
diff changeset
43 protected ZoomboxControl zoombox;
a866cdf1ca40 Implemented a zoombox control and added it to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 539
diff changeset
44
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
45 protected ImgButton zoomToMaxExtent;
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
46
1281
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
47 protected ImgButton historyBack;
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
48
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
49 protected ImgButton zoomOut;
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
50
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
51 protected ImgButton chartProperties;
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
52
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
53 protected Button addPoints;
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
54
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
55 protected PanControl panControl;
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
56
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
57
1545
2f0150f21e77 Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1541
diff changeset
58 /** @param chartTab Output-Tab on which this toolbar is located. */
2f0150f21e77 Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1541
diff changeset
59 public ChartToolbar(ChartOutputTab chartTab) {
1364
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1350
diff changeset
60 super(chartTab);
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
62 this.chartTab = chartTab;
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
63 datacage = new Button(MSG.databasket());
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
64 position = new MousePositionPanel(chartTab);
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
65 zoombox = new ZoomboxControl(chartTab, MSG.zoom_in());
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
66 zoomToMaxExtent = new ImgButton();
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
67 zoomOut = new ImgButton();
1281
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
68 historyBack = new ImgButton();
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
69 panControl = new PanControl(chartTab, MSG.pan());
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
70 chartProperties = new ImgButton();
1558
eff394f9714a Fix i18n issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1551
diff changeset
71 addPoints = new Button(MSG.points());
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
72
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
73 addPoints.addClickHandler(new ClickHandler() {
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
74 public void onClick(ClickEvent event) {
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
75 openPointWindow();
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
76 }
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
77 });
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
78
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 datacage.addClickHandler(new ClickHandler() {
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 public void onClick(ClickEvent event) {
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 GWT.log("Clicked 'datacage' button.");
1364
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1350
diff changeset
82 openDatacageWindow((ChartOutputTab) getOutputTab());
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 });
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
86 String baseUrl = GWT.getHostPageBaseURL();
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
87
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
88 downloadPNG = new ImgLink(
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1364
diff changeset
89 baseUrl + MSG.downloadPNG(),
1484
cb5ab84505b7 Set the chart export size to -1, so that the FLYS server is able to distinguish between an export and the query to display a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1429
diff changeset
90 chartTab.getExportUrl(-1, -1, "png"),
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
91 20,
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
92 20);
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
93
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
94 downloadPDF = new ImgLink(
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1364
diff changeset
95 baseUrl + MSG.downloadPDF(),
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
96 chartTab.getExportUrl(1280, 1024, "pdf"),
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
97 20,
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
98 20);
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
99
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
100 downloadSVG = new ImgLink(
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1364
diff changeset
101 baseUrl + MSG.downloadSVG(),
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
102 chartTab.getExportUrl(1280, 1024, "svg"),
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
103 20,
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
104 20);
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
105
1587
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
106 downloadCSV = new ImgLink(
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
107 baseUrl + MSG.downloadCSV(),
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
108 chartTab.getExportUrl(-1, -1, "csv"),
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
109 20,
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
110 20);
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
111
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
112 zoomToMaxExtent.setSrc(baseUrl + MSG.zoom_all());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
113 adjustImageButton(zoomToMaxExtent);
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
114 zoomToMaxExtent.addClickHandler(new ClickHandler() {
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
115 public void onClick(ClickEvent event) {
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
116 getChartOutputTab().resetRanges();
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
117 }
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
118 });
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
119
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
120 zoomOut.setSrc(baseUrl + MSG.zoom_out());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
121 adjustImageButton(zoomOut);
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
122 zoomOut.addClickHandler(new ClickHandler() {
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
123 public void onClick(ClickEvent event) {
1281
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
124 getChartOutputTab().zoomOut(10);
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
125 }
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
126 });
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
127
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
128 historyBack.setSrc(baseUrl + MSG.zoom_back());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
129 adjustImageButton(historyBack);
1281
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
130 historyBack.addClickHandler(new ClickHandler() {
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
131 public void onClick(ClickEvent event) {
1280
66192d170c79 Bugfix: #179 and #198 Zoom-out will no longer work with a factor but with stacked chart extents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 911
diff changeset
132 getChartOutputTab().zoomOut();
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
133 }
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
134 });
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
135
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 540
diff changeset
136 zoombox.addZoomHandler(chartTab);
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
137 zoombox.addClickHandler(new ClickHandler() {
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
138 public void onClick(ClickEvent event) {
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
139 panControl.deselect();
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
140 }
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
141 });
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
142
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
143 panControl.addPanHandler(chartTab);
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
144 panControl.addClickHandler(new ClickHandler() {
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
145 public void onClick(ClickEvent event) {
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
146 zoombox.deselect();
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
147 }
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
148 });
541
ed29599e06e5 Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 540
diff changeset
149
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
150 chartProperties.setSrc(baseUrl + MSG.properties_ico());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
151 adjustImageButton(chartProperties);
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
152 chartProperties.addClickHandler(new ClickHandler() {
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
153 public void onClick(ClickEvent event) {
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
154 openPropertiesEditor();
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
155 }
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
156 });
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
157
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
158
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159 initLayout();
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
160 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
162 /** Set width, height and other properties of an imagebutton. */
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
163 public void adjustImageButton(ImgButton imgButton) {
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
164 imgButton.setWidth(20);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
165 imgButton.setHeight(20);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
166 imgButton.setShowDown(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
167 imgButton.setShowRollOver(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
168 imgButton.setShowDisabled(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
169 imgButton.setShowDisabledIcon(true);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
170 imgButton.setShowDownIcon(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
171 imgButton.setShowFocusedIcon(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
172 }
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
173
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
174
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
175 public ChartOutputTab getChartOutputTab() {
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
176 return chartTab;
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
177 }
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
178
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
179
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
180 protected void initLayout() {
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
181 setWidth100();
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182 setHeight(PANEL_HEIGHT);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
183 setMembersMargin(10);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
184 setPadding(5);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
185 setBorder("1px solid black");
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
187 Label spacer = new Label();
539
fea93eebd2fa Improved the layout of the mouse position panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
188 spacer.setWidth("*");
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
189 datacage.setWidth("95px");
538
75df57220104 Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 534
diff changeset
190 position.setWidth("200px");
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
191
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
192 addMember(datacage);
1344
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
193 addMember(downloadPNG);
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
194 addMember(downloadPDF);
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
195 addMember(downloadSVG);
1587
45cd2364adad Issue 466.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1568
diff changeset
196 addMember(downloadCSV);
543
9c2cf4811a7d Added a control to reset the zoom of a chart. In addition, the zoom buttons are displayed as ImgButtons now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 541
diff changeset
197 addMember(zoomToMaxExtent);
1281
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
198 addMember(historyBack);
544
0f4095a522ab Added a zoom-out control to the chart toolbar which zooms 10% of the current ranges out.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 543
diff changeset
199 addMember(zoomOut);
540
a866cdf1ca40 Implemented a zoombox control and added it to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 539
diff changeset
200 addMember(zoombox);
552
6050d49eaba3 Adapted the ChartInfoService to return more information about charts than before. In addition, the PanControl is added to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 544
diff changeset
201 addMember(panControl);
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
202 addMember(chartProperties);
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
203 addMember(addPoints);
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
204 addMember(spacer);
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
205 addMember(position);
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
206 }
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
207
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
208 /**
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
209 * Open the chart property editor dialog.
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
210 */
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
211 protected void openPropertiesEditor() {
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
212 ChartPropertiesEditor editor =
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
213 new ChartPropertiesEditor(getChartOutputTab());
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
214 editor.show();
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
215 }
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
216
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
217
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
218 /** Open editor for custom points. */
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
219 protected void openPointWindow() {
1558
eff394f9714a Fix i18n issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1551
diff changeset
220 new ManualPointsEditor(chartTab.getView().getCollection(),
1568
2432973ccced Handle manual points on a per-chart(type) basis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1558
diff changeset
221 this.chartTab, this.chartTab.getMode().getName()).show();
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
222 }
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
223 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org