Mercurial > dive4elements > river
changeset 573:756bd8f0b97c
The DoubleArrayPanel is more tolerant towards entered whitespaces.
flys-client/trunk@2123 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 15 Jun 2011 09:03:27 +0000 |
parents | 830e4720caad |
children | 3629d36f0e5d |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java |
diffstat | 2 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Wed Jun 15 09:01:22 2011 +0000 +++ b/flys-client/ChangeLog Wed Jun 15 09:03:27 2011 +0000 @@ -1,3 +1,8 @@ +2011-06-15 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java: + Be more tolerant with entered whitespaces. + 2011-06-15 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/client/ui/ParameterList.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java Wed Jun 15 09:01:22 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java Wed Jun 15 09:03:27 2011 +0000 @@ -143,7 +143,7 @@ return valid; } - String[] parts = value.split(" "); + String[] parts = value.split("\\s+"); if (parts == null) { return valid; @@ -154,6 +154,11 @@ try { for (String part: parts) { + + if (part.length() == 0) { + continue; + } + double location = f.parse(part); } @@ -186,7 +191,7 @@ return null; } - String[] parts = value.split(" "); + String[] parts = value.split("\\s+"); if (parts == null) { return null; @@ -198,6 +203,10 @@ int i = 0; OUTER: for (String part: parts) { + if (part.length() == 0) { + continue; + } + try { double x = f.parse(part); for (int j = 0; j < i; ++j) {