Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java @ 7933:900299ab8e6e
Replaced plain gwt with smartgwt components in info panels.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 17 Jun 2014 09:45:48 +0200 |
parents | ea9eef426962 |
children | 71144e25a6c9 |
comparison
equal
deleted
inserted
replaced
7932:b1393f96c153 | 7933:900299ab8e6e |
---|---|
11 import java.util.Date; | 11 import java.util.Date; |
12 | 12 |
13 import com.google.gwt.core.client.GWT; | 13 import com.google.gwt.core.client.GWT; |
14 import com.google.gwt.i18n.client.DateTimeFormat; | 14 import com.google.gwt.i18n.client.DateTimeFormat; |
15 import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; | 15 import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; |
16 import com.google.gwt.user.client.ui.Grid; | 16 import com.smartgwt.client.widgets.Label; |
17 import com.smartgwt.client.widgets.layout.HLayout; | |
17 import com.smartgwt.client.widgets.layout.VLayout; | 18 import com.smartgwt.client.widgets.layout.VLayout; |
18 | 19 |
19 import org.dive4elements.river.client.client.FLYSConstants; | 20 import org.dive4elements.river.client.client.FLYSConstants; |
20 import org.dive4elements.river.client.shared.model.MeasurementStation; | 21 import org.dive4elements.river.client.shared.model.MeasurementStation; |
21 | 22 |
26 | 27 |
27 public MeasurementStationInfoPanel(MeasurementStation station) { | 28 public MeasurementStationInfoPanel(MeasurementStation station) { |
28 setStyleName("infopanel"); | 29 setStyleName("infopanel"); |
29 setWidth100(); | 30 setWidth100(); |
30 | 31 |
31 Grid grid = new Grid(5, 2); | 32 VLayout grid = new VLayout(); |
32 | 33 |
34 HLayout line1 = new HLayout(); | |
33 String type = station.getMeasurementType(); | 35 String type = station.getMeasurementType(); |
34 if (type != null) { | 36 if (type != null) { |
35 grid.setText(0, 0, MSG.measurement_station_type()); | 37 Label key = new Label(MSG.measurement_station_type()); |
36 grid.setText(0, 1, type); | 38 Label value = new Label(type); |
39 key.setWidth(150); | |
40 line1.addMember(key); | |
41 line1.addMember(value); | |
42 grid.addMember(line1); | |
37 } | 43 } |
38 | 44 |
45 HLayout line2 = new HLayout(); | |
39 String riverside = station.getRiverSide(); | 46 String riverside = station.getRiverSide(); |
40 if (riverside != null) { | 47 if (riverside != null) { |
41 grid.setText(1, 0, MSG.riverside()); | 48 Label key = new Label(MSG.riverside()); |
42 grid.setText(1, 1, riverside); | 49 Label value = new Label(riverside); |
50 key.setWidth(150); | |
51 line2.addMember(key); | |
52 line2.addMember(value); | |
53 grid.addMember(line2); | |
43 } | 54 } |
44 | 55 |
56 HLayout line3 = new HLayout(); | |
45 String gaugename = station.getGaugeName(); | 57 String gaugename = station.getGaugeName(); |
46 if (gaugename != null) { | 58 if (gaugename != null) { |
47 grid.setText(2, 0, MSG.measurement_station_gauge_name()); | 59 Label key = new Label(MSG.measurement_station_gauge_name()); |
48 grid.setText(2, 1, gaugename); | 60 Label value = new Label(gaugename); |
61 key.setWidth(150); | |
62 line3.addMember(key); | |
63 line3.addMember(value); | |
64 grid.addMember(line3); | |
49 } | 65 } |
50 | 66 |
67 HLayout line4 = new HLayout(); | |
51 DateTimeFormat df = DateTimeFormat.getFormat( | 68 DateTimeFormat df = DateTimeFormat.getFormat( |
52 PredefinedFormat.DATE_MEDIUM); | 69 PredefinedFormat.DATE_MEDIUM); |
53 | 70 |
54 Date starttime = station.getStartTime(); | 71 Date starttime = station.getStartTime(); |
55 if (starttime != null) { | 72 if (starttime != null) { |
56 grid.setText(3, 0, MSG.measurement_station_start_time()); | 73 Label key = new Label(MSG.measurement_station_start_time()); |
57 grid.setText(3, 1, df.format(starttime)); | 74 Label value = new Label(df.format(starttime)); |
75 key.setWidth(150); | |
76 line4.addMember(key); | |
77 line4.addMember(value); | |
78 grid.addMember(line4); | |
58 } | 79 } |
59 | 80 |
81 HLayout line5 = new HLayout(); | |
60 String moperator = station.getOperator(); | 82 String moperator = station.getOperator(); |
61 if (moperator != null) { | 83 if (moperator != null) { |
62 grid.setText(4, 0, MSG.measurement_station_operator()); | 84 Label key = new Label(MSG.measurement_station_operator()); |
63 grid.setText(4, 1, moperator); | 85 Label value = new Label(moperator); |
86 key.setWidth(150); | |
87 line5.addMember(key); | |
88 line5.addMember(value); | |
89 grid.addMember(line5); | |
64 } | 90 } |
65 | 91 |
66 addMember(grid); | 92 addMember(grid); |
67 } | 93 } |
68 } | 94 } |