Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoRecord.java @ 235:d3f8d6966c20
Added location and distance tables.
flys-client/trunk@1791 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 02 May 2011 14:47:12 +0000 |
parents | |
children | 385e9368ffcd |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoRecord.java Mon May 02 14:47:12 2011 +0000 @@ -0,0 +1,92 @@ +package de.intevation.flys.client.shared.model; + +import java.util.Date; + +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.google.gwt.core.client.GWT; + + +/** + * 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()); + } + + + /** + * 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 DistanceInfoObject getDistanceInfo() { + return distanceInfo; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :