Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapToolbar.java @ 9701:0caaca0df028
another try for river axis legend
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Wed, 20 Jan 2021 19:25:47 +0100 |
parents | 5e38e2924c07 |
children |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5859
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5859
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5859
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5859
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5859
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5859
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui.map; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.google.gwt.core.client.GWT; |
4472
dc7e41efd5ba
Work (in progress) on a print settings dialog.
Christian Lins <christian.lins@intevation.de>
parents:
4436
diff
changeset
|
12 |
1433
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
13 import com.smartgwt.client.types.Alignment; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import com.smartgwt.client.types.SelectionType; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
15 |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
16 import com.smartgwt.client.util.SC; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
17 |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
18 import com.smartgwt.client.widgets.Button; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
19 import com.smartgwt.client.widgets.Canvas; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import com.smartgwt.client.widgets.ImgButton; |
1433
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
21 import com.smartgwt.client.widgets.Label; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
22 |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import com.smartgwt.client.widgets.events.ClickEvent; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 import com.smartgwt.client.widgets.events.ClickHandler; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
25 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
26 import com.smartgwt.client.widgets.layout.HLayout; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
27 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.client.FLYSConstants; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
29 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
30 import org.dive4elements.river.client.client.ui.Toolbar; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
31 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
32 import org.dive4elements.river.client.client.utils.EnableDisableCmd; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
33 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
34 import org.dive4elements.river.client.shared.model.ThemeList; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
36 import org.gwtopenmaps.openlayers.client.Map; |
4473
6db783627137
Map print does now submit additional parameters to MapPrintServiceImpl.
Christian Lins <christian.lins@intevation.de>
parents:
4472
diff
changeset
|
37 |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
38 import org.gwtopenmaps.openlayers.client.control.DragPan; |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
39 import org.gwtopenmaps.openlayers.client.control.SelectFeature; |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
40 import org.gwtopenmaps.openlayers.client.control.SelectFeatureOptions; |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
41 import org.gwtopenmaps.openlayers.client.control.ZoomBox; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
42 |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
43 import org.gwtopenmaps.openlayers.client.event.MapZoomListener; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
44 |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
45 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
46 |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
47 import org.gwtopenmaps.openlayers.client.layer.Vector; |
5859
a3cd78333185
Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
48 |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
49 import org.gwtopenmaps.openlayers.client.util.Attributes; |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
50 |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 /** |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
52 * Toolbar for the Map views. |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 */ |
2509
3952429cc41b
Added zoom listener a adjust the print link bbox.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2508
diff
changeset
|
55 public class MapToolbar |
3952429cc41b
Added zoom listener a adjust the print link bbox.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2508
diff
changeset
|
56 extends Toolbar |
3952429cc41b
Added zoom listener a adjust the print link bbox.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2508
diff
changeset
|
57 implements MapZoomListener |
3952429cc41b
Added zoom listener a adjust the print link bbox.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2508
diff
changeset
|
58 { |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
61 protected FloodMap floodMap; |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
62 protected DragPan pan; |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
63 protected ZoomBox zoomBox; |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
64 protected SelectFeature selectFeature; |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
65 protected GetFeatureInfo getFeatureInfo; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
67 protected Button manageThemesButton; |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
68 protected Button datacageButton; |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
69 protected Button legendButton; |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
70 |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
71 protected ImgButton addWMSButton; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 protected ImgButton zoomToMaxButton; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 protected ImgButton zoomBoxButton; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 protected ImgButton zoomOutButton; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 protected ImgButton panButton; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
76 protected ImgButton selectButton; |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
77 protected ImgButton infoButton; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
78 protected ImgButton removeButton; |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
79 protected ImgButton elevationButton; |
5606
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
80 protected ImgButton printMap; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
81 |
1433
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
82 protected Label epsgLabel; |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
83 |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
84 protected DrawControl drawControl; |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
85 protected MeasureControl measureControl; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
86 |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
87 protected LegendWindow legendWindow; |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
88 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
89 protected Canvas position; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
1386
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1364
diff
changeset
|
92 public MapToolbar(FloodMap floodMap, boolean digitize) { |
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1364
diff
changeset
|
93 this(null, floodMap, digitize); |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
94 } |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
95 |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
96 |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
97 public MapToolbar( |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
98 MapOutputTab mapTab, |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
99 FloodMap floodMap, |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
100 boolean digitize) |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
101 { |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
102 super(mapTab); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 setWidth100(); |
2452
0235cdb62c98
Issue 563.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2449
diff
changeset
|
105 setHeight(38); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 setMembersMargin(10); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 setPadding(5); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 setBorder("1px solid black"); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 this.floodMap = floodMap; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 zoomToMaxButton = createMaxExtentControl(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 zoomBoxButton = createZoomBoxControl(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 zoomOutButton = createZoomOutControl(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 panButton = createPanControl(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
115 drawControl = createDrawControl(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
116 selectButton = createSelectFeatureControl(); |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
117 infoButton = createGetFeatureInfo(); |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
118 measureControl = createMeasureControl(); |
1386
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1364
diff
changeset
|
119 position = createMousePosition(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
120 removeButton = createRemoveFeatureControl(); |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
121 elevationButton = createElevationControl(); |
1433
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
122 epsgLabel = createEPSGLabel(); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
124 if (mapTab != null) { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
125 manageThemesButton = createManageThemesControl(); |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
126 addMember(manageThemesButton); |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
127 |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
128 datacageButton = createDatacageControl(); |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
129 addMember(datacageButton); |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
130 |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
131 legendButton = createLegendControl(); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
132 addMember(legendButton); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
133 |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
134 addWMSButton = createWMSControl(); |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
135 addMember(addWMSButton); |
2507
7ef59d7e113d
Added link to print map.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2471
diff
changeset
|
136 |
5606
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
137 printMap = createMapPrintControl(); |
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
138 addMember(printMap); |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
139 } |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
140 |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 addMember(zoomToMaxButton); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 addMember(zoomBoxButton); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 addMember(zoomOutButton); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 addMember(panButton); |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
145 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
146 if (digitize) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
147 addMember(drawControl); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
148 addMember(selectButton); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
149 addMember(removeButton); |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
150 addMember(elevationButton); |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
151 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
152 |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
153 if (infoButton != null) { |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
154 addMember(infoButton); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
155 } |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
156 |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
157 addMember(measureControl); |
1433
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
158 addMember(createRightPanel()); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
159 } |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
160 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
161 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
162 protected HLayout createRightPanel() { |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
163 HLayout right = new HLayout(); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
164 right.setAlign(Alignment.RIGHT); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
165 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
166 right.addMember(epsgLabel); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
167 right.addMember(position); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
168 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
169 return right; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 protected Map getMap() { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 return floodMap.getMap(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 protected void activatePan(boolean activate) { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 if (activate) { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 panButton.select(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
181 pan.activate(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 else { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 panButton.deselect(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 pan.deactivate(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 protected void activateZoomBox(boolean activate) { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 if (activate) { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 zoomBoxButton.select(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 zoomBox.activate(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 else { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 zoomBoxButton.deselect(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 zoomBox.deactivate(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1386
diff
changeset
|
202 public void activateDrawFeature(boolean activate) { |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
203 drawControl.activate(activate); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
204 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
205 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
206 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
207 protected void activateSelectFeature(boolean activate) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
208 if (activate) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
209 selectButton.select(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
210 selectFeature.activate(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
211 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
212 else { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
213 selectButton.deselect(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
214 selectFeature.deactivate(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
215 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
216 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
217 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
218 |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
219 protected void activateMeasureControl(boolean activate) { |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
220 measureControl.activate(activate); |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
221 } |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
222 |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
223 |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
224 protected void activateGetFeatureInfo(boolean activate) { |
2469
505e68d8d131
Take care on nullpointers in the MapToolbar because the info button is not always enabled.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2452
diff
changeset
|
225 if (infoButton == null) { |
505e68d8d131
Take care on nullpointers in the MapToolbar because the info button is not always enabled.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2452
diff
changeset
|
226 return; |
505e68d8d131
Take care on nullpointers in the MapToolbar because the info button is not always enabled.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2452
diff
changeset
|
227 } |
505e68d8d131
Take care on nullpointers in the MapToolbar because the info button is not always enabled.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2452
diff
changeset
|
228 |
2447
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
229 if (activate) { |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
230 infoButton.select(); |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
231 } |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
232 else { |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
233 infoButton.deselect(); |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
234 } |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
235 |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
236 getFeatureInfo.activate(activate); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
237 } |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
238 |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
239 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
240 protected ImgButton createButton(String img, ClickHandler handler) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
241 ImgButton btn = new ImgButton(); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 String baseUrl = GWT.getHostPageBaseURL(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
244 btn.setSrc(baseUrl + img); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
245 btn.setWidth(20); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
246 btn.setHeight(20); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
247 btn.setShowDown(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
248 btn.setShowRollOver(false); |
2471
a1ff911e8365
Replaced FLYS specific icon set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2469
diff
changeset
|
249 btn.setShowRollOverIcon(false); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
250 btn.setShowDisabled(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
251 btn.setShowDisabledIcon(true); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
252 btn.setShowDownIcon(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
253 btn.setShowFocusedIcon(false); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
255 if (handler != null) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
256 btn.addClickHandler(handler); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
257 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
258 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
259 return btn; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
260 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
261 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
262 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
263 protected ImgButton createToggleButton( |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
264 String img, |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
265 final EnableDisableCmd cmd |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
266 ) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
267 final ImgButton btn = new ImgButton(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
268 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
269 String baseUrl = GWT.getHostPageBaseURL(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
270 btn.setSrc(baseUrl + img); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
271 btn.setActionType(SelectionType.CHECKBOX); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
272 btn.setSize(20); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
273 btn.setShowRollOver(false); |
2471
a1ff911e8365
Replaced FLYS specific icon set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2469
diff
changeset
|
274 btn.setShowRollOverIcon(false); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
275 btn.setSelected(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
276 btn.addClickHandler(new ClickHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
277 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
278 public void onClick(ClickEvent e) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
279 if (btn.isSelected()) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
280 cmd.enable(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
281 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
282 else { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
283 cmd.disable(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
284 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
285 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
286 }); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
287 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
288 return btn; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
289 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
290 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
291 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
292 protected ImgButton createMaxExtentControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
293 ImgButton zoomToMax = createButton(MSG.zoom_all(), new ClickHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
294 @Override |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
295 public void onClick(ClickEvent event) { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
296 floodMap.getMap().zoomToMaxExtent(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
297 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
298 }); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
299 |
880
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
300 zoomToMax.setTooltip(MSG.zoomMaxExtent()); |
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
301 |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
302 return zoomToMax; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
303 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
304 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
305 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
306 protected ImgButton createZoomBoxControl() { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
307 zoomBox = new ZoomBox(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
308 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
309 EnableDisableCmd cmd = new EnableDisableCmd() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
310 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
311 public void enable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
312 activatePan(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
313 activateDrawFeature(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
314 activateSelectFeature(false); |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
315 activateMeasureControl(false); |
2447
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
316 activateGetFeatureInfo(false); |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
317 activateZoomBox(true); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
318 } |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
319 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
320 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
321 public void disable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
322 activateZoomBox(false); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
323 } |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
324 }; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
325 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
326 ImgButton button = createToggleButton(MSG.zoom_in(), cmd); |
880
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
327 button.setTooltip(MSG.zoomIn()); |
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
328 |
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
329 Map map = getMap(); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
330 map.addControl(zoomBox); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
331 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
332 return button; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
333 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
334 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
335 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
336 protected ImgButton createZoomOutControl() { |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
337 ImgButton zoomOut = createButton(MSG.zoom_out(), new ClickHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
338 @Override |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
339 public void onClick(ClickEvent event) { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
340 Map map = floodMap.getMap(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
341 int level = map.getZoom(); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
342 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
343 if (level > 1) { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
344 map.zoomTo(level-1); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
345 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
346 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
347 }); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
348 |
880
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
349 zoomOut.setTooltip(MSG.zoomOut()); |
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
350 |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
351 return zoomOut; |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
352 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
353 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
354 |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
355 protected ImgButton createPanControl() { |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
356 pan = new DragPan(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
357 getMap().addControl(pan); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
358 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
359 EnableDisableCmd cmd = new EnableDisableCmd() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
360 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
361 public void enable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
362 activateZoomBox(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
363 activateDrawFeature(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
364 activateSelectFeature(false); |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
365 activateMeasureControl(false); |
2447
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
366 activateGetFeatureInfo(false); |
1695d66896f9
Deactivate GetFeatureInfo button if another toggle button is pressed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1433
diff
changeset
|
367 activatePan(true); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
368 } |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
369 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
370 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
371 public void disable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
372 activatePan(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
373 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
374 }; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
375 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
376 final ImgButton button = createToggleButton(MSG.pan(), cmd); |
880
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
377 button.setTooltip(MSG.moveMap()); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
378 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
379 return button; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
380 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
381 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
382 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
383 protected DrawControl createDrawControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
384 EnableDisableCmd cmd = new EnableDisableCmd() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
385 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
386 public void enable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
387 activateZoomBox(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
388 activatePan(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
389 activateDrawFeature(true); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
390 activateSelectFeature(false); |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
391 activateMeasureControl(false); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
392 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
393 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
394 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
395 public void disable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
396 activateDrawFeature(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
397 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
398 }; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
399 return new DrawControl(getMap(), floodMap.getBarrierLayer(), cmd); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
400 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
401 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
402 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
403 protected ImgButton createSelectFeatureControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
404 SelectFeatureOptions opts = new SelectFeatureOptions(); |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
802
diff
changeset
|
405 opts.setBox(true); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
406 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
407 // VectorFeatures selected by the SelectFeature control are manually |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
408 // marked with the string "mark.delete". The control to remove selected |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
409 // features makes use of this string to determine if the feature should |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
410 // be deleted (is marked) or not. Actually, we would like to use the |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
411 // OpenLayers native mechanism to select features, but for some reason |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
412 // this doesn't work here. After a feature has been selected, the layer |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
413 // still has no selected features. |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
414 opts.onSelect(new SelectFeature.SelectFeatureListener() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
415 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
416 public void onFeatureSelected(VectorFeature feature) { |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
417 floodMap.selectFeature(feature); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
418 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
419 }); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
420 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
421 opts.onUnSelect(new SelectFeature.UnselectFeatureListener() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
422 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
423 public void onFeatureUnselected(VectorFeature feature) { |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
424 floodMap.disableFeature(feature); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
425 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
426 }); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
427 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
428 selectFeature = new SelectFeature(floodMap.getBarrierLayer(), opts); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
429 getMap().addControl(selectFeature); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
430 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
431 EnableDisableCmd cmd = new EnableDisableCmd() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
432 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
433 public void enable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
434 activateDrawFeature(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
435 activatePan(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
436 activateZoomBox(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
437 activateSelectFeature(true); |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
438 activateMeasureControl(false); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
439 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
440 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
441 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
442 public void disable() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
443 activateSelectFeature(false); |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
444 floodMap.disableFeatures(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
445 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
446 }; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
447 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
448 ImgButton button = createToggleButton(MSG.selectFeature(), cmd); |
880
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
449 button.setTooltip(MSG.selectObject()); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
450 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
451 return button; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
452 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
453 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
454 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
455 protected ImgButton createRemoveFeatureControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
456 ImgButton remove = createButton(MSG.removeFeature(),new ClickHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
457 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
458 public void onClick(ClickEvent event) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
459 Vector barriers = floodMap.getBarrierLayer(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
460 VectorFeature[] features = barriers.getFeatures(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
461 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
462 if (features == null || features.length == 0) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
463 return; |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
464 } |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
465 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
466 for (int i = features.length-1; i >= 0; i--) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
467 VectorFeature feature = features[i]; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
468 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
469 Attributes attr = feature.getAttributes(); |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
470 int del = attr.getAttributeAsInt(FloodMap.MARK_SELECTED); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
471 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
472 if (del == 1) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
473 barriers.removeFeature(feature); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
474 feature.destroy(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
475 } |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
476 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
477 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
478 }); |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
479 |
880
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
480 remove.setTooltip(MSG.removeObject()); |
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
481 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
482 return remove; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
483 } |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
484 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
799
diff
changeset
|
485 |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
486 protected ImgButton createElevationControl() { |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
487 ImgButton btn = createButton(MSG.adjustElevation(), new ClickHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
488 @Override |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
489 public void onClick(ClickEvent evt) { |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
490 Vector barriers = floodMap.getBarrierLayer(); |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
491 VectorFeature[] features = barriers.getFeatures(); |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
492 |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
493 VectorFeature feature = null; |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
494 |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
495 if (features == null || features.length == 0) { |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
496 SC.warn(MSG.error_no_feature_selected()); |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
497 return; |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
498 } |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
499 |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
500 boolean multipleFeatures = false; |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
501 |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
502 for (VectorFeature f: features) { |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
503 Attributes attr = f.getAttributes(); |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
504 if (attr.getAttributeAsInt(FloodMap.MARK_SELECTED) == 1) { |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
505 if (feature == null) { |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
506 feature = f; |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
507 } |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
508 else { |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
509 multipleFeatures = true; |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
510 } |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
511 } |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
512 } |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
513 |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
514 if (feature == null) { |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
515 SC.warn(MSG.error_no_feature_selected()); |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
516 return; |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
517 } |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
518 |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
519 new ElevationWindow(floodMap, feature).show(); |
1317
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
520 |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
521 if (multipleFeatures) { |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
522 SC.warn(MSG.warning_use_first_feature()); |
45b9b1fc26e2
Improved error handling while using the elevation control - Make selected features in the map visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1315
diff
changeset
|
523 } |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
524 } |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
525 }); |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
526 |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
527 btn.setTooltip(MSG.adjustElevationTooltip()); |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
528 |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
529 return btn; |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
530 } |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
531 |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
532 |
1386
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1364
diff
changeset
|
533 protected Canvas createMousePosition() { |
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1364
diff
changeset
|
534 return new MapPositionPanel(floodMap.getMapWidget()); |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
535 } |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
536 |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
537 |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
538 protected MeasureControl createMeasureControl() { |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
539 EnableDisableCmd cmd = new EnableDisableCmd() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
540 @Override |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
541 public void enable() { |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
542 activateDrawFeature(false); |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
543 activatePan(false); |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
544 activateZoomBox(false); |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
545 activateSelectFeature(false); |
2449
e73e92c70290
Deactivate measure control when activating GetFeatureInfo control and reverse.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2447
diff
changeset
|
546 activateGetFeatureInfo(false); |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
547 } |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
548 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
549 @Override |
802
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
550 public void disable() { |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
551 // do nothing |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
552 } |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
553 }; |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
554 |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
555 return new MeasureControl(floodMap, cmd); |
d45ad7fd3027
Added map tools to measure lines and polygons.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
556 } |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
557 |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
558 |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
559 protected Button createDatacageControl() { |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
560 Button btn = new Button(MSG.databasket()); |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
561 btn.addClickHandler(new ClickHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
562 @Override |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
563 public void onClick(ClickEvent evt) { |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
564 openDatacageWindow((MapOutputTab) getOutputTab()); |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
565 } |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
566 }); |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
567 |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
568 return btn; |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1317
diff
changeset
|
569 } |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
570 |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
571 |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
572 protected Button createLegendControl() { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
573 Button btn = new Button(MSG.legend()); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
574 btn.addClickHandler(new ClickHandler() { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
575 @Override |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
576 public void onClick(ClickEvent event) { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
577 openLegendWindow(); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
578 } |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
579 }); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
580 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
581 return btn; |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
582 } |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
583 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
584 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
585 protected void openLegendWindow() { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
586 if (legendWindow == null) { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
587 MapOutputTab tab = (MapOutputTab) getOutputTab(); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
588 legendWindow = new LegendWindow(tab.getThemePanel().getThemeList()); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
589 } |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
590 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
591 legendWindow.show(); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
592 } |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
593 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
594 |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
595 protected ImgButton createGetFeatureInfo() { |
1404
09566522e899
Query GetFeatureInfo with layers defined in MapThemePanel - which are the real layers in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
596 MapOutputTab ot = (MapOutputTab) getOutputTab(); |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
597 if (ot == null) { |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
598 return null; |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
599 } |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
600 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
601 //ThemeList tl = ot.getCollection().getThemeList("floodmap"); |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
602 |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
603 getFeatureInfo = new GetFeatureInfo( |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
604 getMap(), |
1404
09566522e899
Query GetFeatureInfo with layers defined in MapThemePanel - which are the real layers in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
605 ot.getThemePanel(), |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
606 "gml"); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
607 |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
608 EnableDisableCmd cmd = new EnableDisableCmd() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
609 @Override |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
610 public void enable() { |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
611 activateDrawFeature(false); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
612 activatePan(false); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
613 activateZoomBox(false); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
614 activateSelectFeature(false); |
2449
e73e92c70290
Deactivate measure control when activating GetFeatureInfo control and reverse.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2447
diff
changeset
|
615 activateMeasureControl(false); |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
616 activateGetFeatureInfo(true); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
617 } |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
618 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
619 @Override |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
620 public void disable() { |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
621 activateGetFeatureInfo(false); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
622 } |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
623 }; |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
624 |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
625 ImgButton button = createToggleButton(MSG.getFeatureInfo(), cmd); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
626 button.setTooltip(MSG.getFeatureInfoTooltip()); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
627 |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
628 return button; |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1389
diff
changeset
|
629 } |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
630 |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
631 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
632 protected Button createManageThemesControl() { |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
633 Button btn = new Button(MSG.manageThemes()); |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
634 btn.addClickHandler(new ClickHandler() { |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
635 |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
636 @Override |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
637 public void onClick(ClickEvent event) { |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
638 ((MapOutputTab)getOutputTab()).toogleThemePanel(); |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
639 } |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
640 }); |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
641 return btn; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
642 } |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
643 |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
644 |
5606
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
645 protected ImgButton createMapPrintControl() { |
4474
bd78d2b0e309
Map print settings can now be configured via settings window.
Christian Lins <christian.lins@intevation.de>
parents:
4473
diff
changeset
|
646 final MapToolbar mtb = this; |
8856 | 647 ImgButton btn = createButton( |
648 MSG.printMapSettings(), new ClickHandler() { | |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
649 @Override |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
650 public void onClick(ClickEvent event) { |
5606
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
651 MapPrintWindow mpsw = |
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
652 new MapPrintWindow(outputTab.getCollection(), mtb); |
4472
dc7e41efd5ba
Work (in progress) on a print settings dialog.
Christian Lins <christian.lins@intevation.de>
parents:
4436
diff
changeset
|
653 outputTab.getCollectionView().addChild(mpsw); |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
654 } |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
655 }); |
5606
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
656 btn.setTooltip(MSG.printTooltip()); |
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
657 |
4436
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
658 return btn; |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
659 } |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
660 |
9fca4d60fb7c
Reintroduce wrongly outbacked changes (rev 4418-4425).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
661 |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
662 protected ImgButton createWMSControl() { |
1418
750a53950e9f
The WMSLayerTree displays WMS layers that support a given SRS only.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
663 final String srs = floodMap.getRiverProjection(); |
750a53950e9f
The WMSLayerTree displays WMS layers that support a given SRS only.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
664 |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
665 ImgButton add = createButton(MSG.addWMS(), new ClickHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
2905
diff
changeset
|
666 @Override |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
667 public void onClick(ClickEvent event) { |
1412
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1406
diff
changeset
|
668 MapOutputTab ot = (MapOutputTab) getOutputTab(); |
1418
750a53950e9f
The WMSLayerTree displays WMS layers that support a given SRS only.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
669 new ExternalWMSWindow(ot, srs).start(); |
1406
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
670 } |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
671 }); |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
672 |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
673 add.setTooltip(MSG.addWMSTooltip()); |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
674 |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
675 return add; |
6c8a29abbe30
Added an initial control that allows (when it is finished) adding map layers from external WMS.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1404
diff
changeset
|
676 } |
1433
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
677 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
678 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
679 protected Label createEPSGLabel() { |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
680 Label epsgLabel = new Label(floodMap.getRiverProjection()); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
681 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
682 epsgLabel.setAlign(Alignment.RIGHT); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
683 epsgLabel.setWidth(75); |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
684 |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
685 return epsgLabel; |
d73f503f2465
Added a label that displays the current map projection to the MapToolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1418
diff
changeset
|
686 } |
2507
7ef59d7e113d
Added link to print map.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2471
diff
changeset
|
687 |
2509
3952429cc41b
Added zoom listener a adjust the print link bbox.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2508
diff
changeset
|
688 @Override |
3952429cc41b
Added zoom listener a adjust the print link bbox.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2508
diff
changeset
|
689 public void onMapZoom(MapZoomListener.MapZoomEvent e) { |
5606
0d8564196d73
Break printing to rework the parametrization of the print job
Andre Heinecke <aheinecke@intevation.de>
parents:
4475
diff
changeset
|
690 // updatePrintUrl(); |
4474
bd78d2b0e309
Map print settings can now be configured via settings window.
Christian Lins <christian.lins@intevation.de>
parents:
4473
diff
changeset
|
691 } |
bd78d2b0e309
Map print settings can now be configured via settings window.
Christian Lins <christian.lins@intevation.de>
parents:
4473
diff
changeset
|
692 |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
693 public void updateThemes(ThemeList themeList) { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
694 if (legendWindow != null) { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
695 legendWindow.update(themeList); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
696 } |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4013
diff
changeset
|
697 } |
799
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
698 } |
f4299b90c996
Added controls to navigate in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
699 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |