annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DistanceInfoRecord.java @ 5861:172338b1407f

GWT client: Added copyright header.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:30:15 +0200
parents 5aa05a7a34b7
children ea9eef426962
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.shared.model;
235
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 import com.smartgwt.client.widgets.grid.ListGridRecord;
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 /**
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 * The DistanceInfoRecord is a wrapper to put DistanceInfo objects into
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 * a ListGrid.
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 *
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 */
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 public class DistanceInfoRecord extends ListGridRecord {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 /** The artifact collection. */
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 protected DistanceInfoObject distanceInfo;
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 /**
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 * The default constructor.
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 *
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 * @param info The distance info object.
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 */
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 public DistanceInfoRecord(DistanceInfoObject info) {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 this.distanceInfo = info;
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 setDescription(info.getDescription());
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 setFrom(info.getFrom());
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 if (info.getTo() != null)
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 setTo(info.getTo());
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 else
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 setTo(info.getFrom());
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 setRiverside(info.getRiverside());
568
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
41 setBottom(info.getBottom());
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
42 setTop(info.getTop());
235
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 /**
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 * Sets the creation time.
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 *
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 * @param creationTime The creation time.
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 */
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 public void setDescription(String description) {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 setAttribute("description", description);
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 /**
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 * Returns the description.
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 *
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 * @return the description.
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 */
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 public String getDescription() {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 return getAttributeAsString("description");
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 public void setFrom(double from) {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 setAttribute("from", from);
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 public double getFrom() {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 return getAttributeAsDouble("from");
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 public void setTo(double to) {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 setAttribute("to", to);
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 public double getTo() {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 return getAttributeAsDouble("to");
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 public void setRiverside(String side) {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 setAttribute("riverside", side);
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 public String getRiverside() {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 return getAttributeAsString("riverside");
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93
568
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
94 public void setBottom(Double bottom) {
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
95 setAttribute("bottom", bottom != null ? bottom.toString() : "-");
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
96 }
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
97
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
98 public String getBottom() {
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
99 return getAttributeAsString("bottom");
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
100 }
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
101
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
102 public void setTop(Double top) {
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
103 setAttribute("top", top != null ? top.toString() : "-");
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
104 }
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
105
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
106 public String getTop() {
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
107 return getAttributeAsString("top");
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
108 }
1d20533a4ae3 Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 252
diff changeset
109
235
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 public DistanceInfoObject getDistanceInfo() {
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 return distanceInfo;
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 }
d3f8d6966c20 Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org