comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java @ 8417:71144e25a6c9

Add comment to measurement stations info.
author Tom Gottfried <tom@intevation.de>
date Thu, 16 Oct 2014 13:39:22 +0200
parents 900299ab8e6e
children
comparison
equal deleted inserted replaced
8416:6399ebc6fce9 8417:71144e25a6c9
23 public class MeasurementStationInfoPanel extends VLayout { 23 public class MeasurementStationInfoPanel extends VLayout {
24 24
25 /** The message class that provides i18n strings.*/ 25 /** The message class that provides i18n strings.*/
26 private FLYSConstants MSG = GWT.create(FLYSConstants.class); 26 private FLYSConstants MSG = GWT.create(FLYSConstants.class);
27 27
28 private static final int KEY_WIDTH = 150;
29
28 public MeasurementStationInfoPanel(MeasurementStation station) { 30 public MeasurementStationInfoPanel(MeasurementStation station) {
29 setStyleName("infopanel"); 31 setStyleName("infopanel");
30 setWidth100(); 32 setWidth100();
31 33
32 VLayout grid = new VLayout(); 34 VLayout grid = new VLayout();
34 HLayout line1 = new HLayout(); 36 HLayout line1 = new HLayout();
35 String type = station.getMeasurementType(); 37 String type = station.getMeasurementType();
36 if (type != null) { 38 if (type != null) {
37 Label key = new Label(MSG.measurement_station_type()); 39 Label key = new Label(MSG.measurement_station_type());
38 Label value = new Label(type); 40 Label value = new Label(type);
39 key.setWidth(150); 41 key.setWidth(KEY_WIDTH);
40 line1.addMember(key); 42 line1.addMember(key);
41 line1.addMember(value); 43 line1.addMember(value);
42 grid.addMember(line1); 44 grid.addMember(line1);
43 } 45 }
44 46
45 HLayout line2 = new HLayout(); 47 HLayout line2 = new HLayout();
46 String riverside = station.getRiverSide(); 48 String riverside = station.getRiverSide();
47 if (riverside != null) { 49 if (riverside != null) {
48 Label key = new Label(MSG.riverside()); 50 Label key = new Label(MSG.riverside());
49 Label value = new Label(riverside); 51 Label value = new Label(riverside);
50 key.setWidth(150); 52 key.setWidth(KEY_WIDTH);
51 line2.addMember(key); 53 line2.addMember(key);
52 line2.addMember(value); 54 line2.addMember(value);
53 grid.addMember(line2); 55 grid.addMember(line2);
54 } 56 }
55 57
56 HLayout line3 = new HLayout(); 58 HLayout line3 = new HLayout();
57 String gaugename = station.getGaugeName(); 59 String gaugename = station.getGaugeName();
58 if (gaugename != null) { 60 if (gaugename != null) {
59 Label key = new Label(MSG.measurement_station_gauge_name()); 61 Label key = new Label(MSG.measurement_station_gauge_name());
60 Label value = new Label(gaugename); 62 Label value = new Label(gaugename);
61 key.setWidth(150); 63 key.setWidth(KEY_WIDTH);
62 line3.addMember(key); 64 line3.addMember(key);
63 line3.addMember(value); 65 line3.addMember(value);
64 grid.addMember(line3); 66 grid.addMember(line3);
65 } 67 }
66 68
70 72
71 Date starttime = station.getStartTime(); 73 Date starttime = station.getStartTime();
72 if (starttime != null) { 74 if (starttime != null) {
73 Label key = new Label(MSG.measurement_station_start_time()); 75 Label key = new Label(MSG.measurement_station_start_time());
74 Label value = new Label(df.format(starttime)); 76 Label value = new Label(df.format(starttime));
75 key.setWidth(150); 77 key.setWidth(KEY_WIDTH);
76 line4.addMember(key); 78 line4.addMember(key);
77 line4.addMember(value); 79 line4.addMember(value);
78 grid.addMember(line4); 80 grid.addMember(line4);
79 } 81 }
80 82
81 HLayout line5 = new HLayout(); 83 HLayout line5 = new HLayout();
82 String moperator = station.getOperator(); 84 String moperator = station.getOperator();
83 if (moperator != null) { 85 if (moperator != null) {
84 Label key = new Label(MSG.measurement_station_operator()); 86 Label key = new Label(MSG.measurement_station_operator());
85 Label value = new Label(moperator); 87 Label value = new Label(moperator);
86 key.setWidth(150); 88 key.setWidth(KEY_WIDTH);
87 line5.addMember(key); 89 line5.addMember(key);
88 line5.addMember(value); 90 line5.addMember(value);
89 grid.addMember(line5); 91 grid.addMember(line5);
90 } 92 }
91 93
94 HLayout line6 = new HLayout();
95 String mcomment = station.getComment();
96 if (mcomment != null) {
97 Label key = new Label(MSG.measurement_station_comment());
98 Label value = new Label(mcomment);
99 key.setWidth(KEY_WIDTH);
100 value.setWidth(300);
101 line6.addMember(key);
102 line6.addMember(value);
103 grid.addMember(line6);
104 }
105
92 addMember(grid); 106 addMember(grid);
93 } 107 }
94 } 108 }

http://dive4elements.wald.intevation.org