Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/QSegmentedInputPanel.java @ 5349:d43ef9f709cd
Add HWSLines and HWSPoints to datacage for the map
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 20 Mar 2013 16:37:02 +0100 |
parents | d07abdb7ed7f |
children |
rev | line source |
---|---|
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 import com.google.gwt.i18n.client.NumberFormat; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 import com.google.gwt.user.client.rpc.AsyncCallback; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import com.smartgwt.client.types.TitleOrientation; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 import com.smartgwt.client.types.VerticalAlignment; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 import com.smartgwt.client.util.SC; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 import com.smartgwt.client.widgets.Canvas; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.Label; |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
12 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
14 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import com.smartgwt.client.widgets.layout.HLayout; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 import com.smartgwt.client.widgets.layout.VLayout; |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
18 import com.smartgwt.client.widgets.tab.Tab; |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 import com.smartgwt.client.widgets.tab.TabSet; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
21 import de.intevation.flys.client.client.Config; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
22 import de.intevation.flys.client.client.FLYSConstants; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
23 import de.intevation.flys.client.client.services.WQInfoService; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
24 import de.intevation.flys.client.client.services.WQInfoServiceAsync; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
25 import de.intevation.flys.client.client.ui.wq.QDTable; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
26 import de.intevation.flys.client.client.ui.wq.WTable; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
27 import de.intevation.flys.client.shared.model.ArtifactDescription; |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 import de.intevation.flys.client.shared.model.Data; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 import de.intevation.flys.client.shared.model.DataItem; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 import de.intevation.flys.client.shared.model.DataList; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 import de.intevation.flys.client.shared.model.DefaultData; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 import de.intevation.flys.client.shared.model.DefaultDataItem; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 import de.intevation.flys.client.shared.model.WQDataItem; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 import de.intevation.flys.client.shared.model.WQInfoObject; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 import de.intevation.flys.client.shared.model.WQInfoRecord; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
37 import java.util.ArrayList; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
38 import java.util.HashMap; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
39 import java.util.Iterator; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
40 import java.util.List; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
41 import java.util.Map; |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 /** |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 * This UIProvider creates a widget to enter Q values per segment. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 */ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 public class QSegmentedInputPanel |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 extends AbstractUIProvider |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 implements ChangeHandler, BlurHandler |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 { |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
51 |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
52 private static final long serialVersionUID = -8627825064071479905L; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
53 |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 public static final String FIELD_WQ_MODE = "wq_isq"; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 public static final String FIELD_WQ_Q = "Q"; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 public static final String GAUGE_SEPARATOR = ":"; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 public static final String GAUGE_PART_SEPARATOR = ";"; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 public static final String VALUE_SEPARATOR = ","; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 public static final int ROW_HEIGHT = 20; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 /** The constant field name for choosing single values or range.*/ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 public static final String FIELD_MODE = "mode"; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 /** The constant field value for range input mode.*/ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 public static final String FIELD_MODE_RANGE = "range"; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 protected WQInfoServiceAsync wqInfoService = |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 GWT.create(WQInfoService.class); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 /** The message class that provides i18n strings.*/ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 /** Stores the input panels related to their keys.*/ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
78 protected Map<String, DoubleArrayPanel> wqranges; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 /** Stores the min/max values for each q range.*/ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 protected Map<String, double[]> qranges; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 protected QDTable qdTable; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
84 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 protected WTable wTable; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 protected TabSet tabs; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
88 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 public QSegmentedInputPanel() { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 wqranges = new HashMap<String, DoubleArrayPanel>(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 qranges = new HashMap<String, double[]>(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 qdTable = new QDTable(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 wTable = new WTable(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 /** Create main UI Canvas. */ |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
99 @Override |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 public Canvas create(DataList data) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 initHelperPanel(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 Canvas submit = getNextButton(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 Canvas widget = createWidget(data); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 Label label = new Label(MSG.wqadaptedTitle()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 label.setHeight(25); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
109 VLayout layout = new VLayout(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 layout.setMembersMargin(10); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 layout.setWidth(350); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 layout.addMember(label); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 layout.addMember(widget); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 layout.addMember(submit); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
116 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
117 return layout; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
120 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 protected void initHelperPanel() { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 tabs = new TabSet(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 tabs.setWidth100(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 tabs.setHeight100(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 // TODO i18n |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 Tab qTab = new Tab("Q / D"); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 qTab.setPane(qdTable); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 qdTable.hideIconFields(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 tabs.addTab(qTab, 1); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 helperContainer.addMember(tabs); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
135 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 // TODO Q only would suffice. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 fetchWQData(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
139 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 /** Create display for passive mode. */ |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
142 @Override |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 public Canvas createOld(DataList dataList) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 List<Data> all = dataList.getAll(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 Data wqData = getData(all, "ranges"); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
146 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
147 Canvas back = getBackButton(dataList.getState()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
148 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
149 HLayout valLayout = new HLayout(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
150 VLayout vlayout = new VLayout(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
151 Label wqLabel = new Label(dataList.getLabel()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
152 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
153 wqLabel.setValign(VerticalAlignment.TOP); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 wqLabel.setWidth(200); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
156 wqLabel.setHeight(25); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
157 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
158 valLayout.addMember(wqLabel); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
159 valLayout.addMember(createOldWQValues(wqData)); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
160 valLayout.addMember(back); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
161 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
162 vlayout.addMember(valLayout); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
163 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
164 return vlayout; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
165 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
166 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
167 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
168 /** Create canvas showing previously entered values. */ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
169 protected Canvas createOldWQValues(Data wqData) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
170 VLayout layout = new VLayout(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 //TODO: Sort by first field, numerically. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
173 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 DataItem item = wqData.getItems()[0]; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
175 String value = item.getStringValue(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
176 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
177 String[] gauges = value.split(GAUGE_SEPARATOR); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
178 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
179 for (String gauge: gauges) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
180 HLayout h = new HLayout(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
181 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
182 String[] parts = gauge.split(GAUGE_PART_SEPARATOR); |
5104
5f70c73b11ed
Display gauge names in WQAdapted input panel instead of gauge range.
Raimund Renkert <rrenkert@intevation.de>
parents:
4184
diff
changeset
|
183 String[] values = parts[3].split(VALUE_SEPARATOR); |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
184 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
185 Label l = new Label(parts[0] + " - " + parts[1] + ": "); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
186 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
187 StringBuilder sb = new StringBuilder(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 boolean first = true; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
189 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
190 for (String v: values) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
191 if (!first) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
192 sb.append(", "); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
193 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
194 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
195 sb.append(v); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
196 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
197 first = false; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
198 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
199 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
200 Label v = new Label(sb.toString()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
201 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
202 l.setWidth(65); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
203 v.setWidth(65); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
204 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
205 h.addMember(l); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
206 h.addMember(v); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
207 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
208 layout.addMember(h); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
209 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
210 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
211 return layout; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
212 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
213 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
214 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
215 protected Canvas createWidget(DataList dataList) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
216 VLayout layout = new VLayout(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
217 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
218 Canvas list = createList(dataList); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
219 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
220 DataItem[] items = getWQItems(dataList); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
221 int listHeight = ROW_HEIGHT * items.length; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
222 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
223 layout.addMember(list); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
224 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
225 layout.setHeight(25 + listHeight); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
226 layout.setWidth(350); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
227 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
228 return layout; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
229 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
230 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
231 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
232 @Override |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
233 public List<String> validate() { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
234 List<String> errors = new ArrayList<String>(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
235 NumberFormat nf = NumberFormat.getDecimalFormat(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
236 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
237 Iterator<String> iter = wqranges.keySet().iterator(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
238 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
239 while (iter.hasNext()) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
240 List<String> tmpErrors = new ArrayList<String>(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
241 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
242 String key = iter.next(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
243 DoubleArrayPanel dap = wqranges.get(key); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
244 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
245 if (!dap.validateForm()) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
246 errors.add(MSG.error_invalid_double_value()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
247 return errors; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
248 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
249 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
250 double[] mm = qranges.get(key); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
251 if (mm == null) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
252 SC.warn(MSG.error_read_minmax_values()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
253 continue; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
254 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
255 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
256 double[] values = dap.getInputValues(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
257 // might geht npe here if one field not filled |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
258 double[] good = new double[values.length]; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
259 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
260 int idx = 0; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
261 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
262 for (double value: values) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
263 if (value < mm[0] || value > mm[1]) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
264 String tmp = MSG.error_validate_range(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
265 tmp = tmp.replace("$1", nf.format(value)); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
266 tmp = tmp.replace("$2", nf.format(mm[0])); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
267 tmp = tmp.replace("$3", nf.format(mm[1])); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
268 tmpErrors.add(tmp); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
269 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
270 else { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
271 good[idx++] = value; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
272 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
273 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
274 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
275 double[] justGood = new double[idx]; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
276 for (int i = 0; i < justGood.length; i++) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
277 justGood[i] = good[i]; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
278 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
279 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
280 if (!tmpErrors.isEmpty()) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
281 dap.setValues(justGood); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
282 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
283 errors.addAll(tmpErrors); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
284 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
285 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
286 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
287 return errors; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
288 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
289 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
290 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
291 protected Canvas createList(DataList dataList) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
292 VLayout layout = new VLayout(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
293 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
294 DataItem[] items = getWQItems(dataList); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
295 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
296 for (DataItem item: items) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
297 String title = item.getLabel(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
298 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
299 DoubleArrayPanel dap = new DoubleArrayPanel( |
5195
d07abdb7ed7f
flys/issue1137: Allow value selection via inputhelpers in WQAdaptedPanel.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5104
diff
changeset
|
300 createLineTitle(title), null, this, null, TitleOrientation.LEFT); |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
301 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
302 wqranges.put(title, dap); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
303 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
304 if (item instanceof WQDataItem) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
305 WQDataItem wq = (WQDataItem) item; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
306 double[] mmQ = wq.getQRange(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
307 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
308 qranges.put(title, mmQ); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
309 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
310 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
311 layout.addMember(dap); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
312 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
313 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
314 layout.setHeight(items.length * ROW_HEIGHT); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
315 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
316 return layout; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
317 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
318 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
319 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
320 protected DataItem[] getWQItems(DataList dataList) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
321 List<Data> data = dataList.getAll(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
322 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
323 for (Data d: data) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
324 String name = d.getLabel(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
325 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
326 // TODO to be gone |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
327 if (name.equals(FIELD_WQ_MODE)) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
328 continue; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
329 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
330 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
331 return d.getItems(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
332 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
333 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
334 return null; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
335 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
336 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
337 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
338 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
339 public String createLineTitle(String key) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
340 String[] splitted = key.split(";"); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
341 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
342 return splitted[0] + " - " + splitted[1]; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
343 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
344 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
345 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
346 @Override |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
347 public Data[] getData() { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
348 Data values = getWQValues(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
349 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
350 return new Data[] { values }; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
351 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
352 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
353 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
354 protected Data getWQValues() { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
355 String wqvalue = null; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
356 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
357 Iterator<String> iter = wqranges.keySet().iterator(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
358 while (iter.hasNext()) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
359 String key = iter.next(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
360 DoubleArrayPanel dap = wqranges.get(key); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
361 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
362 double[] values = dap.getInputValues(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
363 if (wqvalue == null) { |
5104
5f70c73b11ed
Display gauge names in WQAdapted input panel instead of gauge range.
Raimund Renkert <rrenkert@intevation.de>
parents:
4184
diff
changeset
|
364 wqvalue = createValueString(key + "; ", values); |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
365 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
366 else { |
5104
5f70c73b11ed
Display gauge names in WQAdapted input panel instead of gauge range.
Raimund Renkert <rrenkert@intevation.de>
parents:
4184
diff
changeset
|
367 wqvalue += GAUGE_SEPARATOR + createValueString(key + "; ", values); |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
368 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
369 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
370 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
371 // TODO probably ranges |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
372 DataItem valueItem = new DefaultDataItem( |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
373 "ranges", "ranges", wqvalue); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
374 Data values = new DefaultData( |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
375 "ranges", null, null, new DataItem[] { valueItem }); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
376 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
377 return values; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
378 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
379 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
380 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
381 protected String createValueString(String key, double[] values) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
382 StringBuilder sb = new StringBuilder(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
383 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
384 boolean first = true; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
385 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
386 for (double value: values) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
387 if (!first) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
388 sb.append(","); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
389 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
390 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
391 sb.append(Double.toString(value)); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
392 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
393 first = false; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
394 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
395 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
396 return key + ";" + sb.toString(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
397 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
398 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
399 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
400 @Override |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
401 public void onChange(ChangeEvent event) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
402 // TODO IMPLEMENT ME |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
403 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
404 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
405 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
406 @Override |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
407 public void onBlur(BlurEvent event) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
408 DoubleArrayPanel dap = (DoubleArrayPanel) event.getForm(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
409 dap.validateForm(event.getItem()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
410 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
411 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
412 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
413 protected void fetchWQData() { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
414 Config config = Config.getInstance(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
415 String locale = config.getLocale (); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
416 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
417 ArtifactDescription adescr = artifact.getArtifactDescription(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
418 DataList[] data = adescr.getOldData(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
419 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
420 double[] mm = getMinMaxKM(data); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
421 String river = getRiverName(data); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
422 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
423 wqInfoService.getWQInfo(locale, river, mm[0], mm[0], |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
424 new AsyncCallback<WQInfoObject[]>() { |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
425 @Override |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
426 public void onFailure(Throwable caught) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
427 GWT.log("Could not recieve wq informations."); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
428 SC.warn(caught.getMessage()); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
429 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
430 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
4116
diff
changeset
|
431 @Override |
4116
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
432 public void onSuccess(WQInfoObject[] wqi) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
433 int num = wqi != null ? wqi.length :0; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
434 GWT.log("Recieved " + num + " wq informations."); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
435 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
436 if (num == 0) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
437 return; |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
438 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
439 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
440 addWQInfo(wqi); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
441 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
442 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
443 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
444 ); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
445 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
446 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
447 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
448 protected void addWQInfo (WQInfoObject[] wqi) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
449 for(WQInfoObject wi: wqi) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
450 WQInfoRecord rec = new WQInfoRecord(wi); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
451 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
452 if (wi.getType().equals("W")) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
453 wTable.addData(rec); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
454 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
455 else { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
456 qdTable.addData(rec); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
457 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
458 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
459 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
460 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
461 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
462 /** |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
463 * Determines the min and max kilometer value selected in a former state. A |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
464 * bit silly, but we need to run over each value of the "old data" to find |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
465 * such values because it is not available here. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
466 * |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
467 * @param data The DataList which contains the whole data inserted for the |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
468 * current artifact. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
469 * |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
470 * @return a double array with [min, max]. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
471 */ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
472 protected double[] getMinMaxKM(DataList[] data) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
473 ArtifactDescription adesc = artifact.getArtifactDescription(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
474 return adesc.getKMRange(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
475 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
476 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
477 |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
478 /** |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
479 * Returns the name of the selected river. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
480 * |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
481 * @param data The DataList with all data. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
482 * |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
483 * @return the name of the current river. |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
484 */ |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
485 protected String getRiverName(DataList[] data) { |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
486 ArtifactDescription adesc = artifact.getArtifactDescription(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
487 return adesc.getRiver(); |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
488 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
489 } |
4ffeccc5b5a1
Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
490 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |