diff flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java @ 1566:c408074c6409

Initialize the min and max fields in RangePanel. flys-client/trunk@3822 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 30 Jan 2012 10:12:05 +0000
parents 252c22237fe7
children 1227878665b5
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java	Mon Jan 30 08:57:43 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java	Mon Jan 30 10:12:05 2012 +0000
@@ -144,13 +144,27 @@
                 list.add(new DefaultData(name, label, null, dataItems, def));
             }
             else if (type.equals("intrange")) {
-                String min   = ClientProtocolUtils.getMinNode(d);
-                String max   = ClientProtocolUtils.getMaxNode(d);
+                String min = ClientProtocolUtils.getMinNode(d);
+                String max = ClientProtocolUtils.getMaxNode(d);
+
+                String defMin = ClientProtocolUtils.getDefMin(d);
+                String defMax = ClientProtocolUtils.getDefMax(d);
 
                 try {
                     int lower = Integer.parseInt(min);
                     int upper = Integer.parseInt(max);
-                    list.add(new IntegerRangeData(name, label, lower, upper));
+
+                    if (defMin != null && defMax != null) {
+                        list.add(new IntegerRangeData(
+                                name, label,
+                                lower, upper,
+                                Integer.parseInt(defMin),
+                                Integer.parseInt(defMax)));
+                    }
+                    else {
+                        list.add(
+                            new IntegerRangeData(name, label, lower, upper));
+                    }
                 }
                 catch (NumberFormatException nfe) {
                     logger.warn("NumberFormatException: ", nfe);

http://dive4elements.wald.intevation.org