annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistancePanel.java @ 8870:c26fb37899ca

Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui. Also using now the localization info from the server instead of localizing the modules again on the client side.
author gernotbelger
date Wed, 07 Feb 2018 11:59:13 +0100
parents 5e38e2924c07
children 28c50f5efceb
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;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import com.google.gwt.core.client.GWT;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import com.google.gwt.i18n.client.NumberFormat;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
14 import com.smartgwt.client.data.AdvancedCriteria;
863
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
15 import com.smartgwt.client.data.Criteria;
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
16 import com.smartgwt.client.data.Criterion;
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
17 import com.smartgwt.client.data.Record;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
18 import com.smartgwt.client.types.Alignment;
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
19 import com.smartgwt.client.types.OperatorId;
783
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
20 import com.smartgwt.client.util.SC;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 import com.smartgwt.client.widgets.Canvas;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import com.smartgwt.client.widgets.Label;
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
23 import com.smartgwt.client.widgets.form.DynamicForm;
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
24 import com.smartgwt.client.widgets.form.fields.SelectItem;
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
25 import com.smartgwt.client.widgets.form.fields.StaticTextItem;
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
26 import com.smartgwt.client.widgets.form.fields.events.BlurEvent;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 import com.smartgwt.client.widgets.form.fields.events.BlurHandler;
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
28 import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
29 import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
30 import com.smartgwt.client.widgets.grid.ListGrid;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
31 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
783
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
32 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 import com.smartgwt.client.widgets.layout.HLayout;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 import com.smartgwt.client.widgets.layout.VLayout;
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
35 import com.smartgwt.client.widgets.tab.Tab;
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
36 import com.smartgwt.client.widgets.tab.TabSet;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
37 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
893
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
38 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
40 import org.dive4elements.river.client.client.Config;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
41 import org.dive4elements.river.client.client.FLYSConstants;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
42 import org.dive4elements.river.client.client.event.FilterHandler;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
43 import org.dive4elements.river.client.client.event.RangeFilterEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
44 import org.dive4elements.river.client.client.event.StringFilterEvent;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
45 import org.dive4elements.river.client.client.ui.range.DistanceInfoDataSource;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
46 import org.dive4elements.river.client.client.ui.range.LocationsTable;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
47 import org.dive4elements.river.client.client.ui.range.RangeTable;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
48 import org.dive4elements.river.client.shared.model.ArtifactDescription;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
49 import org.dive4elements.river.client.shared.model.Data;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
50 import org.dive4elements.river.client.shared.model.DataItem;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
51 import org.dive4elements.river.client.shared.model.DataList;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
52 import org.dive4elements.river.client.shared.model.DefaultData;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
53 import org.dive4elements.river.client.shared.model.DefaultDataItem;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
55 import java.util.ArrayList;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
56 import java.util.LinkedHashMap;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
57 import java.util.List;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59
7141
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
60 /** Panel to allow input of distance for calculation range. */
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8800
diff changeset
61 public class DistancePanel
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8800
diff changeset
62 extends AbstractUIProvider implements BlurHandler, FilterHandler
863
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
63 {
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
65 private static final long serialVersionUID = -883142387908664588L;
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
66
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
67 public static final int DEFAULT_STEP_WIDTH = 100;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
69 public static final String FIELD_LOWER = "ld_from";
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
70 public static final String FIELD_UPPER = "ld_to";
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
71 public static final String FIELD_STEP = "ld_step";
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
72
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
76 protected RangeTable distancesTable;
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
77 protected LocationsTable locationsTable;
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
78
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 protected DoubleRangePanel distancePanel;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
81 protected TableFilter filterDescription;
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
82 protected RangeTableFilter filterRange;
893
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
83
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
84 protected TabSet tabs;
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
85
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 protected double min;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 protected double max;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
89 protected StaticTextItem filterResultCount;
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
90 protected ListGrid currentFiltered;
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 public DistancePanel() {
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
93 this("right");
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
94 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
95
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
96
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
97 public DistancePanel(String labelOrientation) {
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
98 distancePanel = new DoubleRangePanel(
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
99 labelFrom(), labelTo(), labelStep(),
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
100 0d, 0d, 0d, 250, this, labelOrientation);
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104 @Override
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 public Canvas create(DataList data) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 VLayout layout = new VLayout();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 layout.setMembersMargin(10);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108
1423
204e085a9f1c Bugfix: set correct label for 'waterlevel/ground' state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1387
diff changeset
109 Label label = new Label(getLabel());
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 Canvas submit = getNextButton();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 label.setHeight(25);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 distancePanel.setHeight(50);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 layout.addMember(label);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 layout.addMember(distancePanel);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 layout.addMember(submit);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 initMinMaxValues(data);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 initDefaultValues(data);
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
122 initHelperPanel();
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 return layout;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 @Override
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 public Canvas createOld(DataList dataList) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 String s = getOldSelectionString(dataList);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 String l = dataList.getLabel();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133 Label label = new Label(l);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 Label selected = new Label(s);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 HLayout layout = new HLayout();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 layout.setWidth(400);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139 label.setWidth(200);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140 selected.setWidth(130);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 layout.addMember(label);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 layout.addMember(selected);
784
3fa64c796ffc Added the missing 'back'-button to the DistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 783
diff changeset
144 layout.addMember(getBackButton(dataList.getState()));
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146 return layout;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
148
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 protected String getOldSelectionString(DataList dataList) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 List<Data> items = dataList.getAll();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
153 Data dFrom = getData(items, getLowerField());
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
154 Data dTo = getData(items, getUpperField());
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
155 Data dStep = getData(items, getStepField());
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157 DataItem[] from = dFrom.getItems();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 DataItem[] to = dTo.getItems();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159 DataItem[] step = dStep.getItems();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
160
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161 StringBuilder sb = new StringBuilder();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
162 sb.append(from[0].getLabel());
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
163 sb.append(" " + getUnitFrom() + " - ");
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 sb.append(to[0].getLabel());
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
165 sb.append(" " + getUnitTo() + " - ");
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 sb.append(step[0].getLabel());
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
167 sb.append(" " + getUnitStep());
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
168
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169 return sb.toString();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
170 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
171
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172
1423
204e085a9f1c Bugfix: set correct label for 'waterlevel/ground' state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1387
diff changeset
173 protected String getLabel() {
204e085a9f1c Bugfix: set correct label for 'waterlevel/ground' state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1387
diff changeset
174 return MSG.distance_state();
204e085a9f1c Bugfix: set correct label for 'waterlevel/ground' state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1387
diff changeset
175 }
204e085a9f1c Bugfix: set correct label for 'waterlevel/ground' state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1387
diff changeset
176
204e085a9f1c Bugfix: set correct label for 'waterlevel/ground' state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1387
diff changeset
177
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
178 protected String labelFrom() {
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
179 return getLabelFrom() + " [" + getUnitFrom() + "]";
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
180 }
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
181
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
182
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
183 protected String getLabelFrom() {
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
184 return MSG.dpLabelFrom();
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
185 }
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
186
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
187
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
188 protected String getUnitFrom() {
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
189 return MSG.dpUnitFrom();
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
190 }
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
191
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
192
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
193 protected String labelTo() {
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
194 return getLabelTo() + " [" + getUnitTo() + "]";
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
195 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
196
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
197
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
198 protected String getLabelTo() {
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
199 return MSG.dpLabelTo();
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
200 }
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
201
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
202
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
203 protected String getUnitTo() {
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
204 return MSG.dpUnitTo();
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
205 }
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
206
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
207
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
208 protected String labelStep() {
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
209 return getLabelStep() + " [" + getUnitStep() + "]";
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
210 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
211
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
212
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
213 protected String getLabelStep() {
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
214 return MSG.dpLabelStep();
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
215 }
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
216
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
217
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
218 protected String getUnitStep() {
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
219 return MSG.dpUnitStep();
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
220 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
221
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
222
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
223 protected String getLowerField() {
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
224 return FIELD_LOWER;
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
225 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
226
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
227
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
228 protected String getUpperField() {
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
229 return FIELD_UPPER;
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
230 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
231
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
232
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
233 protected String getStepField() {
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
234 return FIELD_STEP;
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
235 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
236
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
237
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
238 @Override
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
239 public List<String> validate() {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
240 List<String> errors = new ArrayList<String>();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
241
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
242 if (!distancePanel.validateForm()) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
243 errors.add(MSG.wrongFormat());
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
244
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
245 return errors;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
246 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
247
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
248 validateFrom(errors);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
249 validateTo(errors);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
250
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
251 return errors;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
252 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
253
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
254
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
255 protected void validateFrom(List<String> errors) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
256 double from = distancePanel.getFrom();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
257
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
258 if (from < min || from > max) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
259 NumberFormat nf = NumberFormat.getDecimalFormat();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
260
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
261 String tmp = MSG.error_validate_lower_range();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
262 tmp = tmp.replace("$1", nf.format(from));
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
263 tmp = tmp.replace("$2", nf.format(min));
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
264
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
265 distancePanel.setFrom(min);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
266 errors.add(tmp);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
267 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
268 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
269
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
270
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
271 protected void validateTo(List<String> errors) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
272 double to = distancePanel.getTo();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
273
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
274 if (to < min || to > max) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
275 NumberFormat nf = NumberFormat.getDecimalFormat();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
276
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
277 String tmp = MSG.error_validate_upper_range();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
278 tmp = tmp.replace("$1", nf.format(to));
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
279 tmp = tmp.replace("$2", nf.format(max));
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
280
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
281 distancePanel.setTo(max);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
282 errors.add(tmp);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
283 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
284 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
285
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
286
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
287 @Override
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
288 public Data[] getData() {
1387
3cbc7fbfff0e Set attribute 'ld_mode' in appropiate UIProviders.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1265
diff changeset
289 Data[] data = new Data[4];
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
290
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
291 data[0] = getDataFrom();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
292 data[1] = getDataTo();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
293 data[2] = getDataStep();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
294
1387
3cbc7fbfff0e Set attribute 'ld_mode' in appropiate UIProviders.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1265
diff changeset
295 DataItem item = new DefaultDataItem("ld_mode","ld_mode", "distance");
3cbc7fbfff0e Set attribute 'ld_mode' in appropiate UIProviders.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1265
diff changeset
296 data[3] = new DefaultData(
3cbc7fbfff0e Set attribute 'ld_mode' in appropiate UIProviders.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1265
diff changeset
297 "ld_mode", null, null, new DataItem[] { item });
3cbc7fbfff0e Set attribute 'ld_mode' in appropiate UIProviders.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1265
diff changeset
298
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
299 return data;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
300 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
301
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
302
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
303 protected Data getDataFrom() {
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
304 String value = String.valueOf(distancePanel.getFrom());
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
305 String field = getLowerField();
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
306
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
307 DataItem item = new DefaultDataItem(field, field, value);
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
308 return new DefaultData(
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
309 field, null, null, new DataItem[] { item });
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
310 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
311
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
312
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
313 protected Data getDataTo() {
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
314 String value = String.valueOf(distancePanel.getTo());
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
315 String field = getUpperField();
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
316
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
317 DataItem item = new DefaultDataItem(field, field, value);
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
318 return new DefaultData(
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
319 field, null, null, new DataItem[] { item });
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
320 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
321
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
322
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
323 protected Data getDataStep() {
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
324 String value = String.valueOf(distancePanel.getStep());
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
325 String field = getStepField();
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
326
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
327 DataItem item = new DefaultDataItem(field, field, value);
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
328 return new DefaultData(
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
329 field, null, null, new DataItem[] { item });
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
330 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
331
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
332
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
333 @Override
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
334 public void onBlur(BlurEvent event) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
335 distancePanel.validateForm();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
336 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
337
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
338
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
339 protected void initMinMaxValues(DataList data) {
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
340 Data f = getData(data.getAll(), getLowerField());
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
341 Data t = getData(data.getAll(), getUpperField());
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
342
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
343 DataItem[] fItems = f.getItems();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
344 DataItem[] tItems = t.getItems();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
345
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
346 try {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
347 min = Double.valueOf(fItems[0].getStringValue());
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
348 max = Double.valueOf(tItems[0].getStringValue());
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
349 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
350 catch (NumberFormatException nfe) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
351 min = -Double.MAX_VALUE;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
352 max = Double.MAX_VALUE;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
353 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
354 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
355
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
356
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
357 protected void initDefaultValues(DataList data) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
358 initDefaultFrom(data);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
359 initDefaultTo(data);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
360 initDefaultStep(data);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
361 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
362
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
363
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
364 protected void initDefaultFrom(DataList data) {
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
365 Data f = getData(data.getAll(), getLowerField());
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
366
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
367 double from = getDefaultFrom();
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
368
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
369 try {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
370 from = getDefaultValue(f);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
371 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
372 catch (NumberFormatException nfe) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
373 // do nothing
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
374 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
375
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
376 distancePanel.setFrom(from);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
377 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
378
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
379
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
380 protected double getDefaultFrom() {
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
381 return min;
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
382 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
383
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
384
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
385 protected void initDefaultTo(DataList data) {
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
386 Data t = getData(data.getAll(), getUpperField());
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
387
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
388 double to = getDefaultTo();
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
389
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
390 try {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
391 to = getDefaultValue(t);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
392 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
393 catch (NumberFormatException nfe) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
394 // do nothing
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
395 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
396
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
397 distancePanel.setTo(to);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
398 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
399
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
400
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
401 protected double getDefaultTo() {
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
402 return max;
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
403 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
404
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
405
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
406 protected void initDefaultStep(DataList data) {
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
407 Data s = getData(data.getAll(), getStepField());
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
408
8800
2aaf87bc3ea7 Backout revision d793caaf5b5e.
Tom Gottfried <tom@intevation.de>
parents: 8790
diff changeset
409 double step = getDefaultStep();
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
410
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
411 try {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
412 step = getDefaultValue(s);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
413 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
414 catch (NumberFormatException nfe) {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
415 // do nothing
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
416 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
417
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
418 distancePanel.setStep(step);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
419 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
420
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
421
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
422 protected double getDefaultStep() {
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
423 return DEFAULT_STEP_WIDTH;
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
424 }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
425
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 784
diff changeset
426
7745
1d6b957d8953 issue1549: Add live-validation to wsplgen to-field.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7731
diff changeset
427 /** Gets the double from default in data, null if none. */
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
428 protected double getDefaultValue(Data data)
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
429 throws NumberFormatException
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
430 {
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
431 DataItem def = data.getDefault();
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
432 String defValue = def != null ? def.getStringValue() : null;
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
433
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
434 return Double.valueOf(defValue);
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
435 }
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
436
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
437
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
438 protected void initHelperPanel() {
793
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
439 distancesTable = new RangeTable();
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
440 locationsTable = new LocationsTable();
4497d19c22fd Finished the panel to enter waterlevel/ground information (from, to, diff).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 788
diff changeset
441
782
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
442 Config config = Config.getInstance();
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
443 String url = config.getServerUrl();
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
444 String river = getRiverName();
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
445
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
446 distancesTable.setAutoFetchData(true);
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
447 locationsTable.setAutoFetchData(true);
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
448 distancesTable.setDataSource(new DistanceInfoDataSource(
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
449 url, river, "distances"));
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
450 locationsTable.setDataSource(new DistanceInfoDataSource(
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
451 url, river, "locations"));
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
452
783
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
453 distancesTable.addRecordClickHandler(new RecordClickHandler() {
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
454 @Override
783
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
455 public void onRecordClick(RecordClickEvent e) {
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
456 Record r = e.getRecord();
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
457
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
458 String from = r.getAttribute("from");
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
459 String to = r.getAttribute("to");
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
460
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
461 try {
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
462 distancePanel.setFrom(Double.valueOf(from));
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
463 distancePanel.setTo(Double.valueOf(to));
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
464 }
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
465 catch (NumberFormatException nfe) {
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
466 SC.warn(MSG.wrongFormat());
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
467 }
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
468 }
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
469 });
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
470
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
471 locationsTable.addRecordClickHandler(new RecordClickHandler() {
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
472 @Override
783
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
473 public void onRecordClick(RecordClickEvent e) {
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
474 Record r = e.getRecord();
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
475 int field = e.getFieldNum();
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
476
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
477 try {
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
478 String value = r.getAttribute("from");
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
479
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
480 switch (field) {
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
481 case 0:
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
482 distancePanel.setFrom(Double.valueOf(value));
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
483 break;
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
484 case 1:
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
485 distancePanel.setTo(Double.valueOf(value));
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
486 break;
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
487 }
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
488 }
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
489 catch (NumberFormatException nfe) {
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
490 SC.warn(MSG.wrongFormat());
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
491 }
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
492 }
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
493 });
8ebaad41285b #159 Added listeners to the locations and distances tables of the kilometer range panel to set the from/to fields.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 782
diff changeset
494
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
495 tabs = new TabSet();
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
496 tabs.setWidth100();
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
497 tabs.setHeight100();
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
498
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
499 Tab locations = new Tab(MSG.locations());
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
500 Tab distances = new Tab(MSG.distance());
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
501
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
502 locations.setPane(locationsTable);
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
503 distances.setPane(distancesTable);
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
504
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
505 tabs.addTab(locations, 0);
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
506 tabs.addTab(distances, 1);
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
507
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
508 filterResultCount = new StaticTextItem(MSG.resultCount());
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
509 filterResultCount.setTitleAlign(Alignment.LEFT);
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
510 filterResultCount.setTitleStyle("color: #000");
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
511
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
512 filterDescription = new TableFilter();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
513 filterDescription.setHeight("30px");
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
514 filterDescription.addFilterHandler(this);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
515
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
516 filterRange = new RangeTableFilter();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
517 filterRange.setHeight("30px");
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
518 filterRange.addFilterHandler(this);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
519 filterRange.setVisible(false);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
520
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
521 SelectItem filterCriteria = new SelectItem();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
522 filterCriteria.setShowTitle(false);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
523 filterCriteria.setWidth(100);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
524 filterCriteria.addChangedHandler(new ChangedHandler() {
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
525 @Override
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
526 public void onChanged(ChangedEvent e) {
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
527 if(e.getValue().toString().equals("range")) {
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
528 filterRange.setVisible(true);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
529 filterDescription.setVisible(false);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
530 filterDescription.clear();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
531 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
532 else {
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
533 filterRange.setVisible(false);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
534 filterRange.clear();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
535 filterDescription.setVisible(true);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
536 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
537 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
538 });
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
539
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
540 LinkedHashMap<String, String> filterMap =
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
541 new LinkedHashMap<String, String>();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
542 filterMap.put("description", MSG.description());
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
543 filterMap.put("range", MSG.range());
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
544 filterCriteria.setValueMap(filterMap);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
545 filterCriteria.setValue("description");
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
546
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
547 DynamicForm form = new DynamicForm();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
548 form.setFields(filterCriteria);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
549
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
550 DynamicForm form2 = new DynamicForm();
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
551 form2.setFields(filterResultCount);
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
552
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
553 HLayout filterLayout = new HLayout();
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
554 filterLayout.addMember(form);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
555 filterLayout.addMember(filterDescription);
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
556 filterLayout.addMember(filterRange);
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
557 filterLayout.setHeight(30);
893
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
558 tabs.addTabSelectedHandler(new TabSelectedHandler() {
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
559 @Override
893
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
560 public void onTabSelected(TabSelectedEvent evt) {
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
561 filterDescription.clear();
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
562 filterRange.clear();
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
563 filterResultCount.setValue("");
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
564
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
565 Canvas c = evt.getTabPane();
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
566 if(c instanceof ListGrid) {
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
567 currentFiltered = (ListGrid)c;
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
568 }
893
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
569 }
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
570 });
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
571
788
dfbc6693247e Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 787
diff changeset
572 helperContainer.addMember(tabs);
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
573 helperContainer.addMember(filterLayout);
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
574 helperContainer.addMember(form2);
863
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
575 }
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
576
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
577
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
578 @Override
863
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
579 public void onFilterCriteriaChanged(StringFilterEvent event) {
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
580 String search = event.getFilter();
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
581
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
582 if (search != null && search.length() > 0) {
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
583 Criteria c = new Criteria("description", search);
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
584 locationsTable.filterData(c);
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
585 distancesTable.filterData(c);
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
586 filterResultCount.setValue(currentFiltered.getRecords().length);
863
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
587 }
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
588 else {
893
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
589 locationsTable.clearCriteria();
89c01218172b Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 863
diff changeset
590 distancesTable.clearCriteria();
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
591 filterResultCount.setValue("");
863
9bb8b7a751ec Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 793
diff changeset
592 }
781
6653cf54b45d The distance panel got two tables for locations and ranges. Both do not load any data until now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
593 }
782
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
594
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
595
4131
360e22afb98b Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents: 2520
diff changeset
596 @Override
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
597 public void onFilterCriteriaChanged(RangeFilterEvent event) {
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
598 Float from = event.getFrom() - 0.001f;
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
599 Float to = event.getTo() + 0.001f;
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
600
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
601 Criterion combinedFilter = null;
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
602 Criterion locationFilter = null;
7731
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
603
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
604 if (from.equals(Float.NaN) && to.equals(Float.NaN)) {
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
605 locationsTable.clearCriteria();
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
606 distancesTable.clearCriteria();
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
607 filterResultCount.setValue("");
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
608 return;
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
609 }
7731
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
610
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
611 if (from.equals(Float.NaN)) {
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
612 combinedFilter =
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
613 new Criterion("to", OperatorId.LESS_OR_EQUAL, to);
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
614
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
615 locationFilter =
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
616 new Criterion("from", OperatorId.LESS_OR_EQUAL, to);
7731
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
617
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
618 locationsTable.filterData(locationFilter);
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
619 distancesTable.filterData(combinedFilter);
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
620 filterResultCount.setValue(currentFiltered.getRecords().length);
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
621 return;
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
622 }
7731
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
623
91a57b66c7ed Client side fix for flys/issue1549
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7141
diff changeset
624 if (to.equals(Float.NaN)) {
1538
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
625 combinedFilter =
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
626 new Criterion("from", OperatorId.GREATER_OR_EQUAL, from);
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
627 }
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
628 else {
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
629 AdvancedCriteria c1 =
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
630 new AdvancedCriteria(OperatorId.AND, new Criterion[] {
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
631 new Criterion("from", OperatorId.GREATER_OR_EQUAL, from),
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
632 new Criterion("from", OperatorId.LESS_OR_EQUAL, to)
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
633 });
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
634
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
635 AdvancedCriteria c2 =
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
636 new AdvancedCriteria(OperatorId.AND, new Criterion[] {
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
637 new Criterion("to", OperatorId.GREATER_OR_EQUAL, from),
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
638 new Criterion("to", OperatorId.LESS_OR_EQUAL, to)
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
639 });
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
640
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
641 AdvancedCriteria c3 =
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
642 new AdvancedCriteria(OperatorId.AND, new Criterion[] {
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
643 new Criterion("from", OperatorId.LESS_OR_EQUAL, to),
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
644 new Criterion("to", OperatorId.GREATER_OR_EQUAL, from)
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
645 });
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
646
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
647 combinedFilter =
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
648 new AdvancedCriteria(OperatorId.OR, new Criterion[] {
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
649 c1, c2, c3
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
650 });
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
651 }
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
652 locationsTable.filterData(combinedFilter);
92f81eac034a Added filter implementation for input helper tables in single location and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1534
diff changeset
653 distancesTable.filterData(combinedFilter);
1567
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
654 filterResultCount.setValue(currentFiltered.getRecords().length);
7e738bc8ed75 Show hit count in filtered input helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1538
diff changeset
655
1534
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
656 }
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
657
98123d34529b Added UI parts and event for filtering distances and locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1423
diff changeset
658
782
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
659 protected String getRiverName() {
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
660 ArtifactDescription adescr = artifact.getArtifactDescription();
2520
fe67f1345687 Added a MINFOArtifact and improved the DistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1567
diff changeset
661 return adescr.getRiver();
782
4a7ece57f44c #159 The tables in the WQ panel for calculation 4 are now filled with data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
662 }
780
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
663 }
a39c2f531755 Implemented a new panel to enter kilometer ranges (with no option to insert locations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
664 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org