Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java @ 4268:f75968f0ce80
Refactor GaugePanel and GaugeInfo to extract a base class
Extract a base class from GaugePanel and GaugeInfo to reuse code for displaying
the measurement station information.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 26 Oct 2012 12:19:54 +0200 |
parents | 221d255f7ec2 |
children |
comparison
equal
deleted
inserted
replaced
4267:8f9f80db46f3 | 4268:f75968f0ce80 |
---|---|
6 import com.google.gwt.i18n.client.NumberFormat; | 6 import com.google.gwt.i18n.client.NumberFormat; |
7 import com.google.gwt.user.client.ui.Anchor; | 7 import com.google.gwt.user.client.ui.Anchor; |
8 import com.google.gwt.user.client.ui.DecoratorPanel; | 8 import com.google.gwt.user.client.ui.DecoratorPanel; |
9 import com.google.gwt.user.client.ui.Grid; | 9 import com.google.gwt.user.client.ui.Grid; |
10 import com.google.gwt.user.client.ui.Label; | 10 import com.google.gwt.user.client.ui.Label; |
11 import com.google.gwt.user.client.ui.ScrollPanel; | |
12 import com.google.gwt.user.client.ui.Tree; | 11 import com.google.gwt.user.client.ui.Tree; |
13 import com.google.gwt.user.client.ui.TreeItem; | 12 import com.google.gwt.user.client.ui.TreeItem; |
14 | 13 |
15 import com.smartgwt.client.widgets.layout.HLayout; | 14 import com.smartgwt.client.widgets.layout.HLayout; |
16 | 15 |
17 import de.intevation.flys.client.client.FLYS; | 16 import de.intevation.flys.client.client.FLYS; |
18 import de.intevation.flys.client.client.FLYSConstants; | |
19 import de.intevation.flys.client.shared.model.Data; | 17 import de.intevation.flys.client.shared.model.Data; |
20 import de.intevation.flys.client.shared.model.DataItem; | 18 import de.intevation.flys.client.shared.model.DataItem; |
21 import de.intevation.flys.client.shared.model.DataList; | 19 import de.intevation.flys.client.shared.model.DataList; |
22 import de.intevation.flys.client.shared.model.GaugeInfo; | 20 import de.intevation.flys.client.shared.model.GaugeInfo; |
23 import de.intevation.flys.client.shared.model.RiverInfo; | 21 import de.intevation.flys.client.shared.model.RiverInfo; |
24 | 22 |
25 import java.util.ArrayList; | 23 import java.util.ArrayList; |
26 import java.util.Iterator; | 24 import java.util.Iterator; |
27 import java.util.List; | 25 import java.util.List; |
28 | 26 |
29 | 27 /** |
30 public class GaugeTree extends ScrollPanel { | 28 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> |
31 | 29 */ |
32 private FLYS flys; | 30 public class GaugeTree extends InfoTree { |
33 private Tree tree; | |
34 private DataList[] data; | |
35 | |
36 /** The message class that provides i18n strings.*/ | |
37 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); | |
38 | 31 |
39 public GaugeTree(FLYS flys) { | 32 public GaugeTree(FLYS flys) { |
40 this.flys = flys; | 33 this.flys = flys; |
41 tree = new Tree(); | 34 tree = new Tree(); |
42 setWidget(tree); | 35 setWidget(tree); |
44 | 37 |
45 /** | 38 /** |
46 * Resets the items of the tree. | 39 * Resets the items of the tree. |
47 * If the list of gauges is empty or null the tree will be empty. | 40 * If the list of gauges is empty or null the tree will be empty. |
48 */ | 41 */ |
49 public void setGauges(RiverInfo riverinfo) { | 42 @Override |
43 public void setRiverInfo(RiverInfo riverinfo) { | |
50 tree.clear(); | 44 tree.clear(); |
51 | 45 |
52 List<GaugeInfo> gauges = riverinfo.getGauges(); | 46 List<GaugeInfo> gauges = riverinfo.getGauges(); |
53 | 47 |
54 if (gauges != null && !gauges.isEmpty()) { | 48 if (gauges != null && !gauges.isEmpty()) { |
88 private void addGauge(GaugeInfo gauge) { | 82 private void addGauge(GaugeInfo gauge) { |
89 GaugeInfoItem gaugeitem = new GaugeInfoItem(flys, gauge); | 83 GaugeInfoItem gaugeitem = new GaugeInfoItem(flys, gauge); |
90 tree.addItem(gaugeitem); | 84 tree.addItem(gaugeitem); |
91 } | 85 } |
92 | 86 |
93 public void openAll() { | 87 void getLocations(String labelname, List<Double> locations, DataList dl) { |
94 GWT.log("GaugeTree - openAll"); | 88 for (int j = dl.size()-1; j >= 0; --j) { |
89 Data d = dl.get(j); | |
90 String label = d.getLabel(); | |
91 if (label.equals(labelname)) { | |
92 getLocationsFromData(locations, d); | |
93 } | |
94 } | |
95 } | |
96 | |
97 void getLocationsFromData(List<Double> locations, Data data) { | |
98 DataItem[] items = data.getItems(); | |
99 for (int k = 0; k < items.length; k++) { | |
100 String tmp = items[k].getStringValue(); | |
101 GWT.log("GaugeTree - getLocationsFromData " + tmp); | |
102 if (tmp != null) { | |
103 if (tmp.contains(" ")) { | |
104 // string contains several values ... | |
105 String[] values = tmp.split(" "); | |
106 for(int i=0; i < values.length; i++) { | |
107 Double value = Double.valueOf(values[i]); | |
108 if (value != null) { | |
109 locations.add(value); | |
110 } | |
111 } | |
112 } | |
113 else { | |
114 Double value = Double.valueOf(tmp); | |
115 if (value != null) { | |
116 locations.add(value); | |
117 } | |
118 } | |
119 } | |
120 } | |
121 } | |
122 | |
123 public void openOnReference(Long number) { | |
124 GWT.log("GaugeTree - openOnReference " + number); | |
95 for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) { | 125 for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) { |
96 TreeItem item = it.next(); | 126 TreeItem item = it.next(); |
97 item.setState(true); | 127 if (item instanceof GaugeInfoItem) { |
98 } | 128 GaugeInfoItem gitem = (GaugeInfoItem)item; |
99 } | 129 if (gitem.getReference().equals(number)) { |
100 | 130 item.setState(true); |
101 public void setData(DataList[] data) { | 131 } |
102 this.data = data; | 132 else { |
103 if (tree.getItemCount() > 0) { | 133 item.setState(false); |
104 open(); | 134 } |
135 } | |
136 } | |
137 } | |
138 | |
139 public void openOnDistance(Double start, Double end) { | |
140 GWT.log("GaugeTree - openOnDistance " + start + " " + end + " " + | |
141 tree.getItemCount()); | |
142 | |
143 for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) { | |
144 TreeItem item = it.next(); | |
145 /* Strange stuff is happening here: | |
146 * GWT Tree.treeItemIterator returns another TreeItem for each | |
147 * GaugeInfoItem */ | |
148 if (item instanceof GaugeInfoItem) { | |
149 boolean setstate = false; | |
150 GaugeInfoItem gitem = (GaugeInfoItem)item; | |
151 if (end == null && gitem.getStart() != null) { | |
152 if (gitem.getStart() >= start) { | |
153 setstate = true; | |
154 } | |
155 } | |
156 else { | |
157 // as getStart()/getEnd() return Double objects, they can be null and | |
158 // can cause NPEs when comparing with double... strange... | |
159 if (gitem.getStart() != null && gitem.getEnd() != null) { | |
160 GWT.log("GaugeTree - openOnDistance gitem " + gitem.getStart() + " " + gitem.getEnd()); | |
161 if ((start >= gitem.getStart() && start <= gitem.getEnd()) || | |
162 (end >= gitem.getStart() && end <= gitem.getEnd()) || | |
163 (start <= gitem.getStart() && end >= gitem.getEnd())) { | |
164 setstate = true; | |
165 } | |
166 } | |
167 } | |
168 item.setState(setstate); | |
169 } | |
170 } | |
171 } | |
172 | |
173 /** | |
174 * Open Gauge entry if a location fits to the gauge | |
175 */ | |
176 public void openOnLocations(List<Double> locations) { | |
177 GWT.log("GaugeTree - openOnLocations " + locations + " " + | |
178 tree.getItemCount()); | |
179 | |
180 if (locations == null || locations.isEmpty()) { | |
181 return; | |
182 } | |
183 | |
184 for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) { | |
185 TreeItem item = it.next(); | |
186 if (item instanceof GaugeInfoItem) { | |
187 GaugeInfoItem gitem = (GaugeInfoItem)item; | |
188 boolean isset = false; | |
189 for (Double location: locations) { | |
190 if (locations == null) { | |
191 continue; | |
192 } | |
193 | |
194 Double start = gitem.getStart(); | |
195 Double end = gitem.getEnd(); | |
196 if (start == null || end == null) { | |
197 // should not occur but avoid NullPointerException | |
198 continue; | |
199 } | |
200 | |
201 if (location >= start && location <= end) { | |
202 isset = true; | |
203 break; | |
204 } | |
205 } | |
206 item.setState(isset); | |
207 } | |
208 } | |
209 } | |
210 | |
211 class GaugeInfoItem extends TreeItem { | |
212 | |
213 private GaugeInfo gauge; | |
214 | |
215 public GaugeInfoItem(FLYS flys, GaugeInfo gauge) { | |
216 GaugeInfoHead gaugeinfohead = new GaugeInfoHead(flys, gauge); | |
217 GaugeInfoPanel gaugeinfopanel = new GaugeInfoPanel(gauge); | |
218 setWidget(gaugeinfohead); | |
219 addItem(gaugeinfopanel); | |
220 this.gauge = gauge; | |
221 } | |
222 | |
223 public Double getStart() { | |
224 return gauge.getKmStart(); | |
225 } | |
226 | |
227 public Double getEnd() { | |
228 return gauge.getKmEnd(); | |
229 } | |
230 | |
231 public Long getReference() { | |
232 return gauge.getOfficialNumber(); | |
233 } | |
234 } | |
235 | |
236 class GaugeInfoHead extends HLayout { | |
237 | |
238 public GaugeInfoHead(FLYS flys, GaugeInfo gauge) { | |
239 setStyleName("gaugeinfohead"); | |
240 setAutoHeight(); | |
241 setAutoWidth(); | |
242 | |
243 NumberFormat nf = NumberFormat.getDecimalFormat(); | |
244 | |
245 Label label = new Label(gauge.getName(), true); | |
246 addMember(label); | |
247 | |
248 Double start; | |
249 Double end; | |
250 | |
251 if (!gauge.isKmUp()) { | |
252 start = gauge.getKmStart(); | |
253 end = gauge.getKmEnd(); | |
254 } | |
255 else { | |
256 start = gauge.getKmEnd(); | |
257 end = gauge.getKmStart(); | |
258 } | |
259 | |
260 String kmtext = ""; | |
261 if (start != null) { | |
262 kmtext += nf.format(start); | |
263 kmtext += " - "; | |
264 } | |
265 if (end != null) { | |
266 kmtext += nf.format(end); | |
267 } | |
268 if (start != null || end != null) { | |
269 kmtext += " km"; | |
270 } | |
271 | |
272 label = new Label(kmtext); | |
273 | |
274 addMember(label); | |
275 | |
276 Double station = gauge.getStation(); | |
277 if (station != null) { | |
278 String stext = nf.format(station); | |
279 stext += " km"; | |
280 label = new Label(stext); | |
281 addMember(label); | |
282 } | |
283 | |
284 Long number = gauge.getOfficialNumber(); | |
285 String url = number != null ? | |
286 MSG.gauge_url() + number : | |
287 MSG.gauge_url(); | |
288 Anchor anchor = new Anchor(MSG.gauge_info_link(), url, "_blank"); | |
289 addMember(anchor); | |
290 | |
291 addMember(new GaugeCurveAnchor(flys, gauge)); | |
292 } | |
293 } | |
294 | |
295 class GaugeCurveAnchor extends Anchor implements ClickHandler { | |
296 | |
297 private FLYS flys; | |
298 private GaugeInfo gauge; | |
299 | |
300 public GaugeCurveAnchor(FLYS flys, GaugeInfo gauge) { | |
301 super(MSG.gauge_curve_link()); | |
302 this.flys = flys; | |
303 this.gauge = gauge; | |
304 | |
305 addClickHandler(this); | |
306 } | |
307 | |
308 @Override | |
309 public void onClick(ClickEvent ev) { | |
310 GWT.log("GaugeCurveAnchor - onClick " + gauge.getRiverName() + | |
311 " " + gauge.getOfficialNumber()); | |
312 flys.newGaugeDischargeCurve(gauge.getRiverName(), | |
313 gauge.getOfficialNumber()); | |
314 } | |
315 } | |
316 | |
317 class GaugeInfoPanel extends DecoratorPanel { | |
318 | |
319 public GaugeInfoPanel(GaugeInfo gauge) { | |
320 setStyleName("gaugeinfopanel"); | |
321 Grid grid = new Grid(4, 2); | |
322 | |
323 NumberFormat nf = NumberFormat.getDecimalFormat(); | |
324 | |
325 Double minw = gauge.getMinW(); | |
326 Double maxw = gauge.getMaxW(); | |
327 if (minw != null && maxw != null) { | |
328 grid.setText(0, 0, MSG.wq_value_q()); | |
329 grid.setText(0, 1, "" + nf.format(minw) + | |
330 " - " + nf.format(maxw)); | |
331 } | |
332 | |
333 Double minq = gauge.getMinQ(); | |
334 Double maxq = gauge.getMaxQ(); | |
335 if (minq != null && maxq != null) { | |
336 grid.setText(1, 0, MSG.wq_value_w()); | |
337 grid.setText(1, 1, "" + nf.format(minq) + | |
338 " - " + nf.format(maxq)); | |
339 } | |
340 | |
341 Double aeo = gauge.getAeo(); | |
342 if (aeo != null) { | |
343 grid.setText(2, 0, "AEO [km²]"); | |
344 grid.setText(2, 1, "" + nf.format(aeo)); | |
345 } | |
346 | |
347 Double datum = gauge.getDatum(); | |
348 if (datum != null) { | |
349 grid.setText(3, 0, MSG.gauge_zero() + " [" + | |
350 gauge.getWstUnit() + "]"); | |
351 grid.setText(3, 1, "" + nf.format(datum)); | |
352 } | |
353 | |
354 setWidget(grid); | |
105 } | 355 } |
106 } | 356 } |
107 | 357 |
108 public void open() { | 358 public void open() { |
109 ArrayList<Double> locations = new ArrayList<Double>(); | 359 ArrayList<Double> locations = new ArrayList<Double>(); |
194 } | 444 } |
195 else { | 445 else { |
196 openAll(); | 446 openAll(); |
197 } | 447 } |
198 } | 448 } |
199 | |
200 private void getLocations(String labelname, List<Double> locations, DataList dl) { | |
201 for (int j = dl.size()-1; j >= 0; --j) { | |
202 Data d = dl.get(j); | |
203 String label = d.getLabel(); | |
204 if (label.equals(labelname)) { | |
205 getLocationsFromData(locations, d); | |
206 } | |
207 } | |
208 } | |
209 | |
210 private void getLocationsFromData(List<Double> locations, Data data) { | |
211 DataItem[] items = data.getItems(); | |
212 for (int k = 0; k < items.length; k++) { | |
213 String tmp = items[k].getStringValue(); | |
214 GWT.log("GaugeTree - getLocationsFromData " + tmp); | |
215 if (tmp != null) { | |
216 if (tmp.contains(" ")) { | |
217 // string contains several values ... | |
218 String[] values = tmp.split(" "); | |
219 for(int i=0; i < values.length; i++) { | |
220 Double value = Double.valueOf(values[i]); | |
221 if (value != null) { | |
222 locations.add(value); | |
223 } | |
224 } | |
225 } | |
226 else { | |
227 Double value = Double.valueOf(tmp); | |
228 if (value != null) { | |
229 locations.add(value); | |
230 } | |
231 } | |
232 } | |
233 } | |
234 } | |
235 | |
236 private Double getDoubleValue(Data d) { | |
237 String tmp = d.getStringValue(); | |
238 if (tmp != null) { | |
239 return Double.valueOf(tmp); | |
240 } | |
241 return null; | |
242 } | |
243 | |
244 public void openOnReference(Long number) { | |
245 GWT.log("GaugeTree - openOnReference " + number); | |
246 for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) { | |
247 TreeItem item = it.next(); | |
248 if (item instanceof GaugeInfoItem) { | |
249 GaugeInfoItem gitem = (GaugeInfoItem)item; | |
250 if (gitem.getReference().equals(number)) { | |
251 item.setState(true); | |
252 } | |
253 else { | |
254 item.setState(false); | |
255 } | |
256 } | |
257 } | |
258 } | |
259 | |
260 public void openOnDistance(Double start, Double end) { | |
261 GWT.log("GaugeTree - openOnDistance " + start + " " + end + " " + | |
262 tree.getItemCount()); | |
263 | |
264 for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) { | |
265 TreeItem item = it.next(); | |
266 /* Strange stuff is happening here: | |
267 * GWT Tree.treeItemIterator returns another TreeItem for each | |
268 * GaugeInfoItem */ | |
269 if (item instanceof GaugeInfoItem) { | |
270 boolean setstate = false; | |
271 GaugeInfoItem gitem = (GaugeInfoItem)item; | |
272 if (end == null && gitem.getStart() != null) { | |
273 if (gitem.getStart() >= start) { | |
274 setstate = true; | |
275 } | |
276 } | |
277 else { | |
278 // as getStart()/getEnd() return Double objects, they can be null and | |
279 // can cause NPEs when comparing with double... strange... | |
280 if (gitem.getStart() != null && gitem.getEnd() != null) { | |
281 GWT.log("GaugeTree - openOnDistance gitem " + gitem.getStart() + " " + gitem.getEnd()); | |
282 if ((start >= gitem.getStart() && start <= gitem.getEnd()) || | |
283 (end >= gitem.getStart() && end <= gitem.getEnd()) || | |
284 (start <= gitem.getStart() && end >= gitem.getEnd())) { | |
285 setstate = true; | |
286 } | |
287 } | |
288 } | |
289 item.setState(setstate); | |
290 } | |
291 } | |
292 } | |
293 | |
294 /** | |
295 * Open Gauge entry if a location fits to the gauge | |
296 */ | |
297 public void openOnLocations(List<Double> locations) { | |
298 GWT.log("GaugeTree - openOnLocations " + locations + " " + | |
299 tree.getItemCount()); | |
300 | |
301 if (locations == null || locations.isEmpty()) { | |
302 return; | |
303 } | |
304 | |
305 for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) { | |
306 TreeItem item = it.next(); | |
307 if (item instanceof GaugeInfoItem) { | |
308 GaugeInfoItem gitem = (GaugeInfoItem)item; | |
309 boolean isset = false; | |
310 for (Double location: locations) { | |
311 if (locations == null) { | |
312 continue; | |
313 } | |
314 | |
315 Double start = gitem.getStart(); | |
316 Double end = gitem.getEnd(); | |
317 if (start == null || end == null) { | |
318 // should not occur but avoid NullPointerException | |
319 continue; | |
320 } | |
321 | |
322 if (location >= start && location <= end) { | |
323 isset = true; | |
324 break; | |
325 } | |
326 } | |
327 item.setState(isset); | |
328 } | |
329 } | |
330 } | |
331 | |
332 class GaugeInfoItem extends TreeItem { | |
333 | |
334 private GaugeInfo gauge; | |
335 | |
336 public GaugeInfoItem(FLYS flys, GaugeInfo gauge) { | |
337 GaugeInfoHead gaugeinfohead = new GaugeInfoHead(flys, gauge); | |
338 GaugeInfoPanel gaugeinfopanel = new GaugeInfoPanel(gauge); | |
339 setWidget(gaugeinfohead); | |
340 addItem(gaugeinfopanel); | |
341 this.gauge = gauge; | |
342 } | |
343 | |
344 public Double getStart() { | |
345 return gauge.getKmStart(); | |
346 } | |
347 | |
348 public Double getEnd() { | |
349 return gauge.getKmEnd(); | |
350 } | |
351 | |
352 public Long getReference() { | |
353 return gauge.getOfficialNumber(); | |
354 } | |
355 } | |
356 | |
357 class GaugeInfoHead extends HLayout { | |
358 | |
359 public GaugeInfoHead(FLYS flys, GaugeInfo gauge) { | |
360 setStyleName("gaugeinfohead"); | |
361 setAutoHeight(); | |
362 setAutoWidth(); | |
363 | |
364 NumberFormat nf = NumberFormat.getDecimalFormat(); | |
365 | |
366 Label label = new Label(gauge.getName(), true); | |
367 addMember(label); | |
368 | |
369 Double start; | |
370 Double end; | |
371 | |
372 if (!gauge.isKmUp()) { | |
373 start = gauge.getKmStart(); | |
374 end = gauge.getKmEnd(); | |
375 } | |
376 else { | |
377 start = gauge.getKmEnd(); | |
378 end = gauge.getKmStart(); | |
379 } | |
380 | |
381 String kmtext = ""; | |
382 if (start != null) { | |
383 kmtext += nf.format(start); | |
384 kmtext += " - "; | |
385 } | |
386 if (end != null) { | |
387 kmtext += nf.format(end); | |
388 } | |
389 if (start != null || end != null) { | |
390 kmtext += " km"; | |
391 } | |
392 | |
393 label = new Label(kmtext); | |
394 | |
395 addMember(label); | |
396 | |
397 Double station = gauge.getStation(); | |
398 if (station != null) { | |
399 String stext = nf.format(station); | |
400 stext += " km"; | |
401 label = new Label(stext); | |
402 addMember(label); | |
403 } | |
404 | |
405 Long number = gauge.getOfficialNumber(); | |
406 String url = number != null ? | |
407 MSG.gauge_url() + number : | |
408 MSG.gauge_url(); | |
409 Anchor anchor = new Anchor(MSG.gauge_info_link(), url, "_blank"); | |
410 addMember(anchor); | |
411 | |
412 addMember(new GaugeCurveAnchor(flys, gauge)); | |
413 } | |
414 } | |
415 | |
416 class GaugeCurveAnchor extends Anchor implements ClickHandler { | |
417 | |
418 private FLYS flys; | |
419 private GaugeInfo gauge; | |
420 | |
421 public GaugeCurveAnchor(FLYS flys, GaugeInfo gauge) { | |
422 super(MSG.gauge_curve_link()); | |
423 this.flys = flys; | |
424 this.gauge = gauge; | |
425 | |
426 addClickHandler(this); | |
427 } | |
428 | |
429 @Override | |
430 public void onClick(ClickEvent ev) { | |
431 GWT.log("GaugeCurveAnchor - onClick " + gauge.getRiverName() + | |
432 " " + gauge.getOfficialNumber()); | |
433 flys.newGaugeDischargeCurve(gauge.getRiverName(), | |
434 gauge.getOfficialNumber()); | |
435 } | |
436 } | |
437 | |
438 class GaugeInfoPanel extends DecoratorPanel { | |
439 | |
440 public GaugeInfoPanel(GaugeInfo gauge) { | |
441 setStyleName("gaugeinfopanel"); | |
442 Grid grid = new Grid(4, 2); | |
443 | |
444 NumberFormat nf = NumberFormat.getDecimalFormat(); | |
445 | |
446 Double minw = gauge.getMinW(); | |
447 Double maxw = gauge.getMaxW(); | |
448 if (minw != null && maxw != null) { | |
449 grid.setText(0, 0, MSG.wq_value_q()); | |
450 grid.setText(0, 1, "" + nf.format(minw) + | |
451 " - " + nf.format(maxw)); | |
452 } | |
453 | |
454 Double minq = gauge.getMinQ(); | |
455 Double maxq = gauge.getMaxQ(); | |
456 if (minq != null && maxq != null) { | |
457 grid.setText(1, 0, MSG.wq_value_w()); | |
458 grid.setText(1, 1, "" + nf.format(minq) + | |
459 " - " + nf.format(maxq)); | |
460 } | |
461 | |
462 Double aeo = gauge.getAeo(); | |
463 if (aeo != null) { | |
464 grid.setText(2, 0, "AEO [km²]"); | |
465 grid.setText(2, 1, "" + nf.format(aeo)); | |
466 } | |
467 | |
468 Double datum = gauge.getDatum(); | |
469 if (datum != null) { | |
470 grid.setText(3, 0, MSG.gauge_zero() + " [" + | |
471 gauge.getWstUnit() + "]"); | |
472 grid.setText(3, 1, "" + nf.format(datum)); | |
473 } | |
474 | |
475 setWidget(grid); | |
476 } | |
477 } | |
478 | |
479 } | 449 } |