Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/map/DrawControl.java @ 5818:a4ff4167be1e
Request feature info on all layers and show it as html if
the server does not return valid gml.
Non queryable layers produce an error message when the request
fails. This is good enough
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 24 Apr 2013 17:33:27 +0200 |
parents | 80e8ef91223c |
children |
rev | line source |
---|---|
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui.map; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import com.smartgwt.client.types.SelectionType; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import com.smartgwt.client.widgets.ImgButton; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import com.smartgwt.client.widgets.events.ClickEvent; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import com.smartgwt.client.widgets.events.ClickHandler; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import com.smartgwt.client.widgets.form.DynamicForm; |
4965
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
9 import com.smartgwt.client.widgets.form.fields.FormItem; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import com.smartgwt.client.widgets.form.fields.SelectItem; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.widgets.layout.HLayout; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
4965
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
15 import de.intevation.flys.client.client.FLYSConstants; |
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
16 import de.intevation.flys.client.client.utils.EnableDisableCmd; |
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
17 |
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
18 import java.util.LinkedHashMap; |
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
19 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import org.gwtopenmaps.openlayers.client.Map; |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1311
diff
changeset
|
21 import org.gwtopenmaps.openlayers.client.Style; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import org.gwtopenmaps.openlayers.client.control.Control; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import org.gwtopenmaps.openlayers.client.control.DrawFeature; |
850
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
24 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener; |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
25 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 import org.gwtopenmaps.openlayers.client.handler.Handler; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 import org.gwtopenmaps.openlayers.client.handler.PathHandler; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 import org.gwtopenmaps.openlayers.client.handler.PolygonHandler; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 import org.gwtopenmaps.openlayers.client.layer.Vector; |
850
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
30 import org.gwtopenmaps.openlayers.client.util.Attributes; |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
32 /** |
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
33 * Widget that handles the drawing of pipes and dikes in the DigitizePanel (MapPanel). |
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
34 */ |
850
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
35 public class DrawControl extends HLayout implements VectorFeatureAddedListener { |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 public static final String BARRIER_PIPE1 = "pipe1"; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 public static final String BARRIER_PIPE2 = "pipe2"; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 public static final String BARRIER_DITCH = "ditch"; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 public static final String BARRIER_DAM = "dam"; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 public static final String BARRIER_RINGDIKE = "ring_dike"; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
43 // FIXME: i18n |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
44 public static final String BARRIER_PIPE1_VALUE = "Rohr 1"; |
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
45 public static final String BARRIER_PIPE2_VALUE = "Rohr 2"; |
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
46 public static final String BARRIER_DITCH_VALUE = "Graben"; |
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
47 public static final String BARRIER_DAM_VALUE = "Damm"; |
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
48 public static final String BARRIER_RINGDIKE_VALUE = "Ringdeich"; |
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
49 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 public static final String FIELD_BARRIER_TYPE = "field_barrier_type"; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 protected EnableDisableCmd cmd; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 protected ImgButton button; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 protected DynamicForm form; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 protected Map map; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 protected Vector layer; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 protected Control control; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 public DrawControl(Map map, Vector layer, EnableDisableCmd cmd) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 this.map = map; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 this.layer = layer; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 this.cmd = cmd; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 initialize(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 protected void initialize() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 setWidth(100); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 setMembersMargin(0); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 button = new ImgButton(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
81 final String baseUrl = GWT.getHostPageBaseURL(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 button.setSrc(baseUrl + MSG.digitize()); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 button.setActionType(SelectionType.CHECKBOX); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 button.setSize(20); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 button.setShowRollOver(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 button.setSelected(false); |
880
22dc88b17253
Added tooltips for the maptoolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
860
diff
changeset
|
87 button.setTooltip(MSG.digitizeObjects()); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 button.addClickHandler(new ClickHandler() { |
4965
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
90 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 public void onClick(ClickEvent e) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 if (button.isSelected()) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 cmd.enable(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 else { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 cmd.disable(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 }); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 form = new DynamicForm(); |
1311
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
102 form.setWidth(100); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 form.setTitlePrefix(""); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 form.setTitleSuffix(""); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
106 final LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 map.put(BARRIER_PIPE1, MSG.getString(BARRIER_PIPE1)); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 map.put(BARRIER_PIPE2, MSG.getString(BARRIER_PIPE2)); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 map.put(BARRIER_DITCH, MSG.getString(BARRIER_DITCH)); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 map.put(BARRIER_DAM, MSG.getString(BARRIER_DAM)); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 map.put(BARRIER_RINGDIKE, MSG.getString(BARRIER_RINGDIKE)); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
113 final LinkedHashMap<String, String> ics = new LinkedHashMap<String, String>(); |
1311
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
114 ics.put(BARRIER_PIPE1, BARRIER_PIPE1); |
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
115 ics.put(BARRIER_PIPE2, BARRIER_PIPE2); |
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
116 ics.put(BARRIER_DITCH, BARRIER_DITCH); |
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
117 ics.put(BARRIER_DAM, BARRIER_DAM); |
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
118 ics.put(BARRIER_RINGDIKE, BARRIER_RINGDIKE); |
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
119 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
120 final SelectItem box = new SelectItem(FIELD_BARRIER_TYPE); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 box.setTitle(""); |
1311
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
122 box.setWidth(100); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 box.setValueMap(map); |
1311
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
124 box.setImageURLSuffix(".png"); |
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
125 box.setValueIcons(ics); |
981dde77b49f
#288 Added icons to the barriers combobox for digitizing features.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
882
diff
changeset
|
126 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 box.addChangedHandler(new ChangedHandler() { |
4965
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
128 @Override |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 public void onChanged(ChangedEvent e) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 setSelectedControl(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 }); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 form.setFields(box); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 addMember(button); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 addMember(form); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 |
850
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
139 layer.addVectorFeatureAddedListener(this); |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
140 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 activate(false); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 protected String getSelectedType() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 return form.getValueAsString(FIELD_BARRIER_TYPE); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 |
4965
8af500d62098
Editing Map print config.
Christian Lins <christian.lins@intevation.de>
parents:
1315
diff
changeset
|
150 @Override |
850
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
151 public void onFeatureAdded(FeatureAddedEvent evt) { |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
152 setCurrentType(evt.getVectorFeature()); |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
153 } |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
154 |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
155 |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
156 protected void setCurrentType(VectorFeature feature) { |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
157 final Attributes attrs = feature.getAttributes(); |
850
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
158 String type = attrs.getAttributeAsString("typ"); |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
159 |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
160 if (type == null || type.length() == 0) { |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
161 type = getSelectedType(); |
860
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
162 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
163 final Style style = FloodMap.getStyle(type); |
1315
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1311
diff
changeset
|
164 if (style != null) { |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1311
diff
changeset
|
165 feature.setStyle(style); |
cf0f906921de
#297 Implemented a window to adjust elevations of geometries in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1311
diff
changeset
|
166 } |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
167 |
860
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
168 if (type.equals(BARRIER_PIPE1)) { |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
169 attrs.setAttribute("typ", BARRIER_PIPE1_VALUE); |
860
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
170 } |
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
171 else if (type.equals(BARRIER_PIPE2)) { |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
172 attrs.setAttribute("typ", BARRIER_PIPE2_VALUE); |
860
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
173 } |
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
174 else if (type.equals(BARRIER_DAM)) { |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
175 attrs.setAttribute("typ", BARRIER_DAM_VALUE); |
860
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
176 } |
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
177 else if (type.equals(BARRIER_DITCH)) { |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
178 attrs.setAttribute("typ", BARRIER_DITCH_VALUE); |
860
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
179 } |
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
180 else if (type.equals(BARRIER_RINGDIKE)) { |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
181 attrs.setAttribute("typ", BARRIER_RINGDIKE_VALUE); |
860
f5855350fc03
Set WSPLGEN specific 'type' attributes after digitizing new geometries.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
850
diff
changeset
|
182 } |
882
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
183 |
d3b4010d2c89
I293: Set the style of digitized features in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
880
diff
changeset
|
184 layer.redraw(); |
850
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
185 } |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
186 } |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
187 |
d02c3835df28
Set the 'typ' attribute of new features (digitized) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
188 |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 protected void removeControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 if (control != null) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 control.deactivate(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 map.removeControl(control); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 protected void setSelectedControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 removeControl(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
200 final String type = getSelectedType(); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 if (type == null || type.length() == 0) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 return; |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 if (type.equalsIgnoreCase(BARRIER_RINGDIKE)) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 control = createDrawPolygonControl(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 else { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 control = createDrawLineControl(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 map.addControl(control); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 control.activate(); |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
215 |
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
216 // Make sure the barrier layer is on top; sometime it looses it z-index... |
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
217 layer.setZIndex(1000); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 protected Control createDrawControl(Handler handler) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 return new DrawFeature(layer, handler); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
226 protected Control createDrawPolygonControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
227 return createDrawControl(new PolygonHandler()); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
228 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
229 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
230 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 protected Control createDrawLineControl() { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 return createDrawControl(new PathHandler()); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
234 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 public void activate(boolean activate) { |
5609
80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
Christian Lins <christian.lins@intevation.de>
parents:
4965
diff
changeset
|
237 final FormItem item = form.getField(FIELD_BARRIER_TYPE); |
800
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 if (activate) { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 button.select(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
241 item.enable(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 setSelectedControl(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 else { |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
245 removeControl(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
246 button.deselect(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
247 item.disable(); |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
248 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 } |
95cc560ce7c4
Added map controls for digitizing and removing barriers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |