bjoern@4962: package de.intevation.flys.client.client.ui.stationinfo; bjoern@4962: bjoern@4962: import java.util.Date; bjoern@4962: bjoern@4962: import com.google.gwt.core.client.GWT; bjoern@4962: import com.google.gwt.i18n.client.DateTimeFormat; bjoern@4962: import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; bjoern@4962: import com.google.gwt.user.client.ui.Grid; bjoern@4962: import com.smartgwt.client.widgets.layout.VLayout; bjoern@4962: bjoern@4962: import de.intevation.flys.client.client.FLYSConstants; bjoern@4962: import de.intevation.flys.client.shared.model.MeasurementStation; bjoern@4962: bjoern@4962: public class MeasurementStationInfoPanel extends VLayout { bjoern@4962: bjoern@4962: /** The message class that provides i18n strings.*/ bjoern@4962: private FLYSConstants MSG = GWT.create(FLYSConstants.class); bjoern@4962: bjoern@4962: public MeasurementStationInfoPanel(MeasurementStation station) { bjoern@4962: setStyleName("infopanel"); bjoern@4962: setWidth100(); bjoern@4962: bjoern@4962: Grid grid = new Grid(5, 2); bjoern@4962: bjoern@4962: String type = station.getMeasurementType(); bjoern@4962: if (type != null) { bjoern@4962: grid.setText(0, 0, MSG.measurement_station_type()); bjoern@4962: grid.setText(0, 1, type); bjoern@4962: } bjoern@4962: bjoern@4962: String riverside = station.getRiverSide(); bjoern@4962: if (riverside != null) { bjoern@4962: grid.setText(1, 0, MSG.riverside()); bjoern@4962: grid.setText(1, 1, riverside); bjoern@4962: } bjoern@4962: bjoern@4962: String gaugename = station.getGaugeName(); bjoern@4962: if (gaugename != null) { bjoern@4962: grid.setText(2, 0, MSG.measurement_station_gauge_name()); bjoern@4962: grid.setText(2, 1, gaugename); bjoern@4962: } bjoern@4962: bjoern@4962: DateTimeFormat df = DateTimeFormat.getFormat( bjoern@4962: PredefinedFormat.DATE_MEDIUM); bjoern@4962: bjoern@4962: Date starttime = station.getStartTime(); bjoern@4962: if (starttime != null) { bjoern@4962: grid.setText(3, 0, MSG.measurement_station_start_time()); bjoern@4962: grid.setText(3, 1, df.format(starttime)); bjoern@4962: } bjoern@4962: bjoern@4962: String moperator = station.getOperator(); bjoern@4962: if (moperator != null) { bjoern@4962: grid.setText(4, 0, MSG.measurement_station_operator()); bjoern@4962: grid.setText(4, 1, moperator); bjoern@4962: } bjoern@4962: bjoern@4962: addMember(grid); bjoern@4962: } bjoern@4962: }