Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeListGrid.java @ 4962:6f6461e07854
Move classes to its own java file
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Mon, 04 Feb 2013 14:56:41 +0100 |
parents | 27b4d5d20dc8 |
children | e70ff0a600a3 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeListGrid.java Mon Feb 04 13:49:15 2013 +0100 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeListGrid.java Mon Feb 04 14:56:41 2013 +0100 @@ -4,21 +4,13 @@ import java.util.List; 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.types.ListGridFieldType; import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.WidgetCanvas; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.grid.events.RecordClickEvent; import com.smartgwt.client.widgets.grid.events.RecordClickHandler; -import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.VLayout; import de.intevation.flys.client.client.FLYS; import de.intevation.flys.client.shared.model.Data; @@ -88,131 +80,6 @@ this.addData(new GaugeRecord(gauge)); } - - class GaugeInfoHead extends HLayout { - - public GaugeInfoHead(FLYS flys, GaugeInfo gauge) { - setStyleName("gaugeinfohead"); - setAutoHeight(); - setAutoWidth(); - - NumberFormat nf = NumberFormat.getDecimalFormat(); - - Label label = new Label(gauge.getName()); - addMember(label); - - Double start; - Double end; - - if (!gauge.isKmUp()) { - start = gauge.getKmStart(); - end = gauge.getKmEnd(); - } - else { - start = gauge.getKmEnd(); - end = gauge.getKmStart(); - } - - String kmtext = ""; - if (start != null) { - kmtext += nf.format(start); - kmtext += " - "; - } - if (end != null) { - kmtext += nf.format(end); - } - if (start != null || end != null) { - kmtext += " km"; - } - - label = new Label(kmtext); - - addMember(label); - - Double station = gauge.getStation(); - if (station != null) { - String stext = nf.format(station); - stext += " km"; - label = new Label(stext); - addMember(label); - } - - Long number = gauge.getOfficialNumber(); - String url = number != null ? - MSG.gauge_url() + number : - MSG.gauge_url(); - Anchor anchor = new Anchor(MSG.gauge_info_link(), url, "_blank"); - addMember(anchor); - - addMember(new GaugeCurveAnchor(flys, gauge)); - } - } - - class GaugeCurveAnchor extends Anchor implements ClickHandler { - - private FLYS flys; - private GaugeInfo gauge; - - public GaugeCurveAnchor(FLYS flys, GaugeInfo gauge) { - super(MSG.gauge_curve_link()); - this.flys = flys; - this.gauge = gauge; - - addClickHandler(this); - } - - @Override - public void onClick(ClickEvent ev) { - GWT.log("GaugeCurveAnchor - onClick " + gauge.getRiverName() + - " " + gauge.getOfficialNumber()); - flys.newGaugeDischargeCurve(gauge.getRiverName(), - gauge.getOfficialNumber()); - } - } - - class GaugeInfoPanel extends VLayout { - - public GaugeInfoPanel(GaugeInfo gauge) { - 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); - } - } - public void open() { ArrayList<Double> locations = new ArrayList<Double>();