annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java @ 285:3e99953bac8d

ISSUE 61: Changed datacage button style. flys-client/trunk@1914 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 May 2011 16:47:23 +0000
parents c271012a97a3
children
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
285
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
7 import com.smartgwt.client.types.Alignment;
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
8
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 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
10 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
11 import com.smartgwt.client.widgets.Label;
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
12 import com.smartgwt.client.widgets.IButton;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
13
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 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
15 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
16
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
17 import com.smartgwt.client.widgets.events.ClickEvent;
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
18 import com.smartgwt.client.widgets.events.ClickHandler;
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
19 import com.smartgwt.client.widgets.events.CloseClickHandler;
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
20 import com.smartgwt.client.widgets.events.CloseClientEvent;
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
21 import com.smartgwt.client.widgets.events.ResizedEvent;
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
22 import com.smartgwt.client.widgets.events.ResizedHandler;
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
23
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 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
25 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
26 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
27
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
28 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
29
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 * @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
32 */
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
33 public class ChartOutputTab extends OutputTab implements ResizedHandler {
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
34
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
35 public static final int DEFAULT_CHART_WIDTH = 600;
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
36 public static final int DEFAULT_CHART_HEIGHT = 500;
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
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
38 /** 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
39 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
40
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 /** 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
42 protected Canvas left;
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 /** 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
45 protected Canvas right;
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 * 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
50 *
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 * @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
52 * @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
53 * @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
54 */
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
55 public ChartOutputTab(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
56 String title,
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
57 Collection collection,
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
58 OutputMode mode,
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
59 CollectionView collectionView
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
60 ){
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 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
62
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
63 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
64 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
65 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
66
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
67 tbarPanel.setBorder("1px solid black");
285
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
68 tbarPanel.setHeight(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
69 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
70 left.setWidth("25%");
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 right.setWidth("*");
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72
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
73 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
74 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
75
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 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
77 hLayout.setWidth100();
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 hLayout.setHeight100();
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 hLayout.setMembersMargin(10);
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 hLayout.addMember(left);
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 hLayout.addMember(right);
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
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
84 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
85 left.addChild(createThemeControlPanel());
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
86 tbarPanel.addChild(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
87 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
88
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
89 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
90 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
91
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
92 setPane(vLayout);
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
93
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
94 right.addResizedHandler(this);
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
95 }
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
96
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
97
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
98 /**
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
99 * This method is called after the chart panel has resized. It removes the
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
100 * chart - if existing - and requests a new one with adjusted size.
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
101 *
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
102 * @param event The resize event.
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
103 */
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
104 public void onResized(ResizedEvent event) {
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
105 Canvas[] children = right.getChildren();
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
106 for (Canvas child: children) {
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
107 right.removeChild(child);
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
108 }
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
109
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
110 right.addChild(createChartPanel(right.getWidth(), right.getHeight()));
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
111 }
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
112
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
113
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
114 protected Canvas createTBarPanel(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
115 final CollectionView collectionView
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
116 ) {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
117 HLayout hLayout = new HLayout();
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
118 hLayout.setWidth100();
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
119 hLayout.setHeight100();
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
120 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
121
285
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
122 Label datacage = new Label("Datenkorb");
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
123 datacage.setHeight(20);
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
124 datacage.setBackgroundColor("#BED730");
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
125 datacage.setBorder("1px solid black");
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
126 datacage.setAlign(Alignment.CENTER);
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
127
285
3e99953bac8d ISSUE 61: Changed datacage button style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 281
diff changeset
128 hLayout.setMargin(5);
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
129 hLayout.addMember(datacage);
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
130 datacage.addClickHandler(new ClickHandler() {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
131 public void onClick(ClickEvent event) {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
132 GWT.log("Clicked 'datacage' button.");
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
133 openDatacageWindow(
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
134 collectionView.getArtifact());
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
135 }
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
136 });
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
137
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
138 return hLayout;
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
139 }
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
140
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
141 protected void openDatacageWindow(Artifact artifact) {
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
142 final DatacageWindow dc = new DatacageWindow(artifact);
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
143 dc.addCloseClickHandler(new CloseClickHandler() {
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
144 public void onCloseClick(CloseClientEvent event) {
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
145 dc.destroy();
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
146 }
276
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
147 });
f4c8ce11df33 UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 267
diff changeset
148 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
149 }
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
150
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
151
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
152 protected Canvas createChartPanel() {
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
153 return createChartPanel(DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
154 }
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
155
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
156
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
157 protected Canvas createChartPanel(int width, int height) {
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
158 Img chart = getChartImg(width, height);
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 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
160 chart.setHeight100();
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161
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
162 return chart;
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
163
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
164 }
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
165
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
166
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
167 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
168 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
169 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
170 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
171
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
172 return label;
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
173 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
174
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 * 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
178 *
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
179 * @param width The chart width.
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
180 * @param height The chart height.
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
181 *
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182 * @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
183 */
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
184 protected Img getChartImg(int width, int height) {
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
185 return new Img(getImgUrl(width, height));
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
187
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
188
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
189 /**
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
190 * 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
191 *
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
192 * @param width The width of the requested chart.
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
193 * @param height The height of the requested chart.
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
194 *
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
195 * @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
196 */
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
197 protected String getImgUrl(int width, int height) {
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
198 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
199
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
200 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
201 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
202 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
203 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
204 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
205 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
206 imgUrl += "&timestamp=" + new Date().getTime();
281
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
207 imgUrl += "&width=" + Integer.toString(width);
c271012a97a3 ISSUE-15 The charts in the chart panel are requested with the size of the parent panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 280
diff changeset
208 imgUrl += "&height=" + Integer.toString(height);
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
209
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
210 return imgUrl;
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
211 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
212 }
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
213 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org