Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java @ 78:9ca5160cf080
Added a service that builds up requests to retrieve chart images. Use this service to display charts in the ChartOutputTab.
flys-client/trunk@1584 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 28 Mar 2011 10:45:45 +0000 |
parents | 571843833129 |
children | d327cff11848 |
comparison
equal
deleted
inserted
replaced
77:5b5ec0403844 | 78:9ca5160cf080 |
---|---|
1 package de.intevation.flys.client.client.ui; | 1 package de.intevation.flys.client.client.ui; |
2 | |
3 import com.google.gwt.core.client.GWT; | |
2 | 4 |
3 import com.smartgwt.client.widgets.Canvas; | 5 import com.smartgwt.client.widgets.Canvas; |
4 import com.smartgwt.client.widgets.Img; | 6 import com.smartgwt.client.widgets.Img; |
5 import com.smartgwt.client.widgets.Label; | 7 import com.smartgwt.client.widgets.Label; |
6 import com.smartgwt.client.widgets.layout.HLayout; | 8 import com.smartgwt.client.widgets.layout.HLayout; |
46 hLayout.addMember(left); | 48 hLayout.addMember(left); |
47 hLayout.addMember(right); | 49 hLayout.addMember(right); |
48 | 50 |
49 Label todo = new Label("TODO: Implement theme editor."); | 51 Label todo = new Label("TODO: Implement theme editor."); |
50 Img chart = getChartImg(); | 52 Img chart = getChartImg(); |
53 chart.setWidth100(); | |
54 chart.setHeight100(); | |
51 | 55 |
52 left.addChild(todo); | 56 left.addChild(todo); |
53 right.addChild(chart); | 57 right.addChild(chart); |
54 | 58 |
55 setPane(hLayout); | 59 setPane(hLayout); |
72 * @return the URL to the chart image. | 76 * @return the URL to the chart image. |
73 */ | 77 */ |
74 protected String getImgUrl() { | 78 protected String getImgUrl() { |
75 Config config = Config.getInstance(); | 79 Config config = Config.getInstance(); |
76 String server = config.getServerUrl(); | 80 String server = config.getServerUrl(); |
81 String uuid = collection.getItem(0).identifier(); | |
82 | |
83 String imgUrl = GWT.getModuleBaseURL(); | |
84 imgUrl += "chart"; | |
85 imgUrl += "?target=chart"; | |
86 imgUrl += "&server=" + server; | |
87 imgUrl += "&mode=img"; | |
88 imgUrl += "&width=600"; | |
89 imgUrl += "&height=400"; | |
90 imgUrl += "&points=false"; | |
91 imgUrl += "&uuid=" + uuid; | |
92 imgUrl += "&hash=" + "TODO-HASH"; | |
93 | |
94 GWT.log("IMAGE URL = " + imgUrl); | |
77 | 95 |
78 // TODO Build the correct url that points to the OUT() resource of the | 96 // TODO Build the correct url that points to the OUT() resource of the |
79 // collection. | 97 // collection. |
80 return server; | 98 return imgUrl; |
81 } | 99 } |
82 } | 100 } |
83 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 101 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |