annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 1551:cfe88143ee89

Display edited manual points next time the point editor is opened. flys-client/trunk@3782 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 27 Jan 2012 09:38:13 +0000
parents 42f1213dfbcc
children eff394f9714a
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
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
39 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
40
540
a866cdf1ca40 Implemented a zoombox control and added it to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 539
diff changeset
41 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
42
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
43 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
44
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
45 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
46
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
47 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
48
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
49 protected ImgButton chartProperties;
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
50
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
51 protected Button addPoints;
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
52
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
53 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
54
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
55
1545
2f0150f21e77 Added basic UI to enter manual points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1541
diff changeset
56 /** @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
57 public ChartToolbar(ChartOutputTab chartTab) {
1364
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1350
diff changeset
58 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
59
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
60 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
61 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
62 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
63 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
64 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
65 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
66 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
67 panControl = new PanControl(chartTab, MSG.pan());
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
68 chartProperties = new ImgButton();
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
69 addPoints = new Button("Points");
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
70
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
71 addPoints.addClickHandler(new ClickHandler() {
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
72 public void onClick(ClickEvent event) {
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
73 openPointWindow();
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
74 }
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
75 });
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
76
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 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
78 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
79 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
80 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
81 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 });
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
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
84 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
85
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
86 downloadPNG = new ImgLink(
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1364
diff changeset
87 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
88 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
89 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
90 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
91
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 downloadPDF = new ImgLink(
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1364
diff changeset
93 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
94 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
95 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
96 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
97
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 downloadSVG = new ImgLink(
1399
748e7c828d03 Issue312.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1364
diff changeset
99 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
100 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
101 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
102 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
103
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
104 zoomToMaxExtent.setSrc(baseUrl + MSG.zoom_all());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
105 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
106 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
107 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
108 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
109 }
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
110 });
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
111
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
112 zoomOut.setSrc(baseUrl + MSG.zoom_out());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
113 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
114 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
115 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
116 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
117 }
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
118 });
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
119
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
120 historyBack.setSrc(baseUrl + MSG.zoom_back());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
121 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
122 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
123 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
124 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
125 }
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
126 });
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
127
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
128 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
129 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
130 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
131 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
132 }
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
133 });
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
134
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
135 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
136 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
137 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
138 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
139 }
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 });
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
141
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
142 chartProperties.setSrc(baseUrl + MSG.properties_ico());
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
143 adjustImageButton(chartProperties);
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
144 chartProperties.addClickHandler(new ClickHandler() {
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
145 public void onClick(ClickEvent event) {
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
146 openPropertiesEditor();
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
147 }
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
148 });
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
149
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
150
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 initLayout();
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
154 /** 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
155 public void adjustImageButton(ImgButton imgButton) {
1540
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
156 imgButton.setWidth(20);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
157 imgButton.setHeight(20);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
158 imgButton.setShowDown(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
159 imgButton.setShowRollOver(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
160 imgButton.setShowDisabled(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
161 imgButton.setShowDisabledIcon(true);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
162 imgButton.setShowDownIcon(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
163 imgButton.setShowFocusedIcon(false);
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
164 }
cd88a257a5e6 Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1484
diff changeset
165
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166
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
167 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
168 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
169 }
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
170
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
171
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172 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
173 setWidth100();
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
174 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
175 setMembersMargin(10);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 setPadding(5);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 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
178
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
179 Label spacer = new Label();
539
fea93eebd2fa Improved the layout of the mouse position panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
180 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
181 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
182 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
183
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
184 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
185 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
186 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
187 addMember(downloadSVG);
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
188 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
189 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
190 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
191 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
192 addMember(panControl);
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
193 addMember(chartProperties);
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
194 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
195 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
196 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
197 }
1429
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
198
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
199 /**
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
200 * Open the chart property editor dialog.
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
201 */
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
202 protected void openPropertiesEditor() {
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
203 ChartPropertiesEditor editor =
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
204 new ChartPropertiesEditor(getChartOutputTab());
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
205 editor.show();
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
206 }
16b7adc66330 Added stub for chart property editor.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1401
diff changeset
207
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
208
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
209 /** Open editor for custom points. */
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
210 protected void openPointWindow() {
1551
cfe88143ee89 Display edited manual points next time the point editor is opened.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1549
diff changeset
211 new ManualPointsEditor(chartTab.getCollection(),
1549
42f1213dfbcc Let ManualPointEditor use RedrawRequests to let freshly edited points show up in Chart.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1548
diff changeset
212 this.chartTab).show();
1541
959e1d0df941 Fixed typo, more stub for add points ui.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1540
diff changeset
213 }
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
214 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
215 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org