annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 1364:9981ba2ee13a

Display the datacage button in the map toolbar. flys-client/trunk@3063 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 24 Oct 2011 13:35:30 +0000
parents 064fb5d181ea
children 748e7c828d03
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.FLYSImages;
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import de.intevation.flys.client.client.ui.CollectionView;
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
15 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
16 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
17
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 /**
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 * @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
21 */
1364
9981ba2ee13a Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1350
diff changeset
22 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
23
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 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
25
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
26 protected static FLYSImages IMG = GWT.create(FLYSImages.class);
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
27
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 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
30
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
32 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
33
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
35 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
36
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
37 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
38
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
39 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
40
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
41 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
42
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
43 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
44
540
a866cdf1ca40 Implemented a zoombox control and added it to the chart toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 539
diff changeset
45 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
46
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
47 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
48
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
49 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
50
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
51 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
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
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
56
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
57 public ChartToolbar(CollectionView view, 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());
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
68
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 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
70 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
71 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
72 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
73 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 });
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75
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
76 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
77
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
78 downloadPNG = new ImgLink(
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
79 IMG.downloadPNG().getURL(),
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
80 chartTab.getExportUrl(1280, 1024, "png"),
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
81 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
82 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
83
51d4b51a51ed Added icons to export chart as PNG, PDF and SVG to the ChartToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1281
diff changeset
84 downloadPDF = new ImgLink(
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 IMG.downloadPDF().getURL(),
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 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
87 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
88 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
89
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 downloadSVG = new ImgLink(
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 IMG.downloadSVG().getURL(),
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 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
93 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
94 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
95
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
96 zoomToMaxExtent.setSrc(baseUrl + MSG.zoom_all());
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
97 zoomToMaxExtent.setWidth(20);
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
98 zoomToMaxExtent.setHeight(20);
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
99 zoomToMaxExtent.setShowDown(false);
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
100 zoomToMaxExtent.setShowRollOver(false);
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
101 zoomToMaxExtent.setShowDisabled(false);
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
102 zoomToMaxExtent.setShowDisabledIcon(true);
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
103 zoomToMaxExtent.setShowDownIcon(false);
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.setShowFocusedIcon(false);
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
105 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
106 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
107 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
108 }
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
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
111 zoomOut.setSrc(baseUrl + MSG.zoom_out());
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.setWidth(20);
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
113 zoomOut.setHeight(20);
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.setShowDown(false);
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 zoomOut.setShowRollOver(false);
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
116 zoomOut.setShowDisabled(false);
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
117 zoomOut.setShowDisabledIcon(true);
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
118 zoomOut.setShowDownIcon(false);
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
119 zoomOut.setShowFocusedIcon(false);
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.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
121 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
122 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
123 }
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 });
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 historyBack.setSrc(baseUrl + MSG.zoom_back());
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 historyBack.setWidth(20);
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.setHeight(20);
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
129 historyBack.setShowDown(false);
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.setShowRollOver(false);
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 historyBack.setShowDisabled(false);
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
132 historyBack.setShowDisabledIcon(true);
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
133 historyBack.setShowDownIcon(false);
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
134 historyBack.setShowFocusedIcon(false);
4782c0ce9cec Re-added the function to zoom-out charts by a given factor (10%).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1280
diff changeset
135 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
136 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
137 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
138 }
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
139 });
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
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 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
142 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
143 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
144 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
145 }
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 });
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 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
149 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
150 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
151 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
152 }
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
153 });
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
154
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155 initLayout();
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158
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
159 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
160 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
161 }
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
162
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
163
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 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
165 setWidth100();
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 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
167 setMembersMargin(10);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
168 setPadding(5);
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169 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
170
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
171 Label spacer = new Label();
539
fea93eebd2fa Improved the layout of the mouse position panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 538
diff changeset
172 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
173 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
174 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
175
533
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 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
177 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
178 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
179 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
180 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
181 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
182 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
183 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
184 addMember(panControl);
534
e08777967bad Added a first implementation of a MousePositionPanel - work is not finished yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 533
diff changeset
185 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
186 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
187 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
188 }
34103ab9fe60 Moved the toolbar stuff of the chart panel into an own class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
189 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org