Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java @ 4982:cbe89b2ce3cd
WQInputPanel: Removed unnecessary parameter from function.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 14 Feb 2013 09:33:41 +0100 |
parents | 0e6e44e6725f |
children | e2053fbcd165 |
line wrap: on
line source
package de.intevation.flys.client.client.ui.stationinfo; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.i18n.client.NumberFormat; import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.Grid; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.Label; import de.intevation.flys.client.client.FLYS; import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.shared.model.GaugeInfo; public class GaugeInfoPanel extends VLayout { /** The message class that provides i18n strings.*/ private FLYSConstants MSG = GWT.create(FLYSConstants.class); /** Application instance. */ private FLYS flys; public GaugeInfoPanel(GaugeInfo gauge, FLYS flys) { this.flys = flys; setStyleName("gaugeinfopanel"); setWidth100(); Grid grid = new Grid(4, 2); NumberFormat nf = NumberFormat.getDecimalFormat(); Double minw = gauge.getMinW(); Double maxw = gauge.getMaxW(); if (minw != null && maxw != null) { grid.setText(0, 0, MSG.wq_value_q()); grid.setText(0, 1, nf.format(minw) + " - " + nf.format(maxw)); } Double minq = gauge.getMinQ(); Double maxq = gauge.getMaxQ(); if (minq != null && maxq != null) { grid.setText(1, 0, MSG.wq_value_w()); grid.setText(1, 1, nf.format(minq) + " - " + nf.format(maxq)); } Double aeo = gauge.getAeo(); if (aeo != null) { grid.setText(2, 0, "AEO [kmĀ²]"); grid.setText(2, 1, nf.format(aeo)); } Double datum = gauge.getDatum(); if (datum != null) { grid.setText(3, 0, MSG.gauge_zero() + " [" + gauge.getWstUnit() + "]"); grid.setText(3, 1, nf.format(datum)); } addMember(grid); addMember(new GaugeMainValueAnchor(flys, gauge)); } /** * Clickable anchor that asks application to show window with * main values for gauge. */ class GaugeMainValueAnchor extends Anchor implements ClickHandler { private FLYS flys; private GaugeInfo gauge; public GaugeMainValueAnchor(FLYS flys, GaugeInfo gauge) { super("TODO:i18n MainVALUES"); // TODO i18n mainvalues this.flys = flys; this.gauge = gauge; addClickHandler(this); } @Override public void onClick(ClickEvent ev) { GWT.log("GaugeMainValueAnchor - onClick " + gauge.getRiverName() + " " + gauge.getOfficialNumber()); flys.newGaugeMainValueTable(gauge); } } }