Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/event/RangeFilterEvent.java @ 1536:4f4d29404dba
Filter the helper input tables using the range filter.
flys-client/trunk@3754 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 24 Jan 2012 08:46:33 +0000 |
parents | 98123d34529b |
children |
comparison
equal
deleted
inserted
replaced
1535:03e82be2aabc | 1536:4f4d29404dba |
---|---|
1 package de.intevation.flys.client.client.event; | 1 package de.intevation.flys.client.client.event; |
2 | |
3 import com.google.gwt.i18n.client.NumberFormat; | |
2 | 4 |
3 /** | 5 /** |
4 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 6 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
5 */ | 7 */ |
6 public class RangeFilterEvent { | 8 public class RangeFilterEvent { |
7 | 9 |
8 protected String from; | 10 protected Float from; |
9 protected String to; | 11 protected Float to; |
10 | 12 |
11 | 13 |
12 public RangeFilterEvent(String from, String to) { | 14 public RangeFilterEvent(String from, String to) { |
13 this.from = from; | 15 NumberFormat nf = NumberFormat.getDecimalFormat(); |
14 this.to = to; | 16 double d; |
17 | |
18 try { | |
19 d = nf.parse(from); | |
20 this.from = Float.valueOf(String.valueOf(d)); | |
21 } | |
22 catch(NumberFormatException nfe) { | |
23 this.from = Float.NaN; | |
24 } | |
25 try { | |
26 d = nf.parse(to); | |
27 this.to = Float.valueOf(String.valueOf(d)); | |
28 } | |
29 catch(NumberFormatException nfe) { | |
30 this.to = Float.NaN; | |
31 } | |
15 } | 32 } |
16 | 33 |
17 | 34 |
18 public String getFrom() { | 35 public Float getFrom() { |
19 return String.valueOf(this.from); | 36 return this.from; |
20 } | 37 } |
21 | 38 |
22 | 39 |
23 public String getTo() { | 40 public Float getTo() { |
24 return String.valueOf(this.to); | 41 return this.to; |
25 } | 42 } |
26 } | 43 } |
27 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 44 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |