annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java @ 5861:172338b1407f

GWT client: Added copyright header.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:30:15 +0200
parents 5aa05a7a34b7
children ea9eef426962
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.ui;
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
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.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
12 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
13 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
14
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.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
16 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
17 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
18 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
19 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
20 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
21 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
22 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
23 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
24 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
25 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
26 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
27 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
28
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
29 import org.dive4elements.river.client.client.Config;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
30 import org.dive4elements.river.client.client.FLYSConstants;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
31 import org.dive4elements.river.client.client.services.WQInfoService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
32 import org.dive4elements.river.client.client.services.WQInfoServiceAsync;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
33 import org.dive4elements.river.client.client.ui.wq.QDTable;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
34 import org.dive4elements.river.client.client.ui.wq.WTable;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
35 import org.dive4elements.river.client.shared.model.ArtifactDescription;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.shared.model.Data;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
37 import org.dive4elements.river.client.shared.model.DataItem;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
38 import org.dive4elements.river.client.shared.model.DataList;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
39 import org.dive4elements.river.client.shared.model.DefaultData;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
40 import org.dive4elements.river.client.shared.model.DefaultDataItem;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
41 import org.dive4elements.river.client.shared.model.WQDataItem;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
42 import org.dive4elements.river.client.shared.model.WQInfoObject;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
43 import org.dive4elements.river.client.shared.model.WQInfoRecord;
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
45 import java.util.ArrayList;
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
46 import java.util.HashMap;
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
47 import java.util.Iterator;
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
48 import java.util.List;
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
49 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
50
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52 /**
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 * 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
54 */
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 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
56 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
57 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
58 {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
59
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
60 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
61
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62 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
63 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
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 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
66
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
67 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
68
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 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
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 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
72
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
73 /** 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
74 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
75
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
76 /** 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
77 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
78
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
79 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
80 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
81
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
82 /** 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
83 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
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 /** 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
86 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
87
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
88 /** 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
89 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
90
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
91 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
92
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
93 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
94
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
95 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
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 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
99 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
100 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
101 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
102 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
103 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
104
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
105
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
106 /** Create main UI Canvas. */
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
107 @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
108 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
109 initHelperPanel();
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
110
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
111 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
112 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
113 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
114
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
115 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
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 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
118 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
119 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
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 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
122 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
123 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
124
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
125 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
126 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
127
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 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
130 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
131 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
132 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
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 // 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
135 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
136
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
137 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
138 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
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 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
141
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
142 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
143
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
144 // 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
145 fetchWQData();
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
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 /** 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
150 @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
151 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
152 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
153 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
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 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
156
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
157 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
158 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
159 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
160
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
161 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
162
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
163 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
164 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
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 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
167 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
168 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
169
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.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
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 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
175
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
176 /** 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
177 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
178 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
179
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
180 //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
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 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
183 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
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 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
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 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
188 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
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 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
191 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
192
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
193 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
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 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
196 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
197
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
198 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
199 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
200 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
203 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
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 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
206 }
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 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
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 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
211 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
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 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
214 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
215
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
216 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
219 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
220 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
221
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 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
224 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
225
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
226 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
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 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
229 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
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 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
232
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
233 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
234 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
235
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
236 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
237 }
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
240 @Override
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
241 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
242 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
243 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
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 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
246
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
247 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
248 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
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 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
251 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
252
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
253 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
254 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
255 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
256 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
257
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[] 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
259 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
260 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
261 continue;
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
262 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
263
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
264 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
265 // 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
266 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
267
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
268 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
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 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
271 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
272 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
273 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
274 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
275 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
276 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
277 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
278 else {
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
279 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
280 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
281 }
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 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
284 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
285 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
288 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
289 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
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 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
292 }
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
295 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
296 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
297
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 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
300 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
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 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
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 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
305 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
306
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
307 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
308 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
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 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
311
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
312 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
313 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
314 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
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 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
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 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
320 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
321
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
322 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
323
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
324 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
327
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
328 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
329 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
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 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
332 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
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 // 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
335 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
336 continue;
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 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
340 }
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 null;
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
346
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 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
348 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
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 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
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
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
354 @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
355 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
356 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
357
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
358 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
359 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
360
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 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
363 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
364
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
365 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
366 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
367 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
368 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
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 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
371 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
372 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
373 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
374 else {
5104
5f70c73b11ed Display gauge names in WQAdapted input panel instead of gauge range.
Raimund Renkert <rrenkert@intevation.de>
parents: 4184
diff changeset
375 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
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 }
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 // 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
380 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
381 "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
382 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
383 "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
384
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
385 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
386 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
387
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
388
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
389 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
390 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
391
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
392 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
393
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
394 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
395 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
396 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
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 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
400
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
401 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
402 }
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 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
405 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
406
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
407
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
408 @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
409 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
410 // 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
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
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
414 @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
415 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
416 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
417 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
418 }
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
421 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
422 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
423 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
424
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
425 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
426 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
427
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
428 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
429 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
430
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
431 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
432 new AsyncCallback<WQInfoObject[]>() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
433 @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
434 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
435 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
436 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
437 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
438
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
439 @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
440 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
441 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
442 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
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 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
445 return;
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 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
449
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
450 }
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 );
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
453 }
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
456 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
457 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
458 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
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 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
461 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
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 else {
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
464 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
465 }
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 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
468
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 /**
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
471 * 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
472 * 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
473 * 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
474 *
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
475 * @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
476 * 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
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 * @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
479 */
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
480 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
481 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
482 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
483 }
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
486 /**
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
487 * 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
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 * @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
490 *
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
491 * @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
492 */
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
493 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
494 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
495 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
496 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
497 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
498 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org