Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java @ 4981:0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 14 Feb 2013 09:32:29 +0100 |
parents | 6f6461e07854 |
children | e2053fbcd165 |
comparison
equal
deleted
inserted
replaced
4980:e70ff0a600a3 | 4981:0e6e44e6725f |
---|---|
1 package de.intevation.flys.client.client.ui.stationinfo; | 1 package de.intevation.flys.client.client.ui.stationinfo; |
2 | 2 |
3 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
4 import com.google.gwt.event.dom.client.ClickEvent; | |
5 import com.google.gwt.event.dom.client.ClickHandler; | |
4 import com.google.gwt.i18n.client.NumberFormat; | 6 import com.google.gwt.i18n.client.NumberFormat; |
7 import com.google.gwt.user.client.ui.Anchor; | |
5 import com.google.gwt.user.client.ui.Grid; | 8 import com.google.gwt.user.client.ui.Grid; |
6 import com.smartgwt.client.widgets.layout.VLayout; | 9 import com.smartgwt.client.widgets.layout.VLayout; |
10 import com.smartgwt.client.widgets.Label; | |
7 | 11 |
12 import de.intevation.flys.client.client.FLYS; | |
8 import de.intevation.flys.client.client.FLYSConstants; | 13 import de.intevation.flys.client.client.FLYSConstants; |
9 import de.intevation.flys.client.shared.model.GaugeInfo; | 14 import de.intevation.flys.client.shared.model.GaugeInfo; |
10 | 15 |
11 public class GaugeInfoPanel extends VLayout { | 16 public class GaugeInfoPanel extends VLayout { |
12 | 17 |
13 /** The message class that provides i18n strings.*/ | 18 /** The message class that provides i18n strings.*/ |
14 private FLYSConstants MSG = GWT.create(FLYSConstants.class); | 19 private FLYSConstants MSG = GWT.create(FLYSConstants.class); |
15 | 20 |
16 public GaugeInfoPanel(GaugeInfo gauge) { | 21 /** Application instance. */ |
22 private FLYS flys; | |
23 | |
24 public GaugeInfoPanel(GaugeInfo gauge, FLYS flys) { | |
25 this.flys = flys; | |
17 setStyleName("gaugeinfopanel"); | 26 setStyleName("gaugeinfopanel"); |
18 setWidth100(); | 27 setWidth100(); |
19 | 28 |
20 Grid grid = new Grid(4, 2); | 29 Grid grid = new Grid(4, 2); |
21 | 30 |
49 gauge.getWstUnit() + "]"); | 58 gauge.getWstUnit() + "]"); |
50 grid.setText(3, 1, nf.format(datum)); | 59 grid.setText(3, 1, nf.format(datum)); |
51 } | 60 } |
52 | 61 |
53 addMember(grid); | 62 addMember(grid); |
63 addMember(new GaugeMainValueAnchor(flys, gauge)); | |
64 } | |
65 | |
66 | |
67 /** | |
68 * Clickable anchor that asks application to show window with | |
69 * main values for gauge. | |
70 */ | |
71 class GaugeMainValueAnchor extends Anchor implements ClickHandler { | |
72 | |
73 private FLYS flys; | |
74 private GaugeInfo gauge; | |
75 | |
76 public GaugeMainValueAnchor(FLYS flys, GaugeInfo gauge) { | |
77 super("TODO:i18n MainVALUES"); | |
78 // TODO i18n mainvalues | |
79 this.flys = flys; | |
80 this.gauge = gauge; | |
81 | |
82 addClickHandler(this); | |
83 } | |
84 | |
85 @Override | |
86 public void onClick(ClickEvent ev) { | |
87 GWT.log("GaugeMainValueAnchor - onClick " + gauge.getRiverName() + | |
88 " " + gauge.getOfficialNumber()); | |
89 flys.newGaugeMainValueTable(gauge); | |
90 } | |
54 } | 91 } |
55 } | 92 } |