Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationRecord.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationRecord.java@821a02bbfb4e |
children | 172338b1407f |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.client.client.ui.stationinfo; | |
2 | |
3 import java.util.Date; | |
4 | |
5 import com.google.gwt.core.client.GWT; | |
6 import com.smartgwt.client.widgets.grid.ListGridRecord; | |
7 | |
8 import org.dive4elements.river.client.client.FLYSConstants; | |
9 import org.dive4elements.river.client.shared.model.MeasurementStation; | |
10 | |
11 /** | |
12 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> | |
13 */ | |
14 public class MeasurementStationRecord | |
15 extends ListGridRecord | |
16 implements MeasurementStation { | |
17 | |
18 /** The message class that provides i18n strings.*/ | |
19 private FLYSConstants MSG = GWT.create(FLYSConstants.class); | |
20 | |
21 public MeasurementStationRecord(MeasurementStation station) { | |
22 this.setCanExpand(true); | |
23 | |
24 Integer number = station.getID(); | |
25 String link = number != null ? | |
26 MSG.measurement_station_url() + number : | |
27 MSG.measurement_station_url(); | |
28 this.setLink(link); | |
29 this.setLinkText(MSG.measurement_station_info_link()); | |
30 this.setCurveLink(MSG.static_sqrelation()); | |
31 this.setID(number); | |
32 this.setName(station.getName()); | |
33 if (station.isKmUp()) { | |
34 this.setKmEnd(station.getKmStart()); | |
35 this.setKmStart(station.getKmEnd()); | |
36 } | |
37 else { | |
38 this.setKmEnd(station.getKmEnd()); | |
39 this.setKmStart(station.getKmStart()); | |
40 } | |
41 this.setKmUp(station.isKmUp()); | |
42 this.setRiverName(station.getRiverName()); | |
43 this.setStation(station.getStation()); | |
44 this.setGaugeName(station.getGaugeName()); | |
45 this.setMeasurementType(station.getMeasurementType()); | |
46 this.setOperator(station.getOperator()); | |
47 this.setRiverSide(station.getRiverSide()); | |
48 this.setStartTime(station.getStartTime()); | |
49 this.setStopTime(station.getStopTime()); | |
50 } | |
51 | |
52 @Override | |
53 public Integer getID() { | |
54 return this.getAttributeAsInt("stationid"); | |
55 } | |
56 | |
57 private void setID(Integer value) { | |
58 this.setAttribute("stationid", value); | |
59 } | |
60 | |
61 @Override | |
62 public String getName() { | |
63 return this.getAttributeAsString("name"); | |
64 } | |
65 | |
66 private void setName(String value) { | |
67 this.setAttribute("name", value); | |
68 } | |
69 | |
70 @Override | |
71 public Double getKmStart() { | |
72 return this.getAttributeAsDouble("kmstart"); | |
73 } | |
74 | |
75 private void setKmStart(Double value) { | |
76 this.setAttribute("kmstart", value); | |
77 } | |
78 | |
79 @Override | |
80 public Double getKmEnd() { | |
81 return this.getAttributeAsDouble("kmend"); | |
82 } | |
83 | |
84 private void setKmEnd(Double value) { | |
85 this.setAttribute("kmend", value); | |
86 } | |
87 | |
88 @Override | |
89 public boolean isKmUp() { | |
90 return this.getAttributeAsBoolean("kmup"); | |
91 } | |
92 | |
93 private void setKmUp(boolean value) { | |
94 this.setAttribute("kmup", value); | |
95 } | |
96 | |
97 @Override | |
98 public Double getStation() { | |
99 return this.getAttributeAsDouble("station"); | |
100 } | |
101 | |
102 private void setStation(Double station) { | |
103 this.setAttribute("station", station); | |
104 } | |
105 | |
106 @Override | |
107 public String getRiverName() { | |
108 return this.getAttributeAsString("rivername"); | |
109 } | |
110 | |
111 private void setRiverName(String rivername) { | |
112 this.setAttribute("rivername", rivername); | |
113 } | |
114 | |
115 @Override | |
116 public String getRiverSide() { | |
117 return this.getAttributeAsString("riverside"); | |
118 } | |
119 | |
120 private void setRiverSide(String riverside) { | |
121 this.setAttribute("riverside", riverside); | |
122 } | |
123 | |
124 @Override | |
125 public String getMeasurementType() { | |
126 return this.getAttributeAsString("measurementtype"); | |
127 } | |
128 | |
129 private void setMeasurementType(String value) { | |
130 this.setAttribute("measurementtype", value); | |
131 } | |
132 | |
133 @Override | |
134 public String getOperator() { | |
135 return this.getAttributeAsString("operator"); | |
136 } | |
137 | |
138 private void setOperator(String value) { | |
139 this.setAttribute("operator", value); | |
140 } | |
141 | |
142 @Override | |
143 public Date getStartTime() { | |
144 return this.getAttributeAsDate("starttime"); | |
145 } | |
146 | |
147 private void setStartTime(Date value) { | |
148 this.setAttribute("starttime", value); | |
149 } | |
150 | |
151 @Override | |
152 public Date getStopTime() { | |
153 return this.getAttributeAsDate("stoptime"); | |
154 } | |
155 | |
156 private void setStopTime(Date value) { | |
157 this.setAttribute("stoptime", value); | |
158 } | |
159 | |
160 @Override | |
161 public String getGaugeName() { | |
162 return this.getAttributeAsString("gaugename"); | |
163 } | |
164 | |
165 private void setGaugeName(String value) { | |
166 this.setAttribute("gaugename", value); | |
167 } | |
168 | |
169 public String getLink() { | |
170 return this.getAttributeAsString("link"); | |
171 } | |
172 | |
173 public void setLink(String link) { | |
174 this.setAttribute("link", link); | |
175 } | |
176 | |
177 public void setCurveLink(String link) { | |
178 this.setAttribute("curvelink", link); | |
179 } | |
180 | |
181 public String getCurveLink() { | |
182 return this.getAttribute("curvelink"); | |
183 } | |
184 | |
185 } |