Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java @ 75:571843833129
Added a panel that will be used to display chart output.
flys-client/trunk@1578 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 28 Mar 2011 07:55:39 +0000 |
parents | |
children | 9ca5160cf080 |
comparison
equal
deleted
inserted
replaced
74:c5586446f3c0 | 75:571843833129 |
---|---|
1 package de.intevation.flys.client.client.ui; | |
2 | |
3 import com.smartgwt.client.widgets.Canvas; | |
4 import com.smartgwt.client.widgets.Img; | |
5 import com.smartgwt.client.widgets.Label; | |
6 import com.smartgwt.client.widgets.layout.HLayout; | |
7 | |
8 import de.intevation.flys.client.shared.model.Collection; | |
9 import de.intevation.flys.client.shared.model.OutputMode; | |
10 import de.intevation.flys.client.client.Config; | |
11 | |
12 | |
13 /** | |
14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
15 */ | |
16 public class ChartOutputTab extends OutputTab { | |
17 | |
18 /** The canvas that wraps the theme editor.*/ | |
19 protected Canvas left; | |
20 | |
21 /** The canvas that wraps the chart.*/ | |
22 protected Canvas right; | |
23 | |
24 | |
25 /** | |
26 * The default constructor to create a new ChartOutputTab. | |
27 * | |
28 * @param title The title of this tab. | |
29 * @param collection The Collection which this chart belongs to. | |
30 * @param mode The OutputMode. | |
31 */ | |
32 public ChartOutputTab(String title, Collection collection, OutputMode mode){ | |
33 super(title, collection, mode); | |
34 | |
35 left = new Canvas(); | |
36 right = new Canvas(); | |
37 | |
38 left.setWidth("25%"); | |
39 right.setWidth("*"); | |
40 | |
41 HLayout hLayout = new HLayout(); | |
42 hLayout.setWidth100(); | |
43 hLayout.setHeight100(); | |
44 hLayout.setMembersMargin(10); | |
45 | |
46 hLayout.addMember(left); | |
47 hLayout.addMember(right); | |
48 | |
49 Label todo = new Label("TODO: Implement theme editor."); | |
50 Img chart = getChartImg(); | |
51 | |
52 left.addChild(todo); | |
53 right.addChild(chart); | |
54 | |
55 setPane(hLayout); | |
56 } | |
57 | |
58 | |
59 /** | |
60 * Builds the chart image and returns it. | |
61 * | |
62 * @return the chart image. | |
63 */ | |
64 protected Img getChartImg() { | |
65 return new Img(getImgUrl()); | |
66 } | |
67 | |
68 | |
69 /** | |
70 * Builds the URL that points to the chart image. | |
71 * | |
72 * @return the URL to the chart image. | |
73 */ | |
74 protected String getImgUrl() { | |
75 Config config = Config.getInstance(); | |
76 String server = config.getServerUrl(); | |
77 | |
78 // TODO Build the correct url that points to the OUT() resource of the | |
79 // collection. | |
80 return server; | |
81 } | |
82 } | |
83 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |