annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java @ 8644:c15cebcf60da

Remove JavaScript greeting exception. This fixes the Error "$wnd.unHighlight" is not a function exception at startup. This apperantly did not do anything (as the function does not exist) and was not necessary (as everything works as expected) So just throw it away.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 27 Mar 2015 19:10:02 +0100
parents 4875ca46fdcd
children 5e38e2924c07
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.ui;
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.List;
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
48 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
49
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 * 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
53 */
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54 public 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
55 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
56 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
57 {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
58
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
59 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
60
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61 public static final String 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
62 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
63
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64 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
65
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66 public static final String 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
67
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 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
69
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 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
71
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
72 /** 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
73 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
74
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
75 /** 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
76 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
77
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
78 protected 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
79 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
80
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
81 /** 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
82 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
83
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
84 /** 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
85 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
86
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
87 /** 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
88 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
89
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
90 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
91
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
92 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
93
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
94 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
95
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
96
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
97 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
98 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
99 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
100 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
101 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
102 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
103
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 /** Create main UI Canvas. */
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
106 @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
107 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
108 initHelperPanel();
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
109
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
110 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
111 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
112 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
113
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
114 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
115
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
116 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
117 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
118 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
119
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
120 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
121 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
122 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
123
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
124 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
125 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
126
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 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
129 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
130 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
131 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
132
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
133 // 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
134 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
135
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
136 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
137 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
138
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
139 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
140
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
141 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
142
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
143 // 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
144 fetchWQData();
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
145 }
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 /** 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
149 @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
150 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
151 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
152 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
153
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
154 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
155
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
156 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
157 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
158 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
159
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
160 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
161
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
162 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
163 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
164
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
165 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
166 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
167 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
168
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
169 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
170
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
171 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
172 }
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 /** 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
176 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
177 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
178
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
179 //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
180
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
181 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
182 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
183
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
184 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
185
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
186 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
187 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
188
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
189 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
190 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
191
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
192 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
193
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
194 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
195 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
196
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
197 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
198 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
199 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
200 }
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 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
203
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
204 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
205 }
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 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
208
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
209 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
210 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
211
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
212 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
213 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
214
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
215 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
216 }
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 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
219 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
220
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 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
223 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
224
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
225 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
226
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
227 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
228 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
229
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
230 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
231
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
232 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
233 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
234
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
235 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
236 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
237
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 @Override
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
240 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
241 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
242 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
243
6100
de92e0cdebdc GWT client: Removed some Iterator cruft.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
244 for (Map.Entry<String, DoubleArrayPanel> entry: wqranges.entrySet()) {
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
245
6100
de92e0cdebdc GWT client: Removed some Iterator cruft.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
246 String key = entry.getKey();
de92e0cdebdc GWT client: Removed some Iterator cruft.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
247 DoubleArrayPanel dap = entry.getValue();
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
248
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
249 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
250 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
251 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
254 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
255 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
256 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
257 continue;
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
258 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
259
6100
de92e0cdebdc GWT client: Removed some Iterator cruft.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
260 List<String> tmpErrors = new ArrayList<String>();
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
261 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
262 // 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
263 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
264
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
265 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
266
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
267 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
268 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
269 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
270 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
271 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
272 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
273 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
274 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
275 else {
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
276 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
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 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
279
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
280 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
281 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
282 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
283 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
284
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
285 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
286 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
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 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
289 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
290 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
291
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
292 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
296 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
297 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
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 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
300
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
301 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
302 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
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 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
305 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
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 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
308
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
309 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
310 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
311 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
312
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
313 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
314 }
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 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
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.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
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 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
322 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
323
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
324
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
325 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
326 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
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 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
329 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
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 // 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
332 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
333 continue;
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
334 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
335
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
336 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
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 null;
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
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 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
345 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
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 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
348 }
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
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
351 @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
352 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
353 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
354
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
355 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
356 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
357
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
358
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
359 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
360 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
361
6100
de92e0cdebdc GWT client: Removed some Iterator cruft.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
362 for (Map.Entry<String, DoubleArrayPanel> entry: wqranges.entrySet()) {
de92e0cdebdc GWT client: Removed some Iterator cruft.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
363 String key = entry.getKey();
de92e0cdebdc GWT client: Removed some Iterator cruft.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
364 DoubleArrayPanel dap = entry.getValue();
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
365
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
366 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
367 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
368 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
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 else {
5104
5f70c73b11ed Display gauge names in WQAdapted input panel instead of gauge range.
Raimund Renkert <rrenkert@intevation.de>
parents: 4184
diff changeset
371 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
372 }
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
375 // 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
376 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
377 "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
378 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
379 "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
380
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
381 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
382 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
383
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
384
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
385 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
386 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
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 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
389
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
390 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
391 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
392 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
395 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
396
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
397 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
400 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
401 }
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
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
404 @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
405 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
406 // 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
407 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
408
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
409
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
410 @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
411 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
412 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
413 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
414 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
415
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
416
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
417 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
418 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
419 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
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 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
422 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
423
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
424 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
425 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
426
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
427 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
428 new AsyncCallback<WQInfoObject[]>() {
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
429 @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
430 public void onFailure(Throwable caught) {
6556
4875ca46fdcd Doc/Debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6100
diff changeset
431 GWT.log("Could not receive wq informations.");
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
432 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
433 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
434
4184
03de5c424f95 Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents: 4116
diff changeset
435 @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
436 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
437 int num = wqi != null ? wqi.length :0;
6556
4875ca46fdcd Doc/Debug.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6100
diff changeset
438 GWT.log("Received " + num + " wq informations.");
4116
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
439
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
440 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
441 return;
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
442 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
443
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
444 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
445
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
446 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
447 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
448 );
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 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
453 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
454 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
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 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
457 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
458 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
459 else {
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
460 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
461 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
462 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
463 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
464
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 * 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
468 * 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
469 * 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
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 * @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
472 * 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
473 *
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
474 * @return 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
475 */
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
476 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
477 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
478 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
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
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
481
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
482 /**
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
483 * 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
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 * @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
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 * @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
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 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
490 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
491 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
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 }
4ffeccc5b5a1 Initial GUI and state for per-segment Q-input for extreme valua analysis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
494 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org