annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java @ 9256:6c24c857ccf9

fixation refactoring and inputItem behaviour to interfaces
author gernotbelger
date Fri, 13 Jul 2018 12:04:21 +0200
parents 5e38e2924c07
children e6958f0e72fa
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.ui.fixation;
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
11 import java.util.HashMap;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
12 import java.util.LinkedHashMap;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
13 import java.util.Map;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
14
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
15 import org.dive4elements.river.client.shared.model.Data;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
16 import org.dive4elements.river.client.shared.model.DataItem;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
17 import org.dive4elements.river.client.shared.model.DataList;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
18 import org.dive4elements.river.client.shared.model.DefaultData;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
19 import org.dive4elements.river.client.shared.model.DefaultDataItem;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
20 import org.dive4elements.river.client.shared.model.FixingsOverviewInfo;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
21
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 import com.smartgwt.client.types.VerticalAlignment;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 import com.smartgwt.client.widgets.Canvas;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 import com.smartgwt.client.widgets.Label;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 import com.smartgwt.client.widgets.form.DynamicForm;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 import com.smartgwt.client.widgets.form.fields.SelectItem;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 import com.smartgwt.client.widgets.layout.HLayout;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 import com.smartgwt.client.widgets.layout.VLayout;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 public class FixFunctionSelect extends FixationPanel {
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
31 private static final Map<String, String> funcDesc = new HashMap<String, String>();
3846
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
32
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
33 static {
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
34 funcDesc.put("log", "W(Q) = m*ln(Q + b)");
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
35 funcDesc.put("linear", "W(Q) = m * Q + b");
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
36 funcDesc.put("log-linear", "W(Q) = a*ln(m*Q+b)");
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
37 funcDesc.put("exp", "W(Q) = m * a^Q + b");
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
38 funcDesc.put("quad", "W(Q) = n*Q^2+m*Q+b");
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
39 funcDesc.put("pow", "W(Q) = a * Q^c + d");
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
40 funcDesc.put("sq-pow", "S(Q) = a * Q^b");
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
41 }
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
42
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
43 /** The combobox. */
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 protected DynamicForm form;
3366
8bedd1fcaeee Removed trailing whitespace. Import cleanup
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3358
diff changeset
45
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 @Override
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
47 public Canvas createWidget(final DataList data) {
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
48 final VLayout layout = new VLayout();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 layout.setAlign(VerticalAlignment.TOP);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 layout.setHeight(25);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
52 final LinkedHashMap initial = new LinkedHashMap();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
54 this.form = new DynamicForm();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
56 final int size = data.size();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 for (int i = 0; i < size; i++) {
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
59 final Data d = data.get(i);
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
61 final Label label = new Label(d.getDescription());
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 label.setValign(VerticalAlignment.TOP);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 label.setHeight(20);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 label.setWidth(400);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
66 final SelectItem combobox = new SelectItem(d.getLabel());
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 combobox.setWidth(250);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
69 final LinkedHashMap<String, String> funcTypes = new LinkedHashMap<String, String>();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
71 boolean defaultSet = false;
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
72 boolean first = true;
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
74 final DataItem def = d.getDefault();
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
75 final String defValue = def != null ? def.getStringValue() : null;
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 if (defValue != null && defValue.length() > 0) {
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 initial.put(d.getLabel(), def.getStringValue());
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 defaultSet = true;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 // I was here. Me 2.
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
83 for (final DataItem item : d.getItems()) {
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 if (!defaultSet && first) {
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 initial.put(d.getLabel(), item.getStringValue());
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 first = false;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88
3846
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
89 funcTypes.put(item.getStringValue(), item.getLabel());
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 label.setWidth(50);
3846
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
93 combobox.setValueMap(funcTypes);
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 combobox.setShowTitle(false);
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
95 this.form.setItems(combobox);
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97 layout.addMember(label);
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
98 layout.addMember(this.form);
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
101 this.form.setValues(initial);
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 layout.setAlign(VerticalAlignment.TOP);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 return layout;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107
3846
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
108 @Override
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
109 public Canvas createOld(final DataList dataList) {
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
110 final HLayout layout = new HLayout();
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
111 final VLayout vLayout = new VLayout();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 layout.setWidth("400px");
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
114 final Label label = new Label(dataList.getLabel());
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 label.setWidth("200px");
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
117 final int size = dataList.size();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 for (int i = 0; i < size; i++) {
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
119 final Data data = dataList.get(i);
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
120 final DataItem[] items = data.getItems();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
122 for (final DataItem item : items) {
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
123 final HLayout hLayout = new HLayout();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
125 final String desc = funcDesc.containsKey(item.getLabel()) ? funcDesc.get(item.getLabel()) : item.getLabel();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 hLayout.addMember(label);
3846
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
127 hLayout.addMember(new Label(desc));
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 vLayout.addMember(hLayout);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
130 vLayout.setWidth("130px");
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
131 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
132 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
133
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
134 final Canvas back = getBackButton(dataList.getState());
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 layout.addMember(label);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 layout.addMember(vLayout);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 layout.addMember(back);
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 return layout;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142
3846
84a48acabd78 Show full function instead of internal function name (#873).
Christian Lins <christian.lins@intevation.de>
parents: 3366
diff changeset
143 @Override
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 public Data[] getData() {
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
145 final Map<?, ?> values = this.form.getValues();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
147 final Data[] list = new Data[values.size()];
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
148 int i = 0;
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
150 for (final Map.Entry<?, ?> entry : values.entrySet()) {
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
151 final String fieldname = (String) entry.getKey();
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
152 final String selection = (String) entry.getValue();
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
154 final DataItem item = new DefaultDataItem(fieldname, null, selection);
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
155
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
156 list[i++] = new DefaultData(fieldname, null, null, new DataItem[] { item });
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 return list;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 @Override
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
163 public void setValues(final String cid, final boolean checked) {
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 @Override
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
167 public boolean renderCheckboxes() {
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
168 return false;
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
169 }
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171 @Override
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
172 public void success(final FixingsOverviewInfo fixInfo) {
3358
65b71ddc7716 Show the overview and chart in function select state in fix analysis helper
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
173 }
9256
6c24c857ccf9 fixation refactoring and inputItem behaviour to interfaces
gernotbelger
parents: 8856
diff changeset
174 }

http://dive4elements.wald.intevation.org