comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapOutputTab.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents ea9eef426962
children 992c188b7330
comparison
equal deleted inserted replaced
8855:d7c005e12af0 8856:5e38e2924c07
71 import org.gwtopenmaps.openlayers.client.layer.WMSParams; 71 import org.gwtopenmaps.openlayers.client.layer.WMSParams;
72 72
73 73
74 public class MapOutputTab 74 public class MapOutputTab
75 extends OutputTab 75 extends OutputTab
76 implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler, OutputParameterChangeHandler { 76 implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader,
77 TabSelectedHandler, OutputParameterChangeHandler {
77 78
78 public static final String DEFAULT_SRID = "4326"; 79 public static final String DEFAULT_SRID = "4326";
79 80
80 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; 81 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers";
81 82
102 protected MapWidget mapPanel; 103 protected MapWidget mapPanel;
103 protected Canvas mapPanelCanvas; 104 protected Canvas mapPanelCanvas;
104 protected VLayout rootLayout = new VLayout(); 105 protected VLayout rootLayout = new VLayout();
105 protected AbsolutePanel absPan = new AbsolutePanel(); 106 protected AbsolutePanel absPan = new AbsolutePanel();
106 protected FloodMap floodMap; 107 protected FloodMap floodMap;
107 protected java.util.Map<String, String> wmsUrls = new HashMap<String, String>(); 108 protected java.util.Map<String, String> wmsUrls =
109 new HashMap<String, String>();
108 110
109 111
110 public MapOutputTab( 112 public MapOutputTab(
111 String title, 113 String title,
112 Collection collection, 114 Collection collection,
190 protected void doLayout() { 192 protected void doLayout() {
191 if(!rootLayout.isVisible()) { 193 if(!rootLayout.isVisible()) {
192 return; 194 return;
193 } 195 }
194 196
195 // Manually set the height of the AbsolutePanel, somehow this is necessary 197 // Manually set the height of the AbsolutePanel,
198 // somehow this is necessary
196 absPan.setHeight(String.valueOf( 199 absPan.setHeight(String.valueOf(
197 rootLayout.getHeight() - controlPanel.getHeight() - 2) + "px"); 200 rootLayout.getHeight() - controlPanel.getHeight() - 2) + "px");
198 201
199 // Calculate bounds of Map 202 // Calculate bounds of Map
200 int height = rootLayout.getHeight() - 203 int height = rootLayout.getHeight() -
201 controlPanel.getHeight() - 6; 204 controlPanel.getHeight() - 6;
202 int width = controlPanel.getWidth() - 205 int width = controlPanel.getWidth() -
203 (themePanelCanvas.isVisible() ? themePanelCanvas.getWidth() + 4 : 2); 206 (themePanelCanvas.isVisible()
207 ? themePanelCanvas.getWidth() + 4
208 : 2);
204 209
205 // Set size and position of Map 210 // Set size and position of Map
206 String w = String.valueOf(width) + "px"; 211 String w = String.valueOf(width) + "px";
207 String h = String.valueOf(height) + "px"; 212 String h = String.valueOf(height) + "px";
208 GWT.log("width=" + w); 213 GWT.log("width=" + w);
209 214
210 mapPanel.setSize(w, h); 215 mapPanel.setSize(w, h);
211 mapPanel.getMap().updateSize(); 216 mapPanel.getMap().updateSize();
212 if(themePanelCanvas.isVisible()) { 217 if(themePanelCanvas.isVisible()) {
213 absPan.setWidgetPosition(mapPanel, themePanelCanvas.getWidth() + 2, 0); 218 absPan.setWidgetPosition(
219 mapPanel, themePanelCanvas.getWidth() + 2, 0);
214 } 220 }
215 else { 221 else {
216 absPan.setWidgetPosition(mapPanel, 0, 0); 222 absPan.setWidgetPosition(mapPanel, 0, 0);
217 } 223 }
218 224
219 // Set bounds of ThemePanelCanvas 225 // Set bounds of ThemePanelCanvas
220 themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(), String.valueOf(height + 2) + "px"); 226 themePanelCanvas.setSize(
227 themePanelCanvas.getWidthAsString(),
228 String.valueOf(height + 2) + "px");
221 } 229 }
222 230
223 231
224 protected void initBarriers() { 232 protected void initBarriers() {
225 Vector vector = floodMap.getBarrierLayer(); 233 Vector vector = floodMap.getBarrierLayer();
249 } 257 }
250 258
251 ArtifactDescription desc = artifact.getArtifactDescription(); 259 ArtifactDescription desc = artifact.getArtifactDescription();
252 260
253 String geojson = getGeoJSONFromStatic(desc); 261 String geojson = getGeoJSONFromStatic(desc);
254 geojson = geojson != null ? geojson : getGeoJSONFromDynamic(desc); 262 geojson = geojson != null ? geojson : getGeoJSONFromDynamic(desc);
255 263
256 if (geojson == null || geojson.length() == 0) { 264 if (geojson == null || geojson.length() == 0) {
257 GWT.log("No geojson string found -> no barriers existing."); 265 GWT.log("No geojson string found -> no barriers existing.");
258 return; 266 return;
259 } 267 }
271 if (map != null) { 279 if (map != null) {
272 GWT.log("Add new layer '" + layer.getName() + "' to map."); 280 GWT.log("Add new layer '" + layer.getName() + "' to map.");
273 map.addLayer(layer); 281 map.addLayer(layer);
274 if (layer instanceof WMS) { 282 if (layer instanceof WMS) {
275 wmsUrls.put(layer.getName(), 283 wmsUrls.put(layer.getName(),
276 ((WMS)layer).getFullRequestString(new WMSParams(), null)); 284 ((WMS)layer).getFullRequestString(new WMSParams(), null));
277 } 285 }
278 } 286 }
279 } 287 }
280 288
281 289

http://dive4elements.wald.intevation.org