Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/DoubleRangeData.java @ 1593:ff9d71469b7c
Adjusted to be able to feed data to reference curves.
flys-client/trunk@3902 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 03 Feb 2012 13:57:27 +0000 |
parents | |
children | d0a9acddbea2 |
rev | line source |
---|---|
1593
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.shared.model; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 public class DoubleRangeData implements RangeData { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 public static final String TYPE = "doublerange"; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 protected String label; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 protected String description; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 protected double lower; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 protected double upper; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 protected Double defLower; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 protected Double defUpper; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 public DoubleRangeData() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 public DoubleRangeData(String label, String desc, double lower, double upper) { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 this(label, desc, lower, upper, null, null); |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 public DoubleRangeData( |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 String label, |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 String desc, |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 double lower, |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 double upper, |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 Double defLower, |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 Double defUpper |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 ) { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 this.label = label; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 this.description = desc; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 this.lower = lower; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 this.upper = upper; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 this.defLower = defLower; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 this.defUpper = defUpper; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 /** |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 * Returns the label of the item. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 * |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 * @return the label. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 */ |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 public String getLabel() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 return label; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 /** |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 * Returns the description of the item. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 * |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 * @return the description. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 */ |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 public String getDescription() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 return description; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 /** |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 * Returns the type of the item. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 * |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 * @return the type. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 */ |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 public String getType() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 return "doublerange"; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 /** |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 * Returns a DataItem which value is a string that consists of the min and |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 * max value separated by a ';'. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
78 * |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 * @return the DataItem. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 */ |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 public DataItem[] getItems() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 String theMin = String.valueOf(lower); |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 String theMax = String.valueOf(upper); |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
84 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 String label = theMin + " - " + theMax; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 String value = theMin + ";" + theMax; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
88 DataItem item = new DefaultDataItem(label, label, value); |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 return new DataItem[] { item }; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 /** |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 * @return always null. |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 */ |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 public DataItem getDefault() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 return null; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 public Object getLower() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 return lower; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 public Object getUpper() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 return upper; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
109 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 public Object getDefaultLower() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 return defLower; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
116 |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
117 public Object getDefaultUpper() { |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 return defUpper; |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
120 } |
ff9d71469b7c
Adjusted to be able to feed data to reference curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |