annotate gwt-client/src/main/java/org/dive4elements/river/client/client/event/RangeFilterEvent.java @ 5861:172338b1407f

GWT client: Added copyright header.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:30:15 +0200
parents 5aa05a7a34b7
children ea9eef426962
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.event;
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10
1536
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
11 import com.google.gwt.i18n.client.NumberFormat;
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
12
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 /**
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 */
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 public class RangeFilterEvent {
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17
1536
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
18 protected Float from;
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
19 protected Float to;
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 public RangeFilterEvent(String from, String to) {
1536
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
23 NumberFormat nf = NumberFormat.getDecimalFormat();
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
24 double d;
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
25
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
26 try {
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
27 d = nf.parse(from);
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
28 this.from = Float.valueOf(String.valueOf(d));
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
29 }
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
30 catch(NumberFormatException nfe) {
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
31 this.from = Float.NaN;
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
32 }
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
33 try {
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
34 d = nf.parse(to);
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
35 this.to = Float.valueOf(String.valueOf(d));
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
36 }
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
37 catch(NumberFormatException nfe) {
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
38 this.to = Float.NaN;
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
39 }
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42
1536
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
43 public Float getFrom() {
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
44 return this.from;
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47
1536
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
48 public Float getTo() {
4f4d29404dba Filter the helper input tables using the range filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
49 return this.to;
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org