Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoRecord.java @ 5462:f2371f3aaf03
Show top level folder icons only if node has no factory
If you have an empty folder the folder icon is still shown.
This makes it possible to add functional "Top Level" entries
in the Datacage
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 26 Mar 2013 18:29:13 +0100 |
parents | 1d20533a4ae3 |
children |
rev | line source |
---|---|
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.shared.model; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 import com.smartgwt.client.widgets.grid.ListGridRecord; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 /** |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 * 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
|
8 * a ListGrid. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 * |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * @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
|
11 */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 public class DistanceInfoRecord extends ListGridRecord { |
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 /** The artifact collection. */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 protected DistanceInfoObject distanceInfo; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 |
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 /** |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 * The default constructor. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 * |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 * @param info The distance info object. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 public DistanceInfoRecord(DistanceInfoObject info) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 this.distanceInfo = info; |
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 setDescription(info.getDescription()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 setFrom(info.getFrom()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 if (info.getTo() != null) |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 setTo(info.getTo()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 else |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 setTo(info.getFrom()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 setRiverside(info.getRiverside()); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
33 setBottom(info.getBottom()); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
34 setTop(info.getTop()); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 /** |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 * Sets the creation time. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 * |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 * @param creationTime The creation time. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 public void setDescription(String description) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 setAttribute("description", description); |
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 |
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 * Returns the description. |
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 * @return the description. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 public String getDescription() { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 return getAttributeAsString("description"); |
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 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 public void setFrom(double from) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 setAttribute("from", from); |
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 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 public double getFrom() { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 return getAttributeAsDouble("from"); |
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 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 public void setTo(double to) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 setAttribute("to", to); |
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 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 public double getTo() { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 return getAttributeAsDouble("to"); |
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 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 public void setRiverside(String side) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 setAttribute("riverside", side); |
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 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 public String getRiverside() { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 return getAttributeAsString("riverside"); |
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 |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
86 public void setBottom(Double bottom) { |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
87 setAttribute("bottom", bottom != null ? bottom.toString() : "-"); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
88 } |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
89 |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
90 public String getBottom() { |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
91 return getAttributeAsString("bottom"); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
92 } |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
93 |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
94 public void setTop(Double top) { |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
95 setAttribute("top", top != null ? top.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 getTop() { |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
252
diff
changeset
|
99 return getAttributeAsString("top"); |
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 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 public DistanceInfoObject getDistanceInfo() { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 return distanceInfo; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |