Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixEventSelect.java @ 2505:87ac5c532523
First part of the UI for fixing analysis parameter.
flys-client/trunk@4350 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 07 May 2012 13:22:43 +0000 |
parents | |
children | 8f528f5ae137 |
comparison
equal
deleted
inserted
replaced
2504:425bc486a40f | 2505:87ac5c532523 |
---|---|
1 package de.intevation.flys.client.client.ui.fixation; | |
2 | |
3 import java.util.List; | |
4 import java.util.ArrayList; | |
5 | |
6 import com.google.gwt.core.client.GWT; | |
7 | |
8 import com.smartgwt.client.widgets.Canvas; | |
9 import com.smartgwt.client.widgets.Label; | |
10 | |
11 import com.smartgwt.client.widgets.layout.HLayout; | |
12 import com.smartgwt.client.widgets.layout.VLayout; | |
13 | |
14 import de.intevation.flys.client.client.FLYSConstants; | |
15 | |
16 import de.intevation.flys.client.shared.model.Data; | |
17 import de.intevation.flys.client.shared.model.DataList; | |
18 | |
19 /** | |
20 * This UIProvider creates a panel for location or distance input. | |
21 * | |
22 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | |
23 */ | |
24 public class FixEventSelect | |
25 extends FixationPanel | |
26 { | |
27 /** The message class that provides i18n strings. */ | |
28 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); | |
29 | |
30 protected List<String> events; | |
31 | |
32 public FixEventSelect() { | |
33 htmlOverview = ""; | |
34 events = new ArrayList<String>(); | |
35 } | |
36 | |
37 public Canvas createWidget(DataList data) { | |
38 instances.put(this.artifact.getUuid(), this); | |
39 | |
40 VLayout layout = new VLayout(); | |
41 | |
42 Canvas title = new Label(MESSAGES.eventselect()); | |
43 title.setHeight("25px"); | |
44 | |
45 layout.addMember(title); | |
46 return layout; | |
47 } | |
48 | |
49 @Override | |
50 public Canvas createOld(DataList dataList) { | |
51 HLayout layout = new HLayout(); | |
52 layout.setWidth("400px"); | |
53 | |
54 Label label = new Label(dataList.getLabel()); | |
55 label.setWidth("200px"); | |
56 | |
57 Canvas back = getBackButton(dataList.getState()); | |
58 | |
59 layout.addMember(label); | |
60 layout.addMember(back); | |
61 | |
62 return layout; | |
63 } | |
64 | |
65 | |
66 /** | |
67 * This method returns the selected data. | |
68 * | |
69 * @return the selected/inserted data. | |
70 */ | |
71 public Data[] getData() { | |
72 List<Data> data = new ArrayList<Data>(); | |
73 | |
74 return (Data[]) data.toArray(new Data[data.size()]); | |
75 } | |
76 | |
77 | |
78 @Override | |
79 public void setValues(String cid, boolean checked) { | |
80 if (checked) { | |
81 events.add(cid); | |
82 } | |
83 else { | |
84 if (events.contains(cid)) { | |
85 events.remove(cid); | |
86 } | |
87 } | |
88 } | |
89 | |
90 | |
91 @Override | |
92 public boolean renderCheckboxes() { | |
93 return true; | |
94 } | |
95 | |
96 | |
97 public void dumpGWT(String cid) { | |
98 GWT.log("Setting values for cId: " + cid); | |
99 GWT.log("River: " + fixInfo.getRiver()); | |
100 GWT.log("Date: " + fixInfo.getEventByCId(cid).getDate()); | |
101 GWT.log("Name: " + fixInfo.getEventByCId(cid).getName()); | |
102 } | |
103 } |