diff flys-client/src/main/java/org/dive4elements/river/client/shared/model/DistanceInfoRecord.java @ 5834:f507086aa94b

Repaired internal references.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:31:32 +0200
parents flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoRecord.java@1d20533a4ae3
children 821a02bbfb4e
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/org/dive4elements/river/client/shared/model/DistanceInfoRecord.java	Thu Apr 25 12:31:32 2013 +0200
@@ -0,0 +1,107 @@
+package de.intevation.flys.client.shared.model;
+
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+
+/**
+ * The DistanceInfoRecord is a wrapper to put DistanceInfo objects into
+ * a ListGrid.
+ *
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class DistanceInfoRecord extends ListGridRecord {
+
+    /** The artifact collection. */
+    protected DistanceInfoObject distanceInfo;
+
+
+    /**
+     * The default constructor.
+     *
+     * @param info The distance info object.
+     */
+    public DistanceInfoRecord(DistanceInfoObject info) {
+        this.distanceInfo = info;
+
+        setDescription(info.getDescription());
+        setFrom(info.getFrom());
+        if (info.getTo() != null)
+            setTo(info.getTo());
+        else
+            setTo(info.getFrom());
+        setRiverside(info.getRiverside());
+        setBottom(info.getBottom());
+        setTop(info.getTop());
+    }
+
+
+    /**
+     * Sets the creation time.
+     *
+     * @param creationTime The creation time.
+     */
+    public void setDescription(String description) {
+        setAttribute("description", description);
+    }
+
+
+    /**
+     * Returns the description.
+     *
+     * @return the description.
+     */
+    public String getDescription() {
+        return getAttributeAsString("description");
+    }
+
+
+    public void setFrom(double from) {
+        setAttribute("from", from);
+    }
+
+
+    public double getFrom() {
+        return getAttributeAsDouble("from");
+    }
+
+    public void setTo(double to) {
+        setAttribute("to", to);
+    }
+
+
+    public double getTo() {
+        return getAttributeAsDouble("to");
+    }
+
+
+    public void setRiverside(String side) {
+        setAttribute("riverside", side);
+    }
+
+
+    public String getRiverside() {
+        return getAttributeAsString("riverside");
+    }
+
+    public void setBottom(Double bottom) {
+        setAttribute("bottom", bottom != null ? bottom.toString() : "-");
+    }
+
+    public String getBottom() {
+        return getAttributeAsString("bottom");
+    }
+
+    public void setTop(Double top) {
+        setAttribute("top", top != null ? top.toString() : "-");
+    }
+
+    public String getTop() {
+        return getAttributeAsString("top");
+    }
+
+
+    public DistanceInfoObject getDistanceInfo() {
+        return distanceInfo;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org