Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java @ 4215:c179cd02177d
Logout the current user
Add code to the logout button to remove the current user from the session and to
redirect the browser window to the login page.
Part of flys/issue916 (Logout: "Abmelden" Knopf mit Funktion belegen)
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Tue, 23 Oct 2012 09:59:16 +0200 |
parents | 61020a61ed38 |
children | c84630d544a1 |
rev | line source |
---|---|
832
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui.map; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.user.client.ui.HorizontalPanel; |
4064
61020a61ed38
Show river map only once.
Christian Lins <christian.lins@intevation.de>
parents:
3347
diff
changeset
|
4 |
832
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import com.smartgwt.client.widgets.Canvas; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import com.smartgwt.client.widgets.layout.VLayout; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.flys.client.shared.model.BBox; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.flys.client.shared.model.MapInfo; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
3347
6d749af6a9c2
Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents:
1389
diff
changeset
|
11 import org.gwtopenmaps.openlayers.client.Bounds; |
6d749af6a9c2
Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents:
1389
diff
changeset
|
12 |
832
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 public class MapPanel extends VLayout { |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 protected MapToolbar toolbar; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 protected HorizontalPanel mapArea; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 protected FloodMap floodMap; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 protected boolean digitizeEnabled; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 public MapPanel(MapInfo mapInfo, boolean digitizeEnabled) { |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 super(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 BBox bbox = mapInfo.getBBox(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 this.digitizeEnabled = digitizeEnabled; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 this.floodMap = new FloodMap( |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 String.valueOf(mapInfo.getSrid()), |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 new Bounds( |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 bbox.getLowerX(), |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 bbox.getLowerY(), |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 bbox.getUpperX(), |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 bbox.getUpperY())); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 initLayout(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 } |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 private void initLayout() { |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 setWidth100(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 setHeight100(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 mapArea = new HorizontalPanel(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 mapArea.setWidth("99%"); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 mapArea.setHeight("99%"); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 mapArea.add(floodMap.getMapWidget()); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 Canvas wrapper = new Canvas(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 wrapper.setWidth100(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 wrapper.setHeight100(); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 wrapper.addChild(mapArea); |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
1386 | 55 toolbar = new MapToolbar(floodMap, digitizeEnabled); |
832
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 addMember(toolbar); |
3347
6d749af6a9c2
Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents:
1389
diff
changeset
|
58 addMember(wrapper); |
832
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 } |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 public FloodMap getFloodMap() { |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 return floodMap; |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 } |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1386
diff
changeset
|
65 |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1386
diff
changeset
|
66 public MapToolbar getMapToolbar () { |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1386
diff
changeset
|
67 return toolbar; |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1386
diff
changeset
|
68 } |
832
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 } |
303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |