Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/map/DrawControl.java @ 5609:80e8ef91223c
Fix for #802: digitized pipes and dikes should be visible now
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Tue, 09 Apr 2013 12:44:57 +0200 |
parents | 8af500d62098 |
children |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/DrawControl.java Tue Apr 09 12:00:52 2013 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/DrawControl.java Tue Apr 09 12:44:57 2013 +0200 @@ -1,7 +1,6 @@ package de.intevation.flys.client.client.ui.map; import com.google.gwt.core.client.GWT; - import com.smartgwt.client.types.SelectionType; import com.smartgwt.client.widgets.ImgButton; import com.smartgwt.client.widgets.events.ClickEvent; @@ -30,7 +29,9 @@ import org.gwtopenmaps.openlayers.client.layer.Vector; import org.gwtopenmaps.openlayers.client.util.Attributes; - +/** + * Widget that handles the drawing of pipes and dikes in the DigitizePanel (MapPanel). + */ public class DrawControl extends HLayout implements VectorFeatureAddedListener { public static final String BARRIER_PIPE1 = "pipe1"; @@ -39,6 +40,7 @@ public static final String BARRIER_DAM = "dam"; public static final String BARRIER_RINGDIKE = "ring_dike"; + // FIXME: i18n public static final String BARRIER_PIPE1_VALUE = "Rohr 1"; public static final String BARRIER_PIPE2_VALUE = "Rohr 2"; public static final String BARRIER_DITCH_VALUE = "Graben"; @@ -76,7 +78,7 @@ button = new ImgButton(); - String baseUrl = GWT.getHostPageBaseURL(); + final String baseUrl = GWT.getHostPageBaseURL(); button.setSrc(baseUrl + MSG.digitize()); button.setActionType(SelectionType.CHECKBOX); button.setSize(20); @@ -101,21 +103,21 @@ form.setTitlePrefix(""); form.setTitleSuffix(""); - LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); + final LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put(BARRIER_PIPE1, MSG.getString(BARRIER_PIPE1)); map.put(BARRIER_PIPE2, MSG.getString(BARRIER_PIPE2)); map.put(BARRIER_DITCH, MSG.getString(BARRIER_DITCH)); map.put(BARRIER_DAM, MSG.getString(BARRIER_DAM)); map.put(BARRIER_RINGDIKE, MSG.getString(BARRIER_RINGDIKE)); - LinkedHashMap<String, String> ics = new LinkedHashMap<String, String>(); + final LinkedHashMap<String, String> ics = new LinkedHashMap<String, String>(); ics.put(BARRIER_PIPE1, BARRIER_PIPE1); ics.put(BARRIER_PIPE2, BARRIER_PIPE2); ics.put(BARRIER_DITCH, BARRIER_DITCH); ics.put(BARRIER_DAM, BARRIER_DAM); ics.put(BARRIER_RINGDIKE, BARRIER_RINGDIKE); - SelectItem box = new SelectItem(FIELD_BARRIER_TYPE); + final SelectItem box = new SelectItem(FIELD_BARRIER_TYPE); box.setTitle(""); box.setWidth(100); box.setValueMap(map); @@ -152,13 +154,13 @@ protected void setCurrentType(VectorFeature feature) { - Attributes attrs = feature.getAttributes(); + final Attributes attrs = feature.getAttributes(); String type = attrs.getAttributeAsString("typ"); if (type == null || type.length() == 0) { type = getSelectedType(); - Style style = FloodMap.getStyle(type); + final Style style = FloodMap.getStyle(type); if (style != null) { feature.setStyle(style); } @@ -195,7 +197,7 @@ protected void setSelectedControl() { removeControl(); - String type = getSelectedType(); + final String type = getSelectedType(); if (type == null || type.length() == 0) { return; @@ -210,6 +212,9 @@ map.addControl(control); control.activate(); + + // Make sure the barrier layer is on top; sometime it looses it z-index... + layer.setZIndex(1000); } @@ -229,7 +234,7 @@ public void activate(boolean activate) { - FormItem item = form.getField(FIELD_BARRIER_TYPE); + final FormItem item = form.getField(FIELD_BARRIER_TYPE); if (activate) { button.select();