Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java @ 282:e92f7ef455d6
Show rivers as links instead of a combobox.
flys-client/trunk@1911 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 May 2011 14:59:18 +0000 |
parents | c271012a97a3 |
children | 3e99953bac8d |
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 |
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
|
15 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
|
16 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
|
17 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
|
18 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
|
19 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
|
20 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
|
21 |
75
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.shared.model.Collection; |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 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
|
24 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
|
25 |
276
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
26 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
|
27 |
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 * @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
|
30 */ |
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
|
31 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
|
32 |
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 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
|
34 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
|
35 |
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
|
36 /** 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
|
37 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
|
38 |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 /** 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
|
40 protected Canvas left; |
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 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
|
43 protected Canvas right; |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
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 * 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
|
48 * |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 * @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
|
50 * @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
|
51 * @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
|
52 */ |
276
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
53 public ChartOutputTab( |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
54 String title, |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
55 Collection collection, |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
56 OutputMode mode, |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
57 CollectionView collectionView |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
58 ){ |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 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
|
60 |
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
|
61 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
|
62 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
|
63 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
|
64 |
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
|
65 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
|
66 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
|
67 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
|
68 left.setWidth("25%"); |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 right.setWidth("*"); |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 |
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
|
71 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
|
72 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
|
73 |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 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
|
75 hLayout.setWidth100(); |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 hLayout.setHeight100(); |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 hLayout.setMembersMargin(10); |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 hLayout.addMember(left); |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 hLayout.addMember(right); |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
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
|
82 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
|
83 left.addChild(createThemeControlPanel()); |
276
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
84 tbarPanel.addChild( |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
85 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
|
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 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
|
88 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
|
89 |
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 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
|
91 |
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
|
92 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
|
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 |
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 * 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
|
98 * 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
|
99 * |
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 * @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
|
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 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
|
103 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
|
104 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
|
105 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
|
106 } |
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 |
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 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
|
109 } |
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
|
110 |
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 |
276
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
112 protected Canvas createTBarPanel( |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
113 final CollectionView collectionView |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
114 ) { |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
115 HLayout hLayout = new HLayout(); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
116 hLayout.setWidth100(); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
117 hLayout.setHeight100(); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
118 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
|
119 |
276
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
120 IButton datacage = new IButton("Datenkorb"); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
121 datacage.setHeight(25); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
122 datacage.setMargin(5); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
123 |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
124 hLayout.addMember(datacage); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
125 datacage.addClickHandler(new ClickHandler() { |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
126 public void onClick(ClickEvent event) { |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
127 GWT.log("Clicked 'datacage' button."); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
128 openDatacageWindow( |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
129 collectionView.getArtifact()); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
130 } |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
131 }); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
132 |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
133 return hLayout; |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
134 } |
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 protected void openDatacageWindow(Artifact artifact) { |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
137 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
|
138 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
|
139 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
|
140 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
|
141 } |
276
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
142 }); |
f4c8ce11df33
UI stub for data cage
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
267
diff
changeset
|
143 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
|
144 } |
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
|
145 |
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
|
146 |
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
|
147 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
|
148 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
|
149 } |
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
|
150 |
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
|
151 |
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
|
152 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
|
153 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
|
154 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
|
155 chart.setHeight100(); |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 |
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
|
157 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
|
158 |
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
|
159 } |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 |
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
|
161 |
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 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
|
163 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
|
164 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
|
165 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
|
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 return label; |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 } |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 |
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 * 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
|
173 * |
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
|
174 * @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
|
175 * @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
|
176 * |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 * @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
|
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 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
|
180 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
|
181 } |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 /** |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 * 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
|
186 * |
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
|
187 * @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
|
188 * @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
|
189 * |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 * @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
|
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 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
|
193 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
|
194 |
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
|
195 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
|
196 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
|
197 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
|
198 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
|
199 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
|
200 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
|
201 imgUrl += "×tamp=" + 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
|
202 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
|
203 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
|
204 |
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
|
205 return imgUrl; |
75
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 } |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 } |
571843833129
Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |