teichmann@5861: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5861: * Software engineering by Intevation GmbH teichmann@5861: * teichmann@5993: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5861: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5993: * documentation coming with Dive4Elements River for details. teichmann@5861: */ teichmann@5861: teichmann@5835: package org.dive4elements.river.client.shared.model; raimund@245: raimund@245: import com.smartgwt.client.widgets.grid.ListGridRecord; raimund@245: raimund@245: raimund@245: /** raimund@245: * The WQInfoRecord is a wrapper to put WQ Info objects into raimund@245: * a ListGrid. raimund@245: * raimund@245: * @author Raimund Renkert raimund@245: */ raimund@245: public class WQInfoRecord extends ListGridRecord { raimund@245: raimund@245: /** The artifact collection. */ raimund@245: protected WQInfoObject wqInfo; raimund@245: raimund@245: raimund@245: /** raimund@245: * The default constructor. raimund@245: * raimund@245: * @param info The wq info object. raimund@245: */ raimund@245: public WQInfoRecord(WQInfoObject info) { raimund@245: this.wqInfo = info; raimund@245: raimund@245: setName(info.getName()); raimund@245: setType(info.getType()); teichmann@6371: setValue(info.getValue()); teichmann@6371: setOfficial(info.isOfficial() ? "X" : ""); raimund@245: } raimund@245: raimund@245: raimund@245: public void setName(String name) { raimund@245: setAttribute("name", name); raimund@245: } raimund@245: raimund@245: raimund@245: public String getName() { raimund@245: return getAttributeAsString("name"); raimund@245: } raimund@245: raimund@245: raimund@245: public void setType(String type) { raimund@245: setAttribute("type", type); raimund@245: } raimund@245: raimund@245: raimund@245: public String getType() { raimund@245: return getAttributeAsString("type"); raimund@245: } raimund@245: raimund@245: public void setValue(double value) { raimund@245: setAttribute("value", value); raimund@245: } raimund@245: raimund@245: raimund@245: public double getValue() { raimund@245: return getAttributeAsDouble("value"); raimund@245: } raimund@245: teichmann@6371: public void setOfficial(String value) { teichmann@6371: setAttribute("official", value); teichmann@6371: } teichmann@6371: teichmann@6371: public String getOfficial() { teichmann@6371: return getAttributeAsString("official"); teichmann@6371: } teichmann@6371: raimund@245: raimund@245: public WQInfoObject getWQInfo() { raimund@245: return wqInfo; raimund@245: } raimund@245: } raimund@245: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :