comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/MeasurementStationListGrid.java @ 5503:b660090b417d

Create a new sq relation project on measurement station record click. * Added new methods to artifact service. * Added new client-side artifact. * Updated UI to have a new row in 'Messstellen-Info'.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 28 Mar 2013 15:21:15 +0100
parents 6f6461e07854
children
comparison
equal deleted inserted replaced
5502:566eea137330 5503:b660090b417d
5 import com.smartgwt.client.types.ListGridFieldType; 5 import com.smartgwt.client.types.ListGridFieldType;
6 import com.smartgwt.client.widgets.Canvas; 6 import com.smartgwt.client.widgets.Canvas;
7 import com.smartgwt.client.widgets.WidgetCanvas; 7 import com.smartgwt.client.widgets.WidgetCanvas;
8 import com.smartgwt.client.widgets.grid.ListGridField; 8 import com.smartgwt.client.widgets.grid.ListGridField;
9 import com.smartgwt.client.widgets.grid.ListGridRecord; 9 import com.smartgwt.client.widgets.grid.ListGridRecord;
10 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
11 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
10 12
11 import de.intevation.flys.client.client.FLYS; 13 import de.intevation.flys.client.client.FLYS;
12 import de.intevation.flys.client.shared.model.MeasurementStation; 14 import de.intevation.flys.client.shared.model.MeasurementStation;
13 import de.intevation.flys.client.shared.model.RiverInfo; 15 import de.intevation.flys.client.shared.model.RiverInfo;
14 16
16 import java.util.List; 18 import java.util.List;
17 19
18 /** 20 /**
19 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a> 21 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
20 */ 22 */
21 public class MeasurementStationListGrid extends InfoListGrid { 23 public class MeasurementStationListGrid
24 extends InfoListGrid
25 implements RecordClickHandler {
22 26
23 public MeasurementStationListGrid(FLYS flys) { 27 public MeasurementStationListGrid(FLYS flys) {
24 super(flys); 28 super(flys);
25 ListGridField nfield = new ListGridField("name", "Messtelle"); 29 ListGridField nfield = new ListGridField("name", "Messtelle");
26 ListGridField sfield = new ListGridField("kmstart", "Start [km]", 60); 30 ListGridField sfield = new ListGridField("kmstart", "Start [km]", 60);
27 ListGridField efield = new ListGridField("kmend", "Ende [km]", 60); 31 ListGridField efield = new ListGridField("kmend", "Ende [km]", 60);
28 ListGridField stfield = new ListGridField("station", "Station [km]"); 32 ListGridField stfield = new ListGridField("station", "Station [km]");
29 ListGridField lfield = new ListGridField("link", "Link"); 33 ListGridField lfield = new ListGridField("link", "Link");
30 lfield.setType(ListGridFieldType.LINK); 34 lfield.setType(ListGridFieldType.LINK);
31 this.setFields(nfield, sfield, efield, stfield, lfield); 35 ListGridField cfield = new ListGridField("curvelink", "SQ");
36 cfield.addRecordClickHandler(this);
37 this.setFields(nfield, sfield, efield, stfield, lfield, cfield);
32 } 38 }
33 39
34 /** 40 /**
35 * Resets the items of the tree. 41 * Resets the items of the tree.
36 * If the list of gauges is empty or null the tree will be empty. 42 * If the list of gauges is empty or null the tree will be empty.
86 @Override 92 @Override
87 protected Canvas getExpandPanel(ListGridRecord record) { 93 protected Canvas getExpandPanel(ListGridRecord record) {
88 MeasurementStationRecord station = (MeasurementStationRecord)record; 94 MeasurementStationRecord station = (MeasurementStationRecord)record;
89 return new WidgetCanvas(new MeasurementStationInfoPanel(station)); 95 return new WidgetCanvas(new MeasurementStationInfoPanel(station));
90 } 96 }
97
98 @Override
99 public void onRecordClick(RecordClickEvent event) {
100 MeasurementStationRecord station =
101 (MeasurementStationRecord)event.getRecord();
102 flys.newSQRelation(station.getRiverName(), station.getID());
103 }
104
91 } 105 }

http://dive4elements.wald.intevation.org