view gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeRecord.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeRecord.java@821a02bbfb4e
children 172338b1407f
line wrap: on
line source
package org.dive4elements.river.client.client.ui.stationinfo;

import com.google.gwt.core.client.GWT;
import com.smartgwt.client.widgets.grid.ListGridRecord;

import org.dive4elements.river.client.client.FLYSConstants;
import org.dive4elements.river.client.shared.model.GaugeInfo;

/**
 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
 */
public class GaugeRecord extends ListGridRecord implements GaugeInfo {

    /** The message class that provides i18n strings.*/
    private FLYSConstants MSG = GWT.create(FLYSConstants.class);

    public GaugeRecord(GaugeInfo gauge) {
        setCanExpand(true);
        Long number = gauge.getOfficialNumber();
        String url = number != null ?
                MSG.gauge_url() + number :
                MSG.gauge_url();
        setLink(url);
        setLinkText(MSG.gauge_info_link());
        setName(gauge.getName());
        setKmStart(gauge.getKmStart());
        setKmEnd(gauge.getKmEnd());
        setMinQ(gauge.getMinQ());
        setMaxQ(gauge.getMaxQ());
        setMinW(gauge.getMinW());
        setMaxW(gauge.getMaxW());
        setAeo(gauge.getAeo());
        setDatum(gauge.getDatum());
        setKmUp(gauge.isKmUp());
        setOfficialNumber(gauge.getOfficialNumber());
        setRiverName(gauge.getRiverName());
        setStation(gauge.getStation());
        setWstUnit(gauge.getWstUnit());
        setCurveLink(MSG.gauge_curve_link());
    }

    private void setCurveLink(String value) {
        this.setAttribute("curvelink", value);
    }

    private void setLink(String url) {
        this.setAttribute("link", url);
    }

    public String getLink() {
        return this.getAttributeAsString("link");
    }

    public String getName() {
        return this.getAttributeAsString("name");
    }

    private void setName(String value) {
        this.setAttribute("name", value);
    }

    public Double getKmStart() {
        return this.getAttributeAsDouble("kmstart");
    }

    private void setKmStart(Double value) {
        this.setAttribute("kmstart", value);
    }

    public Double getKmEnd() {
        return this.getAttributeAsDouble("kmend");
    }

    private void setKmEnd(Double value) {
        this.setAttribute("kmend", value);
    }

    public Double getMinQ() {
        return this.getAttributeAsDouble("minq");
    }

    private void setMinQ(Double value) {
        this.setAttribute("minq", value);
    }

    public Double getMaxQ() {
        return this.getAttributeAsDouble("maxq");
    }

    private void setMaxQ(Double value) {
        this.setAttribute("maxq", value);
    }

    public Double getMinW() {
        return this.getAttributeAsDouble("minw");
    }

    private void setMinW(Double value) {
        this.setAttribute("minw", value);
    }

    public Double getMaxW() {
        return this.getAttributeAsDouble("maxw");
    }

    private void setMaxW(Double value) {
        this.setAttribute("maxw", value);
    }

    public Double getDatum() {
        return this.getAttributeAsDouble("datum");
    }

    private void setDatum(Double value) {
        this.setAttribute("datum", value);
    }

    public Double getAeo() {
        return this.getAttributeAsDouble("aeo");
    }

    private void setAeo(Double value) {
        this.setAttribute("aeo", value);
    }

    public boolean isKmUp() {
        return this.getAttributeAsBoolean("kmup");
    }

    private void setKmUp(boolean value) {
        this.setAttribute("kmup", value);
    }

    public Double getStation() {
        return this.getAttributeAsDouble("station");
    }

    private void setStation(Double value) {
        this.setAttribute("station", value);
    }

    public String getWstUnit() {
        return this.getAttributeAsString("wstunit");
    }

    private void setWstUnit(String value) {
        this.setAttribute("wstunit", value);
    }

    public Long getOfficialNumber() {
        return this.getAttributeAsLong("officialnumber");
    }

    private void setOfficialNumber(Long number) {
        this.setAttribute("officialnumber", number);
    }

    public String getRiverName() {
        return this.getAttributeAsString("rivername");
    }

    private void setRiverName(String rivername) {
        this.setAttribute("rivername", rivername);
    }
}

http://dive4elements.wald.intevation.org