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