annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java @ 280:b493d606fdef

Enabled the client to request charts in different sizes. flys-client/trunk@1909 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 12 May 2011 09:14:46 +0000
parents f4c8ce11df33
children c271012a97a3
rev   line source
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
213
7ea004d0ffbc The ChartOutputTab calls the out() operation of a Collection now - no longer the out() of its first artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
3 import java.util.Date;
7ea004d0ffbc The ChartOutputTab calls the out() operation of a Collection now - no longer the out() of its first artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
4
78
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
5 import com.google.gwt.core.client.GWT;
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
6
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import com.smartgwt.client.widgets.Canvas;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import com.smartgwt.client.widgets.Img;
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
9 import com.smartgwt.client.widgets.Label;
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
10 import com.smartgwt.client.widgets.IButton;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
11
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import com.smartgwt.client.widgets.layout.HLayout;
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
13 import com.smartgwt.client.widgets.layout.VLayout;
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
15 import com.smartgwt.client.widgets.events.ClickEvent;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
16 import com.smartgwt.client.widgets.events.ClickHandler;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
17 import com.smartgwt.client.widgets.events.CloseClickHandler;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
18 import com.smartgwt.client.widgets.events.CloseClientEvent;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
19
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import de.intevation.flys.client.shared.model.Collection;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 import de.intevation.flys.client.shared.model.OutputMode;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import de.intevation.flys.client.client.Config;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
24 import de.intevation.flys.client.shared.model.Artifact;
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 */
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 public class ChartOutputTab extends OutputTab {
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
31 /** The canvas that wraps the chart toolbar.*/
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
32 protected Canvas tbarPanel;
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
33
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 /** The canvas that wraps the theme editor.*/
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 protected Canvas left;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 /** The canvas that wraps the chart.*/
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 protected Canvas right;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 * The default constructor to create a new ChartOutputTab.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 *
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 * @param title The title of this tab.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 * @param collection The Collection which this chart belongs to.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 * @param mode The OutputMode.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 */
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
48 public ChartOutputTab(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
49 String title,
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
50 Collection collection,
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
51 OutputMode mode,
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
52 CollectionView collectionView
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
53 ){
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 super(title, collection, mode);
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
56 tbarPanel = new Canvas();
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
57 left = new Canvas();
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
58 right = new Canvas();
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
60 tbarPanel.setBorder("1px solid black");
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
61 tbarPanel.setHeight(25);
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
62 left.setBorder("1px solid black");
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 left.setWidth("25%");
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 right.setWidth("*");
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
66 VLayout vLayout = new VLayout();
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
67 vLayout.setMembersMargin(2);
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
68
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 HLayout hLayout = new HLayout();
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 hLayout.setWidth100();
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 hLayout.setHeight100();
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 hLayout.setMembersMargin(10);
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 hLayout.addMember(left);
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 hLayout.addMember(right);
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
77 right.addChild(createChartPanel());
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
78 left.addChild(createThemeControlPanel());
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
79 tbarPanel.addChild(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
80 createTBarPanel(collectionView));
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
81
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
82 vLayout.addMember(tbarPanel);
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
83 vLayout.addMember(hLayout);
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
84
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
85 setPane(vLayout);
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
86 }
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
87
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
88
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
89 protected Canvas createTBarPanel(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
90 final CollectionView collectionView
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
91 ) {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
92 HLayout hLayout = new HLayout();
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
93 hLayout.setWidth100();
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
94 hLayout.setHeight100();
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
95 hLayout.setMembersMargin(10);
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
96
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
97 IButton datacage = new IButton("Datenkorb");
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
98 datacage.setHeight(25);
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
99 datacage.setMargin(5);
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
100
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
101 hLayout.addMember(datacage);
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
102 datacage.addClickHandler(new ClickHandler() {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
103 public void onClick(ClickEvent event) {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
104 GWT.log("Clicked 'datacage' button.");
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
105 openDatacageWindow(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
106 collectionView.getArtifact());
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
107 }
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
108 });
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
109
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
110 return hLayout;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
111 }
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
112
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
113 protected void openDatacageWindow(Artifact artifact) {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
114 final DatacageWindow dc = new DatacageWindow(artifact);
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
115 dc.addCloseClickHandler(new CloseClickHandler() {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
116 public void onCloseClick(CloseClientEvent event) {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
117 dc.destroy();
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
118 }
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
119 });
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
120 dc.show();
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
121 }
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
122
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
123
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
124 protected Canvas createChartPanel() {
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 Img chart = getChartImg();
78
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
126 chart.setWidth100();
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
127 chart.setHeight100();
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
129 return chart;
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
130 }
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131
267
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
132
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
133 protected Canvas createThemeControlPanel() {
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
134 Label label = new Label("Themensteuerung");
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
135 label.setHeight(25);
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
136 label.setMargin(5);
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
137
7e484390d191 ISSUE-48 Added placeholder for the toolbar and the theme control in the chart output tab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 254
diff changeset
138 return label;
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 * Builds the chart image and returns it.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 *
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145 * @return the chart image.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146 */
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 protected Img getChartImg() {
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
148 return new Img(getImgUrl());
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 * Builds the URL that points to the chart image.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154 *
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155 * @return the URL to the chart image.
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156 */
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157 protected String getImgUrl() {
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 Config config = Config.getInstance();
78
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
159
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
160 String imgUrl = GWT.getModuleBaseURL();
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
161 imgUrl += "chart";
213
7ea004d0ffbc The ChartOutputTab calls the out() operation of a Collection now - no longer the out() of its first artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
162 imgUrl += "?uuid=" + collection.identifier();
7ea004d0ffbc The ChartOutputTab calls the out() operation of a Collection now - no longer the out() of its first artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
163 imgUrl += "&type=" + mode.getName();
254
6838e4112eeb Bugfix: the current locale string is used to fetch chart images now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 213
diff changeset
164 imgUrl += "&server=" + config.getServerUrl();
6838e4112eeb Bugfix: the current locale string is used to fetch chart images now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 213
diff changeset
165 imgUrl += "&locale=" + config.getLocale();
213
7ea004d0ffbc The ChartOutputTab calls the out() operation of a Collection now - no longer the out() of its first artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
166 imgUrl += "&timestamp=" + new Date().getTime();
280
b493d606fdef Enabled the client to request charts in different sizes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 276
diff changeset
167 imgUrl += "&width=" + Integer.toString(600);
b493d606fdef Enabled the client to request charts in different sizes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 276
diff changeset
168 imgUrl += "&height=" + Integer.toString(500);
78
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
169
9ca5160cf080 Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 75
diff changeset
170 return imgUrl;
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
171 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
173 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org