# HG changeset patch # User Ingo Weinzierl # Date 1324289592 0 # Node ID c4bc320e3d44ee41826b072c6edcd204e6407979 # Parent 4c5006fecd8de88d19cbacb5c299e616e7aea7b1 Bugfix: make sure that the user has selected a DEM before feeding the Artifact with it. flys-client/trunk@3463 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 4c5006fecd8d -r c4bc320e3d44 flys-client/ChangeLog --- a/flys-client/ChangeLog Mon Dec 19 09:53:45 2011 +0000 +++ b/flys-client/ChangeLog Mon Dec 19 10:13:12 2011 +0000 @@ -1,3 +1,15 @@ +2011-12-19 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants.java: Added + strings that force the user to select a DEM. + + * src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java: + Override validate() to make sure, that the user has selected a DEM. + Otherwise, a popup is displayed. + 2011-12-19 Ingo Weinzierl * src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties, diff -r 4c5006fecd8d -r c4bc320e3d44 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Dec 19 09:53:45 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Dec 19 10:13:12 2011 +0000 @@ -554,6 +554,8 @@ String zoomToLayer(); + String requireDGM(); + // data cage String old_calculations(); diff -r 4c5006fecd8d -r c4bc320e3d44 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Dec 19 09:53:45 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Dec 19 10:13:12 2011 +0000 @@ -284,6 +284,7 @@ measureArea = Measure area map_themepanel_header_style = Style zoomToLayer = Layer-Zoom +requireDGM = You need to choose a DEM. # data cage old_calculations = Former Calculations diff -r 4c5006fecd8d -r c4bc320e3d44 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Dec 19 09:53:45 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Dec 19 10:13:12 2011 +0000 @@ -284,6 +284,7 @@ measureArea = Streckenmessung map_themepanel_header_style = Stil zoomToLayer = Layer-Zoom +requireDGM = Sie m\u00fcssen ein DGM ausw\u00e4hlen. # data cage old_calculations = Fr\u00fchere Berechnungen diff -r 4c5006fecd8d -r c4bc320e3d44 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Dec 19 09:53:45 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Dec 19 10:13:12 2011 +0000 @@ -284,6 +284,7 @@ measureArea = Measure area map_themepanel_header_style = Style zoomToLayer = Layer-Zoom +requireDGM = You need to choose a DEM. # data cage old_calculations = Former Calculations diff -r 4c5006fecd8d -r c4bc320e3d44 flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java Mon Dec 19 09:53:45 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java Mon Dec 19 10:13:12 2011 +0000 @@ -1,5 +1,6 @@ package de.intevation.flys.client.client.ui; +import java.util.ArrayList; import java.util.List; import de.intevation.flys.client.shared.model.Data; @@ -53,6 +54,19 @@ @Override + public List validate() { + List errors = new ArrayList(); + + Recommendation r = getSelectedRecommendation(); + if (r == null) { + errors.add(MSG.requireDGM()); + } + + return errors; + } + + + @Override protected Data[] getData() { Recommendation r = getSelectedRecommendation(); @@ -66,7 +80,7 @@ ToLoad toLoad = widget.getSelection(); List recoms = toLoad.toRecommendations(); - return recoms.get(0); + return recoms != null && recoms.size() >= 1 ? recoms.get(0) : null; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :