Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DistanceInfoRecord.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/shared/model/DistanceInfoRecord.java@821a02bbfb4e |
children | 172338b1407f |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.client.shared.model; | |
2 | |
3 import com.smartgwt.client.widgets.grid.ListGridRecord; | |
4 | |
5 | |
6 /** | |
7 * The DistanceInfoRecord is a wrapper to put DistanceInfo objects into | |
8 * a ListGrid. | |
9 * | |
10 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | |
11 */ | |
12 public class DistanceInfoRecord extends ListGridRecord { | |
13 | |
14 /** The artifact collection. */ | |
15 protected DistanceInfoObject distanceInfo; | |
16 | |
17 | |
18 /** | |
19 * The default constructor. | |
20 * | |
21 * @param info The distance info object. | |
22 */ | |
23 public DistanceInfoRecord(DistanceInfoObject info) { | |
24 this.distanceInfo = info; | |
25 | |
26 setDescription(info.getDescription()); | |
27 setFrom(info.getFrom()); | |
28 if (info.getTo() != null) | |
29 setTo(info.getTo()); | |
30 else | |
31 setTo(info.getFrom()); | |
32 setRiverside(info.getRiverside()); | |
33 setBottom(info.getBottom()); | |
34 setTop(info.getTop()); | |
35 } | |
36 | |
37 | |
38 /** | |
39 * Sets the creation time. | |
40 * | |
41 * @param creationTime The creation time. | |
42 */ | |
43 public void setDescription(String description) { | |
44 setAttribute("description", description); | |
45 } | |
46 | |
47 | |
48 /** | |
49 * Returns the description. | |
50 * | |
51 * @return the description. | |
52 */ | |
53 public String getDescription() { | |
54 return getAttributeAsString("description"); | |
55 } | |
56 | |
57 | |
58 public void setFrom(double from) { | |
59 setAttribute("from", from); | |
60 } | |
61 | |
62 | |
63 public double getFrom() { | |
64 return getAttributeAsDouble("from"); | |
65 } | |
66 | |
67 public void setTo(double to) { | |
68 setAttribute("to", to); | |
69 } | |
70 | |
71 | |
72 public double getTo() { | |
73 return getAttributeAsDouble("to"); | |
74 } | |
75 | |
76 | |
77 public void setRiverside(String side) { | |
78 setAttribute("riverside", side); | |
79 } | |
80 | |
81 | |
82 public String getRiverside() { | |
83 return getAttributeAsString("riverside"); | |
84 } | |
85 | |
86 public void setBottom(Double bottom) { | |
87 setAttribute("bottom", bottom != null ? bottom.toString() : "-"); | |
88 } | |
89 | |
90 public String getBottom() { | |
91 return getAttributeAsString("bottom"); | |
92 } | |
93 | |
94 public void setTop(Double top) { | |
95 setAttribute("top", top != null ? top.toString() : "-"); | |
96 } | |
97 | |
98 public String getTop() { | |
99 return getAttributeAsString("top"); | |
100 } | |
101 | |
102 | |
103 public DistanceInfoObject getDistanceInfo() { | |
104 return distanceInfo; | |
105 } | |
106 } | |
107 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |