Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java @ 903:dd702348b878
Changed columns to the correct type for most tables.
(Issue200)
flys-client/trunk@2752 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 14 Sep 2011 16:13:17 +0000 |
parents | 89c01218172b |
children | 39acba4b5f0b |
rev | line source |
---|---|
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
520
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
3 import java.util.ArrayList; |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
4 import java.util.LinkedHashMap; |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
5 import java.util.List; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import com.google.gwt.core.client.GWT; |
562
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
8 import com.google.gwt.i18n.client.NumberFormat; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
10 import com.smartgwt.client.data.Criteria; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.Canvas; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import com.smartgwt.client.widgets.Label; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.widgets.form.DynamicForm; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import com.smartgwt.client.widgets.form.fields.FormItem; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 import com.smartgwt.client.widgets.form.fields.RadioGroupItem; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import com.smartgwt.client.widgets.layout.HLayout; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import com.smartgwt.client.widgets.layout.VLayout; |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
22 import com.smartgwt.client.widgets.grid.ListGrid; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
23 import com.smartgwt.client.widgets.grid.ListGridField; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
24 import com.smartgwt.client.widgets.grid.events.RecordClickHandler; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
25 import com.smartgwt.client.widgets.grid.events.RecordClickEvent; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
26 import com.smartgwt.client.widgets.grid.events.CellClickHandler; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
27 import com.smartgwt.client.widgets.grid.events.CellClickEvent; |
893
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
28 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
29 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
30 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
31 import com.smartgwt.client.widgets.tab.TabSet; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
32 import com.smartgwt.client.widgets.tab.Tab; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
33 import com.smartgwt.client.data.Record; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
34 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
35 import com.smartgwt.client.types.ListGridFieldType; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 import de.intevation.flys.client.shared.model.Data; |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
38 import de.intevation.flys.client.shared.model.DataItem; |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
39 import de.intevation.flys.client.shared.model.DataList; |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
40 import de.intevation.flys.client.shared.model.DefaultData; |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
41 import de.intevation.flys.client.shared.model.DefaultDataItem; |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
42 import de.intevation.flys.client.shared.model.DistanceInfoObject; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
43 import de.intevation.flys.client.shared.model.ArtifactDescription; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
44 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
45 import de.intevation.flys.client.client.services.DistanceInfoService; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
46 import de.intevation.flys.client.client.services.DistanceInfoServiceAsync; |
211
b92281182c6b
Removed the FLYSMessages interface and replaced it with a FLYSConstants interface - this interface has the ability to lookup i18n strings with given keys.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
47 import de.intevation.flys.client.client.FLYSConstants; |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
48 import de.intevation.flys.client.client.FLYSImages; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
49 import de.intevation.flys.client.client.Config; |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
50 import de.intevation.flys.client.client.event.FilterHandler; |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
51 import de.intevation.flys.client.client.event.StringFilterEvent; |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
52 import de.intevation.flys.client.client.ui.range.DistanceInfoDataSource; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 /** |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 * This UIProvider creates a widget to enter locations or a distance. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 * |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 */ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 public class LocationDistancePanel |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 extends AbstractUIProvider |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
62 implements ChangeHandler, BlurHandler, FilterHandler |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 { |
838
a5e96a36478c
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
64 /** The message class that provides i18n strings. */ |
211
b92281182c6b
Removed the FLYSMessages interface and replaced it with a FLYSConstants interface - this interface has the ability to lookup i18n strings with given keys.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
65 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
67 /** The interface that provides the image resources. */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
68 private FLYSImages IMAGES = GWT.create(FLYSImages.class); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
69 |
838
a5e96a36478c
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
70 /** The DistanceInfoService used to retrieve locations about rivers. */ |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
71 protected DistanceInfoServiceAsync distanceInfoService = |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
72 GWT.create(DistanceInfoService.class); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
74 public static final String FIELD_MODE = "mode"; |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
75 |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 /** The constant name of the input field to enter the start of a distance.*/ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 public static final String FIELD_FROM = "from"; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 /** The constant name of the input field to enter the end of a distance.*/ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 public static final String FIELD_TO = "to"; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
82 /** The constant name of the input field to enter locations.*/ |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
83 public static final String FIELD_VALUE_LOCATION = "location"; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
84 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
85 /** The constant name of the input field to enter distance.*/ |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
86 public static final String FIELD_VALUE_DISTANCE = "distance"; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
87 |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 /** The constant name of the input field to enter the step width of a |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 * distance.*/ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 public static final String FIELD_WIDTH = "width"; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
92 public static final int WIDTH = 250; |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
93 |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 /** The radio group for input mode selection.*/ |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
96 protected DynamicForm mode; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 /** A container that will contain the location or the distance panel.*/ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 protected HLayout container; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
55
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
101 /** The min value for a distance.*/ |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
102 protected double min; |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
103 |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
104 /** The max value for a distance.*/ |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
105 protected double max; |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
106 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
107 /** The 'from' value entered in the distance mode.*/ |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
108 protected double from; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
109 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
110 /** The 'to' value entered in the distance mode.*/ |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
111 protected double to; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
112 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
113 /** The 'step' value entered in the distance mode.*/ |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
114 protected double step; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
115 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
116 /** The values entered in the location mode.*/ |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
117 protected double[] values; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
118 |
838
a5e96a36478c
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
119 /** The input panel for locations. */ |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
120 protected DoubleArrayPanel locationPanel; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
121 |
838
a5e96a36478c
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
122 /** The input panel for distances. */ |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
123 protected DoubleRangePanel distancePanel; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
124 |
838
a5e96a36478c
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
125 /** The tab set containing the location and distance table. */ |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
126 protected TabSet inputTables; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
127 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
128 /** The distance table. */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
129 protected ListGrid distanceTable; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
130 |
838
a5e96a36478c
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
131 /** The locations table. */ |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
132 protected ListGrid locationsTable; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
133 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
134 /** The locations table for distance input. */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
135 protected ListGrid locationDistanceTable; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 |
237
cf25f235b7b6
Cash the table data and rebuild the location table on distance selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
235
diff
changeset
|
137 /** The table data. */ |
cf25f235b7b6
Cash the table data and rebuild the location table on distance selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
235
diff
changeset
|
138 protected DistanceInfoObject[] tableData; |
cf25f235b7b6
Cash the table data and rebuild the location table on distance selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
235
diff
changeset
|
139 |
893
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
140 /** The table filter.*/ |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
141 protected TableFilter filter; |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
142 |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 /** |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 * Creates a new LocationDistancePanel instance. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 */ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 public LocationDistancePanel() { |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
147 distanceTable = new ListGrid(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
148 distanceTable.setAutoFetchData(true); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
149 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
150 locationsTable = new ListGrid(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
151 locationsTable.setAutoFetchData(true); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
152 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
153 locationDistanceTable = new ListGrid(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
154 locationDistanceTable.setAutoFetchData(true); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
155 |
284
be842e36ce1c
ISSUE 46: Removed the table header context menu.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
272
diff
changeset
|
156 locationDistanceTable.setShowHeaderContextMenu(false); |
be842e36ce1c
ISSUE 46: Removed the table header context menu.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
272
diff
changeset
|
157 distanceTable.setShowHeaderContextMenu(false); |
be842e36ce1c
ISSUE 46: Removed the table header context menu.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
272
diff
changeset
|
158 locationsTable.setShowHeaderContextMenu(false); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 /** |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 * This method creates a widget that contains a label, a panel with |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 * checkboxes to switch the input mode between location and distance input, |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 * and a the mode specific panel. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 * |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 * @param data The data that might be inserted. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 * |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 * @return a panel. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 */ |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
171 public Canvas create(DataList data) { |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 VLayout layout = new VLayout(); |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
59
diff
changeset
|
173 layout.setMembersMargin(10); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
55
diff
changeset
|
175 Label label = new Label(MESSAGES.location_distance_state()); |
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
55
diff
changeset
|
176 Canvas widget = createWidget(data); |
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
55
diff
changeset
|
177 Canvas submit = getNextButton(); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
178 createDistanceInputPanel(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
179 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
180 initDefaults(data); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
181 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
182 createLocationTableDistance (); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
183 createDistanceTable(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
184 createLocationTable(); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
59
diff
changeset
|
186 widget.setHeight(50); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 label.setHeight(25); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 layout.addMember(label); |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
190 layout.addMember(widget); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
191 layout.addMember(submit); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
192 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
193 return layout; |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
194 } |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
195 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
196 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
197 /** |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
198 * This method creates a table that contains the distance values. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
199 */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
200 protected void createDistanceTable() { |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
201 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
202 distanceTable.setWidth100(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
203 distanceTable.setShowRecordComponents(true); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
204 distanceTable.setShowRecordComponentsByCell(true); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
205 distanceTable.setHeight100(); |
876
dbaef661d0e5
Changed i18n string for empty table and set header fields to fixed order.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
871
diff
changeset
|
206 distanceTable.setEmptyMessage(MESSAGES.empty_filter()); |
dbaef661d0e5
Changed i18n string for empty table and set header fields to fixed order.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
871
diff
changeset
|
207 distanceTable.setCanReorderFields(false); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
208 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
209 ListGridField addDistance = new ListGridField ("", ""); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
210 addDistance.setType (ListGridFieldType.ICON); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
211 addDistance.setWidth (20); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
212 addDistance.addRecordClickHandler (new RecordClickHandler () { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
213 public void onRecordClick (RecordClickEvent e) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
214 if (!isLocationMode ()) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
215 Record r = e.getRecord(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
216 try { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
217 double min = Double.parseDouble(r.getAttribute("from")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
218 double max = Double.parseDouble(r.getAttribute("to")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
219 setDistanceValues(min, max); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
220 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
221 catch(NumberFormatException nfe) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
222 // Is there anything to do? |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
223 } |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
224 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
225 else { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
226 double[] selected; |
261
f3ea644800c4
Fixed the location input. A range selection sets the correct location values
Raimund Renkert <raimund.renkert@intevation.de>
parents:
252
diff
changeset
|
227 Record r = e.getRecord(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
228 double min = 0, max = 0; |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
229 try { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
230 min = Double.parseDouble(r.getAttribute("from")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
231 max = Double.parseDouble(r.getAttribute("to")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
232 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
233 catch(NumberFormatException nfe) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
234 // Is there anything to do? |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
235 } |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
236 if (getLocationValues() != null) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
237 double[] val = getLocationValues(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
238 selected = new double[val.length + 2]; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
239 for(int i = 0; i < val.length; i++){ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
240 selected[i] = val[i]; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
241 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
242 selected[val.length] = min; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
243 selected[val.length + 1] = max; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
244 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
245 else { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
246 selected = new double[2]; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
247 selected[0] = min; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
248 selected[1] = max; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
249 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
250 setLocationValues(selected); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
251 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
252 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
253 }); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
254 addDistance.setCellIcon (IMAGES.markerGreen ().getURL ()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
255 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
256 ListGridField ddescr = new ListGridField("description", |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
257 MESSAGES.description()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
258 ddescr.setType(ListGridFieldType.TEXT); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
259 ddescr.setWidth("*"); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
260 ListGridField from = new ListGridField("from", MESSAGES.from()); |
903
dd702348b878
Changed columns to the correct type for most tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
893
diff
changeset
|
261 from.setType(ListGridFieldType.FLOAT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
262 from.setWidth("12%"); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
263 ListGridField to = new ListGridField("to", MESSAGES.to()); |
903
dd702348b878
Changed columns to the correct type for most tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
893
diff
changeset
|
264 to.setType(ListGridFieldType.FLOAT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
265 to.setWidth("12%"); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
266 ListGridField dside = new ListGridField("riverside", |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
267 MESSAGES.riverside()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
268 dside.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
269 dside.setWidth("12%"); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
270 |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
271 ListGridField bottom = |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
272 new ListGridField("bottom", MESSAGES.bottom_edge()); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
273 bottom.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
274 bottom.setWidth("10%"); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
275 |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
276 ListGridField top = |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
277 new ListGridField("top", MESSAGES.top_edge()); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
278 top.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
279 top.setWidth("10%"); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
280 |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
281 distanceTable.setFields( |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
282 addDistance, ddescr, from, to, dside, bottom, top); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
283 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
284 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
285 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
286 /** |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
287 * This method creates a table that contains the location values. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
288 */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
289 protected void createLocationTable() { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
290 locationsTable.setWidth100(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
291 locationsTable.setShowRecordComponents(true); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
292 locationsTable.setShowRecordComponentsByCell(true); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
293 locationsTable.setHeight100(); |
876
dbaef661d0e5
Changed i18n string for empty table and set header fields to fixed order.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
871
diff
changeset
|
294 locationsTable.setEmptyMessage(MESSAGES.empty_filter()); |
dbaef661d0e5
Changed i18n string for empty table and set header fields to fixed order.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
871
diff
changeset
|
295 locationsTable.setCanReorderFields(false); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
296 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
297 ListGridField addLocation = new ListGridField ("", ""); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
298 addLocation.setType (ListGridFieldType.ICON); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
299 addLocation.setWidth (20); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
300 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
301 addLocation.addRecordClickHandler (new RecordClickHandler () { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
302 public void onRecordClick (RecordClickEvent e) { |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
303 Record record = e.getRecord(); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
304 double[] selected; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
305 if (getLocationValues() != null) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
306 double[] val = getLocationValues(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
307 selected = new double[val.length + 1]; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
308 for(int i = 0; i < val.length; i++){ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
309 selected[i] = val[i]; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
310 } |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
311 try { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
312 selected[val.length] = |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
313 Double.parseDouble(record.getAttribute("from")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
314 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
315 catch(NumberFormatException nfe) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
316 // Is there anything to do here? |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
317 } |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
318 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
319 else { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
320 selected = new double[1]; |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
321 selected[0] = |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
322 Double.parseDouble(record.getAttribute("from")); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
323 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
324 setLocationValues(selected); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
325 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
326 }); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
327 addLocation.setCellIcon (IMAGES.markerGreen ().getURL ()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
328 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
329 ListGridField ldescr = new ListGridField("description", |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
330 MESSAGES.description()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
331 ldescr.setType(ListGridFieldType.TEXT); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
332 ldescr.setWidth("*"); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
333 ListGridField lside = new ListGridField("riverside", |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
334 MESSAGES.riverside()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
335 lside.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
336 lside.setWidth("12%"); |
570
85d7cc0f2bab
#88 Modified strings in the location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
568
diff
changeset
|
337 ListGridField loc = new ListGridField("from", MESSAGES.locations()); |
903
dd702348b878
Changed columns to the correct type for most tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
893
diff
changeset
|
338 loc.setType(ListGridFieldType.FLOAT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
339 loc.setWidth("12%"); |
615
ba1b27b7d282
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
588
diff
changeset
|
340 |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
341 ListGridField bottom = |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
342 new ListGridField("bottom", MESSAGES.bottom_edge()); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
343 bottom.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
344 bottom.setWidth("10%"); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
345 |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
346 ListGridField top = |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
347 new ListGridField("top", MESSAGES.top_edge()); |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
348 top.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
349 top.setWidth("10%"); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
350 |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
351 locationsTable.setFields(addLocation, ldescr, loc, lside, bottom, top); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
352 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
353 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
354 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
355 /** |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
356 * This method creates a table that contains the location values. |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
357 */ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
358 protected void createLocationTableDistance (){ |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
359 locationDistanceTable.setWidth100(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
360 locationDistanceTable.setShowRecordComponents(true); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
361 locationDistanceTable.setShowRecordComponentsByCell(true); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
362 locationDistanceTable.setHeight100(); |
876
dbaef661d0e5
Changed i18n string for empty table and set header fields to fixed order.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
871
diff
changeset
|
363 locationDistanceTable.setEmptyMessage(MESSAGES.empty_filter()); |
dbaef661d0e5
Changed i18n string for empty table and set header fields to fixed order.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
871
diff
changeset
|
364 locationDistanceTable.setCanReorderFields(false); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
365 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
366 ListGridField addfrom = new ListGridField ("", ""); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
367 addfrom.setType (ListGridFieldType.ICON); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
368 addfrom.setWidth (20); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
369 addfrom.setCellIcon (IMAGES.markerGreen ().getURL ()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
370 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
371 ListGridField addto2 = new ListGridField ("", ""); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
372 addto2.setType (ListGridFieldType.ICON); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
373 addto2.setWidth (20); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
374 addto2.setCellIcon (IMAGES.markerRed ().getURL ()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
375 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
376 locationDistanceTable.addCellClickHandler (new CellClickHandler () { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
377 public void onCellClick (CellClickEvent e) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
378 if (e.getColNum() == 0) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
379 Record r = e.getRecord (); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
380 try { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
381 double fromvalue = |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
382 Double.parseDouble(r.getAttribute("from")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
383 double tovalue = getTo (); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
384 setDistanceValues (fromvalue, tovalue); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
385 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
386 catch(NumberFormatException nfe) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
387 // Is there anything to do in here? |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
388 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
389 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
390 else if (e.getColNum() == 1) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
391 Record r = e.getRecord (); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
392 try { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
393 double fromvalue = getFrom (); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
394 double tovalue = |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
395 Double.parseDouble(r.getAttribute("from")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
396 setDistanceValues (fromvalue, tovalue); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
397 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
398 catch(NumberFormatException nfe) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
399 // Is there anything to do in here? |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
400 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
401 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
402 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
403 }); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
404 ListGridField bottom = |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
405 new ListGridField("bottom", MESSAGES.bottom_edge()); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
406 bottom.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
407 bottom.setWidth("10%"); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
408 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
409 ListGridField top = |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
410 new ListGridField("top", MESSAGES.top_edge()); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
411 top.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
412 top.setWidth("10%"); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
413 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
414 ListGridField ldescr = new ListGridField("description", |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
415 MESSAGES.description()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
416 ldescr.setType(ListGridFieldType.TEXT); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
417 ldescr.setWidth("*"); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
418 ListGridField lside = new ListGridField("riverside", |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
419 MESSAGES.riverside()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
420 lside.setType(ListGridFieldType.TEXT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
421 lside.setWidth("12%"); |
570
85d7cc0f2bab
#88 Modified strings in the location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
568
diff
changeset
|
422 ListGridField loc = new ListGridField("from", MESSAGES.locations()); |
903
dd702348b878
Changed columns to the correct type for most tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
893
diff
changeset
|
423 loc.setType(ListGridFieldType.FLOAT); |
886
2161d3acc83f
Changed field size from fixed to percental value in helper tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
876
diff
changeset
|
424 loc.setWidth("12%"); |
568
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
425 |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
426 locationDistanceTable.setFields( |
1d20533a4ae3
Bring Oberkante and Unterkante into UI.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
562
diff
changeset
|
427 addfrom, addto2, ldescr, loc, lside, bottom, top); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
428 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
429 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
430 |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
431 public Canvas createOld(DataList dataList) { |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
432 List<Data> items = dataList.getAll(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
433 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
434 Data dMode = getData(items, "ld_mode"); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
435 DataItem[] dItems = dMode.getItems(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
436 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
437 boolean rangeMode = true; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
438 if (dItems != null && dItems[0] != null) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
439 rangeMode = FIELD_VALUE_DISTANCE.equals(dItems[0].getStringValue()); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
440 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
441 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
442 HLayout layout = new HLayout(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
443 layout.setWidth("400px"); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
444 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
445 Label label = new Label(dataList.getLabel()); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
446 label.setWidth("200px"); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
447 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
448 Canvas back = getBackButton(dataList.getState()); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
449 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
450 layout.addMember(label); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
451 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
452 if (rangeMode) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
453 layout.addMember(getOldRangeSelection(dataList)); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
454 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
455 else { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
456 layout.addMember(getOldLocationSelection(dataList)); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
457 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
458 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
459 layout.addMember(back); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
460 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
461 return layout; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
462 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
463 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
464 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
465 /** |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
466 * Creates a label for the selected range. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
467 * |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
468 * @param dataList The DataList containing all values for this state. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
469 * |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
470 * @return A label displaying the selected values. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
471 */ |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
472 protected Label getOldRangeSelection(DataList dataList) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
473 List<Data> items = dataList.getAll(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
474 |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
475 Data dFrom = getData(items, "ld_from"); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
476 Data dTo = getData(items, "ld_to"); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
477 Data dStep = getData(items, "ld_step"); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
478 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
479 DataItem[] from = dFrom.getItems(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
480 DataItem[] to = dTo.getItems(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
481 DataItem[] step = dStep.getItems(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
482 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
483 StringBuilder sb = new StringBuilder(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
484 sb.append(from[0].getLabel()); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
485 sb.append(" " + MESSAGES.unitFrom() + " "); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
486 sb.append(to[0].getLabel()); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
487 sb.append(" " + MESSAGES.unitTo() + " "); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
488 sb.append(step[0].getLabel()); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
489 sb.append(" " + MESSAGES.unitWidth()); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
490 |
91
0d8203594bb4
Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
83
diff
changeset
|
491 Label selected = new Label(sb.toString()); |
0d8203594bb4
Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
83
diff
changeset
|
492 selected.setWidth("130px"); |
0d8203594bb4
Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
83
diff
changeset
|
493 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
494 return selected; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
495 } |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
496 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
497 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
498 /** |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
499 * Creates a label for the selected locations. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
500 * |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
501 * @param dataList The DataList containing all values for this state. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
502 * |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
503 * @return A label displaying the selected values. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
504 */ |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
505 protected Label getOldLocationSelection(DataList dataList) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
506 List<Data> items = dataList.getAll(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
507 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
508 Data dLocations = getData(items, "ld_locations"); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
509 DataItem[] lItems = dLocations.getItems(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
510 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
511 String value = lItems[0].getStringValue(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
512 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
513 Label selected = new Label(value); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
514 selected.setWidth(130); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
515 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
516 return selected; |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
517 } |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
518 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
519 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
520 /** |
55
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
521 * This method reads the default values defined in the DataItems of the Data |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
522 * objects in <i>list</i>. |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
523 * |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
524 * @param list The DataList container that stores the Data objects. |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
525 */ |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
526 protected void initDefaults(DataList list) { |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
527 Data m = getData(list.getAll(), "ld_mode"); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
528 Data l = getData(list.getAll(), "ld_locations"); |
55
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
529 Data f = getData(list.getAll(), "ld_from"); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
530 Data t = getData(list.getAll(), "ld_to"); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
531 Data s = getData(list.getAll(), "ld_step"); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
532 |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
533 DataItem[] fItems = f.getItems(); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
534 DataItem[] tItems = t.getItems(); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
535 DataItem[] sItems = s.getItems(); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
536 |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
537 min = Double.valueOf(fItems[0].getStringValue()); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
538 max = Double.valueOf(tItems[0].getStringValue()); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
539 step = Double.valueOf(sItems[0].getStringValue()); |
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
540 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
541 DataItem mDef = m.getDefault(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
542 DataItem lDef = l.getDefault(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
543 DataItem fDef = f.getDefault(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
544 DataItem tDef = t.getDefault(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
545 DataItem sDef = s.getDefault(); |
55
4439f642f632
Read min/max values for the distance mode in the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
53
diff
changeset
|
546 |
517
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
547 String mDefValue = mDef != null ? mDef.getStringValue() : null; |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
548 String theMode = mDefValue != null && mDefValue.length() > 0 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
549 ? mDef.getStringValue() |
588
809756dda091
#132 Set the initial mode of the location/distance panel to 'distance'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
582
diff
changeset
|
550 : FIELD_VALUE_DISTANCE; |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
551 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
552 mode.setValue(FIELD_MODE, theMode); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
553 |
517
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
554 String fDefValue = fDef != null ? fDef.getStringValue() : null; |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
555 setFrom(fDefValue != null && fDefValue.length() > 0 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
556 ? Double.valueOf(fDef.getStringValue()) |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
557 : min); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
558 |
517
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
559 String tDefValue = tDef != null ? tDef.getStringValue() : null; |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
560 setTo(tDefValue != null && tDefValue.length() > 0 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
561 ? Double.valueOf(tDef.getStringValue()) |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
562 : max); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
563 |
517
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
564 String sDefValue = sDef != null ? sDef.getStringValue() : null; |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
565 setStep(sDefValue != null && sDefValue.length() > 0 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
566 ? Double.valueOf(sDef.getStringValue()) |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
567 : step); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
568 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
569 if (lDef != null) { |
517
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
570 String lDefValue = lDef != null ? lDef.getStringValue() : null; |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
571 |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
572 if (lDefValue != null && lDefValue.length() > 0) { |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
573 setLocationValues(lDef.getStringValue()); |
ec965bf8dfef
Take care on empty Data objects while initializing default values in Location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
516
diff
changeset
|
574 } |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
575 } |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
576 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
577 if (theMode.equals(FIELD_VALUE_DISTANCE)) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
578 enableDistancePanel(); |
588
809756dda091
#132 Set the initial mode of the location/distance panel to 'distance'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
582
diff
changeset
|
579 inputTables.selectTab(1); |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
580 } |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
581 } |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
582 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
583 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
584 protected Canvas createWidget(DataList data) { |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
585 VLayout layout = new VLayout(); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
586 container = new HLayout(); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
587 Canvas checkboxPanel = createRadioButtonPanel(); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
588 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
589 // the initial view will display the location input mode |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
590 locationPanel = new DoubleArrayPanel( |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
591 MESSAGES.unitLocation(), |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
592 getLocationValues(), |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
593 this); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
594 container.addMember(locationPanel); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
595 |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
596 layout.addMember(checkboxPanel); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
597 layout.addMember(container); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
598 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
599 container.setMembersMargin(30); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
600 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
601 inputTables = new TabSet(); |
893
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
602 inputTables.addTabSelectedHandler(new TabSelectedHandler() { |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
603 public void onTabSelected(TabSelectedEvent evt) { |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
604 filter.clear(); |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
605 } |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
606 }); |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
607 |
570
85d7cc0f2bab
#88 Modified strings in the location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
568
diff
changeset
|
608 Tab locations = new Tab(MESSAGES.locations()); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
609 Tab distances = new Tab(MESSAGES.distance()); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
610 |
272
d3c053420c3b
ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents:
263
diff
changeset
|
611 inputTables.setWidth100(); |
d3c053420c3b
ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents:
263
diff
changeset
|
612 inputTables.setHeight100(); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
613 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
614 locations.setPane(locationDistanceTable); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
615 distances.setPane(distanceTable); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
616 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
617 inputTables.addTab(locations); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
618 inputTables.addTab(distances); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
619 |
893
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
620 filter = new TableFilter(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
621 filter.setHeight("30px"); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
622 filter.addFilterHandler(this); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
623 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
624 inputTables.setHeight("*"); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
625 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
626 VLayout helper = new VLayout(); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
627 helper.addMember(inputTables); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
628 helper.addMember(filter); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
629 helper.setHeight100(); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
630 helper.setWidth100(); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
631 |
869
94d9c8353ca9
Fixed the filter function and the helper panel.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
863
diff
changeset
|
632 helperContainer.addMember(helper); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
633 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
634 return layout; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
635 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
636 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
637 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
638 public void onFilterCriteriaChanged(StringFilterEvent event) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
639 String search = event.getFilter(); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
640 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
641 if (search != null && search.length() > 0) { |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
642 Criteria c = new Criteria("description", search); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
643 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
644 locationsTable.filterData(c); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
645 distanceTable.filterData(c); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
646 locationDistanceTable.filterData(c); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
647 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
648 else { |
893
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
649 locationsTable.clearCriteria(); |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
650 distanceTable.clearCriteria(); |
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
651 locationDistanceTable.clearCriteria(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
652 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
653 } |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
654 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
655 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
656 |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
657 |
562
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
658 @Override |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
659 public List<String> validate() { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
660 if (isLocationMode()) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
661 return validateLocations(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
662 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
663 else { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
664 return validateRange(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
665 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
666 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
667 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
668 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
669 protected List<String> validateLocations() { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
670 List<String> errors = new ArrayList<String>(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
671 NumberFormat nf = NumberFormat.getDecimalFormat(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
672 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
673 try { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
674 saveLocationValues(locationPanel); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
675 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
676 catch (Exception e) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
677 errors.add(MESSAGES.wrongFormat()); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
678 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
679 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
680 double[] values = getLocationValues(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
681 double[] good = new double[values.length]; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
682 int idx = 0; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
683 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
684 for (double value: values) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
685 if (value < min || value > max) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
686 String tmp = MESSAGES.error_validate_range(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
687 tmp = tmp.replace("$1", nf.format(value)); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
688 tmp = tmp.replace("$2", nf.format(min)); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
689 tmp = tmp.replace("$3", nf.format(max)); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
690 errors.add(tmp); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
691 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
692 else { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
693 good[idx++] = value; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
694 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
695 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
696 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
697 double[] justGood = new double[idx]; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
698 for (int i = 0; i < justGood.length; i++) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
699 justGood[i] = good[i]; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
700 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
701 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
702 if (!errors.isEmpty()) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
703 locationPanel.setValues(justGood); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
704 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
705 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
706 return errors; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
707 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
708 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
709 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
710 protected List<String> validateRange() { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
711 List<String> errors = new ArrayList<String>(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
712 NumberFormat nf = NumberFormat.getDecimalFormat(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
713 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
714 try { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
715 saveDistanceValues(distancePanel); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
716 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
717 catch (Exception e) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
718 errors.add(MESSAGES.wrongFormat()); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
719 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
720 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
721 double from = getFrom(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
722 double to = getTo(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
723 double step = getStep(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
724 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
725 if (from < min || from > max) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
726 String tmp = MESSAGES.error_validate_lower_range(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
727 tmp = tmp.replace("$1", nf.format(from)); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
728 tmp = tmp.replace("$2", nf.format(min)); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
729 errors.add(tmp); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
730 from = min; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
731 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
732 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
733 if (to < min || to > max) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
734 String tmp = MESSAGES.error_validate_upper_range(); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
735 tmp = tmp.replace("$1", nf.format(to)); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
736 tmp = tmp.replace("$2", nf.format(max)); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
737 errors.add(tmp); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
738 to = max; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
739 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
740 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
741 if (!errors.isEmpty()) { |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
742 distancePanel.setValues(from, to, step); |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
743 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
744 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
745 return errors; |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
746 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
747 |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
520
diff
changeset
|
748 |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
749 /** |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
750 * This method returns the selected data. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
751 * |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
752 * @return the selected/inserted data. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
753 */ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
754 public Data[] getData() { |
59
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
755 // XXX If we have entered a value and click right afterwards on the |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
756 // 'next' button, the BlurEvent is not fired, and the values are not |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
757 // saved. So, we gonna save those values explicitly. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
758 if (isLocationMode()) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
759 Canvas member = container.getMember(0); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
760 if (member instanceof DoubleArrayPanel) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
761 DoubleArrayPanel form = (DoubleArrayPanel) member; |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
762 saveLocationValues(form); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
763 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
764 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
765 else { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
766 Canvas member = container.getMember(0); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
767 if (member instanceof DoubleRangePanel) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
768 DoubleRangePanel form = (DoubleRangePanel) member; |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
769 saveDistanceValues(form); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
770 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
771 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
772 |
520
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
773 Data dMode = getDataMode(); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
774 Data dLocations = getDataLocations(); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
775 Data dFrom = getDataFrom(); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
776 Data dTo = getDataTo(); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
777 Data dStep = getDataStep(); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
778 |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
779 List<Data> data = new ArrayList<Data>(); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
780 |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
781 if (dMode != null) { |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
782 data.add(dMode); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
783 } |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
784 |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
785 if (dLocations != null) { |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
786 data.add(dLocations); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
787 } |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
788 |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
789 if (dFrom != null) { |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
790 data.add(dFrom); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
791 } |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
792 |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
793 if (dTo != null) { |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
794 data.add(dTo); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
795 } |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
796 |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
797 if (dStep != null) { |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
798 data.add(dStep); |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
799 } |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
800 |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
801 return (Data[]) data.toArray(new Data[data.size()]); |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
802 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
803 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
804 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
805 /** |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
806 * Returns the Data object for the 'mode' attribute. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
807 * |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
808 * @return the Data object for the 'mode' attribute. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
809 */ |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
810 protected Data getDataMode() { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
811 String value = mode.getValueAsString(FIELD_MODE); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
812 DataItem item = new DefaultDataItem("ld_mode", "ld_mode", value); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
813 return new DefaultData("ld_mode", null, null, new DataItem[] { item }); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
814 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
815 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
816 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
817 protected Data getDataLocations() { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
818 double[] locations = getLocationValues(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
819 boolean first = true; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
820 |
520
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
821 if (locations == null) { |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
822 return null; |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
823 } |
9e2b151770bd
Bugfix in the range/location panel - avoid NullPointerExceptions in getData().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
517
diff
changeset
|
824 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
825 StringBuilder sb = new StringBuilder(); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
826 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
827 for (double l: locations) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
828 if (!first) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
829 sb.append(" "); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
830 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
831 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
832 sb.append(l); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
833 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
834 first = false; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
835 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
836 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
837 DataItem item = new DefaultDataItem( |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
838 "ld_locations", |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
839 "ld_locations", |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
840 sb.toString()); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
841 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
842 return new DefaultData( |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
843 "ld_locations", |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
844 null, |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
845 null, |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
846 new DataItem[] { item }); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
847 } |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
848 |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
849 |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
850 /** |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
851 * Returns the Data object for the 'from' attribute. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
852 * |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
853 * @return the Data object for the 'from' attribute. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
854 */ |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
855 protected Data getDataFrom() { |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
856 String value = Double.valueOf(getFrom()).toString(); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
857 DataItem item = new DefaultDataItem("ld_from", "ld_from", value); |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
858 return new DefaultData( |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
859 "ld_from", null, null, new DataItem[] { item }); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
860 } |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
861 |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
862 |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
863 /** |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
864 * Returns the Data object for the 'to' attribute. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
865 * |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
866 * @return the Data object for the 'to' attribute. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
867 */ |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
868 protected Data getDataTo() { |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
869 String value = Double.valueOf(getTo()).toString(); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
870 DataItem item = new DefaultDataItem("ld_to", "ld_to", value); |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
871 return new DefaultData( |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
872 "ld_to", null, null, new DataItem[] { item }); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
873 } |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
874 |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
875 |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
876 /** |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
877 * Returns the Data object for the 'step' attribute. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
878 * |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
879 * @return the Data object for the 'step' attribute. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
880 */ |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
881 protected Data getDataStep() { |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
882 String value = Double.valueOf(getStep()).toString(); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
883 DataItem item = new DefaultDataItem("ld_step","ld_step", value); |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
884 return new DefaultData( |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
885 "ld_step", null, null, new DataItem[] { item }); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
886 } |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
887 |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
888 |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
889 /** |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
890 * Determines the current input mode. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
891 * |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
892 * @return true, if 'location' is the current input mode, otherwise false. |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
893 */ |
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
894 public boolean isLocationMode() { |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
895 String inputMode = mode.getValueAsString(FIELD_MODE); |
46
0d4795b4f284
Implemented the getData() method of the LocationDistancePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
896 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
897 return inputMode.equals(FIELD_VALUE_LOCATION) ? true : false; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
898 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
899 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
900 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
901 /** |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
902 * Activates the location panel. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
903 */ |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
904 protected void enableLocationPanel() { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
905 locationPanel = new DoubleArrayPanel( |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
906 MESSAGES.unitLocation(), |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
907 getLocationValues(), |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
908 this); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
909 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
910 container.removeMembers(container.getMembers()); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
911 container.addMember(locationPanel); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
912 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
913 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
914 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
915 /** |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
916 * Activates the distance panel. |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
917 */ |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
918 protected void enableDistancePanel() { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
919 distancePanel = new DoubleRangePanel( |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
920 MESSAGES.unitFrom(), MESSAGES.unitTo(), MESSAGES.unitWidth(), |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
921 getFrom(), getTo(), getStep(), |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
922 250, |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
923 this); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
924 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
925 container.removeMembers(container.getMembers()); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
926 container.addMember(distancePanel); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
927 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
928 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
929 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
930 /** |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
931 * This method switches the input mode between location and distance input. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
932 * |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
933 * @param event The click event fired by a RadioButtonGroupItem. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
934 */ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
935 public void onChange(ChangeEvent event) { |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
936 String value = (String) event.getValue(); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
937 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
938 if (value == null) { |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
939 return; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
940 } |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
941 if (value.equals(FIELD_VALUE_LOCATION)) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
942 enableLocationPanel(); |
893
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
943 filter.clear(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
944 // Remove the tab containing the locationDistanceTable. |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
945 // The 'updateTab()' avoids the tab content to be destroyed. |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
946 inputTables.updateTab(0, null); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
947 inputTables.removeTab(0); |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
948 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
949 // Create a new tab containing the locationTable |
570
85d7cc0f2bab
#88 Modified strings in the location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
568
diff
changeset
|
950 Tab t1 = new Tab (MESSAGES.locations()); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
951 t1.setPane(locationsTable); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
952 inputTables.addTab(t1, 0); |
237
cf25f235b7b6
Cash the table data and rebuild the location table on distance selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
235
diff
changeset
|
953 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
954 // Bring this tab to front. |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
955 inputTables.selectTab(0); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
956 } |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
957 else { |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
958 enableDistancePanel(); |
893
89c01218172b
Clear the table filter on tab selection change and input method change.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
886
diff
changeset
|
959 filter.clear(); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
960 // Remove the tab containing the locationTable. |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
961 // The 'updateTab()' avoids the tab content to be destroyed. |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
962 inputTables.updateTab(0, null); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
963 inputTables.removeTab(0); |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
964 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
965 //Create a new tab containing the locationDistanceTable. |
570
85d7cc0f2bab
#88 Modified strings in the location/distance panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
568
diff
changeset
|
966 Tab t1 = new Tab(MESSAGES.locations()); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
967 t1.setPane(locationDistanceTable); |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
968 inputTables.addTab(t1, 0); |
237
cf25f235b7b6
Cash the table data and rebuild the location table on distance selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
235
diff
changeset
|
969 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
970 // Bring the distanceTable tab to front. |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
971 inputTables.selectTab(1); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
972 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
973 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
974 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
975 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
976 /** |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
977 * This method is used to validate the inserted data in the form fields. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
978 * |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
979 * @param event The BlurEvent that gives information about the FormItem that |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
980 * has been modified and its value. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
981 */ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
982 public void onBlur(BlurEvent event) { |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
983 FormItem item = event.getItem(); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
984 String field = item.getFieldName(); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
985 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
986 if (field == null) { |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
987 return; |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
988 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
989 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
990 if (field.equals(DoubleArrayPanel.FIELD_NAME)) { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
991 DoubleArrayPanel p = (DoubleArrayPanel) event.getForm(); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
992 |
59
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
993 saveLocationValue(p, item); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
994 } |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
995 else { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
996 DoubleRangePanel p = (DoubleRangePanel) event.getForm(); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
997 |
59
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
998 saveDistanceValue(p, item); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
999 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1000 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1001 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1002 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1003 |
59
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1004 /** |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1005 * Validates and stores all values entered in the location mode. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1006 * |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1007 * @param p The DoubleArrayPanel. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1008 */ |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1009 protected void saveLocationValues(DoubleArrayPanel p) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1010 FormItem[] formItems = p.getFields(); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1011 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1012 for (FormItem item: formItems) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1013 if (item.getFieldName().equals(DoubleArrayPanel.FIELD_NAME)) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1014 saveLocationValue(p, item); |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1015 } |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1016 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1017 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1018 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1019 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1020 /** |
59
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1021 * Validates and stores all values entered in the distance mode. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1022 * |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1023 * @param p The DoubleRangePanel. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1024 */ |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1025 protected void saveDistanceValues(DoubleRangePanel p) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1026 FormItem[] formItems = p.getFields(); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1027 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1028 for (FormItem item: formItems) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1029 saveDistanceValue(p, item); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1030 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1031 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1032 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1033 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1034 /** |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1035 * Validates and stores a value entered in the location mode. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1036 * |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1037 * @param p The DoubleArrayPanel. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1038 * @param item The item that needs to be validated. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1039 */ |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1040 protected void saveLocationValue(DoubleArrayPanel p, FormItem item) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1041 if (p.validateForm(item)) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1042 setLocationValues(p.getInputValues(item)); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1043 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1044 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1045 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1046 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1047 /** |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1048 * Validates and stores value entered in the distance mode. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1049 * |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1050 * @param p The DoubleRangePanel. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1051 * @param item The item that needs to be validated. |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1052 */ |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1053 protected void saveDistanceValue(DoubleRangePanel p, FormItem item) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1054 if (p.validateForm(item)) { |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1055 setFrom(p.getFrom()); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1056 setTo(p.getTo()); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1057 setStep(p.getStep()); |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1058 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1059 } |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1060 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1061 |
a3d235c63195
Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
1062 /** |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1063 * This method creates the panel that contains the checkboxes to switch |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1064 * between the input mode 'location' and 'distance'. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1065 * |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1066 * @return the checkbox panel. |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1067 */ |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1068 protected Canvas createRadioButtonPanel() { |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1069 mode = new DynamicForm(); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1070 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1071 RadioGroupItem radio = new RadioGroupItem(FIELD_MODE); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1072 radio.setShowTitle(false); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1073 radio.setVertical(false); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1074 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1075 LinkedHashMap values = new LinkedHashMap(); |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1076 values.put(FIELD_VALUE_LOCATION, MESSAGES.location()); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1077 values.put(FIELD_VALUE_DISTANCE, MESSAGES.distance()); |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1078 |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
1079 LinkedHashMap initial = new LinkedHashMap(); |
588
809756dda091
#132 Set the initial mode of the location/distance panel to 'distance'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
582
diff
changeset
|
1080 initial.put(FIELD_MODE, FIELD_VALUE_DISTANCE); |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
1081 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1082 radio.setValueMap(values); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1083 radio.addChangeHandler(this); |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1084 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1085 mode.setFields(radio); |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
43
diff
changeset
|
1086 mode.setValues(initial); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1087 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1088 return mode; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1089 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1090 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1091 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1092 protected void createDistanceInputPanel() { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1093 Config config = Config.getInstance(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1094 String url = config.getServerUrl(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1095 String locale = config.getLocale (); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1096 String river = ""; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1097 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1098 ArtifactDescription adescr = artifact.getArtifactDescription(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1099 DataList[] data = adescr.getOldData(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1100 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1101 if (data != null && data.length > 0) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1102 for (int i = 0; i < data.length; i++) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1103 DataList dl = data[i]; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1104 if (dl.getState().equals("state.winfo.river")) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1105 for (int j = 0; j < dl.size(); j++) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1106 Data d = dl.get(j); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1107 DataItem[] di = d.getItems(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1108 if (di != null && di.length == 1) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1109 river = d.getItems()[0].getStringValue(); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1110 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1111 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1112 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1113 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1114 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1115 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1116 distanceTable.setDataSource(new DistanceInfoDataSource( |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1117 url, river, "distances")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1118 locationsTable.setDataSource(new DistanceInfoDataSource( |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1119 url, river, "locations")); |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1120 locationDistanceTable.setDataSource(new DistanceInfoDataSource( |
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1121 url, river, "locations")); |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1122 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1123 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1124 |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1125 /* protected void updateDistanceInfo(DistanceInfoObject[] di) { |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1126 int i = 0; |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1127 for (DistanceInfoObject dio: di) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1128 if (dio.getTo() != null) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1129 distanceTable.addData(new DistanceInfoRecord(dio)); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1130 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1131 else { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1132 locationsTable.addData(new DistanceInfoRecord(dio)); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1133 locationDistanceTable.addData(new DistanceInfoRecord(dio)); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1134 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1135 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1136 return; |
863
9bb8b7a751ec
Added filter for the "description" row of helper input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
838
diff
changeset
|
1137 }*/ |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1138 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1139 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1140 protected double getFrom() { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1141 return from; |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1142 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1143 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1144 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1145 protected void setFrom(double from) { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1146 this.from = from; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1147 } |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1148 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1149 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1150 protected double getTo() { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1151 return to; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1152 } |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1153 |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1154 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1155 protected void setTo(double to) { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1156 this.to = to; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1157 } |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1158 |
43
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1159 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1160 protected double getStep() { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1161 return step; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1162 } |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1163 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1164 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1165 protected void setStep(double step) { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1166 this.step = step; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1167 } |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1168 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1169 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1170 protected double[] getLocationValues() { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1171 return values; |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1172 } |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1173 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1174 |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1175 protected void setLocationValues(double[] values) { |
6bcd8e3f21a7
Refactored the LocationDistancePanel, so that is uses the DoubleArrayPanel and DoubleRangePanel from the last commit as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
41
diff
changeset
|
1176 this.values = values; |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1177 locationPanel.setValues(values); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1178 } |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1179 |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1180 |
516
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1181 protected void setLocationValues(String values) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1182 String[] vs = values.split(" "); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1183 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1184 if (vs == null) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1185 return; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1186 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1187 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1188 double[] ds = new double[vs.length]; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1189 int idx = 0; |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1190 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1191 for (String s: vs) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1192 try { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1193 ds[idx++] = Double.valueOf(s); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1194 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1195 catch (NumberFormatException nfe) { |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1196 // do nothing |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1197 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1198 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1199 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1200 setLocationValues(ds); |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1201 } |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1202 |
ba606e575663
ISSUE-85 (part II/III) Repaired broken location/range panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
1203 |
235
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1204 protected void setDistanceValues (double from, double to) { |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1205 setFrom(from); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1206 setTo(to); |
d3f8d6966c20
Added location and distance tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
1207 distancePanel.setValues(from, to, getStep()); |
41
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1208 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1209 } |
87a44f8e25cc
Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1210 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |