diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 627:833290f16f09

ISSUE-85 (part I/III) Added further fields for the location/range state. flys-artifacts/trunk@1992 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 24 May 2011 11:27:37 +0000
parents 929137ee8154
children 51b69bca4560
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Tue May 24 11:23:57 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Tue May 24 11:27:37 2011 +0000
@@ -461,6 +461,25 @@
 
 
     /**
+     * Determines the selected mode of distance/range input.
+     *
+     * @return true, if the range mode is selected otherwise false.
+     */
+    public boolean isRange() {
+        StateData mode = getData("ld_mode");
+
+        if (mode == null) {
+            logger.warn("No mode location/range chosen. Defaults to range.");
+            return true;
+        }
+
+        String value = (String) mode.getValue();
+
+        return value.equals("range");
+    }
+
+
+    /**
      * This method returns the given distance 
      *
      * @return an array with lower and upper kilometer range for each

http://dive4elements.wald.intevation.org