comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeRecord.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/GaugeRecord.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 com.google.gwt.core.client.GWT;
4 import com.smartgwt.client.widgets.grid.ListGridRecord;
5
6 import org.dive4elements.river.client.client.FLYSConstants;
7 import org.dive4elements.river.client.shared.model.GaugeInfo;
8
9 /**
10 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
11 */
12 public class GaugeRecord extends ListGridRecord implements GaugeInfo {
13
14 /** The message class that provides i18n strings.*/
15 private FLYSConstants MSG = GWT.create(FLYSConstants.class);
16
17 public GaugeRecord(GaugeInfo gauge) {
18 setCanExpand(true);
19 Long number = gauge.getOfficialNumber();
20 String url = number != null ?
21 MSG.gauge_url() + number :
22 MSG.gauge_url();
23 setLink(url);
24 setLinkText(MSG.gauge_info_link());
25 setName(gauge.getName());
26 setKmStart(gauge.getKmStart());
27 setKmEnd(gauge.getKmEnd());
28 setMinQ(gauge.getMinQ());
29 setMaxQ(gauge.getMaxQ());
30 setMinW(gauge.getMinW());
31 setMaxW(gauge.getMaxW());
32 setAeo(gauge.getAeo());
33 setDatum(gauge.getDatum());
34 setKmUp(gauge.isKmUp());
35 setOfficialNumber(gauge.getOfficialNumber());
36 setRiverName(gauge.getRiverName());
37 setStation(gauge.getStation());
38 setWstUnit(gauge.getWstUnit());
39 setCurveLink(MSG.gauge_curve_link());
40 }
41
42 private void setCurveLink(String value) {
43 this.setAttribute("curvelink", value);
44 }
45
46 private void setLink(String url) {
47 this.setAttribute("link", url);
48 }
49
50 public String getLink() {
51 return this.getAttributeAsString("link");
52 }
53
54 public String getName() {
55 return this.getAttributeAsString("name");
56 }
57
58 private void setName(String value) {
59 this.setAttribute("name", value);
60 }
61
62 public Double getKmStart() {
63 return this.getAttributeAsDouble("kmstart");
64 }
65
66 private void setKmStart(Double value) {
67 this.setAttribute("kmstart", value);
68 }
69
70 public Double getKmEnd() {
71 return this.getAttributeAsDouble("kmend");
72 }
73
74 private void setKmEnd(Double value) {
75 this.setAttribute("kmend", value);
76 }
77
78 public Double getMinQ() {
79 return this.getAttributeAsDouble("minq");
80 }
81
82 private void setMinQ(Double value) {
83 this.setAttribute("minq", value);
84 }
85
86 public Double getMaxQ() {
87 return this.getAttributeAsDouble("maxq");
88 }
89
90 private void setMaxQ(Double value) {
91 this.setAttribute("maxq", value);
92 }
93
94 public Double getMinW() {
95 return this.getAttributeAsDouble("minw");
96 }
97
98 private void setMinW(Double value) {
99 this.setAttribute("minw", value);
100 }
101
102 public Double getMaxW() {
103 return this.getAttributeAsDouble("maxw");
104 }
105
106 private void setMaxW(Double value) {
107 this.setAttribute("maxw", value);
108 }
109
110 public Double getDatum() {
111 return this.getAttributeAsDouble("datum");
112 }
113
114 private void setDatum(Double value) {
115 this.setAttribute("datum", value);
116 }
117
118 public Double getAeo() {
119 return this.getAttributeAsDouble("aeo");
120 }
121
122 private void setAeo(Double value) {
123 this.setAttribute("aeo", value);
124 }
125
126 public boolean isKmUp() {
127 return this.getAttributeAsBoolean("kmup");
128 }
129
130 private void setKmUp(boolean value) {
131 this.setAttribute("kmup", value);
132 }
133
134 public Double getStation() {
135 return this.getAttributeAsDouble("station");
136 }
137
138 private void setStation(Double value) {
139 this.setAttribute("station", value);
140 }
141
142 public String getWstUnit() {
143 return this.getAttributeAsString("wstunit");
144 }
145
146 private void setWstUnit(String value) {
147 this.setAttribute("wstunit", value);
148 }
149
150 public Long getOfficialNumber() {
151 return this.getAttributeAsLong("officialnumber");
152 }
153
154 private void setOfficialNumber(Long number) {
155 this.setAttribute("officialnumber", number);
156 }
157
158 public String getRiverName() {
159 return this.getAttributeAsString("rivername");
160 }
161
162 private void setRiverName(String rivername) {
163 this.setAttribute("rivername", rivername);
164 }
165 }

http://dive4elements.wald.intevation.org