comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeRecord.java @ 4956:f46a07c11324

Refactor Pegel- and Messtelleninfo in client ui Use SmartGWT ListGrid instead of GWT Tree to display the station entires.
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 01 Feb 2013 16:32:48 +0100
parents
children 8c527ea4603b
comparison
equal deleted inserted replaced
4950:4c7acc3a4ae1 4956:f46a07c11324
1 package de.intevation.flys.client.client.ui.stationinfo;
2
3 import com.google.gwt.core.client.GWT;
4 import com.smartgwt.client.widgets.grid.ListGridRecord;
5
6 import de.intevation.flys.client.client.FLYSConstants;
7 import de.intevation.flys.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 }
40
41 private void setLink(String url) {
42 this.setAttribute("link", url);
43 }
44
45 public String getLink() {
46 return this.getAttributeAsString("link");
47 }
48
49 public String getName() {
50 return this.getAttributeAsString("name");
51 }
52
53 private void setName(String value) {
54 this.setAttribute("name", value);
55 }
56
57 public Double getKmStart() {
58 return this.getAttributeAsDouble("kmstart");
59 }
60
61 private void setKmStart(Double value) {
62 this.setAttribute("kmstart", value);
63 }
64
65 public Double getKmEnd() {
66 return this.getAttributeAsDouble("kmend");
67 }
68
69 private void setKmEnd(Double value) {
70 this.setAttribute("kmend", value);
71 }
72
73 public Double getMinQ() {
74 return this.getAttributeAsDouble("minq");
75 }
76
77 private void setMinQ(Double value) {
78 this.setAttribute("minq", value);
79 }
80
81 public Double getMaxQ() {
82 return this.getAttributeAsDouble("maxq");
83 }
84
85 private void setMaxQ(Double value) {
86 this.setAttribute("maxq", value);
87 }
88
89 public Double getMinW() {
90 return this.getAttributeAsDouble("minw");
91 }
92
93 private void setMinW(Double value) {
94 this.setAttribute("minw", value);
95 }
96
97 public Double getMaxW() {
98 return this.getAttributeAsDouble("maxw");
99 }
100
101 private void setMaxW(Double value) {
102 this.setAttribute("maxw", value);
103 }
104
105 public Double getDatum() {
106 return this.getAttributeAsDouble("datum");
107 }
108
109 private void setDatum(Double value) {
110 this.setAttribute("datum", value);
111 }
112
113 public Double getAeo() {
114 return this.getAttributeAsDouble("aeo");
115 }
116
117 private void setAeo(Double value) {
118 this.setAttribute("aeo", value);
119 }
120
121 public boolean isKmUp() {
122 return this.getAttributeAsBoolean("kmup");
123 }
124
125 private void setKmUp(boolean value) {
126 this.setAttribute("kmup", value);
127 }
128
129 public Double getStation() {
130 return this.getAttributeAsDouble("station");
131 }
132
133 private void setStation(Double value) {
134 this.setAttribute("station", value);
135 }
136
137 public String getWstUnit() {
138 return this.getAttributeAsString("wstunit");
139 }
140
141 private void setWstUnit(String value) {
142 this.setAttribute("wstunit", value);
143 }
144
145 public Long getOfficialNumber() {
146 return this.getAttributeAsLong("officialnumber");
147 }
148
149 private void setOfficialNumber(Long number) {
150 this.setAttribute("officialnumber", number);
151 }
152
153 public String getRiverName() {
154 return this.getAttributeAsString("rivername");
155 }
156
157 private void setRiverName(String rivername) {
158 this.setAttribute("rivername", rivername);
159 }
160 }

http://dive4elements.wald.intevation.org